Category Archives: Software

Ember: Getting the index in #each loops

Unfortunately Ember’s version of handlebars does not support the {{@index}} value in a loop. If you do a google search you’ll find many people asking how to get this, without much help. The most frequent solution is to use the itemViewClass, which creates a nested view object for each iteration, which means you have to use view.parentView to access that templates view. What about a solution that just works out of the box?

Continue reading Ember: Getting the index in #each loops

Running IE on your Mac, for free via modern.ie

Several years ago I figured out how to convert the Virtual PC images windows used to provide for Windows testing to VirtualBox format, that would run on the Mac. It was a long process but was the only way to legally(ish) test Windows for free on your Mac.

This year Microsoft lauched modern.ie, where they providing Windows on free disk images compatible on Mac and Linux!
Continue reading Running IE on your Mac, for free via modern.ie

Running IE6, IE7 and IE8 on your Mac

UPDATE – May 6th, 2013:

Microsoft has now officially released copies of their OS/Browser bundles for all OSes using VirtualBox, Parallels or VMWare! You can get them from modern.ie.


I use a Mac, which means testing my work in IE6, IE7 and IE8 is a pain. I have Parallels installed but I don’t want to buy extra copies of Windows just to test in IE. Plus, Parallels doesn’t compress the virtual hard drive so each OS takes about 10 – 20GB of space.

The good news is that Microsoft provides free VirtualPC disk images for each of their browsers:

http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B…

The bad news is that they wont run on Mac and VirtualPC wont run inside Parallels or VMWare Fusion — but I’ve found a solution! We can convert the disk images to work for VMWare Fusion or VirtualBox.

Setup

First go and download the versions of IE you want to use:


http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B…

To do the conversion you’ll need a copy of the Qemu command line tool. I couldn’t get it to work on Mac, so you’ll probably need to use it on a Linux or Windows machine. (you can do this through Parallels or VMWare Fusion too) Download, extract and install Qemu tool on your computer.

Linux

WILL NOT work on windows because it was not compiled to support files over 2GB.
http://fabrice.bellard.free.fr/qemu/

Windows

Download “Qemu-0.9.1-windows.zip” from:
http://lassauge.free.fr/qemu/

VMWare Fusion

This is the easiest way to go and has superior support for shared network and clipboard between Mac and PC, except it means you’ll need to buy a copy of VMWare Fusion. I wrote these instructions using the trial version, someday I’ll buy my own full version.

The process will probably take less than an hour and require about 2Gb of space. These instructions are tailored towards using Windows for the file conversion with qemu. If you’re using Linux you’re probably smart enough to adapt these instructions to your system. Several people in the comments have mentioned being able to use Q on the Mac to do the file conversion.

  1. Open a command prompt: Start > Run and type “cmd”
  2. Use “cd” to go to the directory you download and extracted Qemu.
  3. Run:
    qemu-img.exe convert -f vpc "XP SP2 with IE7.vhd" -O vmdk XPIE7.vmdk

    • “XP SP2 with IE7.vhd” is the path to the IE VPC file you downloaded
    • “XPIE7.vmdk” is the new file that VMWare Fusion will use.
  4. Wait…(will probably take 15 – 30 minutes)
  5. Move the new “.vmdk” file to your mac.
  6. Open VMWare Fusion and click File > New
  7. Go through the wizard and when you get to the “Virtual Hard Disk” page, expand “Advanced disk options”, check “Use an existing virtual disk” and use the dropdown to find the new “.vmdk” file.
  8. Finish the wizard and start it! (If prompted to upgrade the virtual harddrive, click “Yes”)
  9. Ignore any driver dialogs that ask you to insert a Windows CD. The VMWare Tools should install these drivers for you (see next step).
  10. Install the VMWare tools (Virtual Machine > Install VMWare Tools) as soon as Windows boots up. If installing the tools gives you a weird error, read the next section.
  11. You’re done!

Installing the VMWare Tools

If the VMWare Tools wont install automatically follow these simple steps to install it manually:

  1. With VMWare Fusion running click Virtual Machine > Install VMWare Tools
  2. Open your “My Computer” to see which drive letter the CDRom with the VMWare Tools has mounted to.
  3. Open a command prompt: Start > Run and type “cmd”
  4. Type the following and press enter (change “D” to the drive letter from step 2):
    • msiexec -i "D:VMware Tools.msi"
  5. The installation wizard should open and walk you through the rest of the install.

VirtualBox

The great thing with VirtualBox is that it’s free and available for most OSes! The process will take a little longer and will temporarily require about 20Gb – 30Gb of disk space. In the end your IE virtual disk will only be about 2Gb.

You might be tempted to do the VMWare Fusion conversion, outlined above, and use the “.vmdk” file in VirtualBox. It’s true that VirtualBox supports “.vmdk”, but everytime I tried it I ran into massive problems.

