Copy Path to Clipboard : Another Life Saver
Note. It works fine with Windows 7 as well.
ReSharper: Life Saver for Visual Studio Users
Unfortunately it's not free, but if you are doing open source development they give you it for free. Anyway, the cost isn't sky-high to purchase as well.
It's Cold Again
එලිය නුඹේ නැති වුනා ද
සීත අහසෙ රජ වුනා ද
නුඹ ආයෙත් සැඟ වුනා ද
2/22/11
(C) Saliya Ekanayake
Subscript and Superscript with MS Word 2007 Equations
If you want to type e1 with 1 as subscript just type e_1. The moment you hit space it will become what you want. To make 1 superscript type e^1 and space. Enjoy!
Open Cubicles and Work
Honestly, I really really don't like this setting. I wonder who came up with this idea of having people sit nearby in the open and work. May be people are thinking that having open cubicles give more freedom to people because they are not physically constrained by walls or doors. But have they ever thought the effect on mind? Does physical boundaries affect the same way to mind? In fact, I think it's totally the other way around. You cannot think effectively when you are in open with others. Essentially what happens is that you are physically free, but mentally constrained.
The truth with everyone, no matter how much they don't like to show it, is that they have unique ways of working optimally. This may include things like clapping and rubbing the hands when your code works and say "Oh! Sh*t" when it doesn't. Not to mention the luxury of thinking silently. How much of these can you do when you are in a professional setting surrounded by others? Also, how much actions of others can you tolerate. Here's one of my personal experience. A person who sat next to me used to sip his coffee so loud and end each sip with the sound "aah". I understand that it's how he likes to enjoy his coffee. That's perfectly fine, but for me that sipping was annoying and disturbing.
So in my view, if you want to work effectively specially when you have to think, open cubicles are nothing but jail to your mind. If you think I am crazy, think of theses (http://www.guardian.co.uk/books/2009/sep/19/books-written-in-prison). These guys were in prison physically, but they had all the "space" in mind to think. No I am not suggesting to go to prison to work :D.
Anyway, another good video on "Why work doesn't happen at work", by Jason Fried from one the TED talks can be found from here (http://www.ted.com/talks/jason_fried_why_work_doesn_t_happen_at_work.html).
Great Feedback: MapReduce In Simple Terms
WCF Hosting with IIS7
So I was clueless for a while, but luckily found this great article in WCF Tools team's blog, which mentioned that it may be because I installed Visual Studio prior to installing IIS. I did the simple command mentioned there and wow! it worked.
I will post a step-by-step guide in a later post on how to deploy your WCF Service in IIS7.
Hadoop: Writing Byte Output
public void reduce(Text text, Iterator<byteswritable> itr, OutputCollector<text,> output, Reporter reporter)
In the main method I used SequenceFileOutputFormat as the output format. But it turned out that this way I get output as a SequenceFile, which I cannot later read by a separate Java program to extract out the values. May be I am wrong here, but as far as my searching went on, I couldn't find a way to easily do this.
After being fed up with searching I thought of writing a custom FileOutputFormat just to suit my job. So I wrote this ByteOutputFormat class, which simply writes the value bytes as a binary file. So later I can read it using a normal (non Hadoop aware) Java program to extract the bytes.
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.BytesWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.io.compress.DefaultCodec;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.RecordWriter;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.util.Progressable;
import org.apache.hadoop.util.ReflectionUtils;
import java.io.DataOutputStream;
import java.io.IOException;
/**
* @author Saliya Ekanayake
*/
public class ByteOutputFormat<K, V> extends FileOutputFormat {
protected static class ByteRecordWriter<K, V> implements RecordWriter<K, V> {
private DataOutputStream out;
public ByteRecordWriter(DataOutputStream out) {
this.out = out;
}
public void write(K key, V value) throws IOException {
boolean nullValue = value == null || value instanceof NullWritable;
if (!nullValue) {
BytesWritable bw = (BytesWritable) value;
out.write(bw.get(), 0, bw.getSize());
}
}
public synchronized void close(Reporter reporter) throws IOException {
out.close();
}
}
@Override
public RecordWriter<K, V> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress)
throws IOException {
if (!getCompressOutput(job)) {
Path file = FileOutputFormat.getTaskOutputPath(job, name);
FileSystem fs = file.getFileSystem(job);
FSDataOutputStream fileOut = fs.create(file, progress);
return new ByteRecordWriter<K, V>(fileOut);
} else {
Class codecClass = getOutputCompressorClass(job, DefaultCodec.class);
CompressionCodec codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, job);
Path file = FileOutputFormat.getTaskOutputPath(job, name + codec.getDefaultExtension());
FileSystem fs = file.getFileSystem(job);
FSDataOutputStream fileOut = fs.create(file, progress);
return new ByteRecordWriter<K, V>(new DataOutputStream(codec.createOutputStream(fileOut)));
}
}
}
Hope this would be helpful for you as well.
MapReduce: Explained Simply as The Story of Sam
Command Line: Relaxing Colors
Background Color: #3A4237 (in RGB this is 58,66,55)
Text Color: White
It will give you this feeling of a good old chalk board. Here's a screen capture of how it looks.

