Monday, December 29, 2008

Cool Tool: Paint.Net



Not just .NET based, not just free it is open source too !
Paint.Net is an awesome light weight photo editor for everyday photo editing needs.

Cool Tool: Slick Run

Slick Run could literally really save you hours of dragging your mouse to program shortcuts!

Quoting the author:


SlickRun is a free floating command line utility for Windows. SlickRun gives you almost instant access to any program or website. SlickRun allows you to create command aliases (known as MagicWords), so C:\Program Files\Outlook Express\msimn.exe becomes MAIL.

Enter a web URL into SlickRun and it will launch your browser and navigate to the specified address. Run multiple programs in a few keystrokes, jot a note, look up a definition... SlickRun is the most natural way to interact with your computer.

Sunday, December 28, 2008

Another 2D game

This game looks like it is going to make it to top games in 2009 !


Crayon Physics Deluxe from Petri Purho on Vimeo.



For now you can go for a free alternative (NERD ALERT!) :

It sums it all up

Nokia E71




Whoever said iPhone will dominate was partially correct. With Nokia's years of experience, they sure wont give up that easy!
(Although a $99 iPhone will sure make a huge difference )

One example of a really good deal from Nokia is the Nokia E71. Which is essentially a good price/features deal.

Key Features include:
- Full Qwerty Keyboard
- 369 MHz processor/128 MB SDRAM Memory
- Wifi/Bluetooth/Infrared/v2.0 microUSB
- GPS
- 3.15 MP camera
- MP3/AAC/MPEG player
- Email/IM
- Slim!
- 10 hours talk time battery

Google releases Browser Security Handbook

They are taking this whole web browser thing seriously !
To the extent that they did release a security handbook.

Google Chrome is no beta any more, IE8(which is still Beta) will contain similar features to google chrome.

One of the key features in IE8 is that it supports Tab Groups. And most notably Advanced Printing (finally?). It took them 8 versions to figure out that something is wrong with printing!!

It is not clear yet which browser will score more in terms of JAVA SCRIPT SPEED(which is what matters anyway)!

Saturday, December 27, 2008

World of Goo !




This game is just amazing. One of the best games in 2008 actually.
With a more than an excellent physics engine and low hardware requirements it sure ROCKS !

You can't resist finishing the demo !

It is really fun to play it after all those crazy evil FPS games I have been playing the past weeks.

It is all about the business value!

If I learned anything from the last year at work. It is all about the Business Value !

Whatever time or effort I spend on any task, if that doesn't directly translate to a business requirement then I am simply wasting my time.

It could be surprising how much good feedback we get from our clients on projects that we are "not proud of", just because it does a really important task (high business value?) !

I call it the development ROI (Return On Investment). If my development work doesn't directly translate to business values (something that I can explain to a non tech-savvy user) I simply stop.

So basically I stopped the awful habit of "optimizing my code" ! Why 'd I spend hours optimizing code that will run less than 10 times in an hour ! And it didn't fail me so far ! So I only optimize code that would result in bottle necks or really really poor performance!

Wednesday, July 30, 2008

Turn on Windows XP Clear Type !

Do you have a LCD Monitor ?

It is time! Enable Clear Type support in Windows. And you will be thanking me already. Here is what you will get:


Even if you have a CRT monitor you will still get some improved readability.

Monday, June 30, 2008

Reset Database Table Identity Value

One of things that always motivate me to blog is future reference. Anything I place here makes a good reference later. And of course I can always tell people "Hey you can find it here"

So here is today's SQL tip:

you can use the DDBC command to reseed the identity column value. This is usually helpful after a series of DELETE operations. By default MS SQL Server doesn't reseed (give the default seed value + 1) the identity column, so say you had a Users table with 1000 records with an identity column UserID. Then you decided to kick all the users off ( DELETE FROM Users). Then you decided to add them back INSERT INTO Users(.. ) VALUES ( ... ), the first inserted row will have a UserID value of 1001 ( not 1).

DDBC command sytnax:

DBCC CHECKIDENT ( table_name, [reseed / noreseed], [new_seed_value])

So to use it on our Users table, we can do the following:


DBCC CHECKIDENT ( Users, reseed, 0)