These instructions are tailored towards using Windows for the file conversion with qemu. If you’re using Linux you’re probably smart enough to adapt these instructions to your system. Several people in the comments have mentioned being able to use Q on the Mac to do the file conversion.

  1. Open a command prompt: Start > Run and type “cmd”
  2. Use “cd” to go to the directory you download and extracted Qemu.
  3. Run: qemu-img.exe convert -f vpc "XP SP2 with IE7.vhd" -O raw XPIE7.bin
    • “XP SP2 with IE7.vhd” is the path to the IE VPC file you just downloaded
    • “XPIE7.bin” is the new file.
  4. Wait…(will take about an hour)
  5. Move the new “.bin” file to your mac. (or try the next 2 steps on the same machine)
  6. Install VirtualBox
  7. Convert and compress the “.bin” file. (This can also be done on Windows or Linux if you have VirtualBox on that machine)
    1. Open a terminal or command prompt.
    2. Go to the directory where your “.bin” file is.
    3. VBoxManage convertdd XPIE7.bin XPIE7.vdi (FYI: on Windows, VBoxManage is in “C:Program Filesinnotek VirtualBox”)
    4. VBoxManage modifyvdi XPIE7.vdi compact
  8. Open VirtualBox
  9. Click New
  10. Go through the wizard

    • Give it at least 350MB of “Base Memory”
    • Use the new “.vdi” file as the “Boot Hard Disk”.
  11. Finish wizard and start it!
  12. Ignore any driver dialogs that ask you to insert a Windows CD. The VirtualBox tools should install these drivers for you (see next step).
  13. Be sure to install the VirtualBox tools as soon as Windows boots up. (Click: Device > Install Guest Additions)

Now you can have all IE versions running on your Mac. Enjoy!

A Bad Week for Software: Parallels vs. VMWare, Pandora vs. Last.fm and Entourage

This has been an interesting week with software for me. I decided to try a few software apps and had some surprising results.

Parallels vs. VMWare vs. Entourage

I’m a mac user who works in a PC environment. As such I have to learn to work with MS Exchange in the best way possible. I’ve tried Thunderbird with IMAP — but that simply didn’t work since I couldn’t schedule or respond to meetings.

Eventually I went with Parallels so I could use Outlook on my mac. It worked well, not great, but good enough for my purposes. My biggest problem was that somethings just didn’t seem to work well. For example after the computer would wake up from sleep Parallels thought it would be a good idea to reopen the apps that were already running. So windows would have 5 new Outlook processes and 3 new IE processes open at the same time. This can be very annoying.

So this week I decided to try out VMWare Fusion. Everyone I’ve talked to says it’s awesome and so much better than Parallels. I was very optimistic and downloaded the demo and imported the Parallels vhd into it. Unfortunately I found VMWare to be kludgier than Parallels. More specifically:

Problems with VMWare Fusion

  • Often times ran slow, or had a significant delay when I tried to access it.
  • It doesn’t know I have a dock and when I maximize widows, they expand under it.
  • (the kicker) No cross application support. For example, when I click a link in Outlook it opens in the Firefox on Windows. I want it to open in Firefox on the mac side.

Parallels doesn’t have these problems, so I am back to using that.

Except that’s not the end of the story. I also won a copy of Office 2008 for Mac at the Geeks Love Bowling event at SXSW. We didn’t win for the most points, but for consuming the most alcohol; we had to live up to our team name: “The Beer Liberation Front”. (See Pictures).

I got excited that Entourage in Office 2008 might actually be usable. After installing it I was impressed — the UI looked great and the calendar wasn’t pink! (Entourage 2004 was pink) Entourage is very usable but I still fell back to Outlook because I couldn’t totally get used to it. Here are some points:

Problems with Entourage 2008

  • Local folders are far down on the left bar, so you have to scroll to get to most of them.
  • Not many options to customize.
  • Sorting email by “conversation” doesn’t build the message tree like Outlook, so you don’t really know who replied to which message.
  • Not as easy to skim through the email list.
  • NO WAY to directly import PST files from Outlook (The same company produces both of these products, right?)
  • (the kicker) Dragging an email to your local folder COPIES it instead of moving it! How does that make sense?

Overall these are mostly small issues, but the app wasn’t good enough to make me totally switch to it. Maybe someday.

Pandora vs. Last.fm

I’ve been using the Pandora music player for the last 6 months and have found so many great new artists through their music recommendations; I love it. They’ve always had big advertising around the player, and I never minded. They provide a valuable service to me and I think they should get paid for that. The problem is this week their player took a turn to the dark side: It would play a song or two, but refuse the next one until you put focus on the browser window with the player. This is unacceptable! I cannot stop what I’m doing every 5 – 10 minutes to jump to that page just to get another couple songs!

