Google+
Showing posts with label C. Show all posts
Showing posts with label C. Show all posts

Thursday, May 5, 2011

Add Icon to webpage url





To add an icon to your URL:

  1. You need an icon. There are plenty of icons on your pc to pick from. Use windows search and look for *.ico Or you can create one go here
  2. Upload the icon to your directory on line the same location of the index.html
  3. Rename the icon on line to favicon.ico
  4. Add both lines below to the head of your index.html page
<.link rel="icon" type="image/ico" href="favicon.ico"><./link>
<.link rel="shortcut icon" href="favicon.ico"><./link>



Also you can add an animated icon, just create an animated gif 16 x 16 and upload it to the root directory and add this code. It works only with Firefox browser. 


<.link rel="shortcut icon" type="image/gif" href="animated_favicon.gif">


They all will look like this 


<.link rel="shortcut icon" type="image/ico"favicon.ico">
<.link rel="shortcut icon" type="image/gif" href="animated_favicon.gif">
<.link rel="shortcut icon" href="favicon.ico">



Also just upload the favicon.ico to the root directory of the site all new browsers will find it.

Wednesday, July 14, 2010

Bit Wise in any programming language

Bit wise operator in C,.NET,JAVA,C++

C Bitwise Operators
The bitwise operators perform bitwise-AND (&), bitwise-exclusive-OR (^), and bitwise-inclusive-OR (|) operations.

Syntax:-

AND-expression:
equality-expression

AND-expression & equality-expression

exclusive-OR-expression:
AND-expression

exclusive-OR-expression ^ AND-expression

inclusive-OR-expression:
exclusive-OR-expression

inclusive-OR-expression | exclusive-OR-expression

The operands of bitwise operators must have integral types, but their types can be different. These operators perform the usual arithmetic conversions; the type of the result is the type of the operands after conversion.



Operator Description

  • &

The bitwise-AND operator compares each bit of its first operand to the corresponding bit of its second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.
  • ^

The bitwise-exclusive-OR operator compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

  • |

The bitwise-inclusive-OR operator compares each bit of its first operand to the corresponding bit of its second operand. If either bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

Examples
These declarations are used for the following three examples:


short i = 0xAB00;
short j = 0xABCD;
short n;

n = i & j;
The result assigned to n in this first example is the same as i (0xAB00 hexadecimal).


n = i | j;

n = i ^ j;
The bitwise-inclusive OR in the second example results in the value 0xABCD (hexadecimal), while the bitwise-exclusive OR in the third example produces 0xCD (hexadecimal).

Microsoft Specific

The results of bitwise operation on signed integers is implementation-defined according to the ANSI C standard. For the Microsoft C compiler, bitwise operations on signed integers work the same as bitwise operations on unsigned integers. For example, -16 & 99 can be expressed in binary as

11111111 11110000
& 00000000 01100011
_________________
00000000 01100000

The result of the bitwise AND is 96 decimal.