Label Cloud

Sunday, December 28, 2008

Stack Overflow

The site StackOverflow.com is available for a few months, but I just recently discovered it. It is created by Joel Spolsky, Jeff Atwood, Jarrod Dixon, Geoff Dalgas, Jeremy Kratz, and Brent Ozar.

The idea behind a site is a Question / Answer forum for all things development related. Not language specific at all. Definitely recommended place to visit.

http://www.stackoverflow.com

Technorati Tags: ,,


Share/Save/Bookmark

Monday, December 22, 2008

Rebuilding my PC – And thank you Mozy for the backup

I’ve finally rebuilt my PC. The installation Vista install was relatively painless, except for one minor snag. When I booted from the DVD Drive, and deleted my old partition, Vista refused to install with a message: “Windows is unable to find a system volume that meets it's criteria for installation.” Ohh Sh*t… Well a quick search on Google (using a laptop), provided a solution. Removing USB from the boot-up sequence in BIOS settings resolved this problem.

Before rebuilding the machine, I’ve spent a few hours backing up data from my desktop to DVDs. However, after reinstallation, I found out that I missed to backup my music collect. I don’t have that much, only 8 gigs or so, but it is still not something that I would want to miss. So here’s were Mozy comes in. I subscribe to Mozy’s online backup solution (http://www.mozy.com) For 4.95 a month, it provides a complete “Set it and Forget it” backup solution. After my machine was back up and running. I logged into the Mozy website. Selected “Restore using Web”, and chose my music folder. In about an hour, Mozy sent me an email notifying my that my restore files was ready. The email contained 3 links to file downloads: 3, 3, and 2GB files. About 1 hour for download, simple extract to the c:\ and I am back having my full music collection restored.

Mozy provides a pretty neat interface, very simple, yet pretty powerful. Ability to create multiple backup sets, bandwidth throttling, explorer integration (for Backup and Restore functions). Professional version provides even more functionality. And if all that didn’t get you excited, guess this: All that functionality is available FREE for up to 2GB of space. Yep. Completely Free. So check it it out: http://www.mozy.com

Technorati Tags: ,,,


Share/Save/Bookmark

Friday, December 19, 2008

XKCD - 11th-Grade Activities

Sometimes, XKCD gets it just right.

So, to all you students out there, theory is important, but you aren't a developer unless you actually WRITE CODE!


Share/Save/Bookmark

Thursday, December 18, 2008

Offshore consulting

I've just encountered a blog entry on managing offshore consultants: http://blogs.msdn.com/techleaders/archive/2008/12/18/how-to-manage-remote-employees-part-1.aspx


At my workplace we are pretty big into using offshore consultants. As a matter of fact, half of my team is offshore.

We use a Globant for an offshore resource provider (http://www.globant.com) In two words: Highly recommended. Our interaction with the Globant team is somewhat different then what I am used to with an offshore development team.

  • They are considered full fledged members of a development team.
  • They all speak excellent English
  • They work our hours
  • They join all regular meetings
  • They are able to travel onshore when required

There are always certain inefficiencies of working remote, some of them I can relate to (I work away from the main office most days of the week). However, there are always ways around them.

  • It is sometimes hard to get in touch with a person in a moments notice. This usually requires planning, as well as an ability to put off your "onshore" things when you receive calls from a member of an offshore team. Time Management and flexibility is key.
  • Regular scrum meetings are a must. It is very critical to have understanding between everyone on the team, on what all tasks are delivered, when, and by who.
  • I found it extremely useful to have offshore developers come onsite for at the beginning of the engagement to establish communication. This allows all members of the team (offshore and onshore) to understand how the engagement will work. Offshore developers get a chance to see firsthand how their product effects the business, possibly meet the end users. Most importantly it opens up the communication channel where offshore developers are able to openly engage onsite team.
  • Having an offshore project manager to help with the engagement helps.

Offshore consulting is not something to be afraid of. Most people I know, work for companies that are split across multiple locations, sometimes across the street, but sometimes across the country or the world. Who knows, your business partner might be considering you "offshore"

Update: Interesting set of answers on the Stack Overflow : Offshoring: does it EVER work? (http://stackoverflow.com/questions/502995/offshoring-does-it-ever-work/503037#503037)


Share/Save/Bookmark

Tuesday, December 09, 2008

Hard Drive Defragmentation

Recently my laptop had been spinning its hard drive a bit too much and I thought to my self "when was the last time I defragmented?" Apparently too long ago:

PreOptimization

  • 36% fragmented files
  • 5% Free Space
  • Very red looking picture
  • Very slow drive access

I have Diskeeper Lite (a free version) - and ran that overnight. The picture became slightly better, but not quite what I wanted:

Optimization-Pass1

Its very hard to defragment the harddrive with less then 20% free space available. So after removing some old files, and freeing up some space, 2nd run was much better:

Optimization-Pass2

Running it for 3rd time did not help much, so for now I am leaving it at that.

Optimization-Pass3 

Overall.... The machine definitely seems faster. Lesson: Defragment regulargly. I'll update the post in a few days to note if the performance stayed good.

Technorati Tags:


Share/Save/Bookmark

Monday, December 08, 2008

Incremental Shortcuts in Eclipse

I am fairly new to Eclipse, but the more I use it, the more I like it.

My latest discovery is how efficient it is to use of shortcuts to find "stuff" in Eclipse. The lookups are incredibly fast and are very useful.

There is Open Type (CTRL+SHIFT+T) and start typing

image

Open Method (CTRL+O) and start typing

image

The typing part is critical. It is available even in preferences setup.

image

I really wish this functionality would exist out of the box in Visual Studio.


Share/Save/Bookmark

Thursday, August 21, 2008

Google Maps Mobile Rocks!

I am using GoogleMaps on my blackberry curve. I don't have a GPS, however, I find the tower based location pretty usefull. Now I am in Paris, and for kicks I tried to use the future here. Well, to my surprise, Google Maps correctly found me in the middle of Paris with accuracy of 1700 meters. That's pretty damn close. This app rocks!!! If you still don't have it, get it at http://maps.google.com/mobile/


Share/Save/Bookmark

Tuesday, July 15, 2008

Simple EntityMapperTranslator

CAB defines a very clean way of defining a translator for converting objects from one type to another. A typical use for this is to convert from an "wire" object a business object and back. This is done by creating an EntityMapperTranslator. Defining two methods: BusinessToService and ServiceToBusiness. And then registering the translator in the IEntityTranslatorService.

Often, the business object identical or nearly identical to the wire object. The code below will copy every property from the SourceType to the TargetType. Of course, this can be used outside of the EntityMapperTranslator as well for the same purpose.

class TypeTranslator : EntityMapperTranslator<SourceType, TargetType>
{
    protected override TargetType BusinessToService(IEntityTranslatorService service, SourceType value)
    {
        TargetType target = new TargetType();
        foreach (PropertyInfo pi in value.GetType().GetProperties())
        {
           PropertyInfo newPi = target.GetType().GetProperty(pi.Name);
           if (newPi != null)
           {
              if (service.CanTranslate(newPi.PropertyType, pi.PropertyType))
                 newPi.SetValue(target, service.Translate(newPi.PropertyType, pi.GetValue(value, null)), null);
              else
                 newPi.SetValue(target, pi.GetValue(value, null), null);
           }
        }
        return target;
    }
}


Share/Save/Bookmark

Thursday, June 26, 2008

Dropping Visual Studio Unit Testing for NUnit

Continuing with my adventures in porting java code to .Net, I am dealing with moving JUnit unit tests to .NET. My first move thought was to convert to Microsoft Unit Testing framework. However, after spending quite a bit of time to get it to work, I gave up and switched to NUnit.

Two things that are NOT supported by the Microsoft framework and forced me to switch

    • Per-Test StartUp/TearDown functions. [TestInitialize] and [TestCleanup] are not called for every [Test]. They are called when the Test class is initialized. That means its very hard to have a good Initialization and Cleanup routines for every test.
    • Lack of Test Inheritance. I a set of unit tests that test different implementations of an interface. The core test of the interface must be the same to make sure that all implementations handle the core identically. However, There might be special additional tests to validate extended functionality. Currently, you can not accomplish that with Inheritance.

Both are fully supported by NUnit.

Technorati Tags: , ,


Share/Save/Bookmark

Saturday, May 31, 2008

1st Java annoyance

For the last month I've spent as much time writing Java code as C# code. And its definitely been a great learning experiences. Even though the core languages are very much alike, and you can usually find a function in .NET that corresponds to Java and the other way around, I've spent quite a bit of time yesterday trying something that should have been completely trivial.

The Problem:

having a Date variable loadDate that includes Date and Time, create two variables startDate and endDate where StartDate is the portion of the loadDate, and endDate is the startDate + 1 day

C# Code:

DateTime loadDate = DateTime.Now; DateTime startDate = loadDate.Date; DateTime endDate = startDate.AddDays(1);

Java Code#

GregorianCalendar cal = new GregorianCalendar( loadDate.getYear() + 1900, loadDate.getMonth(), loadDate.getDate()); Date startDate = cal.getTime(); cal.add(Calendar.DATE, 1); Date endDate = cal.getTime();

Why is the Date.getYear() function returning 108 for a year 2008? What is the logic behind that? Are the Java developers afraid of running out of integer values?

Why the Calendar class supplies the clearDate() function, but no clearTime() function?

Why I can't dd Dates the way I can other classes?

Why the Calendar.add() function doesn't return a result instead of replacing the internal value, the way other classes do?

Why is this not documented in the Date class?


Share/Save/Bookmark

Wednesday, April 09, 2008

SQL ROW_NUMBER() function and Audit tables

I had to search through an audit table to find times when the value changes in a specific field. Considering an audit table

DateModified DateTime
ID varchar()
Quantity decimal
Price decimal

I wanted to find the rows when Quantity changed for the same ID.

I've been able to accomplish that using the ROW_NUMBER function of SQL 2005

Here's the query:

select Row_Number() OVER (PARTITION BY ID Order BY ID, DateModified) as RowID, DateModified, Quantity, ID INTO #TempData from AuditTable select a.ID, b.DateModified, a.Quantity as FromValue, b.Quantity as ToValue from #TempData a inner join #TempData b on a.ID = b.ID and a.RowID = b.RowID-1 and a.Quantity != b.Quantity order by 1, 2 drop table #TempData

Technorati Tags: ,


Share/Save/Bookmark

Tuesday, April 08, 2008

Yuneta's Blog

A friend of mine started a blog and started posting nice support entries.

http://yunetasblog.blogspot.com

Technorati Tags: ,


Share/Save/Bookmark

Saturday, February 16, 2008

Windows Server 2008 will have an SP1 label

I came cross an interesting blog entry that said that Windows Server 2008 will have SP1 label already applied to it. Take a look at http://blogs.msdn.com/iainmcdonald/archive/2008/02/15/windows-server-2008-is-called-sp1-adventures-in-doing-things-right.aspx

Now, how will this effect people's rule not to install a Microsoft server, until SP1 is released (or did the rule implement this version scheme due to that rule :)

Technorati Tags: , ,


Share/Save/Bookmark

Thursday, February 14, 2008

Firefox 3 Beta 3

Firefox team released a public Beta 3 of the new version of Firefox 3 browser. Here are some first impressions

  • Pretty stable, didn't have any stability issues yet. Beta 2 would crash on some very basic pages
  • It is FAST. As in like really, noticeably faster then Firefox 2 and IE. Complex pages like iGoogle, MSDN, etc... show up instantly
  • The URL dialog is nicely improved. You now get a dropdown with recommended URLs based on both URL and page title.
  • It passes the acid2 test

Some minor annoyances

  • Old add-ins and themes do not work

Technorati Tags: , ,


Share/Save/Bookmark

Friday, February 01, 2008

Sara Ford's WebLog : Did you know... You can use Shift+ESC to close a tool window - #142

Sara Ford's Tips Blog is an excellent source of tips. This one especially helpful for me.

Sara Ford's WebLog : Did you know... You can use Shift+ESC to close a tool window - #142

Technorati Tags: , , ,


Share/Save/Bookmark

Friday, January 25, 2008

WCFTestClient - a testing utility from Visual Studio 2008

I stumbled upon an excellent utility for WCF Testing that comes with Visual Studio 2008 - WCFTestClient.

The tool is an simple way to test WCF clients HTTP and TCP bindings. Some things are not supported, however, for basic WCF Testing, this definitely beats the old ASMX test page.

Note: Also check out the WCFSvcHost utility from Visual Studio to host an arbitrary WCF Service.


Share/Save/Bookmark

Thursday, January 17, 2008

.NET 3.5 Source is now available

Everyone's talking about it. The source for .NET 3.5 framework is available for debugging. Read full instructions on how to set it up here

http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx

Technorati Tags: , ,


Share/Save/Bookmark

Saturday, January 12, 2008

Query ExPlus 2.0.2.8 is released

I finally got a chance to release a binary of the latest Query ExPlus v.2.0.2.8

I didn't put time into the project for a while, however, some developers in the community did, and I'd like to extend my appreciation to those guys.

The new functionality since last version is:

  • Handle result sets with NULL primary keys
  • Select All for the grid
  • MRU implemented using Genghis library
  • OleDB Support
  • Fixing Order by in Oracle Browser

The project is still a one executable 172KB in size. The only prerequisite is the .NET 2.0 framework

You can access the project homepage on Source Forge

http://sourceforge.net/projects/queryexplus

The direct download link for the release is

http://sourceforge.net/project/showfiles.php?group_id=176790&package_id=206668&release_id=567994

The download is available as either compressed executable or compressed source

 

Technorati Tags: , ,


Share/Save/Bookmark

Thursday, January 10, 2008

Customizing SCSF Guidance Package for Modular Development

One of the requests that I've received from other developers is the ability to use SCSF for developing a module without including the shell in the solution. We develop a large number of modules independently in different groups and having the shell be a part of every module was getting to be a problem.

The only issue that I was getting with getting this to work was that SCSF guidance package would fail in ViewTemplateCS when I would right click on a folder and tried to add a new view to the project.

To solve the issue, I was made a small tweak to the source in the ViewTemplateReferenceCS.cs. (The code comes with the SCSF, however, you will have to install it separately after the SCSF is installed) The culprit is the function ContainsRequiredReferences(Project project) Specifically the call to ContainsReference(project, prjCommon.Name)

Since the common project is not in the solution, the call failed with Null Reference exception. All I had to do was to change the last line of the function to be ContainsReference(project, "Infrastructure.Interface"); Then recompile the GuidancePackage solution and place the Microsoft.Practices.SmartClientFactory.GuidancePackage.dll into the C:\Program Files\Microsoft Smart Client Factory\Guidance Package folder.


Share/Save/Bookmark

Monday, January 07, 2008

Fixing WCF/WPF VS 2005 Extensions installation after installing VS 2008 or .NET 3.0 SP1

I've encountered a problem trying fix the WCF / WPF Visual Studio 2005 Integration components after I've installed Visual Studio 2008.

Installing a VS 2008 will install .NET 3.0 SP1 and remove the installation of .NET 3.0. When trying to install the WCF / WPF Extension, installation display's a message

Setup has detected that a prerequisite is missing. To use Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP you must have the .NET Framework 3.0 runtime installed. Please install the .NET Framework 3.0 runtime and restart setup

You really can't install .NET 3.0 since a newer version (.NET 3.0 SP1) is already installed.

I found a solution on the MS Forums http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2550726&SiteID=1

It involves either going creating a registry key to full the installers into thinking that SP1 is installed. To fix the issue, add the following value to the registry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{15095BF3-A3D7-4DDF-B193-3A496881E003}] "DisplayName"="Microsoft .NET Framework 3.0"

Thanks Erich for the solution.

Note: I got a comment that this can also be forced using command line: msiexec /i vsextwfx.msi WRC_INSTALLED_OVERRIDE=1

Thanks


Share/Save/Bookmark