Click here to Skip to main content
13,095,663 members (53,306 online)

Comments by Alexandru Ghiondea (Top 16 by date)

Alexandru Ghiondea 5-Aug-11 14:31pm View
You are correct! I was not aware of this - thanks! :)

Alexandru Ghiondea 5-Aug-11 14:00pm View
The way the current solution is wrote, the same numbers will be generated every-time you run your app.

You should provide a seed to the Random number generator. I usually use (int)DateTime.Now.Ticks.

Alexandru Ghiondea 5-Aug-11 2:14am View
That is the because a for loop works like this:
1. Initialize (you are assigning a constant of type int (0) to a variable of type a)
2. Check if condition is valid (you are, again, invoking the > operator with an integer (10) and a variable of type a).
3. Increment -> you have your own increment operator defined for a nybble.

For the first one, you are assigning an integer to a Nybble - so the correct implicit conversion kicks in. (The one from int to Nybble)

For the second one, you are using the < operator. The < operator works on operands of the same type. So it will convert 10 to the Nybble type and the call your < operator (the one defined on Nybble).

Alexandru Ghiondea 4-Aug-11 21:10pm View
When the loop "loops" it has to verify that the value of a is smaller than 10. Because 10 is an integer, it will have to apply the implicit conversion from a (which is a Nybble) to int. So your operator gets called.

Does this explain it? If not, could you be more explicit about what your question is? What is it that you find wrong in the output?
Alexandru Ghiondea 3-Aug-11 13:21pm View
What BobJanova said.

Alexandru Ghiondea 29-Jul-11 13:13pm View
Can you explain what is not working?
Saying that it does not work does not really help us figure out what is wrong.

Alexandru Ghiondea 28-Jul-11 18:16pm View
How would you go back to the original hex string from the number?

Or this is just a way to "check-sum" the original hex string?
Alexandru Ghiondea 28-Jul-11 14:36pm View
Well - this won't work for 50+ digits :|. This is because the long type cannot hold a value bigger than 2^64.

This is the reason why the BigInt type was created - so you can have an arbitrarily large number. What is the reason why BigInt is not acceptable?

But now I go back to my first solution - Why don't you want to generate smaller numbers - basically partitioning your number into chunks? Why is that not an acceptable solution?

Alexandru Ghiondea 28-Jul-11 13:21pm View
So you want to convert the hex string into its the decimal representation?

Alexandru Ghiondea 28-Jul-11 13:11pm View
My understanding was that you wanted to get to this type of string from your byte array:


Could you walk me through an example?

Alexandru Ghiondea 22-Jul-11 12:51pm View
It depends :). You can use it like this:

int a = 10;
while (a --> 10)

Alexandru Ghiondea 8-Jul-11 13:32pm View
But this will write the original stream into the file, and not the XML that is generated by serialization.
Alexandru Ghiondea 7-Jul-11 21:07pm View
I would add that you have to save the file to disk anyway before you open it.
Alexandru Ghiondea 7-Jul-11 20:02pm View
The OP was describing the situation when the user is presented with that choice on many web sites - which means browsers.

As I have already said, there is no built-in dialog window that the OP can use. You have to build your own.

Please don't lash out at people if you did not read the full question or reply.
Alexandru Ghiondea 7-Jul-11 15:26pm View
I am not sure if there is such a dialog built in. I belive the open/save/cancel is a dialog built into the browser.
Alexandru Ghiondea 7-Jul-11 14:29pm View
No worries! :)


Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 1 Jan 1900
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid