How NOT To Optimize LINQ Statements

About a month ago I was experimenting with different ways to optimize my LINQ queries against the IdeaPipe database, in order to improve the read times. I wanted to improve the read times because our new Facebook Application was being launched and I anticipated an increase in our traffic to the server, which is used to host IdeaPipe and the Facebook Application component. Whenever I am trying to optimize SQL queries I fire up SQL Server Profiler and take a look at how the queries are performing. This helps me identify queries that are taking a longer time to execute and probably need to be looked at or re-thought. One of the queries that I identified as needing improvement was the following LINQ query: ...

September 24, 2008 · 4 min · 787 words · Nick Berardi

Review of NDepend

When I was asked to review NDepend I didn’t want to do just another review. Because there are plenty of great reviews and I would just be adding to the noise. So I am going to use this time to give a personal story of how NDepend has helped me restructure some code I have been working on. As you are probably aware I have been working on a start up, called IdeaPipe, we have been going full steam ahead since January 2008 to get IdeaPipe to the point where it is today. Going at that break neck speed for almost 6+ months has left some raw spots in the code, that I have been putting off. Because lets face it even though they are not optimal, they are returning the correct results. Just like a rough draft for a book it is better to get all the way through it and get a good picture of the entire story as a whole, and go back and rework the spots that were created inorder to advance the storeline. The same is true for software. ...

July 16, 2008 · 2 min · 341 words · Nick Berardi

MVC + Facebook == Wonderful Development Platform

Just recently I started experimenting with the ASP.NET MVC Framework and the Facebook Development Platform, it has been a very bumpy road, but I have ironed out some major issues that I would like to share with you today. I will start with a little history of what I am trying to do. For about a month and a half I have had one of my IdeaPipe interns, Dimitry, experimenting with creating a FBML (Facebook Meta Language) Application with MVC. MVC is an ideal platform for FBML because with MVC you have total control over your markup which is needed to have a lean FBML application. I am not going to go in to the differences of developing an FBML vs IFrame Facebook Application, because that information is easily found with a Google Search. What I am going to talk about is the hurdles I overcame and the custom software I had to develop to get MVC working smoothly with Facebook. ...

June 6, 2008 · 4 min · 653 words · Nick Berardi

Give Your ASP.NET Applications Velocity

Scaling ASP.NET Application just got easier with a new technology that Microsoft has just released that they have dubbed codename “Velocity”. This product is still in the early stages of development, but it is meant as a direct competitor against memcached. If you are not familiar with memcached, here is how it is described in Wikipedia: memcached (pronunciation: mem-cache-dee) is a general-purpose distributed memory caching system that was originally developed by Danga Interactive for LiveJournal, but is now used by many other sites. It is often used to speed up dynamic database-driven websites by caching data and objects in memory to reduce the number of times the database must be read. Memcached is distributed under a permissive free software license. ...

June 5, 2008 · 3 min · 533 words · Nick Berardi

ASP.NET MVC Preview 3 Released

The ASP.NET MVC Team has released an refresh of MVC. To all those that are interested the new Preview Release is posted at: http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=13792 The new release contains many new features over the 2nd Preview Release and the Interim Release from a month a half ago. In this post I am going to outline the features that are new from the Interim Release to Preview Release 3. Action Method and Result Changes As you remember from the previous release, you are now required to return an ActionResult. Many of the ActionResults were renamed to the following types: ...

May 27, 2008 · 4 min · 782 words · Nick Berardi

How to create a non-Native jQuery event

