Saliya's Blogs

Mostly technical stuff with some interesting moments of life

Internet Speed: Isn't this nice?

1 comment
In Sri Lanka, I used to connect to Internet using dial-up connection before ADSL came in. Then I felt "wow! ADSL is fast". But today here in IU, I would say "WOW! what a speed". See the picture below to see why I say this.




1 comment :

Post a Comment

Windows7: Desktop Icons: CTRL + Wheel

No comments
I wanted to change the size of the icons in Windows7 desktop as they were bit larger than I like. The solution was a simple one, though I had to do some Googling to find it out.

Just scroll the mouse wheel while pressing CTRL key. That's easy :). In fact, it can be used in many other places like in windows explorer to change the way how items are showed.

No comments :

Post a Comment

Windows7 and Ubuntu 9.10

1 comment
I just wiped out my Dell Insipiron E1505 notebook and installed Windows7 Professional and Ubuntu 9.10. I had enough of the Windows XP Media Center Edition. I thought of moving to Ubuntu 9.10 as well, just feel the fun.

Unlike in the previous experience with Windows, the Windows 7 performs really well. Regarding Ubuntu, it's better than 9.04 (I was happy with 9.04 as well). The only funny thing is that I had to find drivers and manually install my ATI Raedon X1300 VGA for Windows7. Earlier I used to do this for Ubuntu installations :)

For the moment, these two OSs seems to be a great combination if you are planning to get the best of both worlds.

1 comment :

Post a Comment

Pidgin: Unable to Connect to Yahoo

No comments
Pidgin was giving trouble when connecting to my Yahoo account since recently. Today I got to know that it's because of this (http://www.celticwolf.com/useful-information/faqs/26-pidgin-yahoo).

Then I wanted to install a latest version of pidgin on my Ubuntu 9.04. I tried the "how to" given in the official pidgin site (http://www.pidgin.im/download/ubuntu/), but it was unsuccessful. Then I came across these debs (http://linux.softpedia.com/progDownload/Pidgin-Download-6.html) which solved the issue.

Just a quick how-to:

1. Download the i386 (or amd 64) debs
2. Download the two DEB ALL debs
3. Use dpkg -i to install the debs. Start with libpurple-bin_2.6.3-1~getdeb1_all.deb.
Then libpurple0_2.6.3-1~getdeb1_i386.deb (or amd 64 one).
Now move ahead with pidgin-data_2.6.3-1~getdeb1_all.deb.
Next pidgin_2.6.3-1~getdeb1_i386.deb (or amd 64 one)

That's it! no more troubles with Yahoo ;)

No comments :

Post a Comment

Design Defect: Dell E1505

1 comment
See what has happened to the paint and you can understand the defect. Dell, you really need to think more on the paint material :)

1 comment :

Post a Comment

Functional Vs Relational

No comments
After sweating my brain over functional programming in Prof. Daniel Friedman's class over the past several weeks, I got the chance to play with relational programming with miniKanren.

It took me some time to adjust my brain to accept the difference. Finally, I told myself

"Going to the grocer and paying for what you got is functional programming, but going to the grocer and handing over 10$ asking to give whatever that fits is logic programming"

Just a thought :)

No comments :

Post a Comment

Identify Ports: Weird Holes in Your Laptop

