Jump to content
Xtreme .Net Talk

DecemberChild

Members
  • Posts

    4
  • Joined

  • Last visited

About DecemberChild

  • Birthday 12/02/1982

Personal Information

  • Occupation
    Consultant at Edument AB, located in Helsingborg, Sweden
  • Visual Studio .NET Version
    Visual Studio 2010 Ultimate
  • .NET Preferred Language
    C#

Contact Details

  • Skype
    EricLavesson

DecemberChild's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. How did you generate the XML with the text box content? Did you use a third-party framework or did you use the .NET XmlSerializer? I haven't tried it myself, but my first thought is that it shouldn't have to be too hard to serialize the content of a datagrid, but it's hard to say without having more to go on... What have you tried so far?
  2. Oh, sorry. There should be a line that says "Return res". I think I'll try to disable the overflow checking in VB and see where that leads me. Thanks for all the help!
  3. Hi. I've experimented a little with Perlin Noise and noise generation in general the last few months. When I started, I mostly used the Rnd() statement to randomize numbers. The first problem that occured was that I wanted the number generator to return the same number when I passed the same variables to the function. I found the following function in a Perlin Noise tutorial, which I have been trying to convert from C# to VB.NET: float noise::Noise2d(int x, int y) { int n; n = x + y * 57; n = (n<<13) ^ n; float res = (float)( 1.0 - ( (n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff ) / 1073741824.0); return res; } My VB.NET-translation looks like this: Private Function Noise2D(ByVal x As Integer, ByVal y As Integer) As Single Dim n As Integer n = x + y * 57 n = (n << 13) Xor n Dim res As Single = CSng(1.0 - ((n * (n * n * 15731 + 789221) + 1376312589) And &H7FFFFFFF) / 1073741824.0) End Function The code works as it's supposed to in C#, but I keep getting Overflow error in VB.NET all the time. I can't honestly say that I've managed to figure out exactly *why* the code works in C#. I can understand the code and all used commands, but I'm not sure why VB.NET gets an overflow error, while C# don't. Could it be that the purpose of the generator is to cause an intentional overflow, but that C#, instead of returning an error, returns some kind of truncated number instead? I'm not sure myself, and if someone could maybe explain this to me, and explain how I might get it to work in VB.NET, or at least give me some kind of advice, I would be very grateful. Thanks!
  4. I've been programming in VB.NET for some time now, and before that I programmed in VB6. The thing is that I don't want to program VB.NET the rest of my life. I know how to use OOP and so on, which I hope may help me converting to another language. I've been thinking of programming languages such as C++ and C#.. C# seems nice with the GUI-Designer (which I recognize from VB.NET too ;).. ), but on the other hand, I have no experience in C# (and only very little in C++). ...So I have a couple of questions: 1. What are the bigger advantages / disadvantages of C# and C++ compared to each other? 2. One of the reasons I would like to change from VB.NET is because of the lack of information regarding DirectX-programming. Most of it seems to be for C++. How big are the differenses between the languages in DX-programming? 3. C# has an GUI-builder which I already know. I've tried the dialoguebased builder in C++.NET and didn't like it at all.. The question is: Is it worth the effort to learn how to program Window-GUI's in C++ or is it just a waste of time? 4. I've seen some code in C# and it looked very similar to C++-code. How big are the code-differenses? I don't know if one or more of these questions may be stupid, but I have absolutely no C#-experience, and as i said.. very little C++-experience where I have only typed a few consolebased programs and learned how to use If- and for-statements and so on. Only a little basics ;). So I hope you will be a little indulgent with my poor knowledge of these systems ;). Thanks in advance. /Eric Lavesson.
×
×
  • Create New...