I will be soon blogging on the use of FOR XML EXPLICIT. This is not a SQL blog, It is just SQL that I keep forgetting.

Sunday, June 1, 2008

Method Overloading by Return Type

Days ago, I had that interesting conversation with some of my geek friends of overloading methods by return type. I said that is not possible in Java or C# to overload a method by its return type. In other words I said you can not have:

class Demo
{
public static int f()
{
return 1;
}

public static float f()
{
return 1.0F;
}
}

I have backed up my statement with the fact that compiler would have a lot of problems executing the right method, since the methods will have identical signatures but different return types so there is virtually no way of picking up the right method. So one of my friends suggested the following case:

class Demo
{
public static int f(int a)
{
return a;
}

public static float f()
{
return 1.0F;
}
}


With my previous assumption I said that the code won't compile too, which was proven wrong. Actually the compiler will allow that because it can simply differentiate between the two methods, since each of them has a different signature (different parameter list).

So we all learned a valuable lesson in method overloading

Update

The .NET Framework CIL (Common Intermediate Language) actually supports method overloading by return type. Of course the current languages (C#, VB.NET, J# ... etc) running on top of the .NET Framework don't support that feature except when overloading class conversion operators.

Monday, May 5, 2008

Microsoft is taking over Yahoo!

Despite the fact the Microsoft has officially withdrawn its offer to buy Yahoo. I am predicting that this is still the case and that Microsoft is taking ovveeeeeeeeeerrrrrrrrrrr.

Let's see how that goes though !

Sunday, April 27, 2008

Handy SQL Script

Today, I used the following SQL Script to import data from an Excel file into a database table.


INSERT INTO
Users (FirstName, LastName)
SELECT
*
FROM
OPENROWSET( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Users.xls', 'SELECT * FROM [Sheet1$]')

Sunday, March 30, 2008

When to automate?

Automation is always good when in context. This is what the software industry is all about anyway, automation of most of the repetitive tasks.

But as a software developer what have you done to make your job easier? We keep developing tools and systems for other parties. Though it is us who need those tools because it is us who are doing the repetitive tasks all the time.

So a better question than "When to automate?" 'd be "What to automate?"

Personally speaking, I tend to automate testing. A while ago I was working on a web application that required upload to a test FTP server. So whenever I changed an asp file or re-compiled a FLASH movie, I had to manually upload those files to the FTP server. Of course that didn't work, and that was when I started looking out for ways to automate the whole process. I came up with a very simple solution which is using the built-in windows FTP command which supports scripting. (ftp -s:filename)

That saved me a lot of time back then. And we are not even talking about Code Generation or batch updates.

Beside testing, there is a list of things that if automated could make your life easier and help you spend more time on stuff that matters instead of doing repetitive boring tasks.

For instance if you are doing some C# development for windows, you probably have been bored writing properties and private members for every new class you add to your solution. Though C# 3.0 supports automatic properties now. Still it is a boring task. Others include adding error providers to a windows form and handling the Validated event for every control.

These are just example of repetitive tasks that are actively killing our time and minds. If you feel you are wasting time on such tasks, consider automation. Spend some of your time on developing tools for YOU! I have done that and it really saves me a lot of time and helps me focus on more important stuff.


For example a while ago I wrote a very small tool that does the following:
1 - Generates class member variables and properties.
2 - Generates error providers and generate validation events.
3 - Creates temporary text files for me for my todos and so on.
4 - Takes screenshots helping me when I want to demonstrate something to someone or for use in emails and reporting bugs.

Below is a screenshot of that tool.


Developing it took me less than 4 hours, thats less than half my working day. BUT saved me infinite hours of hitting my head against the wall.
I am planning to develop a similar tool to help me with my SQL tasks soon.

Exception handling versus error codes

A while ago, I was really lost between throwing/catching exceptions and returning error codes. After doing some research I have reached the following:
Exception handling is usually expensive due to the stack unwinding process, specially when it is not caught near where it was thrown.

So you can't just go throwing an exception for every trivial error or an invalid input to a procedure. This leads me to believe that a good approach 'd be to check all the inputs given to a method using normal if/else blocks,returning failure status or error codes when something goes wrong or wrong input is provided and only throwing an exception when a fatal error occurs.