No comments
Ever wondered what is the purpose of a weird shape hole in your laptop? I did and luckily I found this nice site (http://techplore.com/technology/know-your-connectors-ports-a-visual-guide/) with all the info I needed.

No comments :

Post a Comment

Internet Explorer 8: Replacement for Chrome
No comments
After installing Windows7 on my machine, I went on installing my usual set of software including Google Chrome. But, I wanted to test InternetExplorer 8, which is the default browser, as well. So why wait, I started using it. Wow! I have to admit that it's cooler than Chrome. Why I say this mostly because it has a nice set of customizable accelartors. Also so far it is reliable than Chrome in Windows7. Moreover, it's way better than IE 7, which I consider as a pretty bad version of IE.


No comments :

Post a Comment

Jython Web Service Framework

1 comment
My friend, Heshan, has done an interesting work to provide a framework extension to Axis2 which enables Jython based Web services and clients. Read more on his article (http://www.ibm.com/developerworks/web/library/wa-jython/)

1 comment :

Post a Comment

Record Scheme Sessions: Transcript

No comments
Ever wanted to save what you type in your Scheme interpreter? I wanted :). So after a small Google search I found these nice two commands.

To start recording type,
(transcript-on "filename")

To end recording type,
(transcript off)

That's it. Now your session is saved in the file given by you.

No comments :

Post a Comment

BGT: The Humble Peformer

No comments
I've been watching Britain Got Talent (BGT) for some time now and I've never come across a performer so humble like Eugene.

Really touching video, yet happy for his courage to come forward.

No comments :

Post a Comment

Running Matlab Remotely: ssh -X

4 comments
I wanted to run Matlab by logging into the university account remotely from my machine. Everything went fine except for the graphics. Matlab started in no graphics mode.

After bit of a search I found the solution. You have to set the X11 forwarding in you ssh configuration file. Here's how to do it.

1. cd /etc/ssh
2. sudo vi ssh_config
3. uncomment the lines "ForwardAgent" and "ForwardX11". Set their values to "yes"
4. sudo vi sshd_config
5. uncomment "X11Forwarding" and set it value to "yes" as well.

that's it and you are good to go.

Type ssh -X username@domain

To test if everything works fine try running xclock once you log in. It should open up a graphical clock window.

4 comments :

Post a Comment

Funny Infinite Loop with C#

No comments
What will happen when you run the following C# code? It's a never ending loop. Oh! really? yea, note the "Name" inside set method. I have used uppercase N. Now it will call setter recursively.

Interesting isn't it? :)


public class Person
{
private String name;
public String Name
{
set
{
System.Console.WriteLine("assigning wow");
Name = value;
}
}
}


public class Hello
{
static void Main()
{
Person person = new Person();
person.Name = "wow";
}
}

No comments :

Post a Comment

Scheme Way: Eclipse Plug-in

15 comments
I thought of searching for an IDE for Scheme, after being bit lazy to learn Emacs. Lucky enough I found a nice plugin for Eclipse named SchemeWay. It took me a bit of time, however, to configure and set up the plug-in to work as I like.

If you are struggling to set it up (as I did) here are few steps to help you with.

1. Download Eclipse from http://www.eclipse.org/downloads/. I chose the classic version

2. Download SchemeWay update pack from

3. Unpack the UpdateSite-1.3.0.alpha7.zip and copy the stuff inside plugins and features folders to eclipse features and plugins folders.

4. Start Eclipse and go to Help --> Install New Software.

5. Click Add on the on the Install window you get. It will give you a small window with two text boxes.

6. Click Local next to the Name text box. Now you can browse to your extracted folder of the SchemeWay update pack.

7. After couple of Ok presses Eclipse will show that it found the SchemeWay plugin. Then go ahead and install it.

8. Once everything is done, you can switch to the Scheme perspective from Window --> Open Perspective --> Other --> Scheme

9. Next task is to set the Scheme interpreter. I use the free version of Chez Scheme (i.e. Petite). So I have to set my interpreter as an external interpreter. To do this click Scheme --> Select Interpreter --> External Interpreter.

10. Now you have to give the necessary parameters to the plug-in to start your interpreter. To do this click Window --> Preferences. It will show you the preference window. On the left hand side of it you can expand the Scheme configurations. Select the External Interpreter configurations from there and set the necessary parameters.

Great! now you are good to go. Just create a new project and add a new Scheme source file. Then once you are done with typing your code, you can load it to the interpreter using CTRL+SHIFT+L.

You can play around a bit and get use to many other key short cuts.

One thing to note: you will have to set the indentation for some definitions to suit your style. You can do this by going to the same scheme configuration from Window --> Preferences.

15 comments :

Post a Comment

Ubuntu 9.04: Way better than 8.10

No comments
I have used Ubuntu since it's version 6.04 simply because I felt that it is easy to work with. Anyway, for me, the versions x.04 never gave a good impression. So I used to say "hey! if it's not a x.10 version then it's not what I like". Interestingly, I am finding it is hard to say with Ubuntu 9.04.

Here's a list of things I felt really cool with 9.04.

1. No configuration necessary for the ATI drivers. Yea I had a really fun time configuring stuff with 8.04, 7.10, and 6.10 (Um, I can't remember what I did with 6.04).

2. External display detection is really awesome. It can even arrange the displays in any order I like (e.g. external one on top of default one).

3. Intel wireless card works like a charm.

4. Easy configurations for printers; hmm, I should really admire this.

5. Reliable (so far). Didn't crash, didn't reboot with errors, and most interestingly hibernate seems to work better than in previous versions.

6. Improved graphics.

In summary, I am beginning to like x.04 s as well :)

No comments :

Post a Comment

Scheme: Trace Functions

1 comment
I found this really useful command in Scheme which helps to trace the function calls, while playing around it.

Say you have define a function named func. Now if you want to trace how it works when you invoke it, just type this.

> (trace func)

The next time you invoke func you will see the trace of function calls.

1 comment :

Post a Comment

GSoC and UoM: Who let the "sharks" out

1 comment
"...University of Moratuwa in Sri Lanka continues to dominate the field with 22 students accepted."

Wow! am I not happy to see this line in the Internet? I truly am. As a former student of University of Moratuwa, Sri Lanka, I am really happy to see the continuous achievement of its student in Google Summer of Code. To think of the fact that I too was a contributor to this success, makes me happy even more.

Keep up the good work "sharks"

1 comment :

Post a Comment

Running Scheme on Ubuntu 8.04

1 comment
Just hitting "scheme" in the console does no good if you are in Ubuntu 8.04. A workaround is explained here (http://ubuntuforums.org/showthread.php?p=4868292)

Here's the solution in brief:

sudo sysctl -w vm.mmap_min_addr=0

Now run scheme

1 comment :

Post a Comment

Last Day at WSO2

1 comment
It has been nearly 14 months since I joined WSO2. Gosh! I feel I joined just yesterday and I strongly believe that it is the wonderful community at WSO2 which made it so pleasant. Today, the time has come to say good bye, yet I am wondering how. It is hard to let go of a place you like.

I am truely grateful to Dr. Sanjiva Weerawarana for giving me the opportunity to work at WSO2 and supporting me to prepare for my future endeavors. Mr. Ruwan Linton played an invaluable role as my team lead and gave the confidence to move forward. Mr. Asankha Perara too did the same prior to Ruwan. My heartiest thanks for you two. I would like to give my sincere gratitude to the rest of the WSO2 team as well for being very much supportive throughout this time.

WSO2 a place like no other!



1 comment :

Post a Comment

Ubuntu: Resizing Partitions

No comments
"No space left on device": Damn, how did this happen?, I told my self. I am pretty sure that I gave enough space for my home partition to carry on with Maven builds at WSO2. Out of curiosity, I issued df -h to see the partitions. Gee, I have accidentally assigned the larger partition to / (root) and smaller one for the home. The only solution is to resize the partitions. After a while, I remembered the great tool that comes with Ubuntu distribution, i.e. gparted.

I booted my machine using an Ubuntu CD and ran gparted. I was very much pleased with its graphical view and was done with my problem in just minutes. Initially my paritions were like,

|------------home----------|--------------/ (root)---------------------------------------------|

After resizing it looked like,

|----------------home----------------------------------------|----------------/ (root)---------|

I was pretty happy with this little tool since it saved me from one hell of a trouble.

No comments :

Post a Comment

Marriage: A Step Forward

7 comments
Kalani and I got married on 29th May 2009 after being in love with for nearly five years.



7 comments :

Post a Comment

Flash Demo: WSO2 ESB, Mashup Server

2 comments
WSO2 ESB is a feature rich light weight Enterprise Service Bus. If you are new to what it has to offer, just see the 4 minute flash demo.

WSO2 Mashup Server is another cool product which let you instantly create mashups. See demo for this too.

2 comments :

Post a Comment

11 Year Old to Shake the Floor: Aiden Davis

No comments
I was astonished to see this video of Aiden Davis performing on BGT 2009. I really liked George Sampson on last year BGT. Aiden simply is better than him in dancing. Wow! I was thrilled

No comments :

Post a Comment

Second Independence: A Day to Remember

No comments
LTTE brought terror for the last 30+ years in Sri Lanka. They claimed to represent Tamils, but it is a lie to protect their acts of violence. They gave no peace for the Tamils nor for Sri Lankans. The cowardly acts of suicide bombing, child soldiers, and killing of innocent civillians revealed us just one thing about LTTE, i.e. their hatred towards peace.

It is of great pleasure to hear that SL forces have put an end to all this terror by killing the leader of LTTE, the coward Velupillai Prabhakaran. This is the second independence day that we should celebrate.

All the blessings and thanks should go to the brave soldiers and the leader, the President Mahinda Rajapakha for giving hope which eventually became the reality.

No comments :

Post a Comment

Label Cloud

No comments
I just added a nice label cloud to my blog. Gosh! I now understand that I should have organized my labeling properly :)

No comments :

Post a Comment

Deploying WSO2 ESB in JBoss 5.0 GA

No comments
It is nice to users themselves trying out new things with WSO2 ESB. Now, Ramanathan has found the steps necessary to deploy WSO2 ESB in JBoss 5.0 GA. Here is the link to his blog entry (http://wso2.org/blog/ramanathan/5318)

No comments :

Post a Comment

WSO2 in Wikimapia

No comments
I just saw WSO2 Inc. in Wikimapia

No comments :

Post a Comment

IntelliJIDEA: A Feature I Like to See

2 comments
Recently I was doing some tiresome debugging with Java using IntelliJIDEA. It was then that I thought that there is a great improvement we can do. This is totally my imagination, so I am not sure on any implementations in the Internet (yet).

The IDEA enables you to put debug points. These debug points may serve in creating a virtual path to traverse through the code. Thus, you are able to quickly jump to the next important point of code by just hitting F9. All this works really well for your debugging scenario. Now, what if you want to debug a different scenario, yet do not want to remove the older debug points? Then you have no option other than to add any new break points for the new scenario along with the older break points. This works okay, but makes the life bit hard since F9 will jump to points which are useless for the new scenario.

So what I suggest is to have a mechanism to define break points separately for each debugging scenario. So when you place a break point you can give it a scenario ID and inform the debugger to follow the break points for the relevant ID. It will be like layers that you find in Adobe Photoshop. You can on/off layers. Similarly we can deactivate a set of debug points based on their ID.

I wonder what JetBrains would think about this :)

2 comments :

Post a Comment

Huawei E160 on Ubuntu 8.04

No comments
Recently, I subscribed to a 3G Internet connection provided by Mobitel. The modem I purchased is Huawei E160. Just like the most other plug-n-play devices this gadget did not include drivers for Ubuntu :). Anyway, I decided to give a try to set it up and voila! it worked.

