CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Erendar

Page 1 of 5 1 2 3 4

Search: Search took 0.08 seconds.

  1. Replies
    12
    Views
    12,063

    Re: double overflow detection

    Top of the thread -> Thread Tools
  2. Replies
    2
    Views
    678

    Re: Stream read help

    Read your file with File.ReadAllText(string path) and then you can do FileWriteAllText(string path, string content)
  3. Replies
    3
    Views
    825

    Re: XmlSerialization doesn't write to file

    Personally i'm using the TextWriter version


    if (FileList.myFiles[0].Count > 0 && Global.bSerialEnable)
    {
    foreach (long key in...
  4. Replies
    6
    Views
    1,368

    Re: Trouble converting string to double

    string s = "981.55";
    double d;
    if (double.TryParse(s, NumberStyles.AllowDecimalPoint,CultureInfo.InvariantCulture,out d))
    Console.WriteLine(d);
    ...
  5. Replies
    12
    Views
    12,063

    Re: double overflow detection

    I'm thinking about this for add to avoid multiplying again


    static double Add(double a,double b)
    {
    double r = a + b;
    if (r == 0.0 && a != (-b))
    throw new...
  6. Replies
    12
    Views
    12,063

    Re: double overflow detection

    You could use something like this then as a multiplication of 2 members will return 0 only if one of them is 0

    Code to be adapted of course

    static double Multiply(double a, double b)
    {...
  7. Replies
    12
    Views
    12,063

    Re: double overflow detection

    Well was wondering, why should it throw an Exception ? It's not it's a limit of the system. as the multiplication of 1.0E-307 by itself will give you 1.0E-614 and the system hasn't been specified...
  8. Re: My simple program closes automatically (New C# user)

    Console.WriteLine("Press anykey to quit");
    Console.ReadKey(true);
  9. Replies
    12
    Views
    12,063

    Re: double overflow detection

    EDIT : Removed my reply. Checked doesn't work for float values
  10. Replies
    2
    Views
    978

    Re: C# Random response from a string,

    Something like this ?


    Random rand = new Random();
    string SelectStringFromArray(string[] s)
    {
    if (s.Length > 0)
    return s[rand.Next(0,...
  11. Re: Add MaxCharactersAllowed property to TextBox same as MaxLength

    In my idead you could create your custom control and then listen for Windows event messages passed to your application.
    ...
  12. Re: Add MaxCharactersAllowed property to TextBox same as MaxLength

    Question :
    Why do you want to make a Property that does the same thing ?

    1st solution (easy way) :
    Manage the keydown event and check how many characters are inside the textbox, if more discard...
  13. Replies
    2
    Views
    9,269

    Re: Document templates library

    If you have MS Office installed almost all component are COM compatible, so you can use them ;)
  14. Replies
    2
    Views
    743

    Re: resizing controls by percent

    Use Anchor properties of controls
  15. Replies
    1
    Views
    2,788

    Re: Need help with a Crypter

    C or C# ?
    Are you talking of the command prompt that pops when you debug your program ?
  16. Replies
    4
    Views
    989

    Re: Using the += Assignment Operator

    In C#.net you can override and define new operators overloads.

    Nice MSDN tutorial there :

    http://msdn.microsoft.com/en-us/library/aa288467(v=vs.71).aspx

    So i would say to redefine it just do...
  17. Re: backgroundworker doesnt get progress info from another class

    I'm not sure if I understood all code but for me the code calling ReportProgress() is actually in the thread that CREATED the backgroundWorker (the UI)

    The backgroundWorker is a indepedant thread...
  18. Replies
    3
    Views
    2,818

    Re: Scope, memory usage and goto

    Well i tried something else


    Console.WriteLine("a");
    goto test;
    int i;
    i = 23;
    test:
    i = 54;
    ...
  19. Replies
    3
    Views
    1,715

    Re: Basic IRC Bot help

    well if your parse all input to lower case then

    if (command.Contains("!Quit"))
    will never trigger as Contains is case sensitive
    just write
    if (command.Contains("!quit"))


    When your bot is...
  20. Replies
    3
    Views
    2,818

    Scope, memory usage and goto

    Start:
    {
    int i = 0;
    i++;
    goto Start;
    }


    My teacher told me never to use goto statements, trying to figure if there's...
  21. Replies
    3
    Views
    1,715

    Re: Basic IRC Bot help

    if (command.Contains("!Quit"))
    {

    I checked what recives the bot when I write !Quit in my irc server
    it reads !quit

    don't ask me why it goes lowercase but that's why it's...
  22. Replies
    3
    Views
    1,607

    Re: Detect parallels and QEMU

    http://www.codeproject.com/Articles/9823/Detect-if-your-program-is-running-inside-a-Virtual
  23. Replies
    2
    Views
    750

    Re: link points in a smart way

    Suggetion : (may be a bad idea)

    Divide your image in bigger chunks than just on pixel basis and count on each chuck how many white dots you have.

    Let's take my image and say black squares are...
  24. Replies
    1
    Views
    839

    2 different implementations of buffer

    Hello,

    I have a class containing network incoming buffer and multiple threads trying to access it. I had to add a ManualResetEvent to act as a token preventing simultaneous access.

    I have an...
  25. Replies
    0
    Views
    514

    Limit DoS on TcpClient

    Hello,

    At the moment I'm using a server which listens for clients on a given ports.


    while (bListenerEnable)
    {
    TcpClient tc =...
Results 1 to 25 of 116
Page 1 of 5 1 2 3 4





Click Here to Expand Forum to Full Width

Featured