Eva's laptop has been acting up for sometime now. I finally decided to get right of windows, and install Ubuntu. Well... Not quite, I still have windows. Err.. Not yet.
I have left a 40 GB partition open for windows and I'll probably reinstall WinXP on that partition.
Anyways, I downloaded Ubuntu. It took me 9 hours! Nope I'm not joking. I lost 2 hours of download when the connection to a mirror at Singapore was lost. So, the download had to be restarted with a mirror in Oz and that took 7 hours.
I finally burnt it on a CD and got started. Everything was done with the greatest of ease. 30 mins later, I had the laptop up and running. But sadly, I couldn't connect to Gooze's Wireless connection. I tried using Ubuntu's inbuilt wireless configuration tool but that didn't work.
So, I tried to configure it manually by using iwconfig. That too didn't get wireless up and finally I had to do a bit of googling. It turned out that I need to use wpa_supplicant as the router was configured with WPA and not WEP.
I just followed the HOWTO and voila! its time for another blog entry.
Other than the WPA part, everything else was really smooth and cool. Its the fastest Linux install I have ever done. My first one was a Slackware installation over an UMSDOS partition and that just screwed up entire Win98 installation. So, it was a RH5.0 that I installed and cleaned out my Win98. After a few years, I reinstalled Windows in a separate partitions. Here I am, 10 years later, with just Linux on my m/c and no WinXP. A full circle!
Monday, May 14, 2007
Saturday, April 21, 2007
A Simple Motor, Super Fun
A cool motor using just a copper wire, a battery and a magnet. link (via).
Myopic view of cool, electrical, motor
Myopic view of cool, electrical, motor
Wednesday, April 18, 2007
A story of VNC and RDP
I have a laptop and a PC at work. The laptop has a docking station that allows me to have a dual monitor setup. So, I connected the Monitor from my PC to the docking station and started using a dual monitor setup.
As expected, the productivity gains by having a dual monitor setup is great, but my PC lost out.
For a couple of months, I stopped using my PC and started using my Laptop for nearly everything. But its not an ideal situation. Builds, large downloads etc. are best on a PC because I can just lock the PC and let it run in the background. Whereas on a laptop, I usually hibernate the laptop when I go home and so, any builds or downloads will stall.
I decided to setup VNC between the two today. I used TightVNC. However, I found that the refresh rate pretty much sucks. Given that the two are just a few feet apart, and on the same network, I expected it to be nearly realtime.
A colleague suggested that I use RDP instead. I tried it out. Its amazing! The refresh rate is realtime and it looks like I'm using the PC itself. Plus, it allows me to run it on my second monitor. So, I can have applications from both my PC and my laptop on the second monitor and there is really no way to figure out if they are from the PC or the laptop.
VNC is pretty bad when it comes to running on a second monitor. If you go "full screen", the server display disappears and you are back to the extended desktop from the laptop.
All said and done, for this kind of setup, RDP is really cool. VNC has its uses especially if for multiple connections, heterogeneous environments etc. Coding Horror has an excellent comparision of the two here.
Myopic view of vnc, rdp
As expected, the productivity gains by having a dual monitor setup is great, but my PC lost out.
For a couple of months, I stopped using my PC and started using my Laptop for nearly everything. But its not an ideal situation. Builds, large downloads etc. are best on a PC because I can just lock the PC and let it run in the background. Whereas on a laptop, I usually hibernate the laptop when I go home and so, any builds or downloads will stall.
I decided to setup VNC between the two today. I used TightVNC. However, I found that the refresh rate pretty much sucks. Given that the two are just a few feet apart, and on the same network, I expected it to be nearly realtime.
A colleague suggested that I use RDP instead. I tried it out. Its amazing! The refresh rate is realtime and it looks like I'm using the PC itself. Plus, it allows me to run it on my second monitor. So, I can have applications from both my PC and my laptop on the second monitor and there is really no way to figure out if they are from the PC or the laptop.
VNC is pretty bad when it comes to running on a second monitor. If you go "full screen", the server display disappears and you are back to the extended desktop from the laptop.
All said and done, for this kind of setup, RDP is really cool. VNC has its uses especially if for multiple connections, heterogeneous environments etc. Coding Horror has an excellent comparision of the two here.
Myopic view of vnc, rdp
Sunday, April 15, 2007
Lua: Hello Mundo
The C API in Programming in Lua does not have a Hello World program. In addition, if you try to follow the example, and compile your code, the program crashes and displays the following
Myopic view of lua
PANIC: unprotected error in call to Lua API (no calling environment)So, I went to the Lua Users Wiki and found some tutorials but still no "hello world" program. So, here it is below
The code itself is self explanatory and the API interface is very interesting. A stack based approach to pass information to/from C from/to lua.
#include <stdio.h>
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
int main(int argc, char* argv[])
{
char buff[] = "print(\"hello world\")";
int error;
lua_State *L = lua_open();
luaL_openlibs(L);
error = luaL_loadbuffer(L, buff, strlen(buff), "line") ||
lua_pcall(L, 0, 0, 0);
if(error)
{
printf("ERROR: %s", lua_tostring(L, -1));
lua_pop(L, 1);
}
lua_close(L);
return 0;
}
Myopic view of lua
Saturday, April 14, 2007
Monday, April 09, 2007
Great site about vim
I use VIM a lot and its almost down to me being unable to code without VIM. This list is really cool! Plenty of tips that will help both rookies and veterans.
I particularly liked the tip about writing to a shell using :w !sh (or in the case of winxp :w !cmd). Its a really cool way of renaming files!
Myopic view of vim
I particularly liked the tip about writing to a shell using :w !sh (or in the case of winxp :w !cmd). Its a really cool way of renaming files!
Myopic view of vim
Tuesday, April 03, 2007
Parameter Passing in C
A favorite question that a friend asks in interviews is related to the usage of a stack in C. His question to the poor sod on the other side is - if a function does not return, what could be some of the reasons?
Naturally, some of the answers are
1. There's an infinite while loop inside
2. The function is recursive and does not have a base result
but the answer that my friend looks for is
3. The return address on the stack has been corrupted.
The funny thing is - the C99 Standard does not even mention the word "stack" anywhere.
I asked a question about parameter passing on comp.lang.c and everyone agrees.
Its time to correct my friend!
Myopic view of c, programming
Naturally, some of the answers are
1. There's an infinite while loop inside
2. The function is recursive and does not have a base result
but the answer that my friend looks for is
3. The return address on the stack has been corrupted.
The funny thing is - the C99 Standard does not even mention the word "stack" anywhere.
I asked a question about parameter passing on comp.lang.c and everyone agrees.
Its time to correct my friend!
Myopic view of c, programming
Thursday, January 25, 2007
A subtle difference
Consider the the following
In both cases, we can create generators such as power-two as
Myopic view of scheme
(define (power-n x)The above definition basically defines a generator function. A slightly different definition using a named let is
(define power-x
(lambda (n)
(if (= n 0)
(list 1)
(cons (power x n) (power-x (- n 1))))))
power-x)
(define (power-n x)In the first case, we define power-x and then explicitly return it. In the second version, we create an anonymous function and return that automatically.
(lambda (n)
(let power-x ((n n))
(if (= n 0)
(list 1)
(cons (power x n) (power-x (- n 1)))))))
In both cases, we can create generators such as power-two as
(define (power-two n)Thanks to a thread on comp.lang.scheme for fixing things!
((power-n 2) n))
Myopic view of scheme
Saturday, January 20, 2007
Scheme48 + Cygwin + Xemacs
I had installed MIT Scheme to use as my base for learning Scheme. I created a nice little phone book language that would operate on a database of phone book entries. However, there was no way to use the little language other than by first starting MIT Scheme and then loading the file. This was cumbersome, but it was still a toy project.
I recently installed XEmacs. I'm basically a VIM guy but I wanted to try out the *other* editor philosophy :-). All said and done, it was still configured to use VIPER! I knew that emacs and friends use a lisp dialect and so it would be fun to see what its like to have an integrated enviroment.
After a quick search, I found a package for XEmacs that allows it to run an inferior scheme process i.e as a child. However running MIT Scheme screwed things up. On Windows, the parent-child I/O model is quite different from what XEmacs wanted and as a result it was not going to work.
So, I installed Scheme48. Installed is not quite the right term, because there is a native windows application available. Instead, I downloaded the source and built it on top of cygwin. That's when all the problems that are associated with a 'minimalist' language like scheme hit. MIT scheme has its own library of useful utilities and its own functions for things like File I/O. I spent an hour or so cleaning up and moving to Scheme48.
The end result? Much happier. XEmacs run scheme48 as an inferior process quite nicely. Plus, I getting a hang of some of the XEmacs commands that run on the inferior process or for that matter even a shell. So, I now have my phone book application and I don't have to leave XEmacs. Perhaps, there is something to this *different* philosophy after all :-)
Myopic view of xemacs, scheme, cygwin
I recently installed XEmacs. I'm basically a VIM guy but I wanted to try out the *other* editor philosophy :-). All said and done, it was still configured to use VIPER! I knew that emacs and friends use a lisp dialect and so it would be fun to see what its like to have an integrated enviroment.
After a quick search, I found a package for XEmacs that allows it to run an inferior scheme process i.e as a child. However running MIT Scheme screwed things up. On Windows, the parent-child I/O model is quite different from what XEmacs wanted and as a result it was not going to work.
So, I installed Scheme48. Installed is not quite the right term, because there is a native windows application available. Instead, I downloaded the source and built it on top of cygwin. That's when all the problems that are associated with a 'minimalist' language like scheme hit. MIT scheme has its own library of useful utilities and its own functions for things like File I/O. I spent an hour or so cleaning up and moving to Scheme48.
The end result? Much happier. XEmacs run scheme48 as an inferior process quite nicely. Plus, I getting a hang of some of the XEmacs commands that run on the inferior process or for that matter even a shell. So, I now have my phone book application and I don't have to leave XEmacs. Perhaps, there is something to this *different* philosophy after all :-)
Myopic view of xemacs, scheme, cygwin
Thursday, September 07, 2006
A Review of Puppy Linux
I have an interesting problem. I want to run linux at work, but don't want to lose the space on my laptop. The solution? Use a live-cd linux distro. At the same time, I'm not looking for too much and so a full blown live-cd distro like knoppix would be overkill.
So, it was going to be a small distro. What's also nice about small distros are that they are extremely easy to use. They aren't bloated (Hey! how much can you fit into 50 MB) and they still seem to have the necessary bits plugged in. I found a few and had shortlisted it down to DSL and Puppy Linux. I gave DSL a try before switching over to Puppy Linux. Don't get me wrong, I liked DSL quite a bit but I found some of the features on Puppy Linux quite a bit better.
Some of the things I really liked about Puppy Linux was its support for the 2.6 Kernel and thereby pretty decent support for hardware. Since I have a laptop, WLAN connectivity is a must and that's what I wanted from Puppy Linux. I gave a good RTFM before actually trying it out and expected Wifi to work out of the box. It didn't. It took me a *lot* of time and effort before I realized that I need to download and install an additional package which patches the Wifi connectivity for my laptop. This wasn't as bad as it seems because of a really cool feature that the distro has - multi session live CD. Basically, this feature allows for software to be installed on top of the same cd and not just that, it allows file modifications to be saved as well. This really is a superb solution, because it gives the illusion of a read/write filesystem on what is actually a read only media. Naturally, this doesn't come for free and the more you save, the longer it takes to boot.
There are a lot more features than just this. Puppy Linux runs off a ramdisk, and so you can remove the Live-CD once it boots. This frees up the CD ROM drive. Plus, this distro makes replication really really easy. All you need to do, is pop in a different CD, and save and it gives a new CD with all the software. This is still a bit unstable though, and I had some problems when I used it, but I does work.
On the whole, I really liked Puppy Linux. Its easy to use and some of its features are seriously cool. No doubt I would be spending more time on it trying to customize it to my liking and yet try to keep things as simple as possible.
So, it was going to be a small distro. What's also nice about small distros are that they are extremely easy to use. They aren't bloated (Hey! how much can you fit into 50 MB) and they still seem to have the necessary bits plugged in. I found a few and had shortlisted it down to DSL and Puppy Linux. I gave DSL a try before switching over to Puppy Linux. Don't get me wrong, I liked DSL quite a bit but I found some of the features on Puppy Linux quite a bit better.
Some of the things I really liked about Puppy Linux was its support for the 2.6 Kernel and thereby pretty decent support for hardware. Since I have a laptop, WLAN connectivity is a must and that's what I wanted from Puppy Linux. I gave a good RTFM before actually trying it out and expected Wifi to work out of the box. It didn't. It took me a *lot* of time and effort before I realized that I need to download and install an additional package which patches the Wifi connectivity for my laptop. This wasn't as bad as it seems because of a really cool feature that the distro has - multi session live CD. Basically, this feature allows for software to be installed on top of the same cd and not just that, it allows file modifications to be saved as well. This really is a superb solution, because it gives the illusion of a read/write filesystem on what is actually a read only media. Naturally, this doesn't come for free and the more you save, the longer it takes to boot.
There are a lot more features than just this. Puppy Linux runs off a ramdisk, and so you can remove the Live-CD once it boots. This frees up the CD ROM drive. Plus, this distro makes replication really really easy. All you need to do, is pop in a different CD, and save and it gives a new CD with all the software. This is still a bit unstable though, and I had some problems when I used it, but I does work.
On the whole, I really liked Puppy Linux. Its easy to use and some of its features are seriously cool. No doubt I would be spending more time on it trying to customize it to my liking and yet try to keep things as simple as possible.
Tuesday, June 27, 2006
Some free ebooks from oreilly
Its not a comprehensive list, but oreilly has decided to open out some of their books. link.
Perhaps a book was outdated enough to be put out of print, yet some
people still needed the information it covered. Or the author or
subject of a book felt strongly that it should be published under a
particular open copyright. Maybe the book was written collectively by a
particular community, as in the case of our Community Press books.
On the whole I think this is a good idea. There are books I definitely want to read
1. Linux Device Drivers (both 2nd and 3rd editions)
2. Unix Text Processing
and to a lesser extent
3. Version Control using Subversion
Perhaps a book was outdated enough to be put out of print, yet some
people still needed the information it covered. Or the author or
subject of a book felt strongly that it should be published under a
particular open copyright. Maybe the book was written collectively by a
particular community, as in the case of our Community Press books.
On the whole I think this is a good idea. There are books I definitely want to read
1. Linux Device Drivers (both 2nd and 3rd editions)
2. Unix Text Processing
and to a lesser extent
3. Version Control using Subversion
Monday, June 26, 2006
Setting up a blog using Sharepoint
Sharepoint is great. It makes collaboration within and across teams really easy. I use it all the time at work. It takes a bit of effort to create a personal page on sharepoint though. Here's what I did.
1. Created a new site with my name
2. Modified the main page with only announcements and a contacts widget.
3. I added only myself to the contacts in the site and changed the display to Newspaper type.
4. The announcements widget automatically act like a blog!!!
1. Created a new site with my name
2. Modified the main page with only announcements and a contacts widget.
3. I added only myself to the contacts in the site and changed the display to Newspaper type.
4. The announcements widget automatically act like a blog!!!
Friday, June 16, 2006
Now that BillG ....
Thursday, June 15, 2006
Webdav and box.net
Systems Boy has an excellent post on publishing ical calendars on the net using box.net. link.
Going further, I tried to find some tools that use webdav. One option is to use tcl vfs. However, this is pretty useless if one is behind a corporate firewall. Next I found a tool called cadaver. Again this doesn't have proxy support.
In the end hunting around, I found that IE itself supports webdav. The only thing is that they don't call it webdav. Instead they call it webfolders! Believe it or not this info comes from mozilla.
So here is what to do if you want to have a 1 GB of storage space on the net.
1. signup with box.net
2. start IE and do file->open "http://www.box.net/dav". Check the option for webfolders
3. Voila!! Now you can store/retrieve files from box.net!!
Going further, I tried to find some tools that use webdav. One option is to use tcl vfs. However, this is pretty useless if one is behind a corporate firewall. Next I found a tool called cadaver. Again this doesn't have proxy support.
In the end hunting around, I found that IE itself supports webdav. The only thing is that they don't call it webdav. Instead they call it webfolders! Believe it or not this info comes from mozilla.
So here is what to do if you want to have a 1 GB of storage space on the net.
1. signup with box.net
2. start IE and do file->open "http://www.box.net/dav". Check the option for webfolders
3. Voila!! Now you can store/retrieve files from box.net!!
Wednesday, June 14, 2006
Wednesday, May 31, 2006
Slashdot redesign winner announced
Tuesday, May 30, 2006
Simple Library to create BMP Files
EasyBMP is a small library that can be embedded inside any application to create BMP files. The project homepage is here.
Tutorial on pointers
Expanding Scope
I'm changing the scope of my blog here. Instead of the narrow focus on Scheme, I'm now going to blog on anything related to software or hardware or techie. Now this should get the blog moving.
Sunday, May 14, 2006
Subscribe to:
Posts (Atom)