Nice cartoon i found about twitter


4:06am, August 31st, 2007

Scheme Language

Today I was introduced to Scheme language, during my AI course and I was amazed by some of its abilities.

For example Java has about nine different integer types like short, byte, int, etc., But Scheme has dynamically bound data type sizes which means I do not have to worry about the expected size of the integer.

I am not sure how long Java, C or C++ will take to calculate 2^10000 (can we calculate that in Java at all? I assume C can do it using arbitrary precision library like GMP). But scheme can do it within a blink of an eye (expt 2 10000).



This was the answer



199506311688075838488374216268358508382349683188619245485200

894985294388302219466319199616840361945978993311294232091242

715564913494137811175937859320963239578557300467937945267652

465512660598955205500869181933115425086084606181046855090748

660896248880904898948380092539416332578506215683094739025569

123880652250966438744410467598716269854532228685381616943157

756296407628368807607322285350916414761839563814589694638994

108409605362678210646214273333940365255656495306031426802349

694003359343166514592977732796657756061725820314079941981796

073782456837622800373028854872519008344645814546505579296014

148339216157345881392570953797691192778008269577356744441230

620187578363255027283237892707103738028663930314281332414016

241956716905740614196543423246388012488561473052074319922596

117962501309928602417083408076059323201612684922884962558413

128440615367389514871142563151110897455142033138202029316409

575964647560104058458415660720449628670165150619206310041864

222759086709005746064178569519114560550682512504060075198422

618980592371180544447880729063952425483392219827074044731623

767608466130337787060398034131971334936546227005631699374555

082417809728109832913144035718775247685098572769379264332215

993998768866608083688378380276432827751722736575727447841122

943897338108616074232532919748131201976041782819656974758981

645312584341359598627841301281854062834766490886905210475808

826158239619857701224070443305830758690393196046034049731565

832086721059133009037528234155397453943977152574552905102123

109473216107534748257407752739863482984983407569379556466386

218745694992790165721037013644331358172143117913982229838458

473344402709641828510050729277483645505786345011008529878123

894739286995408343461588070439591189858151457791771436196987

281314594837832020814749821718580113890712282509058268174362

205774759214176537156877256149045829049924610286300815355833

081301019876758562343435389554091756234008448875261626435686

488335194637203772932400944562469232543504006780272738377553

764067268986362410374914109667185570507590981002467898801782

719259533812824219540283027594084489550146766683896979968862

416363133763939033734558014076367418777110553842257394991101

864682196965816514851304942223699477147630691554682176828762

003627772577237813653316111968112807926694818872012986436607

685516398605346022978715575179473852463694469230878942659482

170080511203223654962881690357391213683383935917564187338505

109702716139154395909915981546544173363116569360311222499379

699992267817323580231118626445752991357581750081998392362846

152498810889602322443621737716180863570154684840586223297928

538756234865564405369626220189635710288123615675125433383032

700290976686505685571575055167275188991941297113376901499161

813151715440077286505731895574509203301853048471138183154073

240533190384620840364217637039115506397890007428536721962809

034779745333204683687958685802379522186291200807428195513179

481576244482985184615097048880272747215746881315947504097321

150804981904558034168269497871413160632106863915116817743047

92596709376



2:43am, August 31st, 2007

Best Teaching Style

In last semester I encountered the best ever teaching style that I met. I do not hesitate to say that the Web mining class had the best one. I am writing it down here because almost everyone in the class were satisfied with it and perhaps it might be a good style for you to think about if you ever gonna teach a subject. A big thank should go to Fil, our professor who did the class and gave us all a kick start in web mininig.



We were assigned at least two research papers per day, two days per week. One student is responsible for doing a presentation and leading the discussion every day, based on those research papers. Everyone had to read those as 25% of the marks were given for participation. So I got to read AND understand all the papers.



And we had a mailing list setup where students discussed about various topics related to the materials discussed in the class and also about relevant areas. I got really good understanding about deep web, google search, security concerns with social networks and also with google services, wikipedia, etc., That was fun and very encouraging.

All the times we were researching about various topics and sometimes Fil was very good at arousing the curiosity among us, especially in topics like privacy in google.



Having understood this as a very good style, I recommended this for one of my friends. But he was afraid to implement this as he was afraid of not being able to answer the various questions that students will ask. Then only I understood how knowledgeable you should be to implement something like that.



I personally like the idea of setting up mailing lists around the class, which enables students to discuss various things and also will give most students to express their ideas especially if they do fear to talk in the class. Reading 4-6 research papers were challenging but that enabled us to cover a big area within a limited time.



Thanks again to Fil for this class and the style.



(I didn't blog about this earlier, because one might think that I am doing this to affect my grading. Since gradings are out, 3 months ago, now I think I'm ok)


11:07pm, August 30th, 2007

