Over the next few days I’m going to move this blog away from wordpress.com and host it at my own domain, http://www.kerneljack.com.
Please head over there from now on as I am going to stop updating this here.
Posted by kerneljack on March 10, 2008
Over the next few days I’m going to move this blog away from wordpress.com and host it at my own domain, http://www.kerneljack.com.
Please head over there from now on as I am going to stop updating this here.
Posted in blogging, website | Leave a Comment »
Posted by kerneljack on August 30, 2007
I’ve just installed Compiz Fusion on my 3-year old ASUS laptop which is running Ubuntu Feisty. I’m quite pleased at how stable it is. I tried Beryl a few months ago and it was not usable at all on the same hardware.
I did run into one problem, though and I couldn’t find any solution to it on either the Ubuntu Forums or anywhere else on the net. My top Gnome panel had a strange white bar under it and all my context menus had white borders. Maybe my google-fu wasn’t very good yesterday, but the only solution that I managed to find after about an hour was this on a Gentoo forum:
This is a known issue. Go to ccsm->Window Decorations and add the string !dock to the value Shadow Windows. I had to enter 2 !dock. First disabled shadows of the context menus and the tool tips, the second stops shadows for the gnome-panel.
I’m just putting this here in case it helps someone with a similar problem.
Technorati Tags: compiz fusion ubuntu beryl
Powered by ScribeFire.
Posted in beryl, compiz, fusion, hardware, linux, software, troubleshooting, ubuntu | 8 Comments »
Posted by kerneljack on August 28, 2007
Paul Graham has impressed me time and again with his stunning insight. Whenever I read his writings, it’s as if he plucked his ideas out from my own head and then put pen to paper. His latest, Holding a Program in One’s Head, contains several gems that I personally have experienced several times at work.
The danger of a distraction depends not on how long it is, but on how much it scrambles your brain. A programmer can leave the office and go and get a sandwich without losing the code in his head. But the wrong kind of interruption can wipe your brain in 30 seconds.
This is spot-on, and I notice this a lot during my lunch break. Sometimes I can’t get a program or problem out of my head and occasionally I even come up with a solution not 10 minutes into my lunch break and then I can’t wait to get back and finish it. Other times however, especially if I have lunch with my colleagues the whole ‘problem space’ I’ve built up in my head simply vanishes. Due to the amount of work it usually takes (maybe a half-hour to an hour) to re-load my brain with the problem I was working on, a lot of post-lunch time is wasted and sometimes I can never recreate the problem fully again because I tend to be sharper in the mornings than in the lazy afternoons.
Since there’s a fixed cost each time you start working on a program, it’s more efficient to work in a few long sessions than many short ones.
I have often wanted to do this, but it’s almost impossible to do. There is always lunch, some other interruption, going home, eating dinner or something similar. On the weekends, however, I sometimes manage to stay up late and can work uninterrupted for quite a while.
Rewriting a program often yields a cleaner design.
True sometimes, but I agree with him that even the process of rewriting a program can lead to significant insights; even if the rewritten program is not a huge improvement.
Instead of summarizing the whole essay here, I highly recommend that all programmers and their managers go read it. Even non-IT staff, such mathematicians, whose work involves long-stretches of thinking, and constructing problem spaces in their heads will benefit from the advice in this essay.
I haven’t been paying attention to my RSS feeds recently and I forgot just how good some people are at writing and expressing their insights
Paul Graham and Joel On Software are two blogs (journals?) that I really enjoy reading.
Technorati Tags: coding programming software
Posted in coding, programming, software, writing | Leave a Comment »
Posted by kerneljack on August 23, 2007
I’ve spent the past 2 weeks on and off reading ‘Bugs in Writing’ and have definitely learned about some mistakes to avoid in writing. In order to fix these mistakes, it is best to do a lot of your own writing so you can find them and eliminate them. I will try to write a brief note about some common mistakes here. I haven’t asked the author for permission, so I will try to do it here in a very general and concise manner.
#1. Avoid using passive voice. Passive voice just means that when you say something about the world or some event that happened, make sure you identify ‘who or what’ was involved. The ‘who or what’ is commonly referred to as an agent.
For example,
Wrong:
The tea was made.
The program was written.
The computer was dropped.
Correct:
Mark made the tea.
Jane wrote this computer program.
Christopher dropped the computer.
#2. Speak directly to your reader. Never address your audience as the reader or refer to yourself as the author. You should speak directly to your reader. You should refer to her as you. If you are the sole author of a book, use I and if you have co-authors, use we. In addition, avoid using one, as in One should realize … or One has written.
#3. So, So that and Such that. Just remember the following:
So means therefore
So that means in order that
Such that means in such a way that
#4. Two or more. Use the terms between, each other, either, and a couple to refer to precisely two entities; and you should use among, one another, any one of, and several to refer to more than two entities.
I will add some more tips later on, but probably not many. The problem is that I haven’t gotten permission from the author and several of the tips have examples that are best quoted verbatim from the book.
Posted in blogging, news, writing | Leave a Comment »
Posted by kerneljack on August 6, 2007
I know I haven’t updated this blog for a while … in fact I frequently abandon it for a few months while I carry on with life’s struggles. Keeping up with my job, finding time to spend with my beautiful wife, all the while attempting to keep current with the fast pace of technology growth.
Starting today, I will try and change that. You see, in order to motivate myself to keep this blog updated I have decided to set myself a goal and complete it. I will keep updating this blog not only with my progress, but will also write about what I have learned as I go along.
So my first goal will be ‘to improve my writing skills’. I have enjoyed writing stuff for a long time now and friends have occasionally told me that ‘you could be a really good writer’. Well I’ve finally decided I should give it a shot.
To be honest, I’ve never been good at grammar, and people find that hard to believe. I’ve simply developed a good ear for what ’sounds right’ based on my perusal of several newspapers, magazines, novels and books over the years. Learning a lot of vocabulary while preparing for my SATs and reading ‘lots’ has really helped.
The first book I’m going to try and read and understand is going to be Bugs in Writing, which I bought several years ago, but never got around to reading. It is written mainly for people who come from a scientific or technical background and hence is perfectly suited for someone like me. Each chapter aims to analyse and fix a single ‘problem’ and you can read each chapter in whatever order you like.
With that, I bid you farewell. I believe my next post is going to be about ‘passive/active voice’. Exciting times indeed
Posted in blogging, news, writing | Leave a Comment »
Posted by kerneljack on April 5, 2007
We have just come back from a brilliant trip to Switzerland! The weather was awesome throughout our trip. We spent most of the time in Lucerne, where we stayed at the Hotel Drei Koenig. On our first day we decided to wander around Lucerne’s Old Town and see as much of it as possible. We ended up quite dreadfully tired and in the evening we just went back to the hotel and simply crashed.
We went on a trip to Mount Titlis the next day. Mount Titlis is one of the highest mountains in Switzerland, at 10,000 feet. I must admit to feeling quite terrified at that height. I was feeling quite disorientated.
The next day we made a long hiking trip up Mount Rigi-Kulm. To get to the start of the hiking point, you have to take a cruise along the river, then a trip up the mountains by train, before you get to your starting point. This is the day of our trip which I think we enjoyed the most.
We spent the rest of the trip in and around Lucerne and on the last day we made a day trip to Zurich. This allowed us to catch our flight straight from Zurich Airport back to London. All in all, a wonderful and highly recommended to anyone interested
Posted in holidays, news, switzerland | Leave a Comment »
Posted by kerneljack on March 31, 2007
Wow, I finally passed my driving test about after 3 or 4 tries! It is quite difficult to pass in this country, they can fail you for very simple mistakes like forgetting to turn your indicators off when stopping or taking off.
In any case, I’m glad I finally passed, now I need to learn about cars and what to buy, etc. I’ve just never been into cars, but I feel I might become an avid car enthusiast. I do like to tinker with technical things, the more geeky the better
Posted in cars, driving, news | Leave a Comment »
Posted by kerneljack on October 26, 2006

