Forgot your password?
Sign in using
Chapters and Sections
Article Help Forum
Submit an article or tip
Post your Blog
Ask a Question
View Unanswered Questions
View All Questions...
All Message Boards...
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work & Training Issues
Design and Architecture
C / C++ / MFC
ATL / WTL / STL
Ruby On Rails
Hardware & Devices
Hosting and Servers
Silverlight / WPF
Site Bugs / Suggestions
The Insider Newsletter
The Daily Build Newsletter
The Insider News
The Weird & The Wonderful
Most Valuable Professionals
General Indian Topics
General Chinese Topics
What is 'CodeProject'?
Ask a Question
Bugs and Suggestions
Article Help Forum
Advertise with us
Comments by Alexandru Ghiondea (Top 16 by date)
You are correct! I was not aware of this - thanks! :)
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.
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).
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?
What BobJanova said.
Can you explain what is not working?
Saying that it does not work does not really help us figure out what is wrong.
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?
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?
So you want to convert the hex string into its the decimal representation?
My understanding was that you wanted to get to this type of string from your byte array:
Could you walk me through an example?
It depends :). You can use it like this:
int a = 10;
while (a --> 10)
But this will write the original stream into the file, and not the XML that is generated by serialization.
I would add that you have to save the file to disk anyway before you open it.
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.
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.
No worries! :)
Web01 | 2.8.140814.1 | Last Updated 1 Jan 1900
All Rights Reserved.
Terms of Service