|
Thanks,
I figured this out. I was passing my form and initialized the sizer after it had already been initialized once. Now I just set a global variable and set it on the passed form.
RABB17
RABB17
"Nothing fancy needed, please just solve all our problems as quickly as possible."
|
|
|
|
|
I am reading UDP packets that a router is sending to me. In this example i am reading the "system uptime" field which starts at bit position 64 from the begining of the packet and is a 32 bit field. So the end of the field is calculated to end at 95.
I know that the first byte of this two bit field prints to the console 69 when i Console.WriteLine(buffer[8]). When I do a Convert.ToString(buffer[8],2) I get 101000101 printed on the console. I converted this byte to a decimal number. unfortunatly this is revered! and is being counted LEFT to RIGHT!
When the binary numbers should start from Right to left. the real binary number of 69 is 01000101. which is the mirror opposite of what the console printed. Do you have any idea why this is?
Here is the code that I am looking at.
public static uint Parse(byte[] datagram, int offset, int length)
{
uint total = 0;
int byte_index;
int bit_offset;
int bit;
byte b;
for ( int i = 0; i < length; i++ )
{
bit_offset = (offset+i) % 8;
byte_index = (offset+i-bit_offset) / 8;
b = datagram[byte_index];
//Writing the datagram to the console and performing the Convert.ToString is where i notice this.
bit = (int)(b >> (7 - bit_offset));
bit = bit & 0x0001;
if ( bit > 0 )
{
total += (uint)Math.Pow(2,length-i-1);
}
}
return total;
}
Is this why there is the shift right and then the AND to somehow fix this issue?
|
|
|
|
|
See endianness for information and see IPAddress.NetworkToHostOrder() for conversion methods.
|
|
|
|
|
what is the type of the distrbution of Computer Generated Random Numbers?
|
|
|
|
|
shabonaa wrote: what is the type of the distrbution of Computer Generated Random Numbers?
No one knows, it's random.
led mike
|
|
|
|
|
That depends on what algorithm is used.
The numbers produced by the Random class is suitable for most regular uses. To create secure keys for encryption it's too predictable, so the encryption classes have their own random generator.
---
b { font-weight: normal; }
|
|
|
|
|
what is type of distribution the default random function in .net use?
|
|
|
|
|
Is this a question on a test, or something?
The distribution is supposed to be uniform. I don't know the exact algorithm, so I can't say how close to uniform they are.
---
b { font-weight: normal; }
|
|
|
|
|
No but one of my friends is trying to convinces me that it is not a uniform distrbution but i think it is a uniform so i needed to be sure to face him
|
|
|
|
|
Well, as the random numbers are not truly random, the distribution is not truly uniform, but it certainly isn't any other type of distribution.
---
b { font-weight: normal; }
|
|
|
|
|
thank u Guffa for ur help
|
|
|
|
|
nothing is random here they are dependent on current time (millisecs presicion)
|
|
|
|
|
hellow to all ..
i am trying to load data from a database in c# , but i am looking to be able in the combobox to select a valuemember , i saw a class that a member wrote nice idea , but is there any other way or simpler way like in the vb.net ?
thxx
|
|
|
|
|
I have application that need to upgrade an existing .mdb file with few modification on .mdb file structure such as add new collum into existing table, changed index properties on couple existing column.
Is there a way to modifyy .mdb file on the fly or do i have to extract data out from old database and insert into new database which have the new structure?
Please help.
Thanks
|
|
|
|
|
i dont know much but
you can use add table query for another database create the new data base with modified data and after the query is completed rename your existing database (for backup purpose) and bring new database in its position
hope this helps
|
|
|
|
|
hi
i found an article in codeproject as DataGridPrinter that print datagrid good. but it has written with VB.Net and i want it in csharp. when i create dll in VB.Net and i use it in c# the following error shown me :
Unable to cast object of type 'System.Windows.Forms.BindingSource' to type 'System.Data.DataTable'
and when i set Datagrid1.DataSource = ds1.Tables["Table1"]; the following error shown me :
//in Line 374
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
how to solve my problem and do you have a other class that print datagrid in C# with header and footer ?
thanks ..
|
|
|
|
|
|
Wolf92 wrote: I need to think
Wolf92 wrote: Can you help me?
Yes, hold on.............................................. did that help?
led mike
|
|
|
|
|
some desktop utility
with muultiple features such as shortcut organizer
single click shut down / logoff
calander
scheduler
and the list goes on up till what you can do and what you can think
|
|
|
|
|
You're building apps as Christmas presents? Glad I'm not on your Christmas list.
|
|
|
|
|
I have to agree. Unless someone on your list wants an app that is unavailable commercially that's a really wierd gift idea.
|
|
|
|
|
Hello,
Im writing a program that checks several companies' websites for prices and compares them. Since every website is different, i have a different library with specific methods for each website. I want to be able to add libraries later on without having to change the source of my program.
What i wanted to do was specify the library names in xml, use that to make an arraylist of websites, and use reflection to use those libraries. However, the program can't find the libraries unless i add the right reference before compiling.
Is it possible to add libraries and use them without having to add a reference and recompiling my program?
|
|
|
|
|
Stijn Van Hamme wrote: Is it possible to add libraries and use them without having to add a reference and recompiling my program?
Yes
Stijn Van Hamme wrote: use reflection to use those libraries
Yes
led mike
|
|
|
|
|
hi
iwanna make Ad Hoc Network Simulator can anybody guide me by any thing tutorial or site in thise field
|
|
|
|
|
Is there any better way to hide property runtime other than [BrowsableAttribute(false)] ?
There is only PreFilterProperties for Design mode but I couldn`t find anything like this for runtime, anyone can help me out?
|
|
|
|