Sunday, December 25, 2011

Smart software makes the difference


How smart should software be? I think it should be smart enough to fix our mistakes, but not smart enough to be intrusive. Let's compare Gmail and Hotmail. Let me start by saying I don't use Hotmail anymore. The reason is that it wouldn't let me send emails because it "detected" that the emails I was sending contained spam (I promise they didn't). This was a really frustrating experience, and very quickly Hotmail became useless to me.


With Gmail it's a completely different experience (excluding the UI changes to the interface... I'll leave that rant for another time). First of all, at least it let's me send emails. Now, when I was getting ready to send an email in which I wrote "I'm attaching", I got this message:





This is a good example of software that is smart, yet not smart enough to be intrusive. Kudos to Google.

Wednesday, December 21, 2011

Sharing files between 2 Amazon AWS instances

This is not intuitive at all, and moreover, I found only 1 post that indicated how to do this. The idea is to open the following ports between the instances:



  • Microsoft file sharing SMB: User Datagram Protocol (UDP) ports from 135 through 139 and Transmission Control Protocol (TCP) ports from 135 through 139.
  • Direct-hosted SMB traffic without a network basic input/output system (NetBIOS): port 445 (TCP and UPD).

After this, you should be good to go. I got this information from this post, or you can go to this KB article from Microsoft as well.



Wednesday, November 30, 2011

I came across this great article on the future of Silverlight. I'm guessing the same thing can be said about Flash. It's interesting to see how technologies that are widely adopted slowly end their life cycle when disruptive technologies appear. Those disruptive technologies (i.e. HTML 5 and JavaScript) usually don't appear overnight, and it takes a while before they are fully adopted. In the end, it's all about reliability, security and performance.

Tuesday, November 29, 2011

Thoughts on JQuery Mobile

I recently had the opportunity to use JQuery Mobile. I've got to say it's a great product, and even though the first release just came out, it's stable and robust. However, if you're going to use it you need to consider that it has some quirks, and you'll need to resolve those manually until they get fixed in the next release (which come out really often, maybe once a month lately). Still, the advantages outweight the disadvantages.


The most important thing you get is a cross-platform framework that leverages development over customization. Yes, you might need to spend more time in UI development than functionality, but at the same time it allows you to deliver functionality quickly and get feedback from your clients. The analogy that comes to my mind is building blocks: JQuery Mobile provides you with pieces of code that you just need to put together!

Sunday, November 20, 2011

Copy and Paste is evil

I consider copy and paste of code one of the most common sources of bugs and bad coding practices. First of all, let's talk about bugs. If you copy and paste code, it's likely you're doing it because you don't know what the code is doing; you only know that it works. You only know that it works, and copying and pasting is easier than re-typing. However, adding code without knowing what it does is a recipe for disaster. A couple of days ago I spent 5 hours troubleshooting code that another developer "copied and pasted". If you're going to copy and paste, at least make sure that you read the code you just copied and pasted.

Moving on bad coding practices. Well, this is an easy one. Duplicate code means that any change needs to happen in 2 different places, and you don't want that. You want classes with clear boundaries, otherwise your code will soon become a big ball of mud.

Monday, October 3, 2011

Setting up a Blackerry simulator: "Could not find or load main class net.rim.application.ipproxyservice.IPPr oxyServiceApplication"

Setting up a BlackBerry simulator should be simple. In fact, it is, but enabling Internet access is not. There are some things to consider. First, you need to install the latest version of JDK. The most important thing to consider here is that you should not install it in Program Files. Use C:\ instead. If you install it in Program Files, you'll get a

"Could not find or load main class net.rim.application.ipproxyservice.IPProxyServiceApplication"

when trying to run MDS. After this, when you fire up the BlackBerry simulator you should be able to open a browser and connect!

Sunday, September 18, 2011

Bing Maps SDK Pushpin options not getting updated

You would expect that by setting the height of a pushpin programmatically -using the pushpin options-, then calling the get height method it would give you the new height. But it doesn't. I did a lot of investigation and setting the height was not modifiying its value. As it turns out, you need to set the width as well. It's just one of those undocumented features from Microsoft...

Wednesday, September 14, 2011

How to get started with Team Explorer Everywhere command line

A project may have code in so many different platforms (.NET for website, Objective C for iPhone apps, Java for Android...), so how do you manage your source code? Don't worry, Team Explorer Everywhere can help you. I had a need to use it to add an iPhone application to our TFS source control, and it's really straight forward. You get a 90 day evaluation period, and you won't regret using this software. There's even no learning curve, after 1 hour of reading documentation you can get started using it (or you can just google how to use it and you get the instructions right away). Anyway, this is what you need to be able to checkout (yeah I've used Subversion as well) code and commit code:

// Accept the EULA
tf eula

// Use the evaluation license
tf productkey -trial

// Create the output directory
IF NOT EXIST C:\TFSGet
MD C:\TFSGet

// Create a workspace
tf workspace /new /s:http://server.sieena.com iphoneworkspace /noprompt /login:rodolfo.ortiz@sieena,mypassword

// Map the folders
tf workfold /s:http://server.sieena.com /iphoneworkspace /map $/MyProject/Release/iPhoneApp C:\TFSGet

// Go to the created directory
pushd C:\TFSGet

// Get the latest version of the code
tf get /recursive /noprompt

// Check out the code for editing
tf checkout * /recursive

// Make changes and check them in!
tf checkin -recursive -comment:"This is a fake checkin"

Microsoft Visual Studio Scrum 1.0... sucks

I've used Rally and JIRA to manage Scrum projects. This last time I decided to give the Visual Studio Scrum template a try and... it's just not what I expected. One of its major drawbacks is the inability to do time tracking. Some people might say that doing time tracking in Scrum is not beneficial and even useless. This might be true for internal projects, but with external clients you need a way to know how much work you've spent on a project (and if you're running out of the initial allocated hours).