Today I had the need to create a custom event using jQuery, in order to launch a customized form validation event from a global submit event. I did this so I could focus in on the first form field that had an error. My event from the global.js script, that is included on every page of IdeaPipe, looks like this: $("form").submit(function () { var valid = $(this).validate(); // if the form didn't validate then focus the input on the first error if (!valid) $(this).find(":input[error]:first").focus(); return valid; }); This is pretty standard jQuery. What this code above does is set a custom function for the submit event for any tag on the page. The submit event will only be allowed to continue if a return value of true is returned from the function. ...

May 23, 2008 · 2 min · 349 words · Nick Berardi

2 Easy Steps To Turn Your Blog Into An OpenID Gateway

Many of you probably have heard of OpenID, but have never had a chance to use it. However, I predict that most of you reading this blog will have used it by the end of the year. I can make this prediction with an almost 100% certainty because there is a growing movement behind it that has many big players actively buying developing and integrating their platforms with the OpenID protocol. Some of the biggest players are: ...

May 13, 2008 · 3 min · 442 words · Nick Berardi

Whats the idea? The reason we implemented IdeaPipe

When we first came up with the idea for IdeaPipe (no pun intended), we saw a need to fill a void in the social networking landscape. There are countless sites dedicated to connecting friends, classmates and business associates, sites that provide opinions and commentary around a specific topic and even sites that simply point to other sites, but there were few if any that enabled individuals or groups to share their ideas for the purposes of gathering feedback, collaborating or simply being heard. ...

May 7, 2008 · 3 min · 493 words · Nick Berardi

Introducing Idea Pipe

I have been working on this new social networking website that is based around the collaboration and sharing of ideas. I have talked about this project in the past, in very vague details, but today I have decided to open the curtains and give everybody a look. http://www.ideapipe.com Currently there are a couple websites out there that are doing the same thing, but in a more focused way for their specific business. One of the examples of these focused websites for sharing of ideas is Dell Idea Storm. In the case of Dell each of the users go to their website and submit ideas on how they can improve Dell’s products. The platform has worked really well for Dell, they seem to be getting a positive response from their community of users. It has led to them introducing a couple of products that they probably wouldn’t have, such as Ubuntu as an alternate to Microsoft Windows, if there wasn’t such an overwhelming support for this install option. ...

April 28, 2008 · 2 min · 350 words · Nick Berardi

Coder Journal's MVC Toolkit

Today I decided to release a toolkit that I have been building over the past couple of months. Most of the code in the toolkit is related to MVC. Here is a list of the features: ActionFilterAttribute’s HttpPostOnlyAttribute Only allows POST to be made against the action. CacheAttribute Sets the action’s response as cacheable. CompressAttribute Compresses the action’s response using GZip or Deflate encoding. ServiceAttribute Marks an action as able to provide the ViewData as JSON, XML, or JSONP. ServiceOnlyAttribute Marks an action as only able to provide the ViewData as JSON, XML, or JSONP, that means no HTML. ExceptionHandlerAttribute Handles any exceptions thrown from an action, and redirects it to another page, or another action. CaptchaAttribute I did a whole post on providing a CAPTCHA for your MVC action. AllowedHttpMethodsAttribute Only the HTTP methods entered in to this filter are allowed for your action. Available HTTP methods are OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, and CONNECT. ViewEngines’s ServiceViewEngine This view engine provides the serialization of the ViewData to JSON, XML, or JSONP. It is set when one of the following is requested from the ServiceAttribute above. Route’s LowercaseRoute I did a whole post on why I needed this in my toolkit. Mostly because of my obsessions to have all URL’s in lowercase. Method Extensions Redirect extends HttpResponse I have had a long standing discontent with the Redirect method of the ASP.NET. I have talked about good use of HTTP Status Codes before. There are at least 3 status codes that you want to consider before choosing a response status code of 302. Just to reiterate my post on the subject use 303 to redirect from a form POST, use 307 when you want to redirect to a page that is going to change with each request, use 301 if you want to permanently redirect one URL to another.I created the, Redirect, extension method on HttpResponse so that the status code could be set for the redirect. View Source: Coder Journal MVC Toolkit Source Download Binary: Coder Journal MVC Toolkit Binary ...

April 13, 2008 · 2 min · 358 words · Nick Berardi