E160 has two modes of operation. It can act as a GSM modem and a data storage. So when you plug it in under Ubuntu it will attach it under one of these modes. If your network manager is older than version 0.97 then you it will normally get attached as a data storage device. You can see info on this by reading the kernel ring buffer with dmesg -c command (you will need root privileges, i.e. sudo dmesg -c). If it get attached as an storage device use usb_modeswitch to change its mode to a GSM modem.

If everything went well then the rest is pretty easy. You will need to install wvdial (i.e. sudo apt-get install wvdial). Then edit the /etc/wvdial.conf file to include the following settings. Note: these are valid only with Mobitel M3 service in Sri Lanka. You may have to change some settings depending on your service prvoider.

[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 3600000
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 =
Area Code =
Phone = *99#
Username = ppp
Password = ppp
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 0
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1


Now execute sudo wvdial and that's it. You are ready to go online with E160 :D

No comments :

Post a Comment

Unlock Toyota Corolla 141

1 comment
On the eve of the Sinahala New Year, I was with my parents in our village. All the members of my mother's family were there to enjoy the occassion. Everything went fine until I accidently locked the car while the key was inside. The situation got worse when we found out that the extra key was inside the car as well. 

After trying out things in "Gone in 60 Seconds" I realized that they were not going to work. One of my relatives, however, found the dust hole cap of the driver's seat and tried to push the carpet hoping to create an entrance into the car. Aha! luck strucked, the carpet elevated the trunk opener and trunk popped. We were, yet, no way near to any of the keys in the car. Then I thought I could slide my hand through the joint of the back seat to grab the extra key. Oh! boy it was hard. So left with no hope, we searched for other ways to get in. 

The elder son of my aunt, however, was able to slide his hand without getting stucked and finally was able to grab the extra key, which was on the back seat. So much fun for the New Year :)

