Posts about Computing

Google Chrome Beta 4 on Linux

November 4th, 2009

I’ve used Chrome on and off in Windows for a while now but finally tried it out on Linux (Ubuntu 9.10 to be exact). It was easy to install the .deb file from Google and I had it running without any problems in less than a minute.

Feature wise it’s the same as the Windows version but the performance is fantastic, it starts in under a second and page loads take fractions of a second. The whole browser feels incredibly fast, in fact faster than anything I’ve tried before.

I recommend that if you’re running Debian or Ubuntu you should give it a try and see what you think.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Installed Ubuntu 9.10 into a VM

November 4th, 2009

I installed Ubuntu 9.10 into Virtualbox last night just to kick the tires so to speak.

The installation went very easily as to be expected from Ubuntu. There’s not many options to choose but even so it’s a very polished and smooth procedure.

My first impression of the desktop is that, like the installer, it’s very polished in appearance. I really like the new notification icons, they are very clear and more professional than before. My main comments are that it seems very responsive, there’s no delay when clicking on menus and applications open almost immediately.

I would say that Firefox opened from a cold start in about 2 seconds and even Open Office opened much quicker than I expect.

I tried to use bootchart to get a feel for how long the boot process took, but unfortunately even after multiple reboot it continued to report boot time of over 1 minute which I know must be wrong. My gut feeling is that the boot was around 25 to 30 seconds.

Having used Fedora for a few years now I don’t think I’m lightly to switch and I miss many things out of the box (there’s no GUI to control the firewall or services for example) that I’m used to in Fedora. Plus I like the ability to choose the install packages on the Fedora DVD instead of adding them later from the repositories.

Having said that, I think Ubuntu looks and performs great and the other distros can certainty learn a lot from Ubuntu 9.10.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

C# Replace New Lines

October 29th, 2009

If you know you’re working on the Windows platform and all data will come from Windows then to replace newlines using C#.NET we just use.

myString=myString.Replace(Environment.NewLine,"");

In all other cases it’s much safer to string together the Replace function to cover all possibilities.

myString=myString.Replace("\r", "").Replace("\n", "");
Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

C# IsNumeric

October 28th, 2009

If you do a search for ‘C# IsNumeric’ you’ll find a lot of hits talking about why this function is available in VB.NET but not in C#.NET. It’s used to test if a given string can be converted to a number.

I agree it’s a very useful function and there’s lots of possible solutions, the main ones being

  1. Loop through the string and check each Char is a number
  2. Use Double.TryParse is a very popular one since it doesn’t throw an exception on failure
  3. Use Convert.ToInt32 inside a try/catch block
  4. Using a Regex expression

I really wanted to use Double.TryParse but unfortunately this will return true for numbers that are decimals. Therefore if you want to test a string for whole numbers you also have to check the string for periods or commas (using string.contains) depending on your locale.

For this reason I tend to use the Regex solution, mainly because it’s very short and simple to implement.

public static bool IsNumeric(string str)
       {
            return Regex.IsMatch(str, "^[0-9]+$");
       }

It also requires the using directive System.Text.RegularExpressions

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Linux Out of Box Experience

October 15th, 2009

I recently had a problem with a 2 page document scanned to pdf that was far too light to read, the black text had become light grey and the contrast was too low.

I searched how to fix this but everything suggested using Photoshop to edit each page, then save to pdf and finally using some extra program to stitch the 2 pdf files together.

At this point it was obviously going to be easier using Linux so I opened Virtualbox and started Fedora 11.

I imported the pdf pages into GIMP, edited them and saved as pdf, then I used Ghostscript to join the files using the following command:

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

I could have done all of this on Windows but not without searching and installing extra programs, in Fedora it was all just there

This is one of the reasons I love Linux, for me the out of box experience leaves Windows in the dust.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Ubuntu 9.10 Boot Time

September 30th, 2009

After reading this article on optimizations made to Ubunbtu 9.10 in relation to the boot time I thought I would check this out in a virtual machine.

I understand that much of the work done will help when booting from an SSD drive and using a virtual machine adds an extra layer between the OS and the bare metal but I though it would be interesting to compare the boot time to Fedora 11, that I also have installed in a VM.

Setting Ubuntu 9.10 Alpha 6 and Fedora 11 up in identical virtual machines, both set to auto login with bootchart installed I was very surprised by the results.

Ubuntu booted in between 1 minute and 1 minute 6 seconds while Fedora 11 booted in between 32 and 34 seconds. This is by no means a controlled test and Ubuntu is still in alpha status but I was pretty shocked by the results. Hopefully by it’s release it will be booting in the sub 30 seconds range.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Non Removable USB Disks

September 30th, 2009

I downloaded Ubuntu NBR to install on an Acer Aspire One.

On a side note why the hell is there no download link direct from the main page, it takes 3 more pages to find the download link. It’s almost as though they don’t want you to use it!

Anyway after downloading the ISO file I also downloaded the Imagewriter for Windows to copy the ISO file to my USB disk. At this point I realised that the disk is not recognised as a removable device and so the tool does not ‘see’ it.

Next I tried the Fedora Live USB Creator but that has exactly the same problem. Finally I tired a different computer but with the same results.

After reading this bug report for Ubuntu Imagewriter it seems to be some issue with certain USB disks where they are not ‘seen’ by the OS as removable disks. Even though my disk does show the “Safely Remove Hardware” list it still doesn’t work.

I’ll try from within Linux next to see if that solves the problem.

Edit: I just tried a different key and it works perfectly. I’d be interested to know how to set Windows (XP SP3) to see a disk as either removable or fixed.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Simple HTTP Server with Python

September 24th, 2009

I came across this article on Linux Journal today about using Python to run a very simple HTTP server from any directory. I tested in on a standard install on Windows and it works perfectly.

As one of the comments says there’s loads of great command line tips to be found at commandlinefu.com, including the one I mention here.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

My Company Upgrades to IE7

September 14th, 2009

I received an email at work on Friday that all work computers will be upgraded to Internet Explorer 7 in the next few days. I nearly jumped out of my seat in joy. As someone who develops Intranet pages I can’t begin to say what a pain in the backside it is to support IE6.

IE 7 certainly isn’t perfect but it’s a damn site better than IE 6 especially in term of rendering and performance on JavaScript heavy pages.

Since IE 7 was released in October 2006 maybe we’ll get IE8 in March 2012! Of course I understand that it has to be thoroughly tested against all company applications; but to be honest we don’t have that many and of those I’m pretty sure many actually use Java so it doesn’t have a lot to do with the browser.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Fedora 11 on an Old Laptop

September 10th, 2009

My old laptop from 2003 runs the original Centrino (Banias) with a 1.3MHz Pentium M. Up till now it’s dual booted Windows XP and Fedora 9 but since I never use it I decided to wipe clean and just install Fedora 11.

It actually runs amazingly well on a full gnome desktop, it’s fast, responsive, boots in about 30 seconds and shuts down in about 5 seconds! I’m sure it actually runs faster than it did with the old install.

I’m pleased that a new OS still runs fine on an old laptop and despite the increasing size and complexity of the OS it doesn’t seem to have impacted performance.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

Switch to our mobile site