Sinhala Poems by My Wife
I am waiting to see the poem written for me :D
Synergy: Share Keyboard and Mouse
1. Install Synergy on both machines.
2. Setup one machine as the server.
3. Add the machines left, right, top, and bottom of the server (if any).
4. Start synergy as client on those other machines.
That's it and it's working. Only thing is that all machines should be in the same network.
One cool thing is that clipboards of all machines are shared. So copy from one machine and paste in the other is possible. Also it enables you to activate screen saver on all machines at once.
Split View in Firefox

Split View in Eclipse
http://addisu.taddese.com/blog/split-windowview-using-eclipse/
Here's a screenshot of how it looks.

FireFox Keyboard Shortcuts
http://support.mozilla.com/en-US/kb/Keyboard+shortcuts
Internet Speed: Isn't this nice?
Windows7: Desktop Icons: CTRL + Wheel
Windows7 and Ubuntu 9.10
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.
Pidgin: Unable to Connect to 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 ;)
Design Defect: Dell E1505
Functional Vs Relational
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 :)
Identify Ports: Weird Holes in Your Laptop
Internet Explorer 8: Replacement for Chrome
Jython Web Service Framework
Record Scheme Sessions: Transcript
Running Matlab Remotely: ssh -X
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.
Funny Infinite Loop with C#
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";
}
}
Scheme Way: Eclipse Plug-in
Ubuntu 9.04: Way better than 8.10
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 :)
Scheme: Trace Functions
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.
GSoC and UoM: Who let the "sharks" out
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"
Running Scheme on Ubuntu 8.04
Here's the solution in brief:
sudo sysctl -w vm.mmap_min_addr=0
Now run scheme
Last Day at WSO2
Ubuntu: Resizing Partitions
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.
11 Year Old to Shake the Floor: Aiden Davis
Second Independence: A Day to Remember
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.
Label Cloud
Deploying WSO2 ESB in JBoss 5.0 GA
WSO2 in Wikimapia
IntelliJIDEA: A Feature I Like to See
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 :)
Huawei E160 on Ubuntu 8.04
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
Unlock Toyota Corolla 141
New Year Drink: Mango
3G Experience with Mobitel M3: Huawei E 160
WSO2 Carbon: Feature Packs
Java Regex: Check for non word characters
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
Batch Resize Images
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/
Playing with BlueProximity
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
Lectures at UoM
Build Your Own SOA Middleware
Access Vista from Ubuntu
For this example say your Vista user account is vista-pc and password is vista-pw. Also say the IP is 192.168.1.2
----Do the following in your Vista machine----
1. Start/Run secpol.msc
2. Open Local Policies/Security Options, find "Network Security: LAN Manager"
3. Change it to "Send LM & NTLM"
4. share the folder that you want (say movies)
---Do the following in your Ubuntu machine---
1. sudo apt-get install smbfs
2. sudo apt-get install smbclient
3. sudo mkdir /mnt/hd
4. sudo mount -t smbfs -o username=vista-pc,password=vista-pw //192.168.1.2/movies /mnt/hd
That's it :) You can now access the shared Vista folder from /mnt/hd
NBQSA Merit Award for Rampart2
Hard Times
I broke my spectacles and got a new pair from George Gooneratne Optometrists. Guess what? They have taken wrong measurements and I had to visit them again to replace the glasses with correct measurements. After spending about two hours at their lab I finally got my sparkling shiny spectacles.
The day after I was playing basket ball at WSO2 when I got hit by the ball right on my face at a most unexpected time. I was actually catching my breath and I look up only to see something crashing on to me. The shiny new spectacles were broken into pieces and my nose got wounded. The wounds were not that serious and I was lucky not to bleed internally. I found the broken frame of my spectacles and thought, hey that's not too bad because I still have the frame to which I can get a pair of glasses fixed. I put all the pieces into my bag and came home. The next day I was getting ready to go and get new glasses fixed. I collected broken frame and believe me, one side arm was missing. What the hell? I told myself. I searched every possible place I could look into but came up with nothing. Hmm, that's life, I thought and went to optometrist and get a new spectacle fixed.
The next day I was happy with my new spectacles and spent the day peacefully at WSO2. The entire day I was in a meeting and later in the evening I and the others were invited to dinner at an Indian restaurant. The food was okay, but it didn't sound right for me. The next morning I woke up to find that I am suffering from a very bad stomach ache. I spent the entire day at home unable to do anything. The medication came to effect only in the evening. Today is the second day of the very unpleasant "Digesting Error", and there is yet another day to go to end the week. I am expecting what next :)
Google Chrome - Fast and Elegant
Java Strings: literal.equals(param) OR param.equals(literal)
1. helloStr.equals("hello")
2. "hello".equals(helloStr)
Both will do fine, but which is the better one? I've been using the second form but never thought of the difference (hmm, that's bad ;) anyway people do remember certain things bit later). In one of the code reviews at WSO2 it was revealed. The first form can lead to a Null pointer exception in the case when the helloStr is null. The second option will save you from this since the literal "hello" is not null always and you are invoking a method of a not null object. In this case even if the helloStr is actually null it doesn't matter because it'll only cause the program to check "hello" against null which results false.
If you are checking two String references then you have no option, but always try to invoke the equals() from the most probably not null reference.
Little things do matter :)
Setup Browser in Pidgin
Fixing this issue, however, was pretty much easy ;) Open Pidgin, go to Tools --> Preferences --> Network. Then you can find a button saying Configure Browser. You'll get a tool window where you can set the command you want to execute in order to open up the browser. In my case FF2 can be started by issuing firefox-2 %s
Just that. It works fine :)
Apache TCP Monitor - How To?
The following blog posts too give an insight into this tool.
http://charithaka.blogspot.com/2008/08/how-to-use-tcpmon-inside-eclipse.html
http://www.keith-chapman.org/2008/07/using-tcp-monitor-to-debug-web-service.html
Internet in Two Machines
Anyway if you want to know about how to setup IP forwarding see the following links.
http://www.ducea.com/2006/08/01/how-to-enable-ip-forwarding-in-linux/
http://www.linuxforums.org/forum/linux-networking/64083-simple-ip-forwarding.html
Default Browser Settings in Thunderbird
The solution was to tell Thunderbird the path of the browser to open. You need to create user.js file inside your ~/.mozilla-thunderbird/xxx.default/ (the xxx means any weird set of letters and numbers, e.g. 20art4c7). Type (or edit the path as to suit your browser) the following lines into that file and save it.
user_pref("network.protocol-handler.app.ftp","/usr/bin/firefox-2");
user_pref("network.protocol-handler.app.http","/usr/bin/firefox-2");
user_pref("network.protocol-handler.app.https","/usr/bin/firefox-2");
That's it :)
XPath with Axiom
The tricky part is, how to work with Namespaces? To get an idea on to the matter consider the following XML document.

