Hi,
Is it possible to use bitwise operators in bit fields?
For example:
typedef struct Mystruct {
unsigned char A :1 ;
unsigned char B :1 ;
} Mystruct;
and assume
struct Mystruct STR_1S, STR_2S, tempSTRS = {0};
then the following line:
tempSTRS = STR_1S & STR_2S;
gives the... (3 Replies)
Hi !
How to reset a variable to 0 after a reset value, say 10 using bitwise
XOR.
For example,
int cnt=0;
if(cnt<10)
cnt++;
else
cnt = 0;
How can we achieve this by using XOR only.
thanks, (1 Reply)
I am taking an online course on Unix scripting. The topic is Unix arithmetic operators and the lesson is Logical and bitwise operations. It is not clear how much storage space Unix uses to represent integers that are typed. Bitwise negation caused me to question how many bits are used to... (3 Replies)
Hi
Suppose we have these code lines:
#define _IN_USE 0x001 /* set when process slot is in use */
#define _EXITING 0x002 /* set when exit is expected */
#define _REFRESHING 0x004
...
1 main () {
2
3 unsigned r_flags =_REFRESHING;
4
5 if (r_flag &... (3 Replies)
Dear all
I have a large file w. ~ 10 million lines.
The first two cols have matching partners.
For example:
A A
A B
B B
or
A A
B A
B B
The matches may be separated by an unknown number of lines.
My intention is to group them and add a "group" value in the last col.
For... (12 Replies)
Hello All,
i have two 16 bit binaries that in two different variables, i want to perform a bitwise AND between the two and store the result in a different variable.
can anyone throw some light on doing this in a bourne shell...
eg var1= 1110101010101011
... (8 Replies)
The purpose of this article is revealing the unrevealed parts of the bitwise XOR.
As we aware, the truth table for the XOR operator is :
A B A^B
0 0 0
0 1 1
1 0 1
1 1 0
For example , 1^2 will be calculated as given below:
First the operands... (1 Reply)
please any one can suggest me how to use bitesie || opearator to do this
#initallize a=0 b=0
#condition
if then
a=0
else a=1
fi
#bitwise or opeartion b = a || b
Please view this code tag video for how to use code tags when posting code and data. (3 Replies)
Hello All,
I am writing basic state machine which maintains 8 different states and there is posibility that system may be in multiple states at a time (Except for state1 to state3. menas only once state can be active at a time from state1 to state3).
I have declared... (9 Replies)
Discussion started by: anand.shah
9 Replies
LEARN ABOUT SUSE
tk::table
Table(3) User Contributed Perl Documentation Table(3)NAME
Tk::Table - Scrollable 2 dimensional table of Tk widgets
SYNOPSIS
use Tk::Table;
$table = $parent->Table(-rows => number,
-columns => number,
-scrollbars => anchor,
-fixedrows => number,
-fixedcolumns => number,
-takefocus => boolean);
$widget = $table->Button(...);
$old = $table->put($row,$col,$widget);
$old = $table->put($row,$col,"Text"); # simple Label
$widget = $table->get($row,$col);
$cols = $table->totalColumns;
$rows = $table->totalRows;
$table->see($widget);
$table->see($row,$col);
($row,$col) = $table->Posn($widget);
DESCRIPTION
Tk::Table is an all-perl widget/geometry manager which allows a two dimensional table of arbitary perl/Tk widgets to be displayed.
Entries in the Table are simply ordinary perl/Tk widgets. They should be created with the Table as their parent. Widgets are positioned in
the table using:
$table->put($row,$col,$widget)
If $widget is not a reference it is treated as a string, and a Lable widget is created with the string as its text.
All the widgets in each column are set to the same width - the requested width of the widest widget in the column. Likewise, all the
widgets in each row are set to the same height - the requested height of the tallest widget in the column.
A number of rows and/or columns can be marked as 'fixed' - and so can serve as 'headings' for the remainder the rows which are scrollable.
The requested size of the table as a whole is such that the number of rows specified by -rows (default 10), and number of columns specified
by -columns (default 10) can be displayed.
If the Table is told it can take the keyboard focus then cursor and scroll keys scroll the displayed widgets.
The Table will create and manage its own scrollbars if requested via -scrollbars.
The table can be emptied using
$table->clear
the widgets which were in the table are destroyed.
The Tk::Table widget is derived from a Tk::Frame, so inherits all its configure options.
BUGS / Snags / Possible enhancements
o Very large Tables consume a lot of X windows.
o No equivalent of pack's -anchor/-pad etc. options
SEE ALSO
Tk::grid, Tk::HList, Tk::TableMatrix, Tk::MListbox, Tk::Columns
perl v5.12.1 2007-11-08 Table(3)