# Wednesday, February 20, 2008

Me, the florist

Here are some pictures of my reborn (I had neglected it for a while) passion:
 

            

Comparing source code on check-in and check-out

A great practice I follow is to do compare when checking in and out some source code.

When in a new project (my current situation) it's really fast to find out what code is hot - heavily changed, and how it is changed. Even when into the project, the new guy can follow what others are doing, can find out if someone accidentally overrides something (it happens more often than you think), and generally keep track of what everybody's doing.

There's an overhead involved - the whole procedure needs some time. I try to commit (check-in) relatively often, and on every sync I do compare. This way the committed code by others could not pile up.

There are also tricks to optimize the process - if the comparator highlights horizontally changed code (most of them do comparison only vertically - line by line) you can ignore code formatting changes faster, because no code is highlighted. If some refactoring takes place, you could ignore the changes in subsequent files after you've seen them in the first one. Example (only spaces and quotes changed):


A good reason for frequent commits is that a frequent update would be easier - when you update a file you see a single change.


Comparing code on commit (check-in) makes some bugs obvious and helps avoid typos. Frankly I don't do it always.


Two additional things I would recommend: when committing, write a description (it helps others understand what's going on) and do atomic commits - commit a single task as one thing (select all changed files and commit them together with an understandable description - it's really helpful for the guy after you.
Note: not all repositories support atomic commits, but still it's a good habit.

The second thing is always to update before commit - avoid partial commits and breaking the build accidentally.

Don't make me think

Today I was on a lecture - http://www.devbg.org/seminars/seminar-Software-Engineering-20-February-2008/

Mihail Mihailov had a great lecture on rapid development (based Steve McConnell's book).

It seems I'm gonna have to check out Steve's less popular books - Rapid Development, and something about estimations.

Because of participation I won a copy of "Don't make me think":


It seems like a book I would enjoy reading and that would have the same way of thinking as I do.

It was signed by Mihail, and funny enough Mihail's signature is something like M2:
Cool, I like it.
# Monday, February 11, 2008

Laptop overheating comes out to be a Vista Search issue

My laptop started heating more and more until at some point I had to start forcing it to "Sleep". (it has Vista on it)

At some point I got really aggravated by that fact and started investigating. Forums revealed that the issue could be linked to heavy processor usage.

Process Explorer showed that I had some wierd behavior even when the machine was idle (Indexing service is disabled - dummest thing ever) - explorer.exe taking 100% for 5-10 seconds.

Repeatedly.

There was a wierd dll doing that (SHLWAPI.DLL):



At some forum I found out that this was related to the start menu search. WTF?

It comes out that the start menu search (which I find one of the few useful things that come with Vista) does a search in the index first and then goes the the hard drive.

We don't want that.

There is an option in the start menu settings which stops that - problem solved.


The good thing is that while searching at the forums I found a pretty useful tool - Dell fan control - one can see everything and EVEN control fans:



dell fan control.png (78.88 KB)
# Sunday, February 10, 2008

DNS Configuration issue - partly solved

A while ago I had an issue with accessing gateway machine by its external network address as discussed here: DNS Configuration issue

The solution with the local DNS server kinda worked - now there is a local DNS server with local names (machine1, machine2...) and mapping the domain names (stoynov.com) with the local addresses. It works pretty well.

The only problem is synchronizing the sub-domains (msdnaa.stoynov.com) with the local DNS server - now they should be added by hand. Kinda sucks. The good thing is that there aren't too many of them.

# Wednesday, November 28, 2007

DNS Configuration issue

There's this problem I've been having for some time.

I have a small server (http, mstsc, file-, ...) at home. It has a real IP address. It also acts as a gateway (AP, lan, bluetooth lan) and shares it's internet connectivity. For that reason that machine acts as a DNS and a DHCP server and has an internal IP address.

There's a domain name resolving to the external (real) IP address.

The problem is seeing the the stuff that should be seen from the outside world from the internal network. All that stuff works when using the internal IP to access that machine, so it's not a firewall issue.

What works and what not: pinging the external address works, telnetting to external IP:80 fails as with any other port.

A simple site wouldn't mind internal or external address.
My blogging application on the contrary would fail because the resources (pictures) are with FQN URLs.
And I would like to make this work in a pretty way.

One solution - local DNS server supplying the internal IP address for that domain name.
This works now, but my local DNS has to have an entry for every single domain/sub-domain - this approach sucks. I also have different services exported on the two different IPs and this local DNS approach break that.

I have seen this problem with the networks of midsize companies. Example with deploying a product inside that network (have to supply internal names).

I'm looking for a better solution.

Anyone?

# Tuesday, November 27, 2007

Car accidents' day, part II

Look here for part one.
I had promised myself until the end of the day to use only first and second gear - I didn't do it.

So what happened until that notorious day was over.
It was snowing all day and after work I decided to go to a nearby mountain (Vitosha) and test my driving skills on an empty road. At some point I parked outside the cleared road to see the view to night Sofia. ...and I couldn't get out of there - the car was stuck in high snow. Digging was necessary. To dig I used a thing I bought for cleaning my windshield - it did an amazing job and I got out.

Few turns and a lot of drifting after that I lost control and got stuck (again!) in ditch stopping just a few inches from a tree. The car was inarguably unable to get out of there on it's own. I was just imaging how now I should start calling friends (it was around 12 o'clock already) which would arrive at least an hour after I called them, when I saw some lights. I got out and raised my thumb and these guys stopped. I had a rope and a Subaru 4x4 got me out in no time. And the car wasn't damaged at all. What a day.

I definitely believe in god now.

Unfortunately there isn't a single picture of all the stuff that happened.

# Monday, November 26, 2007

Car accidents' day

Today for a while I started believing in god.

I had to get up really early to take a friend to a car repair shop. It was (and still is) a rainy day and I was really sleepy. On the way there (driving kinda fast) I missed a right turn and went in the left lane (missing two cars and a van, whose driver lost control and stalled the thing missing me only for half a meter - fortunately he didn't hit anything). I stopped, apologized and continued on my to the shop without even my heart rate going any faster - I guess I was too sleepy (but not too much - as to avoid the accident).

Few hours later getting out of a parking lot I hit a car - quite a limousine with some mafia guys in it. Only a scratch on it and nothing on my car. After hearing the regular threats on my life, we (me and one of them) decided to call the police. Now is the time to mention that driver had parked on a bad place causing a jam and a lot of horns. He then moved the car to a different place but still causing a jam and a lot of angry drivers. At some point he decided to leave without even telling me. After a few minutes I called the cops to tell them not to come. I didn't even get a ticket.

What a day.

Until the end of the day I'll use only first and second gear.

# Friday, November 23, 2007

[Phun] Bank Robbery

I couldn't stop myself from sharing this one. It's amazing...

Bank Robbery in Downtown Los Angeles!

(it doesn't look so real)

# Monday, November 19, 2007

First day without a car

It sucks. It sucks big time :(

# Monday, October 29, 2007

Wierd eclipse configuration

On a recent project I joined I was amazed to see how things were working in regards to the IDE.

First, the environment was not uniform, there were:
  1. An ad hoc approach towards the IDE - different IDE versions and different set of plugins. Good plugins were not easily distributed among all the developers.
  2. Different way of getting and storing the local version of the source code - different plugin for the IBM ClearCase. Some people even downloaded and committed the source manually - through an outside (to the IDE) application.
  3. no one-step build even for debugging - the building required a few manual steps to build and run. Some developers did not use debugging, some used it manually since the IDE could not automatically deploy everything
So after some days on the project I proposed to make a uniform environment that would have automatic building and deploying.

Maybe now's the time to give some info on the project: Web project including ajax written in java, IDE: Eclipse. Lot's of legacy code and legacy dependencies (which had to be removed).


The problems:
  1. Scattered source code and resources:



    There were several projects and each had the source in a
    java directory, some web resources in a web directory and all kind of tests plus test resources in a tests directory.
  2. Dependencies on numeroous (~150) libraries scattered around.


So first I had to separate web content from source code. This could work with linked folders. So I created a few java projects with only the source code.
Then create a new web project that depended on all the other projects and had several linked resources for all the web content. The hardest thing was that in an Eclipse web project one can have only one folder that's gonna be the root one, vis à vie you can't have two directories with web content that shall be deployed in the web root folder. (At least it looks that way when one goes through the configuration of a web project)


After some research it appearred that actually this was possible (manually):
Web-project/.settings/org.eclipse.wst.common.component:


So after this was done the only thing left was to configure the deployment to different servers.

So the moral of that story is that even with a directory structure that complicated one could be able to abstract all that from developers and create an IDE that can do most common tasks automatically.