Search
Code Better
-
Recent Posts
Categories
Category Archives: Libraries
Excel-Style Auto-Filtering List Views in DevExpress
How can you apply Excel-style auto-filtering on list views in DevExpress? It’s surprisingly easy: open up your model, expand Views, select the view you want, and set the ShowAutoFilterRow property (under Behaviour) to true. Instantly, you’ll see a filteration row appear under your table header. And you can use a GUI filter designer! Continue reading
Regular Expression Model Validation in DevExpress
How do you add model-level validation in DevExpress? Very simply, with an attribute; there’s a RuleRequired attribute, and a RuleRegularExpression attribute; the former guarantees null/blank values are not allowed, and the latter allows you to specify a regular expression to validate against the field value. Continue reading
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