Archive for December, 2008

Clone Detective – Hunting out clones

One of the the currently under used resources for .Net developers has to be CodePlex ,the astounding number of great open source projects hosted there is pretty amazing. If you are a .Net developer and do not have the Codeplex newsletter in your RSS reader then i highly suggest you add it now.

Ok enough of the codeplex love :) and onto the main topic here. Clone detective is one of the better open source projects that have been hosted on codeplex. The basic function that it serves is to find and eliminate duplicate pieces of code in your project.

As most developers will tell you that duplicate code is one of the biggest annoyances when it comes to programming , it usually results from copy and paste programming and usually hurts the developer the most when a small pieces of code change in one section and the rest do not get updated.

Now while TDD does aim to prevent and solve this problem , a lot of people and companies cannot just implement TDD into their projects as it usually needs to be done in the very beginning of the project. So an alternative for now is clone detective , it will check your code for duplicates and highlight the duplicate code in the code editor window. The one important thing that makes Clone Detective from every other checker is that it turns the code in token and compares that , what this means is that code does have to be typed exactly the same way to be detected as a duplicate. For a detailed explanation on how it does tokenization have a look at the videos page .

There are a number of other interesting facts that Clone Detective presents , for example it can show per file how much of the file is a clone , how many lines are cloned and how many cloned sections were found. On a whole Clone detective is really awesome just don’t over use it, there are some times when clones just cant be refactored. This should be one tool that every developer uses or at least knows of. This tool is best used in conjunction with Resharper , if you don’t have or use either i suggest you go and get them now.

~stalkerh

Dont you just love working in december

While this may seem like a decidedly odd comment , if you think about it for a few seconds you will realize just how true it is. Also i think it would be a good time to mention this is from the perspective of a developer.

This is the only time of the year when requests actually slow down to the point where i can actually go and review old code .Fix things that were meant to be fixed an just never got down to. Personally i feel its the one time in the year when you can do beta testing and not get a backlash from the rest of your team for trying something new.

The other thing is that traffic is always a killer , no matter what time i leave for work there is always traffic. Yet at this time of the year it is simply a breeze to drive to work a everyone is gone on holiday.

The final point that i will make is this , i just know people are going to say but when do we take a break then , i will never make it yadadada. So what you do is you take you holiday in the off peak times when everyone else is working . This way you still get to relax and avoid all the stress of work , its not totally fool proof but it has worked beautifully for me.

~stalkerh

The search for the perfect developer

In South Africa it seems the developer or at least a good developer is becoming harder and harder to find. No matter where you go or what you do getting a good developer is becoming so elusive that it almost like trying to find the proverbial needle in a haystack.

The fundamental reason behind this is that most people tend to follow the trend that they build there experience and then move on in short bursts.This is a never ending cycle until said individual actually stops working for a company and either starts their own company or just works as a contractor.

This presents 2 huge problems , company’s have a hard time holding on to developers and developers tend to become undependable.The first problem is usually faced by the smaller company’s who are just starting up , they find and recognize good talent but cant hold onto the person due to financial constraints. With the financial crisis the world has been going through this has become even harder for the smaller company’s that manage to even keep afloat.

The second problem is that the developer never works on one system for a long period of time or till release and doesn’t put the same effort into a system as a person that is in a project for the long term.The thinking being that not only why should i put in time and effort into a system that i am not going to maintain or even use but if there are problems i can always move on and get a better job .But on the flip side there are some cases where because of the financial crisis people have to move on not always because they dont like their current company but because they have to , just to keep themselves afloat.

I personally think that some of the smaller companies are to blame , by constantly hunting for better developers instead of training the ones that they already employ to me better people and by sticking to older technologies they are really hurting their business rather than helping it. From a personal perspective , there is nothing that developers hate more than having to use ancient technologies and by forcing them to use said technologies you end up pushing them away.

Now while this may not be the case with every developer i have seen it happening to frequently to believe its not an isolated incident. So while you may never find the perfect developer in this world as an employer what compromise’s do you make when you hire a new person. I know many people use probation as a safety net in case things go south while other people put candidates through stringent tests. While all of these do help to filter out the weeds , in the end i think the perfect developer is one that has been brought up and nurtured in the environment they want to work in.

As a employer or employee what are your thoughts ?

~stalkerh

Wheel of pleasure

So after many weeks of waiting and contemplating(well not really much contemplating) my Logitech Drive FX for the 360 finally arrived. I am sorry if i was leading you in the wrong direction with my title but i assure you my intentions were all good :) .

So some time before RAGE this year i started buying the odd racing game and have to say i was really enjoying it on the xbox 360. I had played Forza 2 and Race Drive Grid since they were the only ones that were recommended unanimously by everyone i asked. Then came the RAGE event , it was there that i got a chance to play Forza 2 with a steering wheel and the 3 screen setup .Wow what a change in racing experience that was, as soon as i got home that night i started playing Forza again, but alas it just did not feel the same anymore. I then decided the last important peripheral i had to get for my xbox was a steering wheel.

Now many months later i finally have my steering wheel and i am back to loving my racing games. After setting everything up i decided i would run a few test runs with all the racing games i had and jot down my findings here. The games i tested were Forza 2 , Race Drive Grid and Need for speed undercover.

Forza 2 : It is in this game that i personally feel the steering shines the most. Since Forza is more simulation than it is arcade you need all the extra control you can get over your car and the Drive FX does it beautifully. The steering’s built in resistance makes a huge difference at lower speeds and on the different terrains allowing you to accurately gauge how much you need to turn or how much you need to adjust the cars speed.

GRID : I personally feel that GRID took a more arcade style rather than a simulation environment. The reason i say this is because if you play the game immediately after playing Forza the accuracy from Forza falls away for higher speeds and slightly more extreme driving. You can immediately see the difference the Drive FX provides after you take your first corner at 120 without crashing.

NFS Undercover : Even though i played this game with the steering i am not entirely sure that its needed. While the game does respond precisely to the steering the game itself is sooo easy that by using the steering i felt if i was cheating some how. The one experience that i have to recommend NFS for , is if you want the Hollywood driving experience. While weaving through traffic on a highway chase at 220km/h , there is very little that is going to beat that experience.

I have to say that i would recommend the Drive FX without a second thought to anyone , although it is a bit expensive if you don’t like racing games or only play them on the odd occasion.

Just remember its the driver not the steering that makes the difference :) ,

till next time

~stalkerh

DynDNS Updater

So the situation that we face in south Africa is quite unique with regards to out internet access, we have 2 kinds of bandwidth , local and international.Local being access to SA hosted resources and international being the rest of the world

Now unfortunately for us international bandwidth is really expensive , so most people turn to local only bandwidth. While you can use most services , things like DynsDNS updates do not work because they are considered international.

First of all for those that don’t know DynDNS is a dynamic IP provider. It allows you to host services from a location that has a dynamic IP , the best example is a Home Pc that needs to be accessed remotely.

Now while there are a few alternatives (if you are on the IS network it works fine) , for people like me where international access is totally blocked i have written a small web service that will do the update for you.

With the help of some code from Ken Hughes that when hosted locally will allow users that only have access to update there dynamic IP’s.

I have attached the source code and exe’s to this post for anyone to have a look at. Once you extract the file you will find 4 folders of importance.

DynDNS Addin : This is the core code used to make calls to the DynDns API. No need to worry about anything here unless you are a coder.

DynDNS Updater : This is the client side exe/app that i have written to interact with the web service. If you want to make updates using local only bandwidth this is the app that you will use. Call it with the parameters “DynDNSUpdater.exe Username password hostname” .

Note i have tested this with mono on ubuntu intrepid so there is no need to use wine if you want to use it on a linux machine. It should also be noted that if you don’t want to call the app using parameters you can edit the app.config file and change the username , password and hostname fields.

If you want this app to be called at any interval, on windows setup a scheduled task in windows (found under accessories->system tools ). On linux setup a cron job to the app from a script, preferably with the values in the app.config .

Tester : This is a basic testing app written by Ken to check that all is working.

WS : This is the web service that is called and used to proxy the calls to the DynDNS API. Unless you are a developer there is not need to worry about this either.

I think that covers the bare basics , if you need any help give me a shout. Note i haven’t uploaded the file to this site due to file types and such ,you can get it from www.codebreaker.co.za

~stalkerh

Coding without understanding is not coding

What it is ,is best described as a glorified typist. Now while i know many people will disagree with this saying that you need to know what code to copy and where to copy the code to so that it can work. I now point you to a very interesting site 1000000 Monkeys , the basic idea is that if a million monkeys keep on typing some thing good will be born from it.

I am now seeing a very similar phenomenon in the coding industry , where we have a ton of monkeys churning out just as many tons of code but only very little being useful to the rest of the world. It is then the job of the more enlighten and ambitious coders to step in and fix the huge mess that has been left behind.

Now to fix this is a task that i think no one person can solve , it has to be the responsibility of every instructor and mentor out there to teach the students to work on there own and not just cling on to the more experienced to do all the work. After all if no one bothers to learn then what will happen to the new generation when the older generation disappears , the end of the world .

If you are one of those copy and paste / Ask senior programmer types then do the following every time you hit a dead end. Google the problem ( if you don’t know how to do that , have a look at Steven’s awesome guide ) , after googling the problem and getting a answer don’t use it blindly , try to under stand it to the best of your capability’s so that when you use the solution you know if there might be any other problems or side effects.

Also it doesn’t hurt to do a bit of research sometimes and by research i mean picking up a book or asking people , you will be surprised how much you can learn like that.

Remember the more coder’s the better the more monkeys the worse :) , now keep well and keep coding.

~stalkerh

Samsung Omnia Rant

Ok so i don’t really like to rant a lot but this time i couldn’t stand by any longer.

So i have had the phone for a few months now and have really gotten used to using the phone the way i want it. Alas i find that there are some cool stuff that i want to do on the phone but there are no applications to do what i want. So off i go to crank out my Dev kit and start hopefully generating some mobile applications.

That was not to be , i was hoping to get a samsung omnia SDk so that i could access specific features of the phone and maybe even create some widgets , but nothing of the sort exists. The only tools you have access to is the .Net SDK .Now for me this is not a problem since i love using .Net to develop my applications , the problem is that you can only use the general features of .Net and none of the true power that the phone offers. Now why in the world they chose to do this i have no clue.

Now this would not have been half bad if they had released a decent widget for the famous sidebar besides the default that come installed with the phone. What you are left with in the end is a side bar that is only as useful as the first 10 secs that you use it. After that its better to switch to one of the other home screens as you are likely to get more work done.

Now if some one could please enlighten me as to how do i get hold of a decent SDK i would be very happy. If you are a official Omnia rep please explain why this was the chosen route.

~stalkerh

FireStats icon Powered by FireStats