Making CSS UL Menu’s Browser-Consistent

If you’ve ever made a web site and wanted it to look consistent from one browser to the next, then you’re well away of the difficulties that are involved. Fixing these sorts of styling issues can be a major annoyance, however, I like to hunt down issues on my own pages from time to time and stand up to the challenge.

One issue that I can across today was dealing with horizontal menu positioning using unordered lists (<UL>) and some positioning. The positioning wasn’t consistent between browsers or even operating systems.

The bad

I started by opening the affected page in multiple browsers (Internet Explorer, Safari, Chrome, Opera & Firefox) on multiple computers (Mac, Linux & Windows) and getting some initial comparisons. There were 3 different variations and (oddly enough) the same browser didn’t necessarily render the same on a different operating system. So there I was. A puzzle… and I like puzzles.

Some of the first things that I inspected were font sizes and families. It occurred to me that different operating systems may differ in fonts, so it seemed like a good starting point. I tested this by forcing a common font: Arial. That wasn’t the problem. The inconsistencies remained consistent.

I also checked into the possibility that the <UL> or <A> elements were applying different heights. Typically anchor elements, <A>, use a display style of inline. If you’re implementing a menu similar to mine then you’re likely applying a block style, which permits better dimension definition of the element. Forcing height on these elements also did not resolve the issue.

I was running out of ideas, but then it hit me. Line-Height. While the other styles appeared to be consistent between browsers and operating systems, there was one style that I’d previously worked with and knew was certainly NOT consistent: line-height.

The good

After forcing a consistent line-height in my CSS, all browsers suddenly began respecting my intended styling. Sigh of relief.

On that note, its worth bringing up the success that browser competition has brought to HTML and CSS rendering standards over the past few years. The push for the fastest and most capable browser has brought a scattered group of browsers a little closer and the result is that we get to enjoy dealing with fewer and fewer bugs.

While your average Joe web developer may have dug around for hours for this issue to no avail, I must say… I thought it was nice to face such a subtle issue rather than being forced to use some crazy IE specific hacks like for legacy IE.

[How to] Create a bootable USB stick on OS X

A couple of days ago I decided to reinstall my operating system since it was failing. I quickly realized that the only functional system that I had at the time was my MacBook Pro. After a bit of Googling, I came up with a pretty straightforward guide, but they really could have formated it to make it easier to follow.

I’m going to run you through the same steps and you should be able to use this guide to create a bootable USB stick for Windows, Ubuntu, Fedora, etc.

The Guide

  1. Download the disc image that you want to use. (I’ll use Ubuntu in my example, but you can use Windows or whatever you’ve downloaded.)
  2. Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight).
  3. Convert the .iso file to .img using the convert option of hdiutil as shown below (replace the paths and image names to suite your needs):

    hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso

    Note: OS X tends to put the .dmg ending on the output file automatically, creating the file target.img.dmg. I’ve always removed the .dmg extension.

  4. Run diskutil list to get the current list of devices.

    diskutil list

  5. Insert your flash media.
  6. Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2).

    diskutil list

  7. Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2).

    diskutil unmountDisk /dev/diskN

  8. Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.imgor ./ubuntu.dmg).

    sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m

    Using /dev/rdisk instead of /dev/disk may be faster
    If you see the error dd: Invalid number ’1m’, you are using GNU dd. Use the same command but replace bs=1m with bs=1M
    If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the ‘Disk Utility.app’ and unmount (don’t eject) the drive.

  9. Run diskutil eject /dev/diskN and remove your flash media when the command completes (replace N with the disk number).

    diskutil eject /dev/diskN

  10. Restart your PC and enter the boot options to choose the USB stick. If you’re installing to your Mac, restart and press alt/option key while the Mac is restarting to choose the USB stick.

If you’ve made it this far, then you should be well on your way to installing a new operating system. Good luck!

Create a Bootable Windows 7 x64 Install Flash Drive from 32-bit Windows

Creating a bootable Windows 7 x64 flash drive from within a 32-bit install of Windows is not as straight forward as it may seem. I recently had to go through this process myself, so I’ll document the steps below.

Things you’ll need

  1. Windows 7 x64 disc image
  2. Windows 7 USB/DVD Download Tool
  3. 32-bit bootsect.exe

Create the installer

  1. Install the Windows 7 USB/DVD Download Tool.
  2. Extract the 32-bit bootsect.exe file to the directory that the Windows 7 USB/DVD Download Tool was installed to. This is usually something like “C:\Users\username\AppData\Local\Apps\Windows 7 USB DVD Download Tool“.
  3. Run the Windows 7 USB/DVD Download Tool and select your Windows 7 disc image. Follow the remaining steps in this tool and your image should be created successfully!

If you’ve followed these steps and your flash installer was created successfully then your next step is to, of course, install Windows 7! Don’t forget to change your boot options to load from USB!

This information is scattered on the web and slightly detailed on the Windows 7 USB/DVD Download Tool page, but I was not able to find a guide laid out as simplified as the one I’ve provided above. In most tutorials they suggest that you download the entire 32-bit iso in order to get the 32-bit bootsect.exe application, but I’ve made that step a lot less troublesome. Hopefully this has helped you!

How Little I Use Windows

windows-7-how-often-i-use-it

Here’s a funny screenshot that I took earlier today that shows how little I actually use Windows these days.

Its funny to me, because for a while now I’ve only booted up in Windows to manually run updates and quick virus checks with the occasional Steam gaming session.

I run updates and scans almost religiously, so I know that October 3, 2010 was the last time that I even used this partition. Thats nearly 4 months of booting only in Linux (Ubuntu and Fedora) on my Desktop.

I do, however, use Mac OS X now on my new MacBook though. I’ve still not gotten around to installing Ubuntu on it, but maybe one day I’ll stop being lazy and just give it a spin.

I’ve known for a while that I could finally cut the cord from Windows, but this just officially confirmed it for me. That said, I won’t soon be giving up my free (via School) copy of Windows 7 Professional. :D

Cr-48: Win, Mac, Lin and CrOS

Google’s new notebook, called Cr-48, is now capable of running any major operating system of your choice!

News came out last month that Cr-48 was able to run not just Googles new Chrome OS, but also Ubuntu!

Now, you can apparently also run Windows 7 or Mac OS X!

Get Your Last.fm Wallpaper From Wallpaperfm

An example from my Last.fm account in Collage mode.

If you have an active Last.fm account and like to switch up your wallpaper from time to time then you’ll love Wallpaperfm!

Example from my Last.fm account in Collage mode.

This python script, by Koant, has been around since at least 2008, but I’ve only recently stumbled across it. It’s easy to start using and is available for Windows, Mac and Linux users!

I’ll help you get started in Linux since that’s what I’ve set it up on. If you need more help or want more configuration options you should look to the information that Koant has posted on his website.

Install

  1. cd
  2. mkdir wallpaperfm
  3. cd wallpaperfm
  4. wget http://ledazibao.free.fr/wallpaperfm/wallpaperfm.py
  5. chmod a+x wallpaperfm.py

Create Your Wallpaper

  1. ./wallpaperfm.py -u YOURLASTFMUSERNAME

That’s the most basic set of options you can use to create your wallpaper (which you will find after running the script in the “wallpaperfm” folder that was created).

There are three options for the type of wallpaper created:

1. Tile

Albums are packed in side by side.

2. Glass

A few albums are highlighted on a glassy surface.

3. Collage

Albums are meshed together in a dreamy design.

To specify one of these modes, simply run the wallpaper script with the mode flag set to your choice.

  • ./wallpaperfm.py -u YOURLASTFMUSERNAME -m collage

There are plenty of other settings you can specify such as size, canvas size, filename, profile period, final opacity, cache, excluded albums, local copy, etc.

Suggestions and Ideas

User Interface and Packaging

I’m sure that this script could be simplified further for Linux users (and more specifically, Debian/Ubuntu users) if a user interface were created. It actually seems like a rather simple task since the parameters for the script are well bounded.

Adding this interface to an installer package would also be a very simple task and would most likely get more attention to such a neat tool!

Cron Jobs, Regularly Updating Your Wallpaper

Another thing, if your music preferences are constantly changing like mine, you may be interested in updating your wallpaper in regular intervals. To do this you can setup a Cron job that runs in the background.

While this may sound difficult and confusing, its really not at all and this helps explain a lot. I can even walk you through the steps.

  1. sudo apt-get install gnome-schedule
  2. Open the application (in Ubuntu) through the Applications menu -> System Tools -> Scheduled tasks.
  3. Click the New button and select the Recurrent task type.
  4. Give the task a description.
  5. Enter the command that runs your script. If you followed the steps above then it should be something similar to:

    /home/YOURUBUNTUNAME/wallpaperfm/wallpaperfm.py -u YOURLASTFMUSERNAME -m collage -f /home/YOURUBUNTUNAME/wallpaperfm/wallpaper

  6. Set the Time & Date option to hourly, daily, weekly, or monthly.
  7. Click the “Add” button to add it to your list of Scheduled Tasks and you’re done!

Have any other suggestions or tips? Leave ‘em in the comments!

Paint Your Mouse Movements with IOGraph!

My IOGraph in a Dual Screen (2.5 hours).

I recently stumbled upon this neat little application that lets you track your mouse movements in a visual way and save the image that is created!

My IOGraph in a Dual Screen (2.5 hours).

As you can see, most of my activity is in my second monitor (right) where my web browser rests, between the tabs and content towards the top. My coding habits and text editor occupy the first monitor (left) and show noticeably less mouse movement and more periods of pausing to work with the keyboard or read.

This application is Java based and runs in Windows, Mac and Linux! I’ll give you a quick run down on how to use this application in Ubuntu..

  1. Make sure that you have Java 6 Runtime installed on your computer. If you don’t, open the Ubuntu Software Center and search for Java. You should find “OpenJDK Java 6 Runtime” near the top of the results. Install that before continuing.
  2. Download IOGraph for Linux and save it where ever you like (I saved mine to the desktop).
  3. Before you can open the Java application (a .Jar file), you will need to set proper executable permissions for it. To do this, simply right click on the file and select Properties. In the Permissions tab, check to enable the option labeled “Allow executing file as program” and click close.

    Allow executing file as program

  4. Now to run the application, right click on the file again and select “Opera with OpenJDK Java 6 Runtime”.

    Open with OpenJDK Java 6 Runtime

Now that you’ve got the application running, you can minimize it and let it track your every move! If you’re having trouble, you may be able to find more help with .Jar files here.

The circles represent points where the mouse was left motionless for a period of time. The larger the circle, the longer it was left motionless.

Enjoy making art while you work and please share your results!

Opera 10.5 Pre-Alpha Internal Release

opera-10-5-pre-alpha-internal-01

I’ve just given a leaked release of Opera 10.5 Pre-Alpha a test drive and I must say that I’m very impressed with the changes I’ve noticed thus far!

I look forward to testing the Official Opera 10.5 Pre-Alpha release on Tuesday, December 22. However, until then I’ll be digging through this leaked version.

Note that Opera has officially warned against installing such leaked builds, stating that the official release will be “much better and you don’t risk getting nasty trojans on you pc.” ;)

Here are some screenshots I’ve taken. I don’t cover everything, but just enough to give you a good idea of what we should be expecting. I also won’t be detailing all of these pictures, but a picture is worth a thousand words right? Inspect them and see what you can find!

I did notice a lot of skin changes and a couple of bugs here and there dealing with the skin, but it’s overall very much improved. The internal “opera:*” pages also seem to be using a different style than previous builds, but then again they may have dropped using the Opera logo in the top of the pages.

Notice the border-radius support!

Try this build at your own risk!
http://rapidshare.com/files/323481638/Opera_1050_20192_in.msi
http://depositfiles.com/files/e01z2q5qp

LifeCam Button Config v1.0.0.0

2009-10-20_0031

I’ve just written a tool that lets you bypass the default Windows Live Messenger prompt when you press you LifeCam’s button on top.

It can be a little annoy, but the good news is that now you can open or focus any application you want with the click of that button.

2009-10-20_0031

As you can see from the image above, I’ve made a simple browse option so you can easily find the file you want. When you open this tool it will automatically display the path to the program that is currently set to open.

2009-10-20_0031_001

If you later decide that you want to just use the default application (the one set before you change anything) then it’s only a couple of clicks away!

Currently the implementation used could be error prone. I have written the application to “assume” that the default application should be installed to “C:\Program Files\Microsoft LifeCam\icepick.exe” for 32-bit computers and to “C:\Program Files (x86)\Microsoft LifeCam\icepick.exe” for 64-bit computers.

If problems are experienced with this then please let me know. It may be better to scan for the application rather than to assume it’s in that location, but typically it should always be in that location.

2009-10-20_0032

Thanks for checking out this little tool! I hope you find it helpful. If you’re curious about the source code just fire off an email! It’s currently written in Visual Basic 2008, but could easily be ported to another language especially since I overly document code so others know what I’m doing. ;)

Download163kb

LifeCam VX-1000 Live Call Button Hack

After digging into process and id’s I was able to track down the Guid for the Microsoft LifeCam VX-1000 and inspect several settings assigned to it via the Windows Registry.

As it turns out, there is a very simple hack to use the Windows Live Call button for any program you’d like!

I don’t have time at the moment to write a script or a program for this, but you can manually configure your webcam to open a program. If it’s already open then pressing the Windows Live Call button will simply bring it back into focus.

So far, I’ve only tested this button to open and focus Digsby and Opera, but it could in theory be used to call and or focus any application.

If you’re a little sketched about editing your Registry then that’s a sign that this hack isn’t for you and you should wait until I (or someone else) releases a tool that suits you.

If you’re still reading, then you probably want to get rid of that annoying Windows Live prompt. ;)

  1. Open up RegEdit.
  2. Navigate through the Registry to the following location:
    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}\0000\Settings
  3. The key that you want to edit is conveniently labeled “QuickStartPath“.
  4. Just change this key to the direct path of any file you want to launch. You can test that it works immediately after saving the key. No need to close RegEdit until you’re done.

If it works, great! You’re done! If not, then you’ve done something wrong.

Remember that the original file that was being launched was something similar to “C:\Program Files (x86)\Microsoft LifeCam\icepick.exe” depending on your platform. Mine is 64-bit, so you’re may not need the “ (x86)” specific Program Files directory (if you’re using a 32-bit computer).

If I find some free time soon I may write a simple program that can be called to do more than just open your messenger. Possibly start a video chat with someone who just signed on. We’ll see in time. ;)

Enjoy this little hack!

Microsoft LifeCam VX-1000

microsoft-lifecam-vx-1000-front

I just recently bought a new webcam via eBay for a great price of $5.50 and have been catching up with some of my Skype friends just for fun.

What’s great about this little webcam is that it has an excellent turning radius and can tilt to just about any angle you need it to.

microsoft-lifecam-vx-1000-front

Another great feature that this webcam offers is the ability to be mounted are rest just about anywhere. The base of the camera opens if you need to hang it somewhere rather than resting it on your desk or tower. The clip can be used to mount it onto your desktop monitor whether it’s an old CRT or a new LCD and it even mounts on very sturdy to my HP Pavilion dv4000 laptop screen.

microsoft-lifecam-vx-1000-side

The picture quality of this little camera is great. Not surprisingly, you can pay a little more and get even better cameras such as the VX-3000 or the VX-6000.

With a built-in microphone, I was able to give away my old microphone and maintain the same capabilities. :D

My only complaint is that the focus ring around the lens was never mentioned on or in the packaging so it took me a little while to figure out how to get rid of the blur (just rotate the lens to adjust).

The camera even offers a one-click access button on the top of it that can launch video calls instantly for Windows Live Messenger. I don’t use Windows Live Messenger much myself (read: at all), but I figured I could play around with the drivers in a hex editor and figure out how to make the button customizable…maybe open the Digsby or Trillian contact list (who knows) so I wrote an application to make this button customizable.

I had plug-and-play luck in Windows 7 with this webcam, however, Ubuntu 9.10 x86_64 has been less than forgiving. I’ve been searching around for a little while trying to configure my webcam that seems to be detected, but the video that’s displayed is corrupt. It seems that it’s a small problem with a fairly easy fix, but I just haven’t found it yet. At least it’s recognized! Hopefully I can write a script or a guide to get this webcam working in Ubuntu for others…once I get it working for myself of course. ;)

If you’ve been looking for a webcam and debating whether or not to buy one then I would suggest this one. It’s affordable, has everything you need and extremely good picture quality!