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

Search:

Type: Posts; User: Mutant_Fruit

Page 1 of 63 1 2 3 4

Search: Search took 1.06 seconds; generated 33 minute(s) ago.

  1. Replies
    9
    Views
    6,471

    Re: Find all instances of type

    You could create a:

    static List<WeakReference> MyObjects;

    Then every time you create an instance of MyObject (for example do this inside the MyObject constructor or whatever) you can do:


    ...
  2. Replies
    3
    Views
    915

    Re: dll import

    uint8 is an unsigned 8 bit integer, which in C# is a 'byte'. Unsigned char is the same as uint8 in this scenario, so the correct p/invoke signature is:

    [DllImport("XbeeFW.dll", EntryPoint =...
  3. Re: How do I get the most out of monodevelop

    It operates pretty similarly to Visual Studio. You open the sln or csproj file to work with the solution and away you go. What error does it give you? Could you describe it in more detail or take a...
  4. Replies
    5
    Views
    2,096

    Re: was c sharp made for linux?

    Mono supports everything up to C# 5 actually ;)

    http://www.infoq.com/news/2011/10/Mono-2-12;jsessionid=C219F07A5D07EC3C2DE13A44065FC8B7
  5. Replies
    5
    Views
    1,335

    Re: Delegates and Event

    In this scenario you could simply write:


    public event BatchInfo.StatusMessageChangeHandle StatusMessageChange;

    This will implicitly have the normal "add" and "remove" handlers. I'm just...
  6. Replies
    2
    Views
    3,832

    Re: How to sort a hashtable?

    This is impossible, it is not how a hashtable works. What you want to do is something like:

    Assuming you have a Dictionary<K, V> you can do something like:

    Dictionary<string, int> foo =...
  7. Re: How do you bypass Stack Overflow Exception?

    Simple! Use an iterative approach instead of recursive. Similar to this: http://www.codeproject.com/Articles/21194/Iterative-vs-Recursive-Approaches
  8. Re: Error passing Dictionary to IDictionary parameter

    A List<string> is not the same as an IList<string>. Change the function to:

    public bool test(IDictionary<string, List<string>> a)

    and it will work as expected.
  9. Re: Difference between Dictionary and OrderedDictionary??

    The biggest difference is that OrderedDictionary can be used like a regular dictionary and also as if it were a List. You can access items by index and they are stored in the order in which you added...
  10. Re: discover real card and real ip address of my machine without calling directly WMI

    There's nothing wrong or 'dirty' with that method at all. That's the way you're supposed to obtain all the network interfaces and you do filter out ones which are not suitable for your purposes in a...
  11. Replies
    4
    Views
    2,190

    Re: Error Handling Strategies

    Setting up a try/catch/finally has nearly no performance penalty. Actually throwing an exception has a performance hit as the runtime has to calculate the stacktrace, do security checks and unwind...
  12. Replies
    2
    Views
    861

    Re: delay in reading data from hard disk

    The odds are he's reading a bunch of MP3s from the main GUI thread which is blocking updates from occurring. He needs to do them in a background thread and post the updates the the UI to avoid making...
  13. Replies
    7
    Views
    1,441

    Re: Symbol to a symbol?

    C# allows this too (unfortunately)

    http://msdn.microsoft.com/en-us/library/dd264739.aspx
  14. Re: [RESOLVED] System.outofmemoryexception, how to handle

    This query will work, but it will hit similar memory issues as your original approach. You will require *all* of the first file to be in memory in order to execute the query. If your files are...
  15. Re: Creating an html 5 browser in C# : Getting started?

    What you want to do is invoke a native library which implements everything. Webkit is possibly the better option. It's not possible to implement this kind of thing yourself, not unless you want to...
  16. Re: Creating an html 5 browser in C# : Getting started?

    What do you actually want to accomplish? Do you want to create the equivalent of firefox/chrome in C#?
  17. Re: System.outofmemoryexception, how to handle

    Or use:



    foreach (var line in File.ReadLines (path_to_file))
    Process (line);


    or
  18. Replies
    4
    Views
    1,726

    Re: HashSet of strings - subsets

    The simplest way of implementing this would be to use a List<string> which is in sorted order and use a BinarySearch to figure out if it contains the item you require.
  19. Re: Linked List, Tree, etc is useful now a day?

    To be honest, if you're asking "Why are we teaching students about fundamental datastructures which have known performance/memory usage tradeoffs", you are not qualified to be a teacher.

    Linked...
  20. Replies
    6
    Views
    20,337

    Re: Problem using List Except

    The solution is a little confusing, but hopefully this will be clear enough:



    class Person {
    public string Name { get; set; }
    }

    // Declare a list
    Person a = new Person { Name = "Bert"...
  21. Replies
    6
    Views
    20,337

    Re: Problem using List Except

    You more than likely need to override the default equality method too:



    public override bool Equals (object other)
    {
    return Equals (other as Customer);
    }
  22. Re: what is the benifit of not creating instance of a static class in c#?

    The main benefit is that you save on memory. For example to get the maths constant 'pi', which is 3.1415.... it'd be a terrible waste to have to create an entire class every time.

    var x = Math.Pi;...
  23. Replies
    2
    Views
    9,597

    Re: TcpListener not accepting clients

    As per documentation: http://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener.pending.aspx

    That property only returns 'true' if someone has connected to the socket but...
  24. Re: XmlDocument load function is giving Out of Memory Exception For large XML file(13

    Use XmlReader instead of XmlDocument. It's a forward-only parser which does not require all of the data to be in memory at one time.
  25. Replies
    5
    Views
    965

    Re: File.Close()!!!

    It's automatically closed. What's the issue you're having? Are you trying to open it multiple times from multiple threads?
Results 1 to 25 of 1567
Page 1 of 63 1 2 3 4





Click Here to Expand Forum to Full Width

Featured