This was enough of a push to send me to try another thing that I’ve been hearing everyone rave about: last.fm. With so many people talking about it, it must be good, right? I signed up, downloaded the software and “scrobbled” (WTF?) my itunes library. Coming from Pandora I expected that by having their program send the titles from my itunes library to my account it would know what I like and give me recommendations on that. No luck. It didn’t tell me what to expect from it, so I decided maybe it was waiting for me to listen to some music first.

I open the player and entered “Pink Floyd” — my favorite band — and pressed play to listen to them and similar artists. Nice so far. I have a rather eclectic music taste so as much as I like Pink Floyd I don’t want to listen to them and similar music all day. In Pandora can setup stations and add a range of artists like Metallica, Ludo, Booker-T and the MGs, RJD2, Moby, Bob Marley, etc. The point is I like my music to switch up ever couple of songs and give me a different sound. Last.fm wont give that to me.

It feels very restrictive. I have to pick an artist or genre and I can’t add anything to it. If I get tired of the music selection I need to start over. The site isn’t helpful either. No real instructions or guidance, they just expect that you get it or are going to take the social approach and search for users like you. I’m sorry; I just want to listen to good music.

For example, take the following screen (notice it tells me the recommendations are a “Sample”):

Give me real results

It says that there aren’t any “real” recommendations for me yet because…why? It read my itunes library, I’ve listened, and scrobbled, a lot of songs. So at what point is it going to recommend something to me? I’ve done everything it has asked me to do. BAD USER EXPERIENCE == FAIL!

The good news is that I’ve found that several projects that have created desktop applications that play music from Pandora and they don’t have the stupid “pause” behavior that is present in the web player. So I’ve downloaded PandoraBoy and can now groove to my stations. In fact as I type this blog post Pandora is playing a list of fantastic selections — I’m very pleased. (at this second it’s playing “Sunday”, by Moby)

Summary

So at the end of the week, even though I’m back where I started, I’m happy I tried these products and got a taste for what’s out there. It seems I was using the better apps to begin with. Big Win!

Flickr / Twitter Mashup = Twickr (or maybe Flitter)

I’ve been using Twitter (https://twitter.com/jgillick) for a little over a month now and the one that’s lacking is picture messaging. What I want is to upload a photo to Flickr, create a TinyUrl for it and sent that plus a short description as a Twitter update. Well now it’s possible.

After a little research I found a tool, called TwitterGram, which does just this. You enter your Flickr username and Twitter username/password and it will automatically send updates to your Twitter log when you upload a photo. Unfortunately it didn’t work for me, so I went ahead and made my own which you can download and run on your servers!

My script starts by reading the Flickr feed (rss or atom), checks for new images that were uploaded within the last 12 hours (this can be set by $timeout — see configuration), gets the TinyUrl for each new photo and sends it with the Flickr title to Twitter.

Setup

Configuration

The options PHP variables at the top of the file.

$twitter
The username/password for your twitter account
$flickr
The flickr feed URL to watch. This must be in atom or rss2 format. NOTE: RSS1.0 does not have timestamps and can cause duplicate entries or other unexpected behavior.
$cacheFile
This file holds the last 50 flickr image URLs uploaded in PHP serialized form to prevent duplicate entries.
$timeout
Filters out photos from your stream that were uploaded before this number of hours ago.
$debug
Set this to TRUE if you want to test the script and do everything but send the message to twitter.

Flickr Feed

Using a Flickr feed lets you limit the Twickr tweets to a specific tag. Here’s how to get the feed URL:

  • Login to Flickr
  • Click “Your Photos”
  • Add the following to the end of the URL “tags/twickr/” (change “twickr” to any tag you want to limit the app to)
  • Click the RSS icon (Subscribe to a feed of stuff on this page...) towards the bottom of the page.
  • The page that loads is your Flickr feed, copy that URL into your $flickr configuration variable.

Testing

Before finishing the setup be sure to test it. Edit the script and set $debug to TRUE and then run it from the command line:

php -f twickr.php

A common error will be “Permission denied” when it tries to create the cacheFile — which is used to store the URL of the last 50 images tweeted to prevent duplicates. This file is saved in the same directory as the script. Be sure the user which calls the script has access to write to this directory.

Remember to set $debug back to FALSE when you’re ready to use the script for real.

Cron Job

If you’ve never setup a cron job before, use this command:

sudo crontab -e

The to have the script (which in my case is at /usr/local/bin/twickr/twickr.php) run every 10 minutes enter the following as it’s own line:

0,10,20,30,40,50 *   *   *   *   php -f /usr/local/bin/twickr/twickr.php

(More information about cron)

Now whenever you upload a photo to flickr with the required tag it’ll automatically send a tweet with the Flickr image title and URL (as a TinyUrl).

Download

Download or get the latest from my SVN repository.

Web Service

If you do not have a web server or are want to have somebody else host the script I’m considering putting together a simple site to do just that for you. If you’re interested let me know in the comments and subscribe to my blog to hear about updates like this in the future.

Updates

Subscribe to my blog to learn about updates.