Setting up geokit.

A quick checklist for creating a new app with geolocation on heroku’s 1.8.7 stack… so you can use the count method to your heart’s content. I’m sure that there’s something I’ve missed, but it’s a start…

  1. sudo gem install geokit (if you haven’t already)
  2. script/plugin install git://github.com/andre/geokit-rails.git
  3. for new app, create heroku app (
    • on 1.8.7 stack – heroku create APPNAME –stack bamboo-ree-1.8.7 –remote REMOTENAME
    • add the following to app’s .gems file:
      1
      2
      3
      rails -v 2.3.5
      pg
      geokit --version '=1.5.0'
  4. get new developer keys for your heroku app
    • http://developer.yahoo.com/maps/simple/
    • http://code.google.com/apis/maps/signup.html
  5. add config.gem “geokit” to config/environment.rb
  6. edit your application controller file:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    include Geokit
    include Geokit::Geocoders
    include Geokit::IpGeocodeLookup

    class ApplicationController < ActionController::Base
      helper :all
      protect_from_forgery
      geocode_ip_address
     
      before_filter :geokit

      def geokit
        store_ip_location
        @current_location = session[:geo_location]  # @current_location is a GeoLoc instance.
      end
      def store_location
        session[:return_to] = request.request_uri
      end
     
    end

From this point forward, the geocoding methods of the Geokit gem are available. There’s more that needs to be done if you want to treat one of your models as geolocatable… but I’ll pick that up later :)

Bookmark and Share

2010/07/03 code No comments

Creating Visual Studio projects from Parallels

If you’re a Mac user forced back into the world of .NET, you might come across the following error message when creating a new Visual Studio project over Parallels:

Invalid URI: the hostname could not be parsed.

Chances are, you are trying to create the project in a directory that is inaccessible to Windows. In the New Project window, check out the Location field. If it contains psf://, you’re trying to save to the Parallels shared folder – a location Visual Studio apparently can’t handle. Change the location to somewhere on your C: drive, and you should be good to go.

Bookmark and Share

2010/05/22 code No comments

Display Line Numbers in Visual Studio

Why Visual Studio 2008 doesn’t display line numbers by default? I don’t know. Why there isn’t a way to toggle line numbers on and off from the interface? I don’t know. Why it…. well, you get the point. Here’s how to fix it so you don’t have to waste time figuring it out:

From the Tools menu, select Options > TextEditor > All Languages > General…… then check the box beside Line Numbers.

You can also turn on line numbers for specific languages too – just select the target language instead of “All Languages.”

If you’re on the right screen and you still don’t see it, make sure the “Show all settings” option in the bottom left corner of the Options windows is checked.

Bookmark and Share

2010/05/22 Fail, code No comments

First sign of the geekpocalypse

I just witnessed the first sign of my impending geekpocalypse… rather than go through the ‘hassle’ of working with a gui-based calculator, I launched irb to do a few quick calculations.

Oy vey.

Bookmark and Share

2010/03/27 Geek, code No comments

Call me.

I’ve a great adoration for the music of Blondie, and in more than one way, I think that Debbie Harry is a great inspiration… but I often can’t handle some of those high-energy tunes on Monday morning. Personally, I’ve always thought that Call Me would be fantastic downtempo in an abandoned cathedral at 3am.

So to celebrate the release of my first iPhone app (MuniMe, in the app store now :) , I decided to take a little bit of my spare time away from coding and play around with music again, so I spent an afternoon a few weeks ago tinkering around with my keyboard and Garage Band, and this is the result.

Call Me

The production value might not be exquisite, but since I’ve been a bit of a purist in the past, I wanted a chance to muck around with different effects and explore beat frequency by overlaying an auto-tuned track with the original (e.g., the last chorus).

And no, this song is not a secret message to anyone. There’s no subtext here. None at all. (You’ll know if this message is directed at you. Don’t call me. Really.)

Bookmark and Share

2010/02/28 Music No comments

Random thoughts: evil.

What is true evil: evil for the sake of being evil, or evil for the sake of being good?

Bookmark and Share

2010/01/22 Uncategorized No comments

Recovering Address Book and iCal calendars from a backup drive

After a clean up-stall of Snow Leopard, all seems well… but I realize I neglected to create easily importable backups of my address book and calendars.

Not a problem – I had backed up my hard drive en toto, so recovering my addresses and calendars wasn’t difficult… but since a quick google search didn’t return any suggestions, I thought I’d share what I did in case you find yourself with the same need.

note:

~//Users/soychicka/ = my user home directory, just like ~//Users/yourHomeDir/ = your home directory.

Sadly, it appears that although they now have much nicer names, all of my screenshots in Snow Leopard are no more than black boxes of appropriate dimensions…. so that means you’ll actually have to *gasp* read directions (just for the time being).

To recover your Address Book contacts:

Open up two finder windows, one for your backup drive and one for your regular old hard drive that you’ll be using on a daily basis… and go to ~/yourHomeDir/Library, then find

~/Library/Application Support

in both windows.

You should see a folder called

AddressBook

in both windows. Drag the copy of AddressBook on the backup drive into

~/Library/Application Support.

If you dragged the folder into the right location, you’ll see a dialog that asks if you want to Keep the original, Keep Both, or Replace. Go ahead and click Keep both – it’ll keep a backup copy of the original for you in case something goes dreadfully wrong.

Then launch Address Book: you should see all of your contacts happily coexisting once again…well, at least as happily as they co-existed before, as sadly, Snow Leopard was not shipped with the power to resolve family quarrels or workplace personality conflicts.

To recover your iCal calendars:

Open up two finder windows, one for your backup drive and one for your regular old hard drive that you’ll be using on a daily basis… and go to ~/yourHomeDir/Library.