So here are few tips to avoid yourself getting into this situation.

1. Keep the extra key at home
2. Check the key before locking the car
3. If your key has a tag number keep it written in your pocket (this number can be used to cut an extra key for your car from the dealer)

Now the bottom line is that things in your trunk are not safe since it can easily be popped ;)

1 comment :

Post a Comment

New Year Drink: Mango

1 comment
Just before the Sinhala New Year I got the chance to taste a raw mango with salt and pepper. If you have not tried this before then my advice is do it today itself. Yep, the taste is awesome :)

Anyway, while eating I wanted something to drink as well. Um, so why not try a mango drink, I felt. 

What you need:
1. A raw mango (gira amba, rata amba, pol amba) except for karthakolomban
2. A mug (yea, who wants to get satisfied with just a cup of water) of water
3. Two table spoons of sugar (depends on your likeness)
4. Salt (very little)

How to:
1. Clean and peel the mango
2. Slice the peeled mango into small sections
3. Put the mango pieces into a blender and add water
4. Blend the mixture till you get a nice light greenish color
5. Filter the final mixuture to a jug and add sugar and salt as you like
6. Add two ice cubes and drink it.

Enjoy the drink while you wait for the New Year !

1 comment :

Post a Comment

3G Experience with Mobitel M3: Huawei E 160