Facebook everywhere. Here?s FDT for .NET

Long time no write…. ha…  So, everyone’s hyped up about Facebook, the latest craze in Cyber World. As you might already know, Codeplex has a Facebook Developer Toolkit project running which might be of interest for all .NET (VB + C#) developers out there. This contains .NET wrappers for the FB API. Wanna try it out? [...]

10:23pm, August 30th, 2007

Damro


6:34am, August 30th, 2007

Greener Cars

Looks like my problem with coping with fuel hikes goes hand in hand with driving green. I found a few related articles on TreeHugger.

Proper Tire Pressure For Better Mileage

New Cars to Check Tire Pressure Automatically

Green Your Drive Without a Hybrid
1. Reduce your air conditioning
2. Change your filters at scheduled intervals
3. Check your tire pressure regularly
4. Use a fuel additive in each fill-up to increase engine performance
5. Get fuel injectors cleaned


4:59am, August 30th, 2007

Installing FFMPEG and FFMPEG-PHP on CentOS

Last few weeks couple of my colleagues were working on a website that required converting videos to FLV format which is much similar to what youtube does. Inorder to do this they were using ffmpeg which does all the video conversion. He also used ffmpeg-php which is an extension for PHP that allows to retrieve information regarding a video file. So I had to get a local development environment working for this particular project. I had an Ubuntu 7.04 box and found this tutorial for installing ffmpeg and ffmpeg-php. I was successfully able to get it working and my colleagues built the site and it was working very smoothly.

Now when we got to the stage of launching the site, I had to repeat all the installation on a live server as they don't come with ffmpeg or ffmpeg-php pre installed. Hosting Companies seem to charge big bucks to get these installed in their servers. So we went for a Virtual Dedicated Server which had root access. It was a Cent OS 4 box and this is how I was able to get ffmpeg and ffmpeg-php installed on it.

Switch to working directory
cd /usr/local/src


Download the source files needed
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz


Extract the Source files
bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz


Create a directory for codecs & import them
mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/


Install SVN/Ruby
yum install subversion
yum install ruby
yum install ncurses-devel


Get the latest FFMPEG/MPlayer from the subversion
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer


Fix few Lib issues for next steps
Add this line in /etc/ld.so.conf
/usr/local/lib

then run
ldconfig -v


Compile LAME
cd /usr/local/src/lame-3.97
./configure
make
make install


Compile libOGG
cd /usr/local/src/libogg-1.1.3
./configure
make
make install


Compile libVorbis
cd /usr/local/src/libvorbis-1.1.2
./configure
make
make install


Compile flvtool2
cd /usr/local/src/flvtool2_1.0.5_rc6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install


Compile MPlayer
cd /usr/local/src/mplayer
./configure
make
make install


Compile FFMPEG
cd /usr/local/src/ffmpeg
./configure --enable-libmp3lame --enable-libogg --enable-libvorbis --disable-mmx --enable-shared
echo '#define HAVE_LRINTF 1' >> config.h
make
make install


Finalize the codec setups
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51


Few tasks before compiling FFMPEG-PHP
yum install automake
yum install autoconf
yum install libtool


Compile FFMPEG-PHP
cd /usr/local/src/ffmpeg-php-0.5.0
phpize
./configure
make
make install


Add FFMPEG-PHP as an extension of PHP
Add this line to your php.ini file (Check the correct path of php.ini)
extension=ffmpeg.so


Restart Apache to load FFMPEG-PHP
service httpd restart


Check if FFMPEG-PHP is loaded correctly
Create a file called phpinfo.php in your webroot and add the following code

<?php
phpinfo
();
?>



Run this page using your browser and if you see a section on ffmpeg then everything is installed and working.

2:31am, August 30th, 2007

RE: RE: Making Websites for ALL

[This is the reply post to shanX’s reply post regarding my “Making Websites for ALL” post.]

This will be a short & sweet post as I’m struggling with time these days. Lots of work to finish but still have 24 hours per day. Now the time is 12.58 am, and I have to get up early in the morning.

Here goes my 10 points…

  1. Web standards are standards that reduce the cost and complexity of development while increasing the accessibility and long-term viability of any site published on the Web.
  2. Yes, I also prefer to code by hand.
  3. Per HTML and XHTML standards, a DOCTYPE (short for “document type declaration”) informs the validator which version of (X)HTML you’re using, and must appear at the very top of every web page. DOCTYPEs are a key component of compliant web pages: your markup and CSS won’t validate without them.
  4. An especially useful feature XHTML inherits from its XML underpinnings is XML namespaces. With namespaces, authors or communities of authors can define their own XML elements, attributes and content models to mix within XHTML documents. This is similar to the semantic flexibility of the ‘class’ attribute from HTML, but with much more power. Some W3C XML namespaces/schema that can be mixed with XHTML include MathML for semantic math markup, Scalable Vector Graphics for markup of vector graphics, and RDFa for embedding RDF data.
  5. HTML Versus XHTML
  6. HTML 5 is still a working draft with major knows issues.
  7. When consider mobile web browsers table layout is way out.
  8. Semantic markup is the future today :)
  9. We are fighting for standards which ensure simple, affordable access to web technologies for all.
  10. We have to think as a user not as a developer when making a website as end of the day site is access by different type of users.

