Wednesday, December 09, 2009

Great programming quotes!

I recently read on stackoverflow a ton of great programmers quotes I thought it’d be good to share.

Here are some of my favorites.

“Walking on water and developing software from a specification are easy if both are frozen.”

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”

“Linux is only free if your time has no value”

“Debuggers don't remove bugs. They only show them in slow motion.”

Read the full list here.

Read Full Post

Wednesday, December 02, 2009

How to disable assert dialogs while testing (.net)

Why would you want to do that in the first place? Let’s say you have a complex (long) test you want to run in your application, so you decided to start it before going home so it’ll be ready tomorrow morning with the results. What would happen if when get to you computer the next morning you find an assert dialog waiting for you to “Abort”, “Retry” or “Ignore”? Believe me, it is frustrating and irritable!
I had a few “alternative ways” to ignore those asserts (http://twitpic.com/qvecx) but Willy told me the correct way to do it.
All you have to do is adding the following to your .exe.config file:

<system.diagnostics>
    <assert assertuienabled="false"/>
</system.diagnostics>



That code tells the framework that you don’t want to show a message box when a “Debug.Assert” is called, which is exactly what I wanted.


So, since my test is a msbuild script all I had to do is adding the above “code” in the msbuild.exe.config and now my tests runs smooth and the results are ready, waiting for me :)


More info on the assert tag here.

Read Full Post

Thursday, November 26, 2009

Mi first useful Azure application

Azure I’ve been plying around with Windows Azure for over a year now, I started with the CTP Microsoft showed at PDC 2008 and played with SQL Azure (FKA: SDS) and Windows Azure ever since.
But today I uploaded my first useful application. I’m currently working the on Genexus deployment project which includes being able to deploy Genexus-generated applications to every supported platform (including of course Windows Azure). More on that in a future post.
So, to deploy an application to Windows Azure programmatically, you have to tell Azure where your package is (by its url) so the best choice is to upload you package to the you Azure storage account. But the storage does not have a nice UI, so I thought first on creating an application to actually see what’s in my storage account and then decided to make it a web application, and allow other to use it.
I know, it does not have a great user interface. I’m not good at it, and I didn’t care for it at all for this version. But I’ll promise I’ll add some functionality and improve the user experience.
If you want to check it out go to http://storageexplorer.cloudapp.net http://azurestorage.azurewebsites.net enter your account name and your access key and see what’s in your storage account. (Read only, for now!)
So I’m happy to announce that this application not only “Works on my Machine” but it also does on the Windows Azure platform :)
WorksOnAzure
Edit: now with improved UI :)

Read Full Post

Wednesday, November 11, 2009

Ode to The Ramones

Google just released a new experimental programming language called Go, and they had the brilliant idea on titling their introductory post as The Ramones did with their songs… “Hey! Ho! Let’s Go!” … brilliant :)

Read more about it from the official blog at http://google-opensource.blogspot.com/2009/11/hey-ho-lets-go.html

Listen to the Ramones here:

Read Full Post

Tuesday, October 27, 2009

Internal Error 500 returned by IIS7 hosted WCF services

500 Here's an issue I had for quite a long time.
For some (unknown at the time) reason the server was returning a "500 - Internal Server error" whenever an exception was thrown.
Even the message on the exception was an html document (pasted below), so who was modifying my exceptions? it turned out to be the IIS itself due to some configuration settings.
There's a "feature" which avoids the IIS to send the real exception to the client sending instead a more "friendly" one.
So, how do you change that? (keep in mind this is IIS 7.0 and above)
Take a look at this great post (where I got the solution from) and follow step 2) of "Enable IIS7 detailed errors".

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<
title>500 - Internal server error.</title>
<
style type="text/css">
<!--
body
{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</
head>
<
body>
<
div id="header"><h1>Server Error</h1></div>
<
div id="content">
<
div class="content-container"><fieldset>
<
h2>500 - Internal server error.</h2>
<
h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>
</
fieldset></div>
</
div>
</
body>
</
html>

Read Full Post