Search
Code Better
-
Recent Posts
Categories
Category Archives: Silverlight
Limiting the Number of Results from LINQ
How can you limit the number of objects returned from a LINQ query, i.e. only request the first N objects (similar to MySQL’s LIMIT keyword)? The answer is via the Take(n) LINQ method; it pulls the first N rows specified. Continue reading
Posted in Core .NET, Silverlight, Web, Wndows Forms, WPF
Tagged LINQ, LINQ for collections
Leave a comment
Tools Update: BaseEncoder and Hasher
We’ve updated the Tools library again. You can now convert integers to an from an arbitrary base (binary, hexadecimal, base64, or any base you wish) as well as calculate SHA-1 hashes of strings with one function call. Useful! Continue reading
Unit Testing and Code-Coverage in Silverlight
You can run unit-testing and code-coverage on Silverlight applications (NUnit, PartCover, et all) with a bit of foresight and reorganization of your code. You can test core logic and classes, albeit not Silverlight-specific code. I show you how. Continue reading
Posted in Core .NET, Silverlight, Tools
Tagged automated testing, NUnit, PartCover, silverlight testing
1 Comment
Persistent Storage 1.1: Arbitrary Object Serialization
Persistent Storage 1.1 brings a much-needed feature: the ability to serialize any arbitrary object quickly and efficiently — even without specifying any attributes. Thanks to Mike Talbot of Alterian for his Silverlight serializer. Continue reading
Optimization 101
How do you optimize your application? Should you? When? How? We go over the basics, with six “rules” that you can follow to help you effectively improve your application performance. Continue reading
Posted in Core .NET, Silverlight, Uncategorized, Web, Wndows Forms
Tagged optimization, out of memory issues, performance, PSR
1 Comment
Silverlight Audio Player
Playing audio files in Silverlight is non-trivial. Hence, the need for a library that allows you to do so; so this is another Tools update to include an AudioManager Silverlight-only class. What does it do? It allows you to play … Continue reading
Normal Distribution Random Generator Available!
We’re pleased to announce a new reusable library: a normally-distributed random number generator. It works like a standard integer random number generator, but produces a normal (bell-curve) distribution instead of a uniform (flat) one. We also packaged a Mersenne Prime implementation with it. Continue reading
The “using” Statement and IDisposable
The using statement allows you to create a block of text around an object (or multiple objects), that implements IDisposable, and to have the CLR automatically call Dispose on that object (or multiple objects). Continue reading
Posted in Core .NET, Silverlight, Web, Wndows Forms
Tagged Garbage Collection, IDisposable, Object Finalization, using statement
4 Comments
String.IndexOf vs. Regexp.Match
How fast is String.IndexOf vs. Regexp.Match? In a 10,000 word text, while searching for a single word located only once at the end of the text, the results were stunning: Regexp.match is more than 70x faster than the equivalent String.IndexOf. That’s a huge difference! Continue reading
Posted in Core .NET, Silverlight, Web, Wndows Forms
Tagged implementing search, project: text editor, regular expressions
Leave a comment