To learn more about web standards go to my Web standards round-up post.

I’m not good at writing at ALL, but hope my series of posts regarding web standards will help anyone who want to make a web better place for ALL.

,

12:14pm, August 29th, 2007

Going to Uganda

Well, not quite. But I sure had a friend fooled on chat:

me: i may be leaving around the 10th and coming back in october
friend: really?where are you going?
me: uganda. ugandan commodity exchange
friend: maru
no wonder you’re trying to a rap accent!
me: hee hee
friend: but you need to know swahili me thinks
me: that’s nigeria u dummy
friend: doesnt it apply to most african countries?
me: ugandans speak a taga-buru dialect
i guess that’s swahili too
friend: haha see se
me: currently getting some stupid vaccines required by the health ministry :(
but they want us to watch out for ebola & the tutsi fly thing - no vaccine for those
friend: oh shit yes, you need to be really careful
hey going out for a bit, i’ll come back and buzz u
me: ok, but first
i should tell you that i’m pulling your leg and i’m actually going back to new york.
ugandan stock exchange!!! haha, i gotta blog this one
friend: napan.


1:39am, August 29th, 2007

National ICT Capacity Summit ?07

This event is  jointly organized by ICTA – Info. Comm. Technology Agency (the gov. body who makes policy decisions re. to ICT in the country) & a collective group of Industry experts . Intention behind this Summit is to increase HR capacity in ICT industry,

This is a 3 day event. The 1st day will be a conference, ending will an awards night. Day 2 & 3 will be the career fair.

And SL Microsoft is a main sponsor and also having a stall at the career fair…
Most of the MVPs are going to be there.
So all are welcome to see the new opportunities in IT industry

1st and 2nd September
BMICH
 


8:59pm, August 28th, 2007

Installing Ubuntu on Virtual PC 2007


9:38am, August 28th, 2007

MediaWiki


7:59am, August 28th, 2007

Open Source Wiki Engines in C#


3:09am, August 28th, 2007

Wasps attack at Sigiriya

Thought make a post on it since two days ago, I was there. There were about 8 wasps nests visible there (there will be more) but they do not attack as long as they are not disturbed. When we were climbing, few people started shouting and I saw wasps coming out from their nests (Zoom the picture and see green area). Immediately one person warned them, so they kept their mouth shut. We were lucky enough to escape from wasp attack. But wasps were disturbed by people yesterday, they attacked people, resulting hospitalizing more than 100 visitors including 20 children.

One thing I noticed is, there are no signs indicates about this danger. At least authorities should set some signs about this danger and visitors must be educated about it. Unfortunately, getting information from authorities at the site is very difficult.

Copy of P1000346

6:56pm, August 27th, 2007

Alone in my room?

They say to really appreciate the value of the things you take for granted, you should be deprived of them. Well it is true to really appreciate the value of family. But in my case, I am going to be deprived of their company only for a short period of time. But I have come appreciate the value of their company, just after being away from them for two days.

Being here in Mauritius, after the end of the working day, all by your self, made me realize, how much I had taken my family for granted. I mean, I knew they were there and hence I was indifferent to their company. But now, at the end of the day, I have to come back to an empty hotel room. Lush is not here to welcome me home. Dinara is not here for me to play with and cuddle. I can’t drop into my mothers place after work to say hi to her. I mean, those were the things that I took for granted when I was back home. But being here now, without them around, it is making me feel all lonely. All I have for solace is just a phone call.

I realize that I may have not shown them how much they mean to me. How much they were a part of my life. How much that their presence filled up my life.

There is a lesson for me in all this. I need to start showing them, when I am around them, what they mean to me. It is a good thing that I can go back to them, and get a chance to make sure that I don’t let the moments just pass me by. I need to take the time appreciate them and make them feel the specialness that I feel for them in my heart.


11:49am, August 27th, 2007

It’s In The Bag

I bought this environmentally friendly bad a few weeks ago at Arpico. It was like 25 bucks and I thought it was a good idea at the time. They happily put my stuff in the new eco bag and I was on my way.

The thing about an eco bag is your supposed to reuse it. So I took it back today. To my surprise I was told I can’t take the bag in. Their “leave your bags at the counter outside” policy contradicted with my quest to save the earth.

I explained to the security guy that they sold me the bad to spare the use of polythene and I was going to take it in. I even showed that it was empty and I was going to put the stuff I buy in it.

After 15 seconds of explaining and the other security guy at the exit telling this guy to let me go, he got off my case.

Arpico please brief your employees so I don’t have to.

I’m still pissed at the whole thing. I’m going to keep taking my bag back, that is if I feel like shopping there again. Because unlike your social responsibility show that you put on I care about where I live.


7:50am, August 27th, 2007

On a personal note,


5:29am, August 27th, 2007

Interactive Tutorial: Practical C++

The following PowerPoint tutorial (and the presentation format) is something I developed over the last two years, basically relying on my experiences in teaching the subject to both complete newbies and somewhat experienced programmers. This tutorial should suit both those audiences if they’re new to C++:

practical-c.ppt

The idea is to give the student an experience that closely resembles the one he gets with an actual lecturer and blackboard, without requiring either. I came up with the presentation format as an experiment in using PowerPoint without information dilution (See Edward Tufte’s treatment of the cognitive style of PowerPoint. For the record I agree with Tufte: PowerPoint is evil if used sloppily). You won’t find anything non-functional here. No fancy animations, (except the yellow call-out boxes), no backdrops and certainly no clip arts of angry ducks sledgehammering computers…

Please feel free to use the tutorial for your own studies. Comments and recommendations for improvement are welcome.


4:18am, August 27th, 2007

Made a journey to heretical place: Sigiriya and Dambulla

After long time, I took my family and went on a trip; to Sigiriya, which is part of our national heritage. We spent two days there, visiting three different heretical places; Sigiriya rock, Pidurangala Temple and Dambulla Temple.

Sigiriya is a rock where a King called Kashyapa built his castle on it. This is one of 10 wonders in the world. Climbing to the top of the hill reminded me that my body really needs daily workout, however I made it. The paintings inside the castle are fully covered now only few can be seen.

P1000331 P1000338
Sigiriya rock Top of the rock; part of the King's palace
P1000342 P1000347
Narrow path to climb up Nests of wasps. They shouldn't be disturbed.

Pidurangala is a temple that is built before the castle. According the person I spoke there, this has been built by the king and given to monks in order to take permission and blessing from monks. Since it was dark and no electricity at the top, we were not permitted to go the top but there were enough of things excavated to watch. It is believed that more than 100 Rahath monks were there.

P1000351 P1000355
Buddha statue at first level Places used by monks for meditation
P1000357 P1000359
   

Dambulla is another temple that has been built inside a rock. We had to climb up bit but not hard as Sigiriya. There are more than 100 Buddha statues inside the rock and one of the strange things inside is, a water line comes from the top. Still the technology used for it is uncovered.

P1000380 P1000381
Temple inside the rock  
P1000382 P1000389
Buddha's statues inside the temple  

These places are built by our ancestors showing there loyalty to the country and paying respect to the Budda. I am proud of being a Sri Lankan.

The place we stayed is Sigiriya Village that is nice place and service is provided by very nice people; very close the Sigiriya rock. The surroundings of the hotel are really beautiful and peaceful.


10:10pm, August 26th, 2007

On my way to Mauritius

I am on my way to Mauritius and writing this post from Dubai International Airport on my transit.

I have a pretty long transit of 12 hours. And since I am flying economy class I am left to use the basic facilities at the airport. I have spent about 6 hours of my transit time and am now bored to death. And I am tired too.

This is the third time I am on a long transit in Dubai. In fact everytime I have had to pass through Dubai I have been on pretty long transits. The worst being a 26 hour transit on my return from Tanzania last year.

I have been hearing that Mauritius is a beautiful country. But I am not sure how much I will enjoy the beauty of the place as I am going there on my own. I now find it pretty hard to be a tourist alone without Lushi. If I was with her, I am sure that I would have enjoyed the place pretty well. But since I am alone and missing her and Dinara, I guess I will just concentrate on my work.

I am going to Mauritius for a system study. Affno, the company I work for is involved in a project in Mauritius, along with another Sri Lankan company, Informatics International to deploy a system at Passport and Immigration Office of Mauritius. This is the second project that I am involved in the African region, the first being the Capitol Markets and Securities Authority project in Tanzania.

This time I am going to be away from home for around a month. This is the longest that I have been separated from Lushi, ever. Earlier I have been away from home in India for about a month, but that was before I was married or met Lushi. This time is it even more lonely for me as I have never been away from Dinara for more than a day since she was born.

I am already missing Dinara and Lushi. And it is not going to get better as this  is only the beginning of my journey. I know Lushi misses me as well. I hope Dinara won’t miss me that much as she would not realize that I am gone. But I miss her! she’ll be 10 monts when I get back and these days she is growing rapidly. And I am going to miss one month of her progress!

NOTE: This was finally posted from Mauritius as I could not connect to the Internet from Dubai.


9:21pm, August 26th, 2007

« Previous Entries