PyDev - Python Development Plug-in for Eclipse
Saliya Ekanayake
Oh! yes, I'm loving this Eclipse! Now I can use it to develop python programs. Use pydev plug-in and you can really give a go with it :) Here is a nice tutorial explaining step by step on how to use the plug-in.
Tip for Linux users: When you go to configure the python interpreter use /usr/bin/python (the tutorial explains only for Windows users )
Tip for Linux users: When you go to configure the python interpreter use /usr/bin/python (the tutorial explains only for Windows users )
Saliya Ekanayake
Fire on Ice
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).
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).
8:05 AM
Fibonacci Calculator in Visual C++
Saliya Ekanayake
#include "stdafx.h"
#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;">
#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;">
7:02 AM
c++
,
Fibonacci
,
non recursive
C plug-in for Eclipse - CDT
Saliya Ekanayake
Ever thought of using an IDE in Linux to type C? For pure C guys this is not a problem because they have the nice little VI or VIM. Yea it's very true that you can do a great lot of things with VI. The only problem for me was that I used to do a lot with Java using Eclipse. So suddenly when I wanted to use C for one of my assignments I found it very difficult to adapt with it.
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.
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.
9:14 AM
C development
,
CDT
,
Eclipse
Saliya Ekanayake
Dr. D. A. I. Munidradasa has Passed Away
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!
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!
1:49 AM
Saliya Ekanayake
Innovative Tools
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 :)
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 :)
1:27 AM
Saliya Ekanayake
CSE Formula
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 :)
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 :)
6:57 AM
Ency
Saliya Ekanayake
I have developed a little tool to embed text messages inside image files using Java called Ency. I'm really interested in this steganography and security stuff. Ency is in its primary stage. It needs more modifications to step into maturity. I found this nice link explaining about steganography while trying to improve Ency. Enjoy hidden messaging with Java ;-)
11:02 AM
ecny
,
steganography
Google Summer of Code 2007
Saliya Ekanayake
My proposal on implementing C14N based on Axiom for Google Summer of Code 2007 has been accepted. Wow! I really feel excited. Thanks specially for Ruchith Fernando for being the mentor of this project. Thanks for everyone else as well who thought to give a vote for the proposal.
10:43 AM
2007
,
gsoc
,
XML canonicalization
Saliya Ekanayake
ADSL is Up and Running
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.
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.
10:35 AM
Saliya Ekanayake
8:20 PM
Installing ATI X1300 Raedon Mobility Display Driver in Ubuntu Edgy(6.10)
Saliya Ekanayake
I was able to configure my graphics card (ATI X1300 Raedon Mobility) on my Dell Inspiron E1505 laptop from this nice link. However, I was bugged with the error "Xlib: extension "XFree86-DRI" missing on display ":0.0".". Then I found out that deactivating the composite extension in /etc/X11/xorg.conf would do the job.
Here's what I did from the beginning:
Here's what I did from the beginning:
sudo apt-get update
sudo apt-get install xorg-driver-fglrx
sudo apt-get install linux-restricted-modules-2.6.17-10-generic
sudo depmod -a
sudo aticonfig --initial
sudo aticonfig --overlay-type=Xv
Now edit the /etc/X11/xorg.conf to include following three lines
Section "Extensions"
Option "Composite" "0"
EndSection
Note: You need to have root privileges to edit this file. So use the command sudo vim /etc/X11/xorg.conf
Then add the following line to /etc/modules
fglrx
Note: You need to have root privileges to edit this file. So use the command sudo vim /etc/modules
Finally press ALT+CTRL+Backspace to restart XServer
Type fglrxinfo in a terminal to verify your installation. You should see something like this
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon X1300 Generic
OpenGL version string: 2.0.6011 (8.28.8)
Now it's DONE :)
Saliya Ekanayake
Setting up ATI Raedon X1300 (128MB) for Ubuntu Edgy on Dell Inspiron E1505
I was trying to configure my graphics card in Ubuntu Edgy and I found this blog which explained the procedure in a nutshell. However, there is a link to setup repositories which directs to a lengthy page. So to get it done in a nutshell too follow this link.
I was trying to configure my graphics card in Ubuntu Edgy and I found this blog which explained the procedure in a nutshell. However, there is a link to setup repositories which directs to a lengthy page. So to get it done in a nutshell too follow this link.
10:31 PM
Java Threads - Simple Example
Saliya Ekanayake
public class MyThreadExtendingThread extends Thread{
public void run(){
for(int i = 0; i < 100000; i++){
System.out.println("child 1 says - " + i);
}
}
}
public class MyThreadImplementingRunnable implements Runnable{
public void run(){
for(int i = 0; i < 100000; i++){
System.out.println("child 2 says - " + i);
}
}
}
public class ThreadTester {
public static void main(String[] args) {
/* Ok think of a thread as a child in your class. You ask the child
to count from 0 to 100000. You as the teacher starts counting with the child.
But you two count on two different "threads" so you don't have to wait till
the kid is finish counting.
Let's see this in java - run and see
*/
//MyThreadExtendingThread extends java.lang.Thread class
MyThreadExtendingThread t1 = new MyThreadExtendingThread(); // create a kid to count
t1.start(); // ask the kid to start his job (in this case counting)
/*MyThreadImplementingRunnable implements java.lang.Runnable interface
so if you have to create an instance out of java.lang.Thread class
and pass an instance of your MyThreadImplementingRunnable to it. Then call start()
method of the java.lang.Thread instance
*/
Thread t2 = new Thread(new MyThreadImplementingRunnable()); // create another kid
t2.start(); // ask the kid to start his job (in this case counting)
// you also start counting
for(int i = 0; i < 100000; i++){
System.out.println("Teacher says - " + i);
}
}
}
public void run(){
for(int i = 0; i < 100000; i++){
System.out.println("child 1 says - " + i);
}
}
}
public class MyThreadImplementingRunnable implements Runnable{
public void run(){
for(int i = 0; i < 100000; i++){
System.out.println("child 2 says - " + i);
}
}
}
public class ThreadTester {
public static void main(String[] args) {
/* Ok think of a thread as a child in your class. You ask the child
to count from 0 to 100000. You as the teacher starts counting with the child.
But you two count on two different "threads" so you don't have to wait till
the kid is finish counting.
Let's see this in java - run and see
*/
//MyThreadExtendingThread extends java.lang.Thread class
MyThreadExtendingThread t1 = new MyThreadExtendingThread(); // create a kid to count
t1.start(); // ask the kid to start his job (in this case counting)
/*MyThreadImplementingRunnable implements java.lang.Runnable interface
so if you have to create an instance out of java.lang.Thread class
and pass an instance of your MyThreadImplementingRunnable to it. Then call start()
method of the java.lang.Thread instance
*/
Thread t2 = new Thread(new MyThreadImplementingRunnable()); // create another kid
t2.start(); // ask the kid to start his job (in this case counting)
// you also start counting
for(int i = 0; i < 100000; i++){
System.out.println("Teacher says - " + i);
}
}
}
Enable Opening of .rar Files from Ubuntu Archive Manager
Saliya Ekanayake
Download the (latest) rar http://files.rarlab.com/rar/rarlinux-3.6.0.tar.gz
Extract the content using tar -xvvzf rarlinux-3.6.0.tar.gz
Copy the file "rar" inside the extracted folder to "usr/bin"
That's it and now archive manager can open .rar files.
Extract the content using tar -xvvzf rarlinux-3.6.0.tar.gz
Copy the file "rar" inside the extracted folder to "usr/bin"
That's it and now archive manager can open .rar files.
Saliya Ekanayake
Internship at WSO2
Tragedy struck for entire world when passenger air planes were used as "bombs" to attack USA. But for my part of the story I started my internship at WSO2, Inc. exactly after 5 years.
It's the fourth day of my training and the most interesting thing is that all the team members are so helpful and friendly. Wow what a relief to be with such great spirits.
Thanks WSO2
Tragedy struck for entire world when passenger air planes were used as "bombs" to attack USA. But for my part of the story I started my internship at WSO2, Inc. exactly after 5 years.
It's the fourth day of my training and the most interesting thing is that all the team members are so helpful and friendly. Wow what a relief to be with such great spirits.
Thanks WSO2
2:27 AM
Saliya Ekanayake
Sinhala New Year
It is Sinhala New Year in Sri Lanka. 13th and 14th of April are the Sinhala New Year days in our country. There are lots of traditional events are organized through out the country to celebrate the up coming Sinhala New Year. Ah! I almost forgot the sweets. The sweetest traditional sweets and various other food stuff also come in to play.
Ok guys and gals keep in touch with blogs to see some cool pics of the Sinhala New Year after 14th.
Have a nice day!
It is Sinhala New Year in Sri Lanka. 13th and 14th of April are the Sinhala New Year days in our country. There are lots of traditional events are organized through out the country to celebrate the up coming Sinhala New Year. Ah! I almost forgot the sweets. The sweetest traditional sweets and various other food stuff also come in to play.
Ok guys and gals keep in touch with blogs to see some cool pics of the Sinhala New Year after 14th.
Have a nice day!
8:44 PM
Subscribe to:
Posts
(
Atom
)