5 comments
After relocating ourselves back to the village, I missed the luxury of Sri Lanka Telecom's (SLT) ADSL broadband connection. CDMA was the saviour till yesterday. Suntel, thogh charge a little bit than other providers, gave a fairly good connection (note: fairly good is w.r.t. the available connection speeds in Sri Lanka). 

Anyway, the need for a high speed connection grew pretty quickly. I tried Dialog, but it seems they do not have the 3G coverage out here. Taking bit of a risk, I decided to purchase a Mobitel connection. Honestly, their customer service was great. The only thing I did not like is the vendor locking of the 3G modem. I mean, the modem is from Huawei, so why do they want it to be locked only for Mobitel SIMs?

Regardless, of the vendor locking the connection was satisfactory with 3.6Mbps. I had to purchase a separate antenna for better reception, yet it is worth the price.

5 comments :

Post a Comment

WSO2 Carbon: Feature Packs

No comments
I just realized the flexibility of WSO2 Carbon when I tried to install Business Process capability into WSO2 ESB, which is based on WSO2 Carbon.

Simply extracting and copying the bundles in the feature pack does the job. Try it out at http://wso2.org/downloads/carbon/feature_packs

No comments :

Post a Comment

Sri Lanka and GSoC

No comments
Sri Lankan students gave a huge impact on Google Summer of Code 2008. This is a video by ICTA on that where my good friend Heshan and others giving out there idea on GSoC.

No comments :

Post a Comment

Java Regex: Check for non word characters

2 comments
I wanted to test a given string to see if it contains any non word characters in Java. Initially I came up with a lengthy version ;) Then after a bit of search I could simply shorten it.

Version1: regular expression

"\\p{Alnum}*[~!@#$%^&*()\\+=\\-:;<>\\s?\\[\\]{},/\\\\\"]+\\p{Alnum}*"

Version2: regular expression

"\\p{Alnum}*\\W+\\p{Alnum}*"

Here's a nice guide (http://java.sun.com/docs/books/tutorial/essential/regex/index.html) to start with Java regular expressions

2 comments :

Post a Comment

Java Threads and Concurrency

No comments
The Sun's tutorial (http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html) on concurrency with Java is a great place to start with multi-threading.

Have fun with threads :)

No comments :

Post a Comment

Batch Resize Images

2 comments
I was searching for a tool to scale images batch wise in Ubuntu and it seems that ImageMagick is just the one for it. Here's how you can get it working as well.

Step1: install ImageMagick

$ sudo apt-get install imagemagick

Step2: go to the images folder and type

$ mogrify -sample 1280 x 800 *.JPG

Here 1280 x 800 is the final size you want and *.JPG is the file set.

To get more info on command options, visit http://linuxuser32.wordpress.com/2007/06/16/batch-image-convert-scale-thumbnail-jpegs-pdf/

2 comments :

Post a Comment

Playing with BlueProximity

No comments
I recently came across this nice blog which had a post on locking the screen automatically. Anyway after seeing the comments I found it will be interesting to use Bluetooth to achieve this. I wanted to write some script on my own to get it done. Anyway as an initial step I tried BlueProximity which comes with Ubuntu. Here is a list of steps to get everything working.

1. Install blueproximity:
$ sudo apt-get install blueproximity

2. Pair up your computer with your phone using Bluetooth. You can use System -> Preferences -> Bluetooth to do so.

3. start blueproximity:
$ blueproximity &

You will see the blueproximity icon appearing on your system panel.

4. Configure blueproximity to suit your likings, i.e. the distance after which your screen will get locked, time duration, etc.

That's it.

Anyway it is not kicking unless I can write my own code :D

No comments :

Post a Comment

Lectures at UoM

1 comment
I started lecturing Data Structures and Algorithms to Level 2 students of the Dept. of Computer Science and Engineering, University of Moratuwa, Sri Lanka. Overall, it is a great experience and I really enjoy it. The bottom line that I understand is that it is only when you start teaching that you understand that you have to learn more ;)

1 comment :

Post a Comment

Build Your Own SOA Middleware

No comments
If what comes out of the box does not suit your way of SOA requirements then try out WSO2 Carbon. The ebook (http://wso2.org/project/carbon/making_good_soa_great.pdf) says it all.

No comments :

Post a Comment

Beautiful Sri Lanka

2 comments

2 comments :

Post a Comment