LinuxWorld started yesterday here in rainy London and I had a great time! It was the first time ever that I wasn’t a visitor, but was helping out at the Jokosher stand. I did several demos of the app to tons of people and we managed to distribute more than 130 Jokosher flyers to interested people.
I was quite surprised at the level of interest in the app, and we managed to solicit a great many feature requests from people, some of which will hopefully end up in Jokosher someday, making it rock even harder! I will definitely try to help out at more of these events in the future
You can find the photos I took with my camera phone at my flickr photo page.
Posted in coding, computers, linux, podcasting, programming, python | Leave a Comment »
Posted by kerneljack on October 18, 2006
Since we moved to Croydon in July I have grown particularly fond of our Saturday morning food shopping. Surrey street is not very far from our place and hosts a farmers market every day, except Sunday. There are a great variety of fruit and vegetables available, plus a fishmonger that sells freh fish everyday. I got my Sony Ericsson W850i phone last week (will write a review soon!) and decided to see how good its camera is by taking some pictures of Surrey Street and the fishmongers. I’ve put a few pictures below and you can see the rest by going to my Flickr page. Enjoy
Posted in food, health, shopping | Leave a Comment »
Posted by kerneljack on October 13, 2006
I’ve been waiting for so long now to import my old WP blog from my old web server to this site. The problem has been that until now, wordpress.com blogs did not have an ‘Import Self-Hosted WordPress Blog’ option so I couldn’t move my older blog across. The only option I had was to spend many days manually adding all of my posts to kerneljack.wordpress.com and correcting all the dates, which would have been a nightmare.
Thankfully I just discovered the wordpress-to-wordpress plugin which allows me to export my old blog as a WXR file which wordpress.com can then import. Now that I am back I will try to keep updating this blog more often.
Posted in blogging, software, website | 1 Comment »
Posted by kerneljack on May 2, 2006
I needed some extra RAM in my 512MB laptop to do some Java heavy lifting (Eclipse, Netbeans, JBoss, Profilers, etc). Those things can take up a lot of RAM, not leaving much for Firefox and other apps. Seeing that my laptop does not cover upgrading RAM under the warranty (very strange) unless done by authorised personnel, I went down to the store I bought my laptop from (Micro Anvika) and asked for a quote. 130 pounds is how much they wanted for a 1GB stick; in contrast I could get the same type of RAM from Crucial for 89 pounds!! That’s a saving of just over 40 pounds! I was hoping it would all go smoothly and the RAM would work because if something messed up I would be without a laptop and a warranty
It all went perfectly of course and a month later I’ve had no problems with the RAM. It’s so simple to buy it from crucial too. They have a comprehensive database of products (computers, laptops, motherboards, etc) and the type of RAM these products take. Simply make the right selections and they tell you what to buy, even how many slots you should have free by default. If even that’s too much for you and you happen to be on a Windows PC or laptop they have an ActiveX applet that will download and try to figure out the RAM type for you. This didn’t work for my system though.
Anyway, the moral of this story is: Always buy RAM from Crucial. It is crucial that you do so
Posted in computers, hardware, website | Leave a Comment »
Posted by kerneljack on April 2, 2006
With all the April Fools jokes flying around, The Scobleizer Dashboard has got to be funniest thing I’ve seen in a while. It would be great if someone actually came up with something like this so a blogger can instantly monitor what’s being said about him all over the web. Kind of like web stats but for an individual blogger or blog; maybe I’ll call it BlogBuzz or BlogStats. BlogBoard, BlogDashboard, dont’ sound that nice. Maybe MemeBoard? That sounds better.
Posted in computers | Leave a Comment »
Posted by kerneljack on March 31, 2006
A lot of the time at work I have to come up with quick solutions to various programming problems, and I mean *real* quick. There is usually very little time for finding the right library or open source toolkit that has already solved the problem or some part of it and then to figure out how to integrate that into our own workflow. It is usually much quicker to simply write a few scripts that get the job done.
In such situations I increasingly find myself solving these problems using the Python programming language. I’ve usually whipped up scripts using bash scripts and even Perl but I often find that I have to “re-learn” Perl again and again, or at least the part that I’m temporarily using to solve some problem. Python just seems (and looks) so much natural and cleaner. I’ve been fascinated by Ruby recently after my brush with Ruby on Rails and I am seriously trying to find a project to use it in all the time!
Anyway I wanted to give some examples of Pythons’ ability to solve quick problems. I’ve used it to make remote backups, check if certain services are running remotely and to fetch and delete mail off a remote server. For example, the following snippet of code can be used to send mail:
import smtplib mailServer = smtplib.SMTP(serverURL) mailServer.sendmail(sender, to, message) mailServer.quit()
Really sweet and simple. I’m sure you can do this in only 1 line or even half a line in Perl (or even Python!) but this is really clear and concise. When I needed to write a script to send mail, I simply googled for it and dug this up in literally 20 secs! That’s one other reason I like writing scripts in Python: you can always google for snippets of code to do stuff.
Similarly, the following can be used to check if SSH is running and accepting connections on a remote server:
IDENT_STRING = "SSH" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, int(PORT))) data = s.recv(1024) s.close() if data.find(IDENT_STRING) == -1: sys.exit (1) # if everything OK, exit normally sys.exit(0)
If you put this in a script and run it, you can use the exit code (echo #?) to determine if SSH was running or not. Very useful if you’re writing a script to make backups to a remote server; you need to make sure that the service is up and running on the server and that it is accepting connections from the local machine.
I will try to see if Ruby makes any of these tasks even easier to do or perhaps easier to write and comprehend. I might even give Groovy a try since Java is my day job and Groovy is described as a scripting language for Java programmers.
Posted in coding, computers, programming, python, scripting | Leave a Comment »
Posted by kerneljack on March 7, 2006
“Rails is the most well thought-out web development framework I’ve ever used. And that’s in a decade of doing web applications for a living. I’ve built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before.” -James Duncan Davidson, Creator of Tomcat and Ant
I tried out the Ruby on Rails (RoR) framework this weekend and I’m quite impressed. I used Apple’s new tutorial for developers which explains how to install and quickly get up and running with a simple Accounts/Expenses webapp. I did encounter one minor glitch while following the install instructions because I was installing on my Debian Linux webserver, instead of an Apple machine. It seems the default ruby install no longer comes with the ruby-zlib library, but that was quickly fixed by following these instructions.
Rails applications all have a consistent directory structure, so you always start by running a command to generate the directory structure for you. This creates directories like app, config, doc, test, etc. The names are very familiar and easy to remember and they reinforce the purpose of the directory, i.e. the test directory is used to hold unit tests and functional tests for our application.
Automatic test creation makes testing an obvious and integral part of the development process, not an afterthought. It encourages you to think of a testing strategy upfront. This is perhaps the single most appreciated aspect of Rails development for me. You are supposed to test your code in other environments, but programmers often write code and if time permits, write tests. Rails tries to make it easy and painless (as much as possible) to test your code.
The next thing I learned about was the fact that Rails, like the Struts framework, tries to explicitly embed the notion of Models, Controllers, and Views within the development workflow. The concept of Actions, which are sent to Controllers in Rails is familiar to Struts. It is very easy to take a Rails URL (as shown in the example) and figure out how the server is going to parse and execute it.
Validation came next and I was suitably impressed. You simply need to add a few lines to the model, describing what each field should validate as, sort of like describing a type for a variable. Simply restart your server and voila, type rubbish in a field and Rails will highlight the field in red and ask you to re-enter it.
After all that, the tutorial shows you how to create a relationship between two models, much like in a relational database. The relation is that ‘one account can have many expenses’. This is accomplished in Rails by adding a ‘belongs to’ field in the Expense model (an expense belongs to an Account) and a ‘has many’ field to the Account model (an Account has many expenses). Simple as that.
Other things covered in the tutorial were:
Overall an excellent introductory tutorial which has left me wanting more. I will definitely go through the Rails website and find out more about RoR and what it can do.
I know this is a small toy example and I want to know how RoR handles in a real mission critical business app as those are the only kinds of apps developers write these days
RoR is easy to code for, but is it easy to maintain? After we get past the simplicity of the example app, how hard is it to write huge apps in it, and how long does it take a new developer to become familiar with and productive with a new codebase? These are all questions that I need answers to and I have the feeling that RoR won’t disappoint.
Posted in coding, computers, software | Leave a Comment »