Archive for June, 2009

HP Website Crazy Links

Friday, June 26th, 2009

I Googlged this and I came up empty, but I can’t be the only person to have noticed it. Maybe other people just aren’t calling it crazy links ;)
Here’s an example of the URL for an HP product that I was looking at:

https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&cp=1-11-15-119^1211_4000_100__

Uh, have you guys looked at your own URL’s??? I get that internally, the CMS you’re using might make them like this, but it’s compltely unfriendly! Even if you’re Mr I-See-Code-In-My-Dreams Software Engineer and ignore feeble humans who don’t remember 64 bit integers off the top of their head, you should realise that it’s terrible for SEO. Or maybe HP just don’t care about SEO because they are already a trusted site in Google. Mind you, I can’t say the same thing for their internal web search engine; every time I search on their website using their own search I come back with a lot of irrelevent results. Go Google Go! I also don’t get why it’s HTTP’s…are HP worried about man-in-the-middle attacks on their public information? “Oh look boss, if we buy this product it says our company will automatically become cool and guarentees to double our stock prices” (oops, SNAP!).

Seriously though, it’s an absolute pain when you have to share the link with someone else. “Oh, look at this from HP…oh it’s 404′ing for you? Sorry, copy and paste didn’t copy the whole URL because it has funky characters in it, let me manually select this crazy long monolithic URL that spans multiple adress field screens for you….oh never mind, lets just use IBM!” :)

Entrepreneur Fun on YouTube

Thursday, June 25th, 2009

I was trudging through some blogs from startup companies in Silicon Valley and discovered a bunch of [short] presentations from some of the people involved with the startups there. I’ve (re)posted my favorites here - the ones that used humor to get their point across. I completely agree with the points I’ve had experience with, and I can see where they’re coming from on the others. If the first one doesn’t make you laugh, then the rest probably won’t either, you probably enjoy a different style of humor to me :)

Rainy Days

Wednesday, June 24th, 2009

I came out to the boat on Monday afternoon and I’ll be here for most of the week. I could have sword when I checked the weather forecast on Saturday that it said the whole week was going to be fine. I couldn’t have been much more wrong. It rained all day today. I feel like I’m in England. I mean, it literally rained the whole day (just not very hard). Very depressing: it fogs up the view out of my window :)

Alternating Colored Rows in Open Office Calc 3

Monday, June 22nd, 2009

You’ve probably seen spreadsheets produced using Microsoft Excel that have this kind of look. You might have seen files produced using OpenOffice Calc that look like this. Excel 2007 comes with many (and I mean lots) of styles for the tables, many of which include alternating row colors. Calc comes with about 10 styles in total, 3 of which use alternating styles, none of which look very “professional” in my opinion (I’d never use them), and all of which are unwiedly and unconfigurable. So, aside from selecting the rows individually one by one and setting the alternating colors (then inserting a cell and having to redo it all over again, ugh), does OO Calc 3 provide an easy way to do this?

Not so far as I can tell. Google showed up a couple of options, all of which were either too hard to setup or too difficult to change once it was setup. I have to conclude that OO3 doesn’t provide a pre-built function for this. But it does give the tools necessary to create one. I’m talking about the conditional styling. Here’s what I do.

We want to apply a conditional style that says “If this cell is even then make it color 1, if it is odd then make it color 2″. Conditional formatting relies on styles being defined. You can’t just tell the Conditional Formatting box that you want the cell to be color 1. You have to tell it that you want the cell to be style1. No problem, all we need to do is create a style based off the default that has a different background color.

If you’re styles window isn’t showing, just go up to the Format > Styles and Formatting option from the menu and it will. In my window I already have the styles defined, but you want to right click in the window and select “New”. Set the name of the style (as you can see, I’ve given mine obvious names for what I used them for). Go to the Background tab and select your desired color.

Click ok to exit the dialogue box. You’ll probably want to create 2 styles like I have, one for your “light” row and one for your “dark” row. Once you’ve done that, we’re ready to setup the alternating row colors in the actual table. Select the cells that you want to apply the alternating row color to and go up to Format > Conditional Formatting like I’ve done below.