Anyway, I'm going to test the MSF for Agile Software Development Process Template. Hope it offers more than the Visual Studio Scrum template.

Sunday, September 11, 2011

JavaScript MVC + ASP.NET MVC

I've been always interested in how to mix ASP.NET MVC and Object Oriented JavaScript. My approach has been to use ASP.NET MVC to expose services and build the client (views/UI) with 100% OO JS code, but I wonder if there's a way to build most of the application (including views) on the server side and still keep using OO JavaScript.

Here's an interesting article that explains a double MVC architecture. You'll need a little background on JavaScript MVC to understand it http://blog.javascriptmvc.com/?p=68

Saturday, June 18, 2011

Catching authorization errors with JQuery when using Forms Authentication in ASP.NET MVC 3

When there's an authentication error (timeout or invalid credentials) in ASP.NET MVC 3, the framework returns the login pages as a result of this. What if you want to catch the error in JQuery and handle it client side. Well, you can't. Unless, of course, you read this article.

Tuesday, April 19, 2011

Breakpoints don't work when debugging a dll in ArcMap

Has this ever happened to you? It's really annoying, because one moment is working, the next one it's not. After doing some searching, it turns out there's an ArcMap configuration file -ArcMap.exe.config- that you need to modify. Just change the version from 2.0 to 4.0 and voila!

http://social.msdn.microsoft.com/Forums/en/vsdebug/thread/22d4c3d3-bf77-40ed-8b1b-64223019f3f1

Wednesday, April 6, 2011

Improving performance on ASP.NET websites

I came across this interesting article with a checklist to improve the performance of ASP.NET websites. The ideas presented in the article are nothing new, but they are provided in such a way that you can check if your website passes or not.

But remember, don't worry about performance until it becomes an issue.

Saturday, April 2, 2011

Firefox 4 is out!

I like the new version of FF a lot. A while ago I stopped using Firefox 3.x and switched to Chrome. The main reason was that the memory footprint of FF would increase a lot when I had a lot of tabs open (I'm a tab addict).

The new FF version seems to behave better, so I'm giving it a second chance.

Friday, April 1, 2011

Running Visual Studio 2010 as an administrator

Lately it's been driving me crazy that when I open an existing Visual Studio solution, it won't open Web or WCF projects because Visual Studio was not run with admin privileges. Time to do something about it!

Check out this link. Basically, you need to check the "Run as an Admin" option in the properties of the VS2010 application. Pretty simple huh?

Sunday, March 13, 2011

"Attempted to read or write protected memory" when accessing 32 bit third party assembly

"Unexpected errors happen when executing 32 bit code that tries to call 64 bit code and viceversa".

Using third party assemblies compiled as 32 bit will throw an exception at runtime if you compiled your solution as "Any CPU" and then run it on a 64 bit machine. This option lets the application run as 32 bit or 64 bit depending on the target machine. The solution is to make sure you compile your application as 32 bit. Simple huh?

Saturday, January 29, 2011

ArcObjects CreateFeatureClass throws exception 2147216889

ArcObjects always throw cryptic errors that don't provide enough information. When I received this error it turned out I wasn't assigning a SpatialReference. This article helped me figure out this was the problem.

Friday, January 14, 2011

Using Json with AJAX

I came across this interesting article on how to use Json with WCF. Specifically, the "d" parameter stands out. This feature is specific to WCF/webHttpBinding, because I've consumed Json services before and this parameter was not available. For more information check out the article.

Tuesday, January 11, 2011

Closable tab control in WPF

Doing a Google search I found probably 5 different ways to implement this feature in the first page. They are all valid (and some more complex than what I need). This article is the one I used to and I strongly recommend it if you are new to WPF. If you want a more advanced implementation then this article is what you need.

Monday, January 10, 2011

MVVM resources

There are probably more than 10 different implementations of MVVM. For example, just to list a few:


Personally, I like Karl's implementation; it's really well documented and easy to understand.

Sunday, January 9, 2011

WPF patterns

This is a good article on how to use WPF and MVC. Is this the best approach? Should I be using MVVM? What's really MVVM? I am not sure since I am still learning WPF, but will post about it as soon as I find out!

Saturday, January 8, 2011

Bug reporting

Users (even developers are users many times) always expect software to "just work". What happens when this is not the case? For example, I accessed blogger using Chrome and couldn't add a new post, so I had to use Firefox. It's really annoying, but the best we can do in those cases is report the bug.

As developers, bug reports are the best tool we have to improve the software. After all, how can we fix a problem that we don't know exists? I've used tools like BugNET and JIRA to track defects, but the tool is not important as long as you track defects.