Search:
Type: Posts; User: Mutant_Fruit
Search:
Search took 0.09 seconds.
-
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:
...
-
April 25th, 2012, 12:50 PM
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 =...
-
April 25th, 2012, 04:33 AM
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...
-
April 3rd, 2012, 05:40 AM
Mono supports everything up to C# 5 actually ;)
http://www.infoq.com/news/2011/10/Mono-2-12;jsessionid=C219F07A5D07EC3C2DE13A44065FC8B7
-
March 28th, 2012, 07:01 AM
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...
-
March 28th, 2012, 04:02 AM
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 =...
-
March 11th, 2012, 07:46 PM
Simple! Use an iterative approach instead of recursive. Similar to this: http://www.codeproject.com/Articles/21194/Iterative-vs-Recursive-Approaches
-
February 17th, 2012, 06:51 PM
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.
-
February 7th, 2012, 06:28 AM
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...
-
February 1st, 2012, 05:22 PM
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...
-
January 29th, 2012, 07:49 AM
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...
-
January 28th, 2012, 09:18 PM
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...
-
January 16th, 2012, 05:10 PM
C# allows this too (unfortunately)
http://msdn.microsoft.com/en-us/library/dd264739.aspx
-
January 10th, 2012, 05:41 AM
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...
-
January 9th, 2012, 12:43 PM
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...
-
January 8th, 2012, 10:22 PM
What do you actually want to accomplish? Do you want to create the equivalent of firefox/chrome in C#?
-
January 8th, 2012, 12:42 PM
Or use:
foreach (var line in File.ReadLines (path_to_file))
Process (line);
or
-
January 5th, 2012, 05:31 AM
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.
-
December 24th, 2011, 11:39 AM
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...
-
December 22nd, 2011, 01:14 PM
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"...
-
December 22nd, 2011, 06:20 AM
You more than likely need to override the default equality method too:
public override bool Equals (object other)
{
return Equals (other as Customer);
}
-
December 19th, 2011, 05:48 AM
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;...
-
December 15th, 2011, 09:19 AM
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...
-
December 13th, 2011, 10:15 AM
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.
-
December 12th, 2011, 12:56 PM
It's automatically closed. What's the issue you're having? Are you trying to open it multiple times from multiple threads?
|
Click Here to Expand Forum to Full Width
|