Once you’re in the Conditional Formatting dialogue box, we need to set 2 conditions. The first one is “if cell is even” and the other one is “if cell is odd”. Every cell falls into one of these two categories in an alternating fashion. By default the dialogue box asks for “Cell Value”. You need to drop that box down and select “Formula”. You also need to tick the 2nd condition box and drop that down to “Formula” as well. It doesn’t matter what order you enter these in, but the formula for the odd cell is:

MOD(ROW();2)==1

And the formula for the even cell is:

MOD(ROW();2)==0

Then select the appropriate style for each i.e. you’re newly created styles.

Click OK to apply the settings and your rows should be alternating with the colors you set in the styles. Woohoo! :)

Some notes:

  • To edit the colors that are applied, just edit the styles. Click on your style then click on “Edit” and just go change the background color.
  • Conditional formatting is applied on a per-cell basis just like when you make the text in one cell bold. If you copy a cell from somewhere else in the sheet that is not part of the alternating rows, and paste it into the sheet (overwriting some other data perhaps), the pasted cell will not have the conditional formatting and thus will probably not have the right color. The easiest way  I have found to fix this is to re-select the cells in the alternating colored table, and re-apply the conditional formatting. This is easy because when you go into the conditional formatting dialogue box, the formulae should already be there, and clicking OK will apply it to the new cell.
  • The formatting is dynamic. That is, as you insert rows, the numbers of the rows change, and so the table automatically re-adjusts for the correct alternating row colors.

Redline

Saturday, June 20th, 2009

It’s 2am on a Saturday morning and I’ve just finished watching Redline. It’s a 90 minute movie, and it took me over 2 hours to watch. Why? I got bored and paused it a lot. This movie is the biggest tart-toting B-grade-actor weak-plotted movie I’ve seen in a long time. It’s almost unwatchable, and the plot is so weak that I’m not surprised that no brand-name actors particpated. So what made me finish watching it? The cars are fantastic. I do love shiney Ferrari’s :) The race scenes are quite nicely filmed, not as good as The Fast And The Furious (any of them), but they are longer and still good.

The movie starts off with a group of rich people making bets on street racers. Then one of the main characters has his brother arrive back from Iraq, and it turns out he is some sort of ninja who specialises in blowing peoples houses up and picking fights. Oh, the main female lead, who’s occupation is a mechanic garage owner and part time singer, also turns out to be some sort of kung fu guru, but she’s not so handy with the C4. This probably doesn’t make much sense, and neither does the movie - the plot is just too fragmented and the actors are not good enough to pull it off. The slogan on the cover is about right, but that’s all that is any good in the movie.

FreeBSD 7.2 & Eclipse Installation Problems

Tuesday, June 16th, 2009

I compiled Eclipse from ports in PCBSD, which is the FreeBSD ports. I have updated them, so they are current. Upon running Eclipse, it bails and dumps the log file:

java.lang.UnsatisfiedLinkError: no swt-gtk or swt-gtk in swt.library.path

Along with a bunch of other referencing errors as to why the file is needed. The solution? Remove Eclipse:

pkg_delete eclipse-3.4.2

Then reinstall it as the package:

pkg_add -r eclipse

Why didn’t I do this originally? I did, it failed to install for some reason or other. Incidentally, when I installed it from the package system, it installed 3.4.1. Not that it really matters, it runs, and that’s what matters! *And* because it build the dependencies from source (I only removed the Eclipse program), I have an optimized version of the JDK woo!!!

PCBSD and Mencoder

Monday, June 15th, 2009

Recently I wanted to rebuild the index of an AVI file in PCBSD. I know AVIDemux will do this if you open the AVI and set the audio / video encoding to copy, and save it. This is good, because AVIDemux is available as a PBI installation package for PCBSD. Unfortunately, AVIDemux failed to open the AVI file (probably because the index was bad and it got confused). Anyway, I know that mencoder (the encoder part of MPlayer) will also do this. It’s command line based, and not included in PCBSD. So, I built it from ports. It wouldn’t build with x264 support, but that’s ok, I got it to build with the ‘normal’ codec selection.

My first attempt to run it yielded:

[spanky@zen /usr/home/spanky]$ mencoder
/libexec/ld-elf.so.1: Shared object “libtwolame.so.0″ not found, required by “mencoder”

