Sponsored Content
Full Discussion: toggle bit
Top Forums Programming toggle bit Post 302431458 by pludi on Tuesday 22nd of June 2010 03:00:14 AM
Old 06-22-2010
Invert it. See Wikipedia on Bitwise operation and your courses learning material.
 

6 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Shell Programming and Scripting

Toggle Hidden Files Mac OS X

Hi all, I have been using Ubuntu for 2 years now, and a few days ago I bought a Macbook. This is my first time using a Mac, so I have spent the better of two days learning the user interface, and configuring my Macbook. One thing I noticed is that there is no easy way to turn on and off hidden... (0 Replies)
Discussion started by: Omniwheel
0 Replies

3. Shell Programming and Scripting

Perl script to toggle through dates by week

Hi, I need help to toggle through dates on a weekly basis to be fed into a script as inputs. The format should be: yyyy/mm/dd (start) yyyy/mm/dd (end), where end date is 7 days increments. The date (start) would be input as an ARGV and would continue until current date. I can check... (2 Replies)
Discussion started by: subhap
2 Replies

4. Shell Programming and Scripting

How to Toggle Flag/Switch Value with Sed

I am trying to figure out a one liner to toggle a flag variable. eg. FLAG=0 Is there a way to use sed to toggle above example between 0 and 1. That is if run with flag set to zero it would change it to one if run again it would set it to zero. I thought I had it figured but the... (6 Replies)
Discussion started by: bsquared
6 Replies

5. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

6. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
Moose::Meta::Attribute::Native::Trait::Bool(3)		User Contributed Perl Documentation	    Moose::Meta::Attribute::Native::Trait::Bool(3)

NAME
Moose::Meta::Attribute::Native::Trait::Bool - Helper trait for Bool attributes VERSION
version 2.0604 SYNOPSIS
package Room; use Moose; has 'is_lit' => ( traits => ['Bool'], is => 'rw', isa => 'Bool', default => 0, handles => { illuminate => 'set', darken => 'unset', flip_switch => 'toggle', is_dark => 'not', }, ); my $room = Room->new(); $room->illuminate; # same as $room->is_lit(1); $room->darken; # same as $room->is_lit(0); $room->flip_switch; # same as $room->is_lit(not $room->is_lit); return $room->is_dark; # same as !$room->is_lit DESCRIPTION
This trait provides native delegation methods for boolean values. A boolean is a scalar which can be 1, 0, "", or "undef". DEFAULT TYPE
If you don't provide an "isa" value for your attribute, it will default to "Bool". PROVIDED METHODS
None of these methods accept arguments. o set Sets the value to 1 and returns 1. o unset Set the value to 0 and returns 0. o toggle Toggles the value. If it's true, set to false, and vice versa. Returns the new value. o not Equivalent of 'not $value'. BUGS
See "BUGS" in Moose for details on reporting bugs. AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.16.2 2012-09-19 Moose::Meta::Attribute::Native::Trait::Bool(3)
All times are GMT -4. The time now is 04:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy