Saturday, 22 August 2009

Free SMS via Twitter

Did you know it is possible to send SMS(Text Messages) to your friends for free using Twitter. Let me explain.

Receiving tweets via SMS
In some countries, you can receive twitter updates via SMS to your mobile phone and you can also send tweets via SMS. This is quite handy if you don't own a smart phone.

You first have to check with your mobile service provider whether they provide this service.

For example:
In New Zealand, Vodafone and Telecom will send tweets to your phone for free but tweeting via SMS will cost the normal charges.
The service it very fast. As soon as you tweet, within a couple of seconds the SMS will be received.

How do you set this up?
  • Log onto twitter
  • Go to the "Settings" link in the top right
  • Go to the "Devices" tab.
  • Provide the details required. They ask for your mobile number
  • They will display a code which you need to text to a number they show in order to verify the mobile user.
  • You are done.
You can choose from which users you want to receive updates
This is a very nice feature because you don't want to receive SMS tweets all day long.
If you go to the list of the people that you follow, you will notice that you can select from which people you would like to receive SMS updates. This just gives the user more control of what content they would like to receive via SMS.

Sleep Interval
You can also specific a period of time where you don't want to receive SMS updates on your mobile phone. This can be setup in the "Devices" tab.
For example, if you set the period from 9PM to 9AM, you will not get any tweets to your phone during that time interval which is handy if you don't want to be interrupted when you sleep.

Since you have everything setup and have some background information, I can now explain how the free texting/SMS to your friends can work.

Free SMS
This idea assumes that your friends are on twitter and have SMS alerts setup.

If you direct message the person, that person will get that message as a text message and no one else will know about it. Its just between you and the person it was sent to.

Example 1:
You are sitting at your computer and you want to message your mate. Just log onto twitter and send then a direct message.

Example 2:
If you have a smart phone which can access the Internet, you could also log onto twitter and and direct message them. If there is free Wi-Fi then there is no cost to you.

You can also take advantage of twitters broadcasting capabilities.
For example, if you want to message something to all of your friends, you could just send a normal tweet and then all your friends would get that message on their mobile phones. So you don't have to text each of your friends one by one.


Facebook Status Update
I have setup selective Facebook updates from my twitter account.
This means if I tweet and its end with "#fb", that tweet will also be posted as a status update on Facebook.
This is another handy way to update your Facebook from your phone.

Tuesday, 16 June 2009

Being Agile

One of the key goals of any software development company is to be agile regarding how quickly the company can respond to clients feedback. Its known that requirements are always changing and it can be difficult to react to these changes quickly.
When companies are not agile enough, clients can become disgruntled as there feedback is not been acted upon and companies could lose valuable clients.

I will discuss a couple of ways a software company can be more agile. The faster you meet your customers requirements, the happy your customers will be, which means a more successful company.

Agile Software Development Process

Firstly you must have an agile software development process in place. There is lots of detailed information on Wikipedia
The main idea is having quick short iterations of the software development life-cycle.

One of my favourite approaches is Scrum.
Below is an excellent video explaining how scrum works. I highly recommend that you watch it.


This video is from Hamid Shojaee who is the CEO of Axosoft. His company makes software change management systems which supports the scrum methodology very well.

I believe that scrum is one of the best processes. After watching the video you will think, how come I didn't come up with this process. One of my favourite aspects of this is the Burn down charts. It gives you great visibility of how the project is progressing.

Other Issues

Existing Code Base
Changing requirement means adding new functionality, improving and refactoring code etc.

If your existing code base in not well designed, architecture and tested, then maintaining this code base could prove very costly.

Let me explain is some detail
Ideally, if your code base is well designed and tested, adding new features and doing general maintenance is easy. The code is nice and modular and its easy to inject new pieces of logic. Its easy to reuse existing code. When there is a good bed of test suites, then you can confidential refactor the code and running the units tests can verify that everything is still working correctly.

On the other hand, if the code base is poorly designed and tested, then adding and maintaining code can be very time consuming and costly.

Once badly designed code in already in the code base, its quite difficult to remove.
  • A lot of people don't know what is good and bad code, thus cant identify what is good and bad.
  • Once bad code is in the code base, it is usually very hard to refactor and remove.
  • Other developers might see this bad code and assume that it is acceptable and the problem gets worse. Two wrongs never make a right, but things can get incredibility messy.
That is why it is important to tackle these problems as early as possible before things get out of control.
An analogy to this is when you get sick. The sooner you identify the symptoms and what is wrong with you, the early you can fight the sickness. Less pain and troubles. The exact same thing applies for coding.

Once you start working in the industry, this will become more apparent.

As long as you learn from your mistakes and improve your work, everything will be fine. Always try and find better ways to do things, this is the way to strive and become really good at what you do.

How to tackles these issues:
  • Its very important to spread the knowledge. If you find out something interesting and helpful, tell people about it. It will make the IT industry a better place. Blogs and twitter and good ways to spread the knowledge.
  • Do something about it. Don't just do nothing. If everyone thinks that someone else will do it, then nothing will happen and the problem is never solved.
  • Keep yourself up to date with the latest news and information in the industry. Use tools like RSS readers, twitter etc to learn and find out more.

Monday, 27 April 2009

Tracking your Blog

Once you have a blog setup, the next thing you should do is track the traffic to your website. This allows you to understand how many people are viewing your content and how much traffic its getting.

There are many services on the internet that allow you to track the traffic to a website. I will just name a few:
Since I am using Blogspot/Blogger which is a Google product, I decided to use Google Analytics.

Setup

Google Analytics is really easy to setup. I found this blog which explains how to setup Google Analytics for a Blogspot Account.
Setup is really very simple.
These are the steps at a very high level:
  1. Sign up for a Google Analytics account.
  2. Copy the code snippet from Google Analytics into your blog. This allows it to be tracked by Google.
  3. Go to Google Analytics and check that the snippet has been deployed correctly. I read somewhere that you have to allow 24 hours for Google to initialise things before you will be able to view some results.

Results
I was very impressed with the results that Google Analytics provides.
  • Simple and easy to understand graphs and data.
  • But also allows you to drill down into more detail.
  • There are lots of different KPI (Key Performance Indicators) which you can use.
  • Shows from which part of the World the viewer came from.
  • And lots more other interesting details

Tuesday, 21 April 2009

Linux Shell Script - Changing Directory

I found out that changing directory in the shell script file does not affect the shell in which it was called.
When you run a shell script, the script in run in another shell session.

I will explain with an example.

This is the contents of my script, which is called "mymkdir":
#!/bin/bash
mkdir $1
cd $1


So the goal of this script was to create a new directory and the name of this will be passed in as parameter. And afterwards we would like to change into that directory.
But if you try and run this script nothing will happen. It will create the new directory, but it wont change into that directory. You will remain in the same location.
This is how I ran the script:
> mymkdir newFolder

Solution
To use the keyword "source" before running the script.
> source mymkdir newFolder

Now it should work as expected. A new directory called "newFolder" has been created and the shells present working directory is now inside the new folder.

Tuesday, 31 March 2009

Twitter

I wanted to share a few thoughts about Twitter. Twitter is actually a very good service. It provides a means of sharing information. I have learnt a lot by using twitter. My general IT knowledge is getting better day by day and you learn lots of new things. Its very addictive once you start using it.

Twitter is quite different from a blog. Since twitter restricts the tweet to only 140 characters, it encourages you to tweet often about things that you would like to share.
On the other hand blogs allow you to write as much as you want and include different types of media (pictures, videos). Therefore writing blogs requires more thought. So you might notice that people tweet much more than updating there blog.

So for more up to date news, twitter is good.
Examples of some news company's that use twitter:
Twitter is also used as a means to exchange URLs with the help of URL shorting services like tr.im, is.gd just to name a few.

But if you want detailed information, then you will get that from a blog. So blogs and twitter kind of serve different purpose.

Another nice feature of Twitter is that it keeps track of all the people that you are following your tweets and all the people that you follow.

Twitter is one of the biggest things happening on the web. If you read feeds about technology, twitter is mentioned lots, much more than facebook. Its cropping up in magazines, radio, you name it.

Those are just some ideas I had about Twitter and blogs.

My twitter details and updates are on the side of my blog.

Tuesday, 3 March 2009

Javadoc/Comments in Code

A work colleague "Richard Paul" suggested some very good ideas about what things should be included in javadocs/comments when coding. So I thought I should write about it to spread the knowledge.

Comment design decisions and why you did it that way


There was a situation at work were we wanted to know why a particular variable was used in a calculation over another variable. Then we started to think back to why we did it that way and this had happened a while ago so not a lot was recalled. We needed to know this because we needed to change the variable being used and couldn't recall if there was any special reason why we used that variable.

But if we had documented in the javadoc why we used that variable over another variable that would have made things much simpler.

Most of the time developers document how their code works in the javadoc. This is good when the code is complex and hard to understand. In the ideal world the code should be well written that very little javadoc is required to explain what is happening. But we believe it is also important to document why you have done something in a particular way. Also any coding design decision should be commented.

I will give you an example to better explain what I mean.

I had to implement an interface for a listener to perform a particular task. Now the event for this listener had 3 different event types.

One option would be used to implement the interface directly and use if statements to handle the 3 different event types.

Another option would be to add an abstract class in the middle which would handle the if statement and delegate to 3 abstract methods. So instead of implementing the interface, you extend this abstract class and instead of implementing 1 method, you now have 3 abstract methods to implement.
The reason I did this was because the code was more clear as to what each method was doing. Also if in the future we wanted another implementation, we could extend the abstract class and the common logic is still in the abstract class and it would be easy to substitute classes.

So, some of the reason I outlined above should be added to the javadoc of the abstract class. So that when someone looks at the code in the future, they will understand why I used an abstract class instead of implementing the interface directly.

Company's might have procedures in place to write supporting document about the code. But this might be hard to locate and might take time. But having some of the reasons in the code makes the information available quickly.


Comment your unit tests


Another place that comments become very useful is in unit tests. Testing code is very important and I might write another post explaining why later on.

So what do I mean?
Each test case you write should be testing a particular case. So sometimes its a good idea in the javadoc of the method to summarise the input and output of the test case. Now if you are creating all the input data inside the test case, then this javadoc might not seem very useful. But if you have created your input data in the setup method of the testing class, then its not very obvious what are the inputs. Creating the input data in the setup method reduced redundancy and is the logical thing to do to make your tests maintainable.

I will give an example to explain what I mean.

public class TestPerson extends TestCase {

protected void setUp() throws Exception {
Person person1 = new Person("name1", 10); // name and age of person
Person person2 = new Person("name2", 11);
// etc
}

/**
* The people should be allocated by name
* Data:
* Person1 - Jane
* Person2 - Bob
* Person3 - Steve
* Outcome: a list in the order Bob, Jane, Steve
*/

public void testAllocatePeopleByName() {

}
}

This is just a simple example demonstrating the concept of commenting your tests.

Now if that Test Class was very long, that javadoc becomes very useful. Instead of scrolling to the top of the test to see the details of the input data in the setup method, you have a summary in the javadoc of the test method.
Maintaining the code and tests now become much easier. If you wanted to maintain this code in the future or if someone else looks at it, they would be able to understand and comprehend it much faster saving time thus money.

Wednesday, 18 February 2009

Greasemonkey

So what is Greasemonkey?
Greasemonkey is an addon for Firefox that allows the user to write scripts which alter the web page dynamically.

Userscripts
This site contains scripts which can be used by Greasemonkey. This would be a good place to have a look to get an idea of what things can be achieved. Its a place where user share their scripts with everyone.

If you know some web technologies like HTML, CSC and javascript, you will be able to write your own scripts.

More information about this can be found on wikipedia

Thursday, 12 February 2009

Fixing issues after new windows xp installation

After I installed Windows XP, there was nothing in the Network Connections so I could not connect to the Internet using my router. Also sound was not working and some games were not working.

How to fix this
You need to install the drivers for the motherboard.
You first need to find out the model of the motherboard.
  • You could open up the computer and check the model number written on the motherboard.
  • Check the specification of your computer. Maybe the invoice for the computer contains a list of components.
For example my motherboard was an "Intel D915". So you just go the google and search for "Intel D915 drivers".

So on the Intel website, there were 4 drivers
  1. A driver so that the basic components on the motherboard work correctly
  2. A sound driver
  3. A network driver (This created a LAN network connection)
  4. An advanced graphics driver. I believe for the on-board graphics card
So after installing all those drivers, everything is working fine.

Monday, 9 February 2009

Rock Climbing for Beginners

If you have never been rock climbing before, then your first experience is quite interesting. So I thought I shall share some interesting things that I learnt. This is indoor rock climbing. Not that actual thing.

I am only going to go over the basic things a learnt. If you want more details then there is always wikipedia.

Since it was my first time, the people working there give gave me and work colleagues a demo about safety and how things work. Also wearing a harness for the first time can be difficult and can be uncomfortable at first.

The demo started of showing how to climb a wall with a belayer. I think it was a top rope system. So the climber attaches themselves to one end of the rope. This rope goes to the top of the wall and then comes down to the belayer who is also attached to the rope. The belayer stands about 5 metres away from the wall.

So as the climber climbs the wall, the belayer has the pull the rope so the rope between the two is always tight. So that if the climber falls, they only fall a small distance. They have special systems attached onto the rope, so that if you do fall, the rope automatically locks, so its quite safe. Then once you have reached the top or have had enough, you can let go of the wall and the belayer will slowly bring you down.

How they measure difficulty
The rock climbing walls have colour coded holds(placed where you put your hands or feet). Each of the colour coded holds are given a level which is shown on the wall. And the aim is to use a single colour to get to the top. If you can then you have achieved that level. Simple as that.
Easier levels have many holds which are large and easy to grip. Harder levels have fewer holds in hard to reach locations and are difficult to grip.

Lead climbing
Another style of climbing that I saw was lead climbing. There is still a belayer, but as the climber climbs its there responsibility to clip themselves into clips along the way. This style is for more experienced rock climbers.

Don't need a belayer
There where also tall narrow walls which don't require a belayer. There is still a rope that you have to clip your harness on, but as you climb the wall there is a mechanism that keeps the rope tight and if you fall, it automatically takes you down slowly.

Bouldering
Instead of going up the wall, in bouldering you go across. In other words rock climbing sideways.

So that was my first experience regarding rock climbing and I recommend that you try it once.

Friday, 6 February 2009

Dual boot Windows XP and ubuntu 8.10

I bought a second hand computer for real cheap so I thought it might be a good idea to try and setup a dual boot using windows xp and ubuntu 8.10

I asked a few people at work and they said it would be very straight forward so I decided I should give it a go and I had nothing to lose. But the journey was harder than I thought.

It is a good idea to install windows xp first. This is because if you decide to install windows second, windows overrides the boot load so you wont get the option of which operating system you would like to load up.

Before you start installing anything, you should decide how the hard drive should be partitioned to accommodate the dual boot. Now I had a 120GB hard drive. So I wanted 40GB for windows, 40GB for ubuntu and 40GB as a separate partition for my files so that both operating systems can access it.

By default, ubuntu can view and modify the contents in the windows partition but windows is unable to even see the ubuntu partition.

Installing windows xp first


So the mission began and installing windows was easy but it takes a while. Maybe about 25 to 30 minutes. So when I was asked about the partitions at the start I only created one 40GB partition and left the rest as free space. The rest of the installation is straight forward.

Let me say, windows xp is extremely fast on the clean installation. The time from computer startup to desktop is like 15 seconds. There is hardly any loading time for the operating system.

But I had a major problem. I had nothing in the "Network Connections" so I could not connect to the internet. The computer was connected to the router but I could not connect to the LAN. I believe some network adapter drivers are missing. But this is a separate issue I will discuss later.

Next installing ubuntu 8.10

The live feature available when installing ubuntu is very handy. It loads up quickly and you can use the operating system without having to install it. It detected being connected to my router automatically and I could browse the internet straight away. So its good how everything just works without having to do anything.

Then on the desktop there is a icon called "Install" which allows you to install ubuntu through a nice wizard. Everything is straight for apart from the Partition section.

There are a few options when decided where ubuntu will be installed.
  1. The first option is resizing an existing partition to make room for ubuntu. The problem was that it was only resizing the 40GB I had allocated for windows.
  2. There are 2 other options but both of them result is using the entire disk (120GB) for ubuntu.
  3. The last option was to setup the partition manually, but this requires some advanced knowledge regarding allocation of disk space required for ubuntu. Like allocation space for the root, swap etc
None of these is what I wanted. I already had 40GB for windows and I wanted to use the free space I had left.

After some researching, I found out there is a "Partition Manager" option in the "System" menu on the live running system. This allows you to manage the partitions on the disk.
You can add, edit and delete partitions.
So after some fiddling around, I created a FAT32 partition at the end of the disk and resized the windows partition to take up 80GB. Resizing partitions is quite simple because it involves dragging a rectangle to the size required.

Then I started the installation progress again and when I got to the partition section I selected the first option of resizing the windows partition which I changed to 80GB. So know is have 40GB for each operating system. The rest of the installation is straight forward.

Finally

Now its was time to restart the computer and to see which options I would be confronted. These are the options:
  1. Load ubuntu, the name started with ubuntu but there was lots of random text afterwards.
  2. This had the same text as the first but the "(Safe)" at the end
  3. There is an option to load another operating system.
  4. The last option is windows xp