Search
Code Better
-
Recent Posts
Categories
Category Archives: Libraries
Forcing a Database Update with DevExpress
How can you force DevExpress to update the database? Either change the module versions in the ModuleInfo table, or else obliterate the entire database. Then run the DB Updater (in either case) and it will regenerate the schema. Continue reading
If/Else Statements in MVC3 With Razor
How can you write an If/Else statement in ASP.NET MVC3? The answer is, surprisingly, with only one @-sign; although similar code would take five sets of angle-brackets in MVC2, Razor lets us write it with just one — which shows that their design goal of enabling a fluid coding flow was very successful. Continue reading
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
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
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
Setting SELECTED in ASP.NET MVC DropDowns
Microsoft’s ASP.NET MVC framework has a nice little helper for creating drop-down lists called Html.DropDownList. But how do you tell it to pre-select a value, i.e. set the SELECTED attribute on the correct OPTION tag? The answer is to use an alternate constructor for your SelectList that sets the selected-value object. Continue reading