Bu in the build process it had stated that the TwoLame libraries were found. I don’t know where it found them, but *I* found them in the VLC directory. Because PCBSD uses isolated installation files (i.e. the installation file includes all “shared” libraries required by the program for execution), and it is possible to uninstall those programs, all libraries that a program needs are kept in that programs directory. That means, if you install 2 programs from a PBI that use the same library, you will have 2 copies of it on your system. This isn’t unusual, Windows does this as well. Anyway, I happened to have VLC installed from a PBI, and VLC uses the TwoLame library also. So, it was simply a matter of linking the VLC version to the normal library search paths so that mencoder would execute:

[root@zen]/lib(85)# ln -s /usr/Programs/vlc0.9.9a/lib/libtwolame.so.0 /usr/lib/libtwolame.so.0

And then everything was peachy and I could [M]Encode!

Some PCBSD Experiences From The Desktop

Monday, June 15th, 2009

PC-BSD is supposed to be a version of FreeBSD that is tailored for use as a Desktop OS. Some of my experiences so far:

1. Installation is excellent, and fast (20 mins). No need to have an internet connection, and not many questions in the installation. Everything worked with autodetection on the reboot of the installation, so this is all good.

2. Updates provided through an automated system (which works). This means the main applications that I use for desktop use (Firefox, OpenOffice, VLC) are all easily updatable. This is good because OSS moves very quick, and by the time any distribution standardises on a release, updates for half the software already exist. The downside is that there is still a reasonable amount of software that I use that is not in the PCBSD format, but I’m sure that will change as they get bigger and add more packages.

3. Bad printing support (for me). This is a BSD problem, not a PC-BSD problem, but ultimately it makes it a bit difficult to do “real” work on my PC - I can’t print it! I have a Samsung CLP-300 which has Linux drivers from the manufacturer. Additionally, the OSS world has support for it in the SPlix software package (Samsung Printer Language software). Unfortunately, the SPlix version in FreeBSD ports is horribly out of date - it hasn’t been updated since the end of 2007, and is still using version 1.x. Version 2.x is out. This wouldn’t be such a problem except that printing on the CLP-300 with the 1.x driver fails with the error: “Filter rastertospl2 for printer CLP300 not available: No such file or directory”. This is a known error in 1.x that was a problem for many Linux distributions, and they promptly updated it. FreeBSD, for some reason, has not.

4. Although everything worked out of the box, the graphics performance is sub-par. I have an ATI HD 2900XT, and ATI don’t produce FreeBSD drivers. nVidia do, but only 32 bit. So I guess I can’t use a video card in my computer. Oh well ;) Seriously though, it works, but there is no 3D hardware acceleration in the open source drivers for the more recent cards. This means that all the OpenGL effects used by the fancy GUI desktop really put a strain on the CPU (30% of both my cores are being used JUST to draw graphics at the moment).

[Update, 16th June] 5. When you shutdown uncleanly (i.e. without actually initiating it from the desktop and waiting for it), upon reboot PCBSD makes you wait for the file system check. Also, it doesn’t actually tell you the status of the file system check! Linux Ext3 makes you wait as well, but at least it tells you thae status so you have an idea of how fast it is going / how long it has to go. Also, FreeBSD has the capability to background the file system checks (I have this set on some other actual FreeBSD test systems), so I don’t know why PCBSD chose to do this. Maybe just for safety…

PC-BSD 7.2 Ports Error

Sunday, June 14th, 2009


When building ports in PC-BSD 7.2 I often get this error:

autom4te: need GNU m4 1.4 or later: /usr/local/bin/gm4

The actual cause is that /usr/local/bin/gm4 does not exist in PC-BSD. PC-BSD places it in /PCBSD/usr/local/bin/gm4. All you need to do is symlink it, and everything should build fine:

ln -s /PCBSD/local/bin/gm4 /usr/local/bin/gm4

Ubuntu Stable Kernel Not So Stable

Thursday, June 11th, 2009

I dist-upgraded my Intrepid machine to Jaunty a couple of days ago. I thought it might break something, boy was that an understatement. As is usual on dist-upgrades for me (Debian and Ubuntu, for the past 5 years or so), the upgrade doesn’t complete the first time it is run. It runs into dependency issues. Running it multiple times consecutively resolves them (must be some race conditions, sigh). Oh I should mention the ONLY reason I was performing the upgrade is that I wanted access to OpenOffice 3. It’s been out since the beginning of the year, but Ubuntu have only just added it into their distribution. It’s MUCH better than 2.4.2, and I’d been running it from the binary distribution that I’d downloaded. There were no problems working inside OO3 from the binary distribution, the problem is, nothing knows that it exists. The install paths for the binary are quite different to Debian’s (and thus Ubuntu’s) and Firefox refuses to acknoledge it as a possible application for anything, and the Thunar file manager conveniently never remembers it’s location when I “open with”. It was driving me nuts.