The following code fragment will retrieve the ns1:c1 element and the two ns2:color attributes of each element.
// root is the document
OMElement root = builder.getDocumentElement();
AXIOMXPath xpath = new AXIOMXPath("//a:c1");
xpath.addNamespace("a", "http://namespace1.com");
OMElement c1 = (OMElement)xpath.selectSingleNode(root);
System.out.println(c1);
xpath = new AXIOMXPath("//@b:color");
xpath.addNamespace("b", "http://namespace2.com");
List
System.out.println(colors.get(0).getAttributeValue());
System.out.println(colors.get(1).getAttributeValue());
The important line in this code is the xpath.addNamespace(prefix, uri) method. This prefix doesn't have to be the exact prefix used in the actual document (which in fact is not known in most cases).
That's it, have fun with Axiom :)
ATI X1300 with Ubuntu 8.04 (Hardy)
So I tried with the Unofficial ATI Wiki and it worked just as expected. Try method 2 mentioned here.
The great news is hibernation works with it :)
Convert ByteArrayInputStream to String
ByteArrayInputStream bais = // get your ByteArrayInputStream instance
int length = bais.available();
byte [] buff = new byte[length];
bais.read(buff);
That's it!!
@ WSO2, Inc.
I joined WSO2 Inc. on 12th May and it has been few busy days until today :). I am waiting for some build to complete and thought to jump in and blog on this.
I feel life has changed a bit compared with the life at the university, yet it is the same old me sitting in front of the computer :)
Repair Sony VAIO VGN FE855E Keyboard
I searched for keyboard replacements and found that they are expensive (Sony service require 169$ to replace a keyboard). There are refurbished keyboards available in e-bay for prices around 70$, but I couldn't get one since I live in Sri Lanka. The price and tax is too much if I deliver something from US. So I gave a go by myself. Bottom line is I fixed all the keys for a price just around 1$ (one dollar :)
I thought of giving the steps I followed in case if some one else is in trouble like me.
Step 1: Identify the not working keys.
You can simply use a text pad to type the keys and identify the ones that doesn't work. To test function keys you can do many things. The easiest thing I did was to run a program in command line and then to press function keys in the same shell (note you should not run the particular program you chose as a background process). There each time you press a function key some kind of symbols appear. So you can see if it works or not. See this is a very primitive way but it works.
Step 2: Removing the plastic plate of the key
In notebook keyboards the plastic key plate is clipped to an underlying plastic support mechanism. See the following picture (the bad key in this case is F11)
Use a small flat screw driver to lift the plastic plate from top left corner and bottom left corner. Note: If you are trying to remove normal keys (like A, B, etc.) then you need to lift from bottom left and bottom right corners of the key plate. Once removed you can see it as follows.
Step 3: Removing the plastic hinges
You can use the same screw driver to remove the white plastic hinges. See IraqiGeek's blog to see more information. One advice is that don't force too much on these small plastic items as they tend to break easily. Once removed you will see something similar to the pictures given below.
Step 4: Peeling off the rubber button
The next step is removing the rubber button. It is little bit hard and needs lots of patience. The rubber button is fixed to the same plastic sheet which contains the touch points. So it is virtually irreplaceable :). The option I selected was to cut off the rubber button. You need a sharp blade to do this. I used a razor blade. Once again, be careful when you cut because a single mistake could damage the underlying carbon contact lines, leaving no option other than to replace the entire keyboard. Once you cut it off you can see it as follows (the second image shows another bad key, i.e. Esc key).
Step 5: Finding a replacement rubber button
If you can get away with this step then you are basically done with repairing. If you see the two images above you can clearly see the carbon touch plats (see the thin white "s" shape in the place where the rubber button is taken off. That is the margin separating the two carbon plates). The keyboard simply works if you can somehow find a button which will contact these two plates when pressed. There are numerous solutions you can find in day to day stuff which can be used as a replacement. The one I found was a simple push button. You can easily find a similar type of thing any electronic parts seller. See the images given below.
The first image shows the small switch I found and the next one shows the rubber button of it removed. You can remove it simply by pulling off gently from the sides of the rubber button (Note: be careful not to tear it off). The third one shows the underside of the rubber button and you can clearly see the carbon dot in it. This is the one which get pressed on to the carbon plates of the keyboard. The side view of this button is given below (in fact this is the same side view of the original notebook's rubber button as well).
The replacement button I found had this problem that the distance of pressing is smaller than that is of the original button. So when you fix the key plate it acts much like a touch button. I didn't like that feeling. So I simply shorten the rubber cylinder by removing a part of it and gluing the two parts. This is though seems simple requires a lot of patience. So drink lot of water before you do this :D and take a deep breath. Ah! one thing I forgot to tell was that not all type of glues can be used to bond rubber. So better to find a super glue which can bond rubber. In my case I found a cheap Indian made super glue (I think the name was Evlico or something like that).
Once you adjust the pressing distance and the button is ready to go you need to one more thing. The rubber button used here acts as a vacuum when pressed and sticks to the key board's plastic sheet. So I made two tiny holes symmetrically. That way it becomes very easy to press and feels much like the original button. See the images given below. I think you can see the tiny holes.
Step 6: Replacing the key plate
First replace the plastic hinges. I think you can do it by yourself. The advice here is don't push too much if the thing isn't attaching. You may probably trying to fit it wrongly. Then place the key plate on top of the rubber button and gently push from four corners (you can hear the "tick" sound as you press which indicates the correct fitting of the plate).
This completes the repair and following is a list of additional rubber button replacements you can use.
1. The calculator touch pads have a nice a rubber membrane with touch switches similar to the one I used.
2. TV / VCR remote controllers too have nice rubber buttons inside.
3. There are various types of rubber push buttons available in the market. So better to find a similar one that suits your machine.
If you have any doubt on the matter just drop a reply to this post.
How to Access Linux (Ext2) Partitions from Windows OS
My Woodwork
Google Pages
This is some nice fact I've noticed but it may not mean anything. Have you seen a diagram of the brain from side view? I guess you probably have. Now try to keep your fingers in the right hand as if you are going for a fight (fisted). Then see your fist from side view. You will see a similar shape to that of brain. Isn't that interesting?
ATI x1300 with Ubuntu Gusty (7.10)
So here goes the answer
Good luck and have fun :)
Ubuntu 7.10 on DELL E1505 Notebook
The two most interesting features I see:
1. Read/Write facility to NTFS (Windows) partitions
2. Easy configuration of restricted drivers (no need to worry about setting up your ATI video card :)
I'm following Neural Networks class for my final year and I felt it's a cool subject. I'm still a newbie in this field. But I gave a try to implement a simple perceptron to train few logic gates. It was a cool experience.
We recently purchased a CDMA data phone and I wanted to connect to the Internet with Linux (Ubuntu 6.10). Try the following steps:
1. plug-in the USB cable (your cable should be Serial (phone side) to USB one).
2. sudo dmesg -c
you should see the following at the bottom
ti_usb_3410_5052 2-1:2.0: TI USB 3410 1 port adapter converter detected
if you see ti_usb_3410_5052: probe of 1-1:1.0 failed with error -5 after the above line then copy the following lines,
#TI USB 3410
SUBSYSTEM=="usb_device" ACTION=="add" SYSFS{idVendor}=="0451",SYSFS{idProduct}=="3410" \
SYSFS{bNumConfigurations}=="2" \
SYSFS{bConfigurationValue}=="1" \
RUN+="/bin/sh -c 'echo 2 > /sys%p/device/bConfigurationValue'"
and save them as /etc/udev/rules.d/026_ti_usb_3410.rules
Now run sudo dmesg -c again and you'll see the following two lines,
ti_usb_3410_5052 1-1:2.0: TI USB 3410 1 port adapter converter detected
usb 1-1: TI USB 3410 1 port adapter converter now attached to /dev/ttyUSB0
3. Now configure the /etc/wvdial.conf as follows, please note that you need to replace your given username, password and phone number with my configuration (abc@prepaid, 1234, #777) given here.
[Dialer suntel]
Modem = /dev/ttyUSB0
Baud = 230400
Phone = #777
Init1 = ATZ
Stupid Mode = 1
Dial Command = ATDT
Username = abc@prepaid
Password = 1234
4. Now type sudo wvdial suntel and enjoy the Internet. If you can't browse then plese add the DNS addresses to /etc/resolv.conf (these DNS addresses can be found in the command line while connecting).
Thanks Farhan Naeem for sharing knowledge on this matter
I loved watching Teenage Mutant Ninja Turtles cartoon when I was a little kid and now I got hand on the movie. I really like it, two thumbs up TMNT!!
Oh! boy, today we had our Advanced Operating Systems paper. It was one hello of a paper.
Anyway may be things happen for good. That's all I know :)
I and my roommate took an ADSL Internet connection to the boarding from Sri Lanka Telecom. It was great in the first few months. But now it sucks. We bought the package which advertises 512Kbit/s (kilo bits per second) down load speed and 128Kbit/s upload speed. But the damn thing won't support even 100Kbit/s download speed. Damn, that sucks.
The most funny thing is that their customer service guy came and inspect the system and said that he feels it's normal. Can you believe it? He even says if we don't like it then we better disconnect it. Yea that's what we wanted as a solution, yikes.
Google announce that code submission for GSOC 2007 is available few minutes before. The student's mailing list got fired with the news :) Everybody (including myself) was posting questions telling that link for the submission doesn't work. Oh! Leslie (at google) must have had a nightmare replying to those emails and we really appreciate your kind and speedy responses.
The mailing list became like a chat room with mails flying within seconds :)
PyDev - Python Development Plug-in for Eclipse
Tip for Linux users: When you go to configure the python interpreter use /usr/bin/python (the tutorial explains only for Windows users )
Is it a miracle that I'm going to talk about? No, it came to life on 17th July 2007 at CS&ES (Computer Science & Engineering Society) AGM (Anual General Meeting).
I was asked to display fire on a block of ice for the AGM. Yea, I did it at the end and it was better than expected. The simple theory behind was burning Trimethylbenzene (a.k.a. paint thinner) on top of ice. Hmm, it's easy to say than do. There were several challenges to face, i.e. what happens when ice melt down due to heat, how to stop spreading fire, how to ignite thinner automatically, how to make an ice cube with a carving to fill thinner, etc. Oh! boy it was a night mare to think all of this.
I tried with few prototypes and they all worked fine. The most interesting part was the igniter. I used two clutch pencil leads touching together with applied voltage of 12V to ignite a match stick. I created a simple stand to hold the thing (unfortunately it was burnt with the fire before I could take a picture) so that giving the power would do the job.
I'm greatly disappointed because no one had taken a picture of the burning ice. Anyway it was a great experience and I'm really happy with the success.
I need to mention few of my friends who helped me to make it a success. They are Rajika (one big thank to this guy), Dinesh (it was his idea to burn ice), Charith, Malaka and Tharindu (they helped me with the final touches).
Fibonacci Calculator in Visual C++
#include
using namespace std;
int calculate_fibonacci(int n);
int main(int argc, char* argv[])
{
int n;
cout << "Enter n: "; cin >> n;
cout << "Fibonacci of " << int="" b="1," bb="0," return="" else="" if="" n="="> 1) {
for (i = 1; i < result =" 0;" bb =" b;" b =" result;">
C plug-in for Eclipse - CDT
Little bit of googling came up with this wonderful tool, CDT. It's a plug-in for Eclipse and you can do a great lot of things with C with rich IDE features. Try this tutorial to learn about the plug-in.
He was one of the great lecturers in the University of Moratuwa and it's my great condolence to mention that he has passed away today. He taught us the principles of Electronics and he showed his expertise throughout his teaching, yet he was a very kind teacher.
He left us with a blank which would hardly get filled in the near future. May you attain nibbana dear sir!
Did you ever think about automatic level tools. Hmm, Black and Decker has thought about it and has given this wonderful laser level, Bulls Eye. The demo is really cool. I also like their Handisaw. I've used several Black and Decker products (can opener, vacuum cleaner, iron and toaster) and all of them were of great quality. Hmm I wish I could buy one of those Handisaws from Sri Lanka :)
The Department of Computer Science & Engineering organizes a toy car race each year for the new comers. The first year entrants to the department are grouped and given the task of creating a remote controlled (not RF controlled actually, hmm I wonder why it is ?) toy vehicle which is to be powered by a 12V DC power source. Eventual grading (not GPA) includes a test run of each vehicle on a track made with few obstacles.
This event is really cool. Bad thing I miss this chance since this event with the batch junior to us. Anyway I'm really interested in such events because I personally believe that students should have some skills to build things rather to design them in papers. Yet it is little bit pathetic to see the construction of vehicles of some groups. One student has tried to give the power of the motor directly to the wheel. I wonder why such situations arise because even they know that it is not the case in any toy. They need to use gear wheels. I hope things would get corrected with time as students begin to like the event.
Good work CSE :)
Ency
Google Summer of Code 2007
Ah! I was able to configure the ADSL router at last. The username and password provided by the ISP did not work. Can you believe it? I was astonished when I received the "authentication failed" error. The 24hr help center, however, gave me the clue to change the password. Luckily I had a dial-up connection as well. At last it worked. Gosh! what a fun it is to play with something new.