Blog Posts

8 Traits of Great Metro Style Apps
<p><img src="http://hectorcorrea.com/images/buildwindowslogo.png" alt="Build Windows" align="left" style="margin-right:15px"/> These are my notes from <a href="http://blogs.msdn.com/b/jensenh/about.aspx" target="_blank">Jensen Harris</a> session at Build Windows conference on Tuesday September 13th, 2011. Jensen is the Director of Program Management for the Microsoft Windows User Experience Team. <br/> <br/> <br/> <br/> </p> <h2 id="metro_style_design">Metro style design</h2> <ul>
AJAX calls with jQuery in ASP.NET MVC
<p>One of the nice things about ASP.NET MVC is the ability to easily integrate standard web libraries like jQuery in .NET web applications. In this blog post I am going to show how to execute AJAX calls with jQuery from an ASP.NET MVC application. The first example shows how to do it with an <a href="#HTTPGET">HTTP GET</a> call and the second one uses an <a href="#HTTPPOST">HTTP POST</a> call. Both examples use JSON in the return type.</p> <a name="HTTPGET"></a> <h2>HTTP GET Example</h2> <p
Binary Tree in C#
<p>A few months ago I decided write a C# program to handle binary trees. I was lucky to still remember some of the basics of this data structure from my college days and was able to write a program to handle the add operation and the code to &quot;walk the tree&quot; in a few hours. To make things more interesting I also decided to write a program to draw the binary tree on the screen. This turned out to be an interesting challenge and kept me busy for a few weeks.</p> <p dir="ltr" style="margi
Book review: Lean Software Development
<p>A couple of weeks ago I finished reading <a target="_blank" href="http://www.amazon.com/exec/obidos/ISBN=0321150783">Lean Software Development</a> by Mary and Tom Poppendieck. What a great little book! In this book Mary and Tom present several tools for lean (their term for agile) software development plus an excellent background on why these types of methods work.</p> <p>Mary has a background (theory and practice) on manufacturing processes and in this book she describes how lean processes
Computer Museum (Paris)
<p>Early August I had the opportunity to visit the computer museum in Paris. The <a target="_blank" href="http://www.museeinformatique.fr/">Musee de l'Informatique</a> has a neat variety of computers in display that range from 1960s mainframe computers, early personal computer models (IBM, Apple, Commodore) from the 80s, and other computer related stuff including punch cards, old hard drives, mother boards, software, to name a few.</p> <p>Here are a few pictures that I took while I was there.</
DevConnections 2008
<p class="MsoNormal" style="margin: 0.2in 0in; line-height: 21.6pt"><span style="font-size: 10pt; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-fareast-font-family: 'Times New Roman'">Below are the brief notes that I took while at DevConnections in Las Vegas (November/2008) This blog entry is mostly bullet points of things that I found interesting without much details. I'll elaborate on some of these topics in future blog entries.<o:p></o:p></span></p> <div class="Mso
DotWiki 2.0
<p>I've posted a new version of the <a target="_blank" href="http://wiki.hectorcorrea.com/">DotWiki</a>. This new version 2.0&nbsp;is a complete rewrite using C# and it has several new features and a more attractive look and feel. Security is probably the most important new feature since it had been by far the most commonly requested feature since I released the original version in 2002.</p> <p>Previous versions of the DotWiki had been updates to the original VB.NET code and I felt that a full
Drawing a Binary Tree in Ruby
<p><img src="http://hectorcorrea.com/images/binarytree_simple.png" alt="git" align="left" style="margin-right:15px"/>When I started learning Ruby last year I decided to implement a <b>binary tree</b> and some of its basic operations (insert, delete, walk, and search) just to get my feet wet on the language. Binary trees are a good exercise because you need to use several features of the language like conditional statements, loops, and classes while at the same time you are solving an interesting
Encrypt and Decrypt a string in C#
<p>This blog posts presents an easy to use C# class to encrypt and decrypt strings in .NET.</p> <p>Although the <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.aspx" target="_blank">System.Security.Cryptography</a> namespace in the .NET Framework provides a wealth of classes to encrypt and decrypt values, it seems that MSDN fails short of providing a good and simple example on how to use these classes for the most common request: encrypt a string.</p> <p>The c
Estimates on Software Projects
<p>Estimates is one of the most controversial topics on software development, including the process to calculate them and the value that they add to the software development process.</p> <p>Every team that I have worked with needs to provide estimates on how long it's going to take to complete a specific feature of a system. Yet, most teams seem to struggle with this activity. Developers enjoy attending a meeting to provide estimates as much as they enjoy visiting the dentist. Project owners
Expose your data as an RSS Feed with .NET 3.5
<p>In talking with my <a target="_blank" href="http://geekswithblogs.net/TheCodeMonkey/Default.aspx">one of my friends</a>&nbsp;a couple of months ago I found that .NET 3.5 now has built-in classes to generate RSS Feeds. This was great news to me since both my personal blog (this site) and the <a target="_blank" href="http://code.hectorcorrea.com/dotwiki/Default.aspx">DotWiki</a> expose data as RSS Feeds but for the longest time I've been using an unsupported library that I downloaded from the w
Finder Error -36 on a NAS
<p>Ever since I got my <a href="http://hectorcorrea.com/Blog/Ruby-Development-on-the-Mac-OS-X">MacAir late last year</a> I've been having <b>issues copying files from my Mac to my external storage device</b>. My external storage device is a Buffalo HD-CELU2 DriveStation that can be accessed as a standard USB drive or as network attached storage (NAS.) I've been using this device as a NAS from my Windows computers for a couple of years with no problems but my Mac refused to work smoothly with it.
Flickr Library in C#
<p>The last few days I've been working on a sample C# library to access Flickr pictures using Flickr's own API. This library is a light-weight C# class that provides two basic features: (1) retrieve the list of photosets in your account and (2) retrieve information about the photos in a photoset.</p> <p>Using this class you can retrieve the photosets in your Flickr account and display them in a combobox with a few lines of code like these:</p> <address>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp
Flow: Second Generation Lean Product Development
<p><img alt="The Principles of Product Development Flow" width="120" height="178" align="left" src="http://hectorcorrea.com/images/flowbook.jpg" />The last few weeks I've been reading the book &quot;<a target="_blank" href="http://www.amazon.com/Principles-Product-Development-Flow-Generation/dp/1935401009">The Principles of Product Development Flow</a>&quot;&nbsp;by Donald Reinertsen<sup>[1]</sup> in which he describes what he calls the second generation of Lead Product Development.</p> <p>I've
Functional Asynchronicity Explained
<p> Over at the Pragmatic Bookshelf Trevor Burnham has a great post titled <a href="http://pragprog.com/magazines/2011-05/a-coffeescript-intervention" target="_blank">A CoffeeScript Intervention</a> in which he shows several code snippets that demonstrate how CoffeeScript code is typically smaller and cleaner than the equivalent JavaScript code.</p> <p>In particular I love the example under the <b>Functional Asynchronicity</b> section. In this section he shows a piece of code that trips most
Future Directions for C# and Visual Basic
<p> <img align="left" src="http://hectorcorrea.com/images/buildwin1.jpg" alt="Roslyn code" style="margin-right:15px"/> These are my notes from Anders Hejlsberg session on Future Directions for C# and Visual Basic. </p> <p>It's been more than 10 years since managed code was introduced back in PDC 2000. Every new release of C# has had one or two major themes:</p> <ul> <li>Version 1: Managed Code was introduced</li> <li>Version 2 2: Generics</li> <li>Version 3: LINQ</li> <li>Versio
Git Basics
<p> <img src="http://hectorcorrea.com/images/git.png" alt="git" align="left" style="margin-right:15px"/> This blog post is a beginners' guide (written by a git beginner) on how to perform <b>basic version control operations with git</b> including <b>initializing a repository</b>, <b>adding files to it</b>, and <b>using branches</b>.</p> <p>The goal of this post is to describe how to use <b>git in your local machine for version control</b>. In a future post I'll cover the basics of using git
HTTP Handlers in .NET 2.0
<div style="margin: 0in 0in 0pt">When I rewrote my web site late last year I knew I wanted to use friendly names for my blog pages instead of using URL parameters. For example, the URL to the post on Binary Trees in C# initially was this:</div> <div style="margin: 0in 0in 0pt">&nbsp;</div> <div style="margin: 0in 0in 0pt"> <div style="margin: 0in 0in 0pt"><a href="http://hectorcorrea.com/Blog.aspx?t=c8ff6dbb-284f-4bde-bf07-909f785529ae">http://hectorcorrea.com/Blog.aspx?t=c8ff6dbb-284f-4bde-b
Introduction to Scrum
<p><img alt="" align="left" src="http://hectorcorrea.com/images/CodeMayJune2008.jpg" />My article Introduction to Scrum has been published in the May/June 2008 issue of <a target="_blank" href="http://www.code-magazine.com/Article.aspx?quickid=0805051">CoDe</a> magazine and is also availabe on <a target="_blank" href="http://www.devx.com/codemag/Article/38611">DevX</a>.</p> <p>As I said in this&nbsp;article</p> <blockquote dir="ltr" style="margin-right: 0px"> <p><font face="Courier New">&quot
Log4net Thread-Safe but not Process-Safe
<p>A few days ago I was struggling with a problem with <a href="http://logging.apache.org/log4net/index.html" target="_blank">log4net</a> in a web application. I have used log4net in many applications before with little or no problem but in this case even with a single user hitting the web site I was seeing strange logging behaviors. In my case <b><i>some of the log entries were being logged but others were not.</i></b></p> <p>The application in question is a C# ASP.NET MVC web application ru
Managing and Leading (The One Thing)
<p><img alt="" hspace="10" align="left" src="http://hectorcorrea.com/images/onething.jpg" />A few years ago my friend Bill from <a target="_blank" href="http://rebarbusinessbuilders.com/Contact.aspx">Rebar Business Builders</a> recommended me the book &quot;The <a target="_blank" href="http://www.amazon.com/One-Thing-You-Need-Know/dp/0743261658">One Thing You Need to Know</a>...About Great Managing, Great Leading, and Sustained Individual Success&quot; by Marcus Buckingham.&nbsp;For a while I he
Managing the Dynamics of Change
<p>This weekend I started reading <a href="http://www.amazon.com/Managing-Dynamics-Change-Productive-Workplace/dp/0071470441" target="_blank">Managing the Dynamics of Change</a> by <a href="http://www.jerryjellison.com/" target="_blank">Jerald M. Jellison</a>. This book talks about people's emotional resistance to change and how to manage it. With my background on technology it's easy for me to look at things (including change) from the logical and rational point of view but, as the author point
Multiple Endpoints for a WCF Service
<p>One of the nice features that Windows Communication Foundation (WCF) provides is the ability to expose a single service via multiple endpoints so that different client applications can consume the same service over different network protocols. For example the same service can be exposed via HTTP for external clients and via TCP for internal clients.&nbsp;</p> <p>In WCF an <strong>endpoint</strong> refers to the combination of the address where service is available, the binding used to commun
Password Recovery in an ASP.NET MVC Project
<p>While rewriting my personal web site with ASP.NET I noticed that although support for the ASP.NET Membership Provider comes included out of the box in a ASP.NET MVC project not all the options are fully implemented to the same extend that they are in a brand new ASP.NET WebForms project. For example, the option to reset your own password if you forgot your old one is not available out of the box in an ASP.NET MVC project.</p> <p>Out of the box the following options are fully implemented in a
Returning HTTP 404 in ASP.NET MVC
<p>A few weeks ago I noticed that when users of my site request a blog topic that does not exist although I was displaying a user friendly message indicating that the topic does not exist <b>I was not returning the proper HTTP status code (404) to indicate to the user that the page was not found</b>. This approach is typically not a problem if the user visiting my site is a human (users don’t really care about HTTP status codes) but it is important if the “user” visiting the site is a web crawle
Rubber Band Reports with Pivot Tables (reprint)
<p><img width="120" height="62" hspace="5" align="left" alt="" src="http://hectorcorrea.com/images/pivottable.jpg" />A few years ago I wrote an article for the <a target="_blank" href="http://utmag.com">Universal Thread Magazine</a> on how to create reports using Excel's Pivot Tables. The article was titled <strong>Programming Rubber Band Reports with Pivot Tables</strong> and showed how to create Excel Pivot Tables from a Visual FoxPro (VFP) application.&nbsp;</p> <p>Although the article is mo
Ruby Development on the Mac OS X
<p><img width="320px" height="240px" align="left" style="margin-right:15px" src="http://hectorcorrea.com/images/mac_macair.jpg" alt="MacAir" /> A little more than a month ago I got myself a MacAir. Even though I’ve own computers since the mid 80s this is the first time that I buy a Machintosh. The reason I bough a Mac rather than a PC is because I wanted to <b>start experimenting with the web development tools that exist for non-Windows environments</b>. Although I’ve been a software developer
Running Visual Studio inside Mac OS X
<p>Lookie here...I am running Microsoft Visual Web Developer Express on my MacAir!</p> <p> <img src="http://hectorcorrea.com/images/osxwin7.png" alt="Windows 7 inside OS X Lion" align="left" style="margin-right:15px" width="35%"/> When I bought <a href="http://hectorcorrea.com/Blog/Ruby-Development-on-the-Mac-OS-X">my MacAir last year</a> to start learning Ruby and Ruby on Rails I wasn't sure how much I was going to really use it. Overtime, I've gotten familiar with it and little by littl
Simple Branching Strategies for Team Foundation Server
<p>In this blog post I describe some branching strategies that I've found useful when using traditional source control systems like Team Foundation Server (TFS).</p> <p>Team Foundation Server has very good branching and merging capabilities that can help teams manage source code in a team environment. However, despite the fact that TFS provides excellent branching and merging capabilities, I usually recommend a simple approach to branching since <i>the process</i> of branching and merging can
Skeletons, Mona Lisa, and Problem Solving
<p>One of the best practices when building applications that I've learned over the years is the value of always having a running version of the application available to show end-to-end progress on the system being developed. Although this is common sense it's easy to get caught on the day-to-day activities and lose track of these things.</p> <p>A typical situation in which teams seem to forget the value of always having a running version of the application is when writting a brand new applica
Sliding-in a Full Page Panel with CSS and jQuery
<p>In this blog post I show how to use CSS and jQuery to slide-in a panel full page on top of another and then slide back in the original content.</p> <p>You can see a running version of the code presented in this blog post <a href="http://hectorcorrea.com/downloads/slide-in-panel-sample.html" target="_blank">here</a>. This demo page starts with a panel showing some part of the Lorem Ipsum text. When you click on the text a new panel displaying the Bacon Ipsum text slides-in on top of
Software Developers and Process Improvement
<p>One of the topics that I've been noticing for a while is how we (as developers) tend to worry about our software development process and try to educate ourselves on the topic while other project stakeholders don't seem to show as much interest on it.</p> <p>For example, I often talk to other developers who are trying to implement Scrum, RUP, or other software development process at their companies and they fell that other project stakeholders (executives, business owners, analysts) are not a
Static constructors and ASP.NET applications
<p>A few days ago I was running into an issue with a static class in an ASP.NET application. The issue (I thought) was that the static constructor was not being fired. It turns out the static constructor was being fired as it should but not as often as I thought it would be.</p> <p>Static constructs are fired once per App Domain.&nbsp;&nbsp;</p> <p>In a Windows application this means that the constructor is fired once everytime I launch the application and access the static class. If I close t
Team Dynamics
<p>A few years ago during my ScrumMaster certification our instructor talked about the different development stages that teams go through. He used Tuckman's development model which includes four stages: Form, Storm, Norm, and Perform.</p> <p>In this model teams start at the&nbsp;<strong>Form</strong> stage when they are first put together. This is the honeymoon period of new teams in which spirits are high,&nbsp;everybody is optimistic,&nbsp;but the work is just about to begin.&nbsp;<strong>S
The Design of Design
<p class="MsoNormal"><img width="100" height="144" align="left" alt="" src="http://hectorcorrea.com/images/designofdesign.jpg" />Earlier this month I received a draft manuscript of Frederick Brook&rsquo;s latest book &ldquo;<a target="_blank" href="http://www.amazon.com/Design-Essays-Computer-Scientist/dp/0201362988">The Design of Design &ndash; essays from a computer scientist</a>&rdquo;<sup>[1]</sup> in which he reviews both what is design and how the design process works.</p> <p class="MsoNo
The Model View Controller is dead, long live the Model View Controller
<p class="MsoNormal">The last few days I&rsquo;ve been reading <a target="_blank" href="http://www.amazon.com/Microsoft&reg;-NET-Architecting-Applications-PRO-Developer/dp/073562609X">Microsoft .NET: Architecting Applications for the Enterprise</a> by Dino Esposito and Andrea Saltarello. On Chapter 7 Dino and Andrea talk about the Presentation Layer and in particular they touch on the Model View Controller (MVC), Model View Presenter (MVP), and Presentation Model (PM) design patterns. I really l
The Mythical Man-Month
<p class="MsoNormal" style="margin: 0in 0in 0pt">Last week I finished reading <a target="_blank" href="http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959">The Mythical Man-Month</a> by Frederick Brooks for the third (or so) time. Although this book was originally published in 1975 it is still a great reading for anyone involved in software development. The edition that I read is the 20th anniversary edition and has a few extra chapters with updated informatio
The Scrum Daily Meeting
<p>We use Scrum at the office to manage our projects. One of the key practices of Scrum is the daily meeting (or <a target="_blank" href="http://www.controlchaos.com/about/management.php">daily Scrum</a>.) The daily meeting is a short meeting (15 minutes in our case) held every day at the same time with the whole team (product owners, QA, and developers.)</p> <p>The goal of the meeting is to keep everybody informed of the progress since the last meeting and make sure there are no roadblocks.</p
Thoughts on Unit Testing
<h4>What is a Unit Test?</h4> <p>A unit test is a piece of code written by a developer for a developer. The intention of this piece of code is to prove that the code does what the developer intents to do (<a href="http://www.pragmaticprogrammer.com/titles/utc2/" target="_blank">Pragmatic Unit Testing in C#</a>). Unit tests are not substitutes for requirement gathering or QA, they are an additional tool that developers can use to produce better systems.</p> <h4>But why would I write such a piec
TransactionScope.Complete Maybe
<p>During a class this week I learned that the <strong>Complete()</strong> method in the <strong>TransactionScope</strong> class works different from what I have always thought.&nbsp;I've always thought that when you issue a call to the Complete() method&nbsp;the transaction is either committed or you get an exception if the transaction cannot be committed. In my mind once the call to Complete() returned it was a sure bet that the transaction was successfully committed. It turns out that is not
Upgrading Your Software Development Tools
<div>Late last year (late November 2007 to be exact) Microsoft released <a target="_blank" href="http://msdn2.microsoft.com/en-us/vs2008/default.aspx">Visual Studio 2008</a> with .NET 3.5 to production. This has generated a lot of buzz around the new features, what&rsquo;s hot, what you should be looking into, and so on. The beta cycle for VS 2008 was long and very public. There has been a lot of articles and access to the new features for a while but now it&rsquo;s here, now it&rsquo;s real. Pe
Windows Presentation Foundation
<p>I've been reading about Windows Presentation Foundation (WPF) for a while and, while at <a href="http://www.devconnections.com/">DevConnections</a> this week, I've attended a few sessions on the topic and to this day I still have mixed feelings about this new technology.</p> <p>On one hand I am really excited to see work done for smart clients and the user interface in Windows. The fact that WPF takes into account new graphics hardware available on most machines these days is really nice.
Yield Return
<p class="MsoNormal">Even though the <strong><span style="font-family: 'Courier New'; ">yield return</span></strong> statement was added to C# since version 2.0 (around 2004) I never quite understood how it really works. A few days ago while going through some tutorials I saw a sample of code that used <span style="font-family: 'Courier New'; ">yield return</span> and decided to finally look under the covers and learn how it works.</p> <p class="MsoNormal">How well do you understand <span style