So after the first dist-upgrade, my X-server broke. Now, that was kind of expected as I’m using a proprietary ATI driver. But that wasn’t what broke. What broke is that my mouse no longer functioned in X. GDM would start, and I just couldn’t move the mouse. I thought it might be related to the partial upgrade, so I run the dist-upgrade again, and also restarted for good measures. The result? The computer failed to boot. It seems that in the current stable version of the Kernel for Ubuntu, 2.6.24, there is a bug with some chipsets that causes the SATA drives not to be recognised. Thus, there is no drive for the kernel to boot from. Now, dist-upgrade is not intelligent to realise that the kernel is a core piece of software and perhaps that old kernel boot image should be kept and marked as “old” (as with what happens when you follow the kernel.org instructions for the source), so I was left with an unbootable system.

With the help of a rescue CD and chroot, I upgraded to the unstable kernel, 2.6.28, and it picked up the chipset properly again, and booted. However, the X problem remained. I fiddled with the X configuration, moved my mouse to a different port, no avail. Eventually I decided to just upgrade the xserver-xorg package and the corresponding x packages to ensure that they installed correctly. At first I couldn’t do this because the installation of the unstable kernel does not automatically install the kernel modules packages, and so I had no ethernet. I had to do the rescue CD + chroot trick to install the linux-modules-2.6.28-11-ubuntu package. After this, I still had no ethernet. For some reason it was not autoprobing my ethernet device deiver. Grr. I eventually also found out that my ethernet device, the Attansic / Atheros L1 is under the Firewire bus. I have NO idea why. Inserting the firewire module results in the ethernet driver loading up straight away. Eventually I just added the ethernet device module, atl1, to the /etc/modules.conf to force the system to load it at startup. Phew, at least it worked, now I could update X!

The result? Now when I start the XServer, it crashes immediately. Not the XServer, the whole computer. I get funny images on my monitor, as if it used the graphics card incorrectly, and then it crashes immediately.

So I finally made the decision to switch to FreeBSD as a desktop operating system. I lose the ability to run VMWare but that’s about it. I chose PC-BSD because it has commercial support, which I thought would make it more stable and configuration-friendly (it does). In order to get the OS installed, I booted off the XUbuntu 8 live CD that I had and used GParted to remove my old Linux partitions and combine them into a big partition for the new OS. I left the data partition (a 160G partition containing my data, always nice to keep the OS and the user data separate). When PC-BSD installed, I didn’t notice the parition size didn’t match up to what I’d just created. The result? PC-BSD thought that it was on the whole area of the disk; the parition pointers were all wrong. I guess GParted broke something. I should have just used fdisk :/

Now, I managed to get this fixed, with Acronis tools and a reinstall of PC-BSD. I got everything sweet and began to unpack some archived data off the data parition. It failed, crashed the computer, and reset the power. Upon reboot, PC-BSD wouldn’t mount the ext3 partition anymore; it complained of a bad superblock. I’ve had this before, it usually just means the drive needs and FSCK because something went wrong in writing to it. I booted back into the XUbuntu live CD, ran FSCK and hey presto, MANY illegal block errors. I left it running for about 6 hours (fsck -y) and came back to find that it had removed all files, and recovered about 60G of the 160G in the lost+found directory. My best guess is that GParted screwed the partition pointers up, then PC-BSD wrote to some wrong areas of the parition so that when it mounted the ext3 data patition, the inodes were broken, and the FreeBSD implementation of the code for ext3 couldn’t cope with it and made the problem worse. I’m still recovering my data, and I realise I have lost about half of it. It’s ok, because it was mainly used as a buffer drive, but I don’t have a full list of what is gone which is annoying. I don’t think I’ll be going back to Linux for a while. In BSD they are quite good at making sure applications are quite stable before putting them into the ports area (much better in my experience, and faster - they had OO3 ages ago!!).