Category

Tutorials

How To: Get Average of Variable Range in Excel

Computer Image

Have you ever needed to get an average of a group of numbers in an Excel spreadsheet? And have you ever needed to do so with a range that is variable? In other words, “I need to get an average of Column B, but I don’t know upfront how many rows are going to be in Column B.”

Well, it turns out to be fairly simple in Excel. I’m partly sharing this with the world to be a help to others, but also because I forget things… and I needed a place to keep it!

Continue Reading

My Entire Ebook Library Online

Oh… you didn’t think that title meant I was providing my entire ebook library to the public, did you? Sorry. Thar be no pirates here, maties. This is more of a tutorial on how I make my ebook library available to me. Onward, hoe!

I love using Calibre to maintain my ebook collection. If you have not heard of it and would like more control over your ebooks, then you should take a look. Calibre also has a built in server that you can access via a web browser. This allows you to browse your ebook collection and download them if you like. This is a really neat feature, except that the software has to be running in order to access it.

What I really want is to be able to publish this library and be able to access it from anywhere without any dependence on my computer and the Calibre software running.

This is my solution.

Continue Reading

Counting Messages in IMAP Folders in Python

Continuing on my last post (), I wanted to show a snippet of Python code that will list a set of IMAP folders and count the number of messages in them. You give it a starting folder and it lists that folder plus all/any sub-folders and their message counts. At the very end it prints a total message count.

Listing IMAP Mailboxes with Python

I’ve been working on some Python scripts recently to manage my IMAP mailboxes and the information I found on the internet was fairly good, but lacked a completeness that my newbie Python skills required. So, I figured I’d post a complete example to list mailboxes (folders) for your IMAP account. This was developed using Python 3.3.

I hope this code snippet help you on your way to Python IMAP goodness. If not, it will at least server as a reminder to myself the next time I need to do something like this.

Windows Vista crcdisk.sys – System Won’t Boot

I recently had a friend call me in need of computer repair assistance. I’ll save you the many hours of troubleshooting and simply list the fix here.

The Dreaded crcdisk.sys

I found this symptom of the problem by booting into Safe Mode and watching the drivers load. I noticed that it always hung for a long time on the crcdisk.sys file. Well, if you perform a search on Google for “windows vista crcdisk.sys” you will find a plethora of woes from computer users desperately trying to regain the functionality of their PC. There are also a plethora of fixes, advice and this worked for me posts. I tried many of these to no avail.

The Road To Recovery

The laptop I was working on was a Toshiba laptop and it had a system restore disk. Great! Sort of. Restoring the system to factory condition from the disk (after the owner had backed up their data of course) resulted in a system that was broken and still had the problem listed above. Hmmm.

Another operating system perhaps? I installed Windows XP from scratch. Worked great. I installed Windows Vista SP2 from scratch (another disk). Worked great. Re-tried the system restore from Toshiba. No good.

At this point I figured I was just going to install Vista from scratch. So I reinstalled Vista and downloaded the Toshiba drivers from their website. One by one I started installing the drivers. Until I got to the driver for a flash media card reader (front of laptop). Bam! It froze up during the install. So I rolled that change back using Windows System Restore and then continued with all of the other drivers. No problems. I tried the flash media driver one more time just to be sure, and sure enough it failed again. That’s good! Predictability is key in diagnosing computer problems.

Continue Reading

Dump A MySQL Database To YAML Using PHP

The Problem

I was recently working on a project that is built on WordPress / BuddyPress. I built up some content using the CMS features of WordPress in my development server and then I transfered the WordPress content to a beta server using the export/import functionality. That kind of stinks having to do that every time I want to push updates to my beta server. So I looked into using Doctrine to generate data fixtures which I could repeatedly run against the different database. Doctrine supports YAML files, which are extremely easy to edit by hand, so it seemed like a good idea.

So what’s the problem? Well, I didn’t currently have any of my data in YAML files. I didn’t want to had edit them or do some sort of copy and paste madness. So, I wrote a script in PHP to dump my data into a YAML file.

Continue Reading

Modify PHP CLI Include Path Dynamically

I was working with an application platform that I had just downloaded today. I just wanted to check it out and play with it a bit. In the application framework was an executable script that provided some command line utility. I fired up the script and received an error like “PHP Fatal error: require_once(): Failed opening required…”. Of course non of the files from the downloaded archived were in the include path for my system, but I didn’t want to just go adding it to my php.ini file just to play around with it short term. What to do.

Command Line Options

First I wanted to see if there was a command line option that I could pass to PHP to tell it what include_path to use for just this one execution. If you execute the following you’ll see the usage:
php --help
There is no include_path command line option, but there is the -d foo[=bar] option which allows us to modify any of the INI entries by key/value.

Continue Reading

Building ChromiumOS (The Google OS)

googlechrome1
I’ve been watching all of the hype about downloading and running the latest Google creation, ChromiumOS this week so yesterday I decided to take a stab at it myself. I did not however want to simply grab a VMWare image and run it. I’m a software engineer for Pete’s sake! I should build it myself. So how did it go? Read on.

System Preparation

First I upgraded my Ubuntu installation to the latest release (9.10 – karmic), which is actually the suggest/preferred build environment for ChromiumOS. Following that I checked the system requirements and made the appropriate adjustments. msttcorefonts did not show up in the Synaptic Package Manager so I just ran the following command and that did the trick:

freetype-dev was also not listed but I had libfreetype6-dev installed and figured that would cover it.

Next I installed version control clients Subversion and Git. I followed that up with installing the Google Chromium Depot Tools. This is basically a group of scripts that Google uses to managing syncing the code repositories and whatnot.

Obtaining the Code

Next I grabbed the code for the Chromium browser. This is actually optional and you can just download a binary instead, but since I’m going this route I figured I’d go all the way. You can follow the instructions here, which include download a huge tar ball that includes the code, extracting it and then syncing the code with the online repository. The first time I synced:

I received some warnings about third party libraries that were no longer a part of the client so I removed them as suggested. Then I remembered that there was a specific way to run the sync when building the OS so I reviewed the website and re-ran the sync (which I would have done anyway since I modified the code base by removing some directories):

.
So I ended up with the Chromium code base in /usr/local/chromium.

Next I needed to grab the ChromiumOS code, so I created a directory for that at /usr/local/chromiumos and grabbed the code like this:

Now obviously you wouldn’t be able to run the above as a normal user, you’d need to sudo right? I actually created the directory initially using sudo and then gave my local user ownership of the directory to complete the rest of the steps.

Now the code sync ran for about 10 minutes and then ended in errors. Uh oh… this isn’t looking good if I have errors in the check out phase. The error was:

After that it appeared to try and get an alternates list and recover but it was unable to do so. I figured since it was trying to recover then there might be a good chance that running it again would solve the problem. So I reran the sync and it got a little farther before it stopped with failures. Then on the third run it finally grabbed all of the code. I guess the third time really is the charm!

Building Chromium OS

The steps in the build process are all pretty straightforward and I didn’t have many problems. Initially if you are going to build the browser portion, you do that before building the OS. During this phase I actually ended up in an infinite loop. After going back to the docs I set the following environment variable:

and that fixed the problem.

Then the building… and building… and building… process took a looooonnnng time. Other than that it was pretty uneventful.

Running Chromium OS

Having gone all the way through I now had a VMWare image of the Google Chromium OS. Awesome! So how did it run? I’m not exactly sure. I was able to create a VM for it and attach the image and boot it up. After that I get the login screen. I put in my Google account login credentials and then…. nothing. I just get a blank blue screen with nothing on it and no activity. I’ll admit, it really is a nice shade of blue but generally I’d like a little more functionality in my operating system. Anyway, I guess I did something wrong or I am running it in some way that is incompatible. I’ll try to figure that one out and post the results as soon as I can.

Nike+ iPod : Cheap Fix For Failure

I’m a runner and I use the Nike+ iPod gadgetry to track my runs. It is very easy to use, convenient and it helps me to be motivated. Well, about three weeks ago it started failing. At random times during my run it would just queue the end of run recording and my workout would end. Very frustrating. I tried several ways of wearing it differently to no avail. I searched the internet for answers and found listings like this one with not much information other than, “you need to buy newer stuff.” This was quite frustrating as my workout routine was being interrupted and I can’t really afford to replace my equipment at the moment.

I’m pretty sure that the failure has to do with water damage from sweat and one day I received some inspiration. I’ve been using this fix for about a week and it has cured my Nike+ woes, so I thought I’d share it. It is simple, easy to implement, and the biggest boon…. it’s super cheap! Here’s what you’ll need:

  1. Your iPod
  2. Your armband (I use one)
  3. Your Nike+ attachment
  4. Your headphones
  5. And one sandwich sized zip-top bag!

* Here is an old review of my equipment

NikePlus_01

Here is what you do:

  1. Attach the Nike+ attachment to your iPod nano
  2. Next, instead of placing your iPod into the armband and then attaching your headphones, you’ll need to thread your headphones through the armband. This will allow you to assemble the whole deal inside the sandwich bag first.
  3. Attach the headphones to your iPod
  4. Slip the sandwich bag over the iPod with everything attached
  5. Wrap it all up like a burrito
  6. Then carefully work the assembly into the armband as it normally would be. It’ll be a little tighter than usual because of the sandwich bag, but it should fit.
  7. That’s it! See the pics below for an illustration.

NikePlus_02NikePlus_03NikePlus_04NikePlus_05NikePlus_06NikePlus_07NikePlus_08

Yeah, I could of just said “wrap it up in a sandwich bag” instead of an entire tutorial with pictures, but that wouldn’t give me as much content for my blog. Now that I have my running rig back on track I don’t have to worry about finding the funds to replace it all; at least not just yet.

Manage Video Clips in iPhoto 6

I was searching the internets this past weekend in search of a simple solution for managing and organizing my video clips on my Mac. I have a somewhat dated iMac with OS X version 10.4 and I don’t have the latest iLife versions. My current version of iPhoto is version 6. I’ve imported short video clips from my camera into iPhoto and that works fine, but I was having a problem trying to find them again. A search resulted in a very simple and elegant tip on this blog: Find Videos in iPhoto. So I attempted to implement the solution and found that there was no “Photo” option in the drop down list for creating my Smart Album. Bummer. I left a comment on the original blog post asking for help.

Of course after investigating a little more I found something else. Whenever you import video clips into iPhoto (version 6) it automatically attaches the “Movie” keyword to the clip. Eureka! I just created a Smart Album using that keyword as in the following screenshot.

VideoAlbum

So I’ve answered my own question. Now I just select my Videos smart album and I can browse through all of the various video clips I have stored on my iMac. Beauty, eh.