Nero's day to day... http://neros.posterous.com Random photographs and other bullshit posterous.com Fri, 04 May 2012 05:10:00 -0700 C# AllowedValuesAttribute and DropDownListFor helpers http://neros.posterous.com/c-allowedvaluesattribute-and-dropdownlistfor http://neros.posterous.com/c-allowedvaluesattribute-and-dropdownlistfor

Currently i'm making an application that makes good use of dynamic C#, ie the ability to make user-customized formulas. The application has been, so far, making use of several enum fields. Since I had to make the enums accessible by users who are not tech-savy, I needed a way to make them into strings without going too deep. Since .NET is an incredibly powerful tool, it gave me an excuse to spend a good few hours learning more about reflection and putting together an attribute with validation in case user wants to edit field manually (not likely) and allow using the field as a standard dropdown for more safety and control. This way, inside the dynamic formulas, one can simply compare the field value to a string.

Without further ado, here is the gist.

https://gist.github.com/2594456

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Tue, 15 Nov 2011 22:16:00 -0800 jQuery extension: Autohash. http://neros.posterous.com/jquery-extension-autohash http://neros.posterous.com/jquery-extension-autohash

So, I was up for a few hours during the night and I decided to spend the time creating something my mind just couldn't leave alone. 

A jQuery extension to deal with URL hashes, you know the things that are in URL's after sharp (#) marks? Yeah. I needed something to allow people to share the specific formdata. I _really_ couldn't find something that simple within a brief search, hence this little extension. Grab it from my gist below, use it as:

$(selector).autohash();

There's really no options, because none is needed, as the plugin really does only two things: it automatically loads the input/select boxes with the ID's specified in the hash with the values in hash. Possibly some additional features such as url encoding and ability to disable automatically checking the element... although that would kind of defeat the whole purpose of the extension.

https://gist.github.com/1369415

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Thu, 02 Jun 2011 03:08:00 -0700 Markdown test http://neros.posterous.com/markdown-test http://neros.posterous.com/markdown-test

https://gist.github.com/1004387

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Wed, 01 Jun 2011 12:49:00 -0700 WTB macro lens :( http://neros.posterous.com/wtb-macro-lens http://neros.posterous.com/wtb-macro-lens

Dsc_0042

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Thu, 24 Mar 2011 11:41:28 -0700 New carrier for my camera! http://neros.posterous.com/new-carrier-for-my-camera http://neros.posterous.com/new-carrier-for-my-camera Now I can look cool while taking shots, too!
Dsc_0194

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Sun, 20 Mar 2011 12:18:59 -0700 More HDR http://neros.posterous.com/more-hdr http://neros.posterous.com/more-hdr So I went to the store at 8 and, equipped with more understanding of HDR and photography, I saw this amazingly beautiful scene with considerable simplicity. I couldn't resist but to take a few shots with different exposure levels and slap them together into an HDR image. It's crap-ish, I know, but it's the first HDR image that actually comes out somewhat decent!

Shophdr

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Sun, 20 Mar 2011 05:05:00 -0700 Many boxes, handle it! http://neros.posterous.com/many-boxes-handle-it http://neros.posterous.com/many-boxes-handle-it

You can't handle the boxes!

But in all seriousness, I should probably throw some of them out. They might not take all that much space when packed together but it just feels like there's a little too many. That stack is nearly 2 meters tall!

Dsc_0129_tonemapped2_12

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero
Sat, 19 Mar 2011 04:04:00 -0700 It's a tree! http://neros.posterous.com/its-a-tree http://neros.posterous.com/its-a-tree

A monkey bread tree

Dsc_0059

Permalink | Leave a comment  »

]]>
http://posterous.com/images/profile/missing-user-75.png http://posterous.com/users/hdKt5VBiOs1WW Nero neros Nero