Go to home page mail me! RSS Feed

.Net Framework 3.0

Taking my key value store to another level

Before I start cramming code, I’ll like to know what you guys think. I’ve been working heavily on my key value store and it has been working as expected, however, the main reason for me building this store does not seem to be completely eliminated with the functionalities that I have in place so far. therefore, I’ll like to add an extra piece to the jigsaw but before I do so I’ll like to hear what you have to say. The storage engine itself is solid and it works with the minimal functionalities that it currently has. As a...

posted @ Saturday, March 06, 2010 8:40 PM | Feedback (0)

A simple way to resize an image

Here is a very simple way to resize an image using a bitmap as a canvas and the graphics object as a the resizing tool. Don’t forget to reference System.Drawing. /// <summary> /// Resizes an image from a source file to a destination file /// the destination file will contain the exact image at the size specified /// </summary> /// <param name="sourceImagePath">the source image file that needs to be resized</param> /// <param name="destinationImagePath">the destination path that the source /// image file needs to be resized to</param> /// <param name="width">the new width</param> /// <param name="height">the new height</param> static void ResizeImage(string sourceImagePath, ...

posted @ Tuesday, July 28, 2009 10:13 AM | Feedback (20)

Write out page load times using an HttpModule and the stopwatch class

One of the most efficient and non-intrusive ways you can implement an intercepting procedure is via an HttpModule. An HttpModule simply receives every request going to or coming from IIS and it allows you to manipulate the content as you see fit and pass it along. I wanted to spit out the time it takes from receiving a request to writing the response on one or more web pages and there was no other better way of doing it except writing an HttpModule, it toke me all but 10mins. Here is the code, feel free to blow it up. ...

posted @ Friday, July 24, 2009 1:40 PM | Feedback (0)

Get underlying type from a nullable type

As my forever quest for simple & reusable code keeps growing, I stumble across some bottlenecks once in a while. Anyway, I have a simple class that is called "PopulateObjectFromFormRequest" and as descriptive as the name is, it does one simple yet helpful task. Given an object as a generic type I.e (user) and a web form as a parameter I.e (aspnetform), it will scan through all the controls of that web form and use reflection on the object and assign values to the object properties that matches controls from within the form. How does this help me? Well if I my...

posted @ Tuesday, March 11, 2008 11:33 AM | Feedback (5)

MVC for Visual Studio Express 2008

For those of us who can't always afford to buy the ridiculously expensive VS Pro/Team 2008 - shouldn't Microsoft be giving those out for FREE. After all we are only promoting windows, without us developers the Windows operating system will be more or less like TinyOS. Anyway, lets leave that for another day. I like using express simply because its lightweight and I don't really use all the features of the Pro versions anyway, I only wish I could "attach to process" then the express editions would be 100% ideal for me. Any who, the express editions do not support MVC - actually...

posted @ Thursday, February 07, 2008 2:03 PM | Feedback (0)

Removing declaration and namespaces from XML (serialization)

Sometimes working with pure XML is our only option and we may just want it as clean as it can be. I usually use the XmlDocument object to load and/or create the XML and manipulate it and then at the end of the day, I'll use the InnerXml property to get pure XML, which I usually save to a file or do something with or I may just be serializing a Serializable object to XML. The XmlDocument object by default assigns a namespace to the XML string and also includes the declaration as the first line of the XML document....

posted @ Tuesday, January 29, 2008 10:27 AM | Feedback (9)

Next entries »