Go to home page mail me! RSS Feed

.Net

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)

Building a NoSQL database

As I stated in my previous posts here and here, I have set out to write my own NoSQL database simply because I can – well not really but because it will give me the edge, learning experience will be great and there isn’t really too many options when it comes to native .NET NoSQL Databases. I want to be able to build web  applications without the RDBMS overhead and schema design time. I haven’t done much yet with distributed or replicating side of things yet, so far all I wanted was a prototype to show that it...

posted @ Saturday, February 13, 2010 6:30 PM | Feedback (0)

Using web.config for SMTP settings

In the old days, we have to manually create custom configuration sections if we want to do cool stuff with app/web.config or simply just put the values in the appSettings section. However, there are a few config options that are out there that most developers don’t know about, a perfect example is the mailSettings config section which allows you to setup your mail settings in your configuration file and simply call the SMTPClient to send an email and by doing so, changing settings can be done on the fly and oh’ if you are worried about security, don’t forget you...

posted @ Tuesday, August 18, 2009 10:02 PM | Feedback (1)

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)

ASP.NET 1.1 to 2.0 conversion

I'm currently converting a huge 1.1 eCommerce site to 2.0 and its nothing but painful, apart from the stress of dealing with the original site lack of structure, there are some things that just don't work. These are my rumblings. I first tried converting the 2003 project to a 2005 website and that didn't go too well, after a few hours, I threw that idea out of the window and converted the project into a 2005 web application and it was a success apart from a few minor tweaks. Here are some other huddles that I had to jump. ...

posted @ Thursday, May 15, 2008 3:03 PM | Feedback (0)

ASP.NET MVC Source Code Now Available

Oh Yes! The ASP.NET source code is now available. Read more at ScottGu's blog. I like open source, no complaints. Next Steps: Our plans are to release regular drops of the source code going forward.  We'll release source updates every time we do official preview drops.  We will also release interim source refreshes in between the preview drops if you want to be able to track and build the source more frequently. We are also hoping to ship our unit test suite for ASP.NET MVC in the future as well (right now we use an internal mocking framework within our tests,...

posted @ Friday, March 21, 2008 1:55 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)

.Net Framework Library Source Code - Now Available!!!

It is DONE! I posted a while back about the possibilities that the .Net Framework Library source code will soon be available to the public and that day has come. Scott has a post up about the release. Today I'm happy to announce that this is now available for everyone to use. Specifically, you can now browse and debug the source code for the following .Net Framework libraries: .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, etc). ASP.NET (System.Web, System.Web.Extensions) Windows Forms (System.Windows.Forms) Windows...

posted @ Thursday, January 17, 2008 4:40 PM | Feedback (0)

Determine if a process is already running

Once you start building applications that run every so often for an undefined/unknown amount of time, its very possible that two processes may overlap.  For example, if you have a schedule task that executes a console application every 5 mins, it is possible that very much possible that it will execute another before the previous one completes. So, how do we determine if a process is already running?  So far I've seen three ways of doing it. Use the Singleton pattern Use Mutex Use System.Diagnostics (my preffered method)  /// <summary> /// Determines if this process is already running, if so it will kill itself. /// </summary> static void ExitIfRunning() { ...

posted @ Monday, January 14, 2008 9:56 AM | Feedback (0)

Full .Net Archive

Next entries »