C# Shorthand | System Type | Range | Meaning in life |
| sbyte | System.Sbyte | -128 to 127 | Signed 8-bit number |
| byte | System.byte | 0 to 255 | Unsigned 8-bit number |
| short | System.Int16 | -32.768 to 32.767 | Signed 16-bit number |
| ushort | System.UInt16 | 0 to 65.535 | Unsigned 16-bit number |
| int | System.Int32 | -2.147.483.648 to 2.147.483.647 | Signed 32-bit number |
| uint | System.UInt32 | 0 to 4,294,967,295 | Unsigned 32-bit number |
| long | System.Int64 | –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 | Signed 64-bit number |
| ulong | System.UInt64 | 0 to 18,446,744,073,709,551,615 | Unsigned 64-bit number |
| char | System.Char | U0000 to Uffff | A single 16-bit Unicode character |
| float | System.Single | 1.5x10-45 to 3.4x1038 | 32-bit floating point number |
| double | System.Double | 5.0x10-324 to 1.7x10308 | 64-bit floating point number |
| bool | System.Boolean | true or false | Represents truth or falsity |
| decimal | System.Decimal | 100 to 1028 | A 96-bit signed number |
| string | System.String | Limited by system memory | Represents a set of Unicode characters |
| object | System.Object | Any type can be stored in an object variable | The base class of all types in the .NET universe |
Wednesday, 7 December 2011
C#: System data types
Saturday, 3 December 2011
Friday, 2 December 2011
log2( x ): Binary Logarithm
In the math.h of Turbo C, binary logarithm ( log2( ) ) doesn't exists. When we are working with tree, we need to calculate depth of the tree, as well as the number of nodes in that depth.
The number of nodes in ith depth can be calculated using : 2i . formula
the max number of node in ith depth : n = 2i - 1 (complete tree).
You can use these formula to find the number of nodes in particular depth.
On the other hand, you may need to find the depth you are currently in.
There is a very easy way to do that. This is using binary logarithm to find the current depth.
If i made mistakes let me know
Good luck
The number of nodes in ith depth can be calculated using : 2i . formula
the max number of node in ith depth : n = 2i - 1 (complete tree).
You can use these formula to find the number of nodes in particular depth.
On the other hand, you may need to find the depth you are currently in.
There is a very easy way to do that. This is using binary logarithm to find the current depth.
... #include <math.h> double log2(double x) { return log(x) / log(2); }
If i made mistakes let me know
Good luck
Wednesday, 30 November 2011
Tuesday, 29 November 2011
Binary Search
Very useful searching algorithm, in every step the number of data, which is going to be sorted will cut into half (fig 1). But keep it in your mind that it works on only sorted data.
Let N be the number of data then,
in worst case the comparison will be done log2(N) + 1 times. And in case of linear searching, the number of comparison would be N.
For example: if we are going to search a number among a million others, in the worst case scenario, the number of comparison would never be exceeded 20. But in case of linear searching algorithm, the number of comparison would be 1.000.000
Source code :
Let N be the number of data then,
in worst case the comparison will be done log2(N) + 1 times. And in case of linear searching, the number of comparison would be N.
For example: if we are going to search a number among a million others, in the worst case scenario, the number of comparison would never be exceeded 20. But in case of linear searching algorithm, the number of comparison would be 1.000.000
Source code :
Saturday, 26 November 2011
Tuesday, 10 May 2011
PHP : Login Page
Here is simple guide to create login page. About design, you can create one as you like using html. This is simple design that i created to demonstrate how login page works. You can use just two text-boxes and submit button, that is all.
Make sure that your text-boxes and submit button are inside the "Form" which uses method field and action field as shown below.
<Form name="Form1" method="post" action="login.php"> ...When you hit login or submit button, all data which are inside this form will be thrown to login.php.
And they won't appear in address bar. Because method is post.
Subscribe to:
Posts (Atom)