You should see a folder called

Calendars

in both windows. Drag the copy of Calendars from the backup drive into

~/Library/

on your regular hard drive.  If you dragged the folder into the right location, you’ll see a dialog that asks if you want to Keep the original, Keep Both, or Replace. Go ahead and click Keep both – it’ll keep a backup copy of the original for you in case something goes dreadfully wrong.

Then launch iCal : you should see all of your calendars happily coexisting once again…again, at least as happily as work and your personal life existed before, as Snow Leopard was not shipped with the power to add hours to the day and give you a raise.

Unless there was some new setting I forgot to enable…..

Random fact: One of Snow leopard’s new spots is pretty nice: if you are attempting to copy a file that has the same name as an existing one, instead of offering the option of replacing or canceling, it gives you the option of keeping both, and renames the original

Filename (original).
 Although it still doesn't allow you to merge the contents of two directories (hint hint), it's a step in the right direction.   Thanks, friendly apple UX team!
Bookmark and Share

2009/11/24 Geek, code, user experience No comments

Back to the top: navigation and design failure.

One of my pet peeves when it comes to web design is one that I consistently see with businesses who traditionally relied on the sunday advertisement insert is a reluctance (or perhaps overt refusal) to format their weekly ad in a manner more appropriate for the web.

Picture 1

I was looking for a new backup hard drive today, and after becoming frustrated with the lack of usability on the ShopLocal.com, I reverted to switching back to viewing the weekly ads of individual retailers, where I happened to stumble across this perfect example – a weekly ad from Best Buy.

We’ll leave aside the fact that this opened in a pop-up, cosmetic issues and the use of flash for the time being…. What’s key here is that the majority of advertisement content that is of interest to the consumer is below the fold, requiring that the user scrolls down the page to see the content that is of interest to them. And if you look at the next image, you’ll see why.

Thumbnail layout

The layout of the ad is intended to reflects the dimensions of a page in those the traditional weekly newspaper advertisments… the ones that were so unwieldy, where you had to either clear a 3′x5′ space to read on, or make a real effort to keep the paper from flopping over on itself… the ones that have been largely replaced in print by a more manageable tabloid format.

Perhaps the old-style ad layout was selected by the designer to reinforce metaphor of a print ad by as a way to make users comfortable with the notion of viewing an ad online. Or perhaps they are simply unwilling to put their ads in a more usable format in order to force more user interaction with their content in hopes of increasing conversions.

Regardless, this format, utilized by grocery stores and other big-box retailers on their sites might be palatable, were it not for one key problem that always appears to be found in near proximity:

Look ma, no navigation!
You read through the page, only to see that it’s nothing which interests you in the least, you go to view the next page, and …. wait…. where? … WTF… ah… what a piece of crap… you discover the greatest foul of all: there is no navigation at the bottom of the page, so you need to perform another action to return to the top of the page, and yet another to see the next page of the ad.

Sure, it might not sound like a big deal, but when you’re looking for a specific item on circulars from 10 different sites, initially it creates uncertainty by going against the user’s expectations; it becomes tedious, and it diminishes any good will a customer has towards the retailer.

So what are some solutions to this problem?
Most important: always include navigation elements at both the top and bottom for any page that may have content dropping beneath the fold.
There really is no excuse for not doing this… and no, using flash is not an excuse.

Take advantage of the space you have.
Rather than designing for print and posting the layout directly on the web, designers should design their blocks of content in a modular fashion that supports multiple layouts. The ideas I have for cross-design are another post altogether, but for the time being, suffice to say that with the proliferation of cross-publishing tools, such as indesign, there really is no longer an excuse to design for one medium at the exclusion of the rest. And again, no, using flash is not an excuse.

Bookmark and Share

2009/11/22 Design, Technology No comments

Pimping out Radiant Apps on Heroku: extension bling

/*headdesk*/

Do you find yourself with a migraine from the incessant *headdesk* associated with trying to figure out why your Radiant app that works so beautifully on your dev box turns into a megaFAIL after you try to deploy it on Heroku?

/*headdesk*/

Wait… are you using any radiant extensions?

Aha! Something isn’t explicitly clear in the vast majority of documentation on Radiant extensions: when you install an extension using ./script/extension install extensionName, you’re actually installing the extension as a submodule.  There are some good reasons to install an extension as a submodule: it’s super-easy, and it provides an easy way to update your extensions when the master branch has been updated.

But there is one very good reason NOT to install extensions as submodules: at this time, Heroku doesn’t support the use of submodules.  So that means even if you’ve followed the instructions and gotten it to work in your development environment, once you deploy to Heroku, the extensions disappear.  No listing in the admin panel, no files in your extension directories, everything is broke-ass, and….  /*headdesk*/

So what to do?  Most offering advice recommend that you find a way around this by installing the extension “normally”.   But what is ‘normal?’

Read more…

Bookmark and Share

2009/11/16 Uncategorized No comments

Radiant Heroku… getting your Radiant App live on Heroku in about 10 minutes.

I’ve discovered various degrees of up-to-datedness and accuracy in some of the tutorials out there for deploying an app built on Radiant CMS to Heroku, so here’s one that is valid for the latest Radiant CMS release (0.8.1).

This tutorial assumes that you have already installed and configured the following:
- Rails (2.3.4)
-  Git (1.6.4.1)
- Heroku gem (1.3.0)

Specifically, it also assumes that you either a) have configured an ssh keys for use with git, or b) know how to deal with it if you haven’t.

If you don’t meet all of the above criteria,  get crackin’… but once you’re ready, read on.

Read more…

Bookmark and Share

2009/11/16 Geek, code No comments