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!

But ours go to eleven…Opera 11

opera11-spinaltap

Opera 11 has been making a lot of buzz across the Internet today now that an alpha version has been released.

New in Opera 11 is support for the very much requested extensions! While there is currently a very limited selection of extensions available, I suspect this will quickly change. ;)

If you’re using Opera 11 already and you’re also using Ubuntu 10.10 with the Ambiance or Radiance themes, do forget to update you skin with my Ambiance and Radiance skins for Opera.

For those who are curious, you can find brief changelogs in the comments with the latest one being here.

If you’re not using Opera 11 yet and would like to, go get it!

Solaris International/Deep Blue Radio Show Podcast

solaris-international

A few years ago, while I was up late working and listening to what was then known as Virgin Radio at the time (and now as Absolute Radio), I happened to catch an episode of the “Deep Blue Radio Show.” Since then, it appears to have been renamed to “Solaris International.”

If you’re unfamiliar with this show, its simply a two hour mix of electronica and trance tunes by Solaris International with Solarstone. You can listen to their previous airings straight from their website, but I’ve finally come across their podcast in iTunes and found that it works perfectly in Linux as well with Rhythmbox!

Their site doesn’t seem to be as intuitive as it could be, which is why it took me so long to stumble across their podcast link. If you’re interested in subscribing, the link is posted immediately below. Copy and past it into your media player. If you’re unsure how, take a look at this excellent guide from GoingLinux.com.

Podcast Link to copy and paste:
http://www.solarstone.co.uk/listenAgain/deepblueradishow-podcast.xml

At the moment, there are over 220 previous podcast episodes available to download, so if you’ve got the time then they’ve got the tunes. ;)

I’m usually not a fan of podcasts, but I have a select few that I frequent. This will easily become my favorite.

If you’re not a fan of electronica or trance music then you can kindly disregard this post or use this as a reminder to search for podcasts featuring music you yourself may enjoy! :D

If you have podcast recommendations, I would love to hear about them in the comments!

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

Screen Capture Tip: Use Jing!

jing1

I’ve been using this little screen capture tool for several weeks now with very positive results! Jing is available to Mac and Windows in both a Free form as well as a Pro (pay for) form.

jing1

Using Jing, you are able to quickly capture a screenshot of a specific window or a pesky little software bug in action, upload it to an online source and paste the link all within a matter of seconds!

If you can’t capture what you’re looking for in a simple image, you might like the option to capture a video of what you are doing on your desktop and share a link to that instead!

jing_header

To use Jing, you simply select it from the top of your screen (where it waits by default) and click capture. You’re then given a selection tool that allows you to pick to screen space that you want to capture….nothing more, nothing less. After selection the area that you want to capture, you simply specify if it’s for an image or for a video.

If you click image, you will have your capture almost immediately  and can pick where to store it! If you select video, you will have 3 seconds to prepare your cursor or anything else you need to do. After the count down, video recording begins. Simply click the stop button when you’re finished and pick a source to upload to!

One feature that I’ve only just started using is the FTP option to upload my captures to kyleabaker.com! Thus far, I’ve used Jing to capture tons of bugs that would have otherwise been nearly impossible to capture.

Aside from the slightly noticeable resource usage and slight hang when it’s first activated, Jing is an excellent tool that I would suggest to anyone who needs to capture a visual from your computer screen!