Posts
My Article at CodeProject: MvcMailer
I just released a .Net NuGet package called MvcMailer and to get people super easily started, put an article at CodeProject.com. You are most welcome to the article at http://www.codeproject.com/KB/aspnet/MvcMailerNuGet.aspx
I welcome your comments and suggestions! Comments Sohan Just released 0.8 and it should work. But please let me know if it doesn't.
I also added multi-part emails in version 0.8. You may check that out as well.
One important change:
Posts
C# Named Parameters Can be Very Useful
Think about the following code example:
htmlHelper.InputHelper(InputType.CheckBox, name, "true", true /* useViewData */, false /* isChecked */, true /* setId */, false /* isExplicitValue */, htmlAttributes);
This line is taken from the source code of ASP.NET MVC, or to be more specific its a line from the InputExtension class. I think the intent of the original developer is clear:
Add comment next to arguments so that one can easily read the method call without getting lost in a who's who since there are quite some arguments to pass.
Posts
2011: Yet Another New Year
Dear Readers:
Happy 2011. 2010 was a great year. Why?
Defended my MSc thesis after a moderate 16 months of grad school life.Published 3 papers in 3 international conferences.Visited 4 new countries - Netherlands, Sweden, Finland and Norway.Visited a few interesting cities - Vancouver, Victoria, Edmonton.100+ posts on DrinkRails.com.25,000+ visits to my two blogs from all over the world.Developed a fresh new app, Plexina Central, for Wairever Inc.Lived a healthy life.Bought my first (98 Corolla) and second (2000 CR-V) cars (also sold my first car)!
Posts
DRY - Total 161 Duplicate ArgumentNullException calls in ASP.Net MVC Source Code
There are 161 occurrences of the following code pattern inside the ASP.Net MVC source code: See details of which class and which line at https://gist.github.com/739523
method(type argument)
{
if(argument == null){
throw new ArgumentNullException("argument")
}
...
}
So, in total this pattern introduces 312 lines of duplicate code without whitespaces and 644 lines of duplicate code including whitespaces. And the pattern is simple, just check a condition and throw exception if its true.
Posts
Book Review: Jose Valim's Crafting Rails Applications
Have you already read this?
The following excerpt by Jose Valim at the end of the book nicely summarizes it:
Finally, you understand Rails better. You can explore other areas of the source code, study other Action Controller and Active Models modules, check other generators implementations or read the source of Railties, Engines and Applications with detail! - Jose ValimFor the impatient readers, this is the best in-depth Ruby on Rails related book I have ever read and you should read this (only 172 pages).
Posts
Ruby - some mysterious language features
Here I will share some of the interesting ruby features that you will notice when looking into mature ruby code by advanced level coders.
Comments Inventory Management Software Thanks for sharing your post and it was superb .I would like to hear more from you in future too.
Posts
Upgrading to Ruby on Rails 3 - beware!
Ryan Bates had a series of posts (1, 2 and 3) on upgrading your Rails 2.3.x apps to Rails 3.x and sure they are useful. But if you are really doing that, beware of the following changes that you will need to do. It will take a lot of time for sure if you you have a moderate sized app.
Upgrading your models:
Get rid of all validates_xxx_of with appropriate validatesGet rid of all def validate .
Posts
Using nil.to_a or whatever.to_a in ruby
Ruby is a programming language for developer happiness and productivity for customers. Here is a quick happiness and productivity tip:
Posts
4 design principles
Simplicity favors regularity.
Smaller is faster.
Good design demands compromise.
Make the common case fast.
The four principles of MIPS design that applies to most design jobs we do, even with our personal lives. Agree?
Posts
OO Design Dilemma: Auditing Changes Across Hierarchical Objects
Here is a sample UML class diagram of the situation that posed me the OO design dilemma a few days ago.
Let me explain with an example,
The Electronic Items catalog has many Televisions. The Sony Televisions come with different specifications, such as refresh rate of 240 Hz, 120 Hz and 60 Hz. However, the 240 Hz ones also comes in different colors - Black and Grey.Now, a store manager needs to see the recent changes across all catalogs, such as electronic items, musical instruments and so on.