Search Results Category: code

“http://”, thou shalt be required no more!

August 2, 2010 at 6:41 pm Filed in:Design | code | geek | user experience No Comments

Over the past few weeks, I’ve discovered that most web forms that contain a field for a url have a major usability failure when it comes to validating the content of the field… the validation fails if you neglect to enter “http://” preceeding the variable portion of the url.

Sure, sure, I get it. Perhaps the form is anticipating that a user may be linking to a site using https://, and thusly requires the user to specify the protocol… but for users linking to blogs, corporate websites, and the other most common use cases for these types of fields, the likelihood of linking to a secure server is (or should be) inversely proportional to the number of users on the site… or in other words, as the number of users increases, the probability of a user’s url requiring https:// approaches 1/∞ (remember algebra? it gets close to zero).

So, a note to all my fellow developers out there… chances are, if someone is linking to something on your site, it’s far more likely that it will require http:// rather than https://… Browsers don’t require that you type http:// before your URL anymore… neither should our forms.   Adhering to the same conventions users are used to elsewhere in their travels throughout the internet will create  a much more satisfying user experience.  Here are a couple of recommendations:

  1. Write up your validations accordingly.  Don’t require a prefix, but allow users to add one, on the off chance that they *are* referring to a secure server.
  2. If, for some reason, you deem it necessary to require users to specify the appropriate prefix, gosh darn it, specify the format for a valid url below the field, or at least display the required format as a tooltip/popup when the user is focused on the field, and draw attention to the required prefix.  Novice – and even seasoned users – may otherwise gloss over it – and be forced to endure the frustration of a failed attempt at submission.
  3. When the field loses focus, alert the user to the fact that their url is not formatted properly.  In big Red letters, and all caps if necessary… preferably somewhere near the field (if it’s still visible in the user’s frame of vision) or near the submit button to remind them to fix their error before continuing

Sure, chances are if they submitted the field once, they’ll fix their error and submit it again… but they’ll be mumbling and grumbling under their breath at you, and I know that some of you out there wouldn’t want to hear the names I’ve called you after a failed form submission. So be good to your users, and build your forms and validations with an eye towards the most common use cases, and make those who subvert convention be the ones who do the work.

For the less geeky, in case you’re wondering why http vs. https matters at all, take a look after the cut for the random facts.

Continue Reading

Setting up geokit.

July 3, 2010 at 2:43 pm Filed in:code No Comments

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 :)

Creating Visual Studio projects from Parallels

May 22, 2010 at 9:54 am Filed in:code No Comments

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.

Display Line Numbers in Visual Studio

May 22, 2010 at 9:44 am Filed in:Fail | code No Comments

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.

First sign of the geekpocalypse

March 27, 2010 at 12:41 pm Filed in:code | geek No Comments

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.

Recovering Address Book and iCal calendars from a backup drive

November 24, 2009 at 8:43 am Filed in:code | geek | user experience No Comments

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).

Continue Reading

Pimping out Radiant Apps on Heroku: extension bling

November 16, 2009 at 2:28 pm Filed in:code | geek 1 Comment

/*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?’

Continue Reading

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

November 16, 2009 at 12:54 pm Filed in:code | geek No Comments

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.

Continue Reading

Restart Apache without restarting OS X

October 29, 2009 at 11:37 am Filed in:code No Comments

1
sudo /usr/sbin/apachectl restart

In case you need to modify your httpd.conf on your local system and restart apache, but you can’t bear the thought of 20 seconds downtime when you could be getting back to …. the important stuff.

funny pictures of cats with captions

Creating a map-based iPhone app

July 18, 2009 at 11:52 am Filed in:code No Comments

The day word went out that OS 3.0 would finally include access to the google MapKit was the tipping point that finally got me to shell out the $99 to join the iPhone developer program. Unfortunately, at the time, documentation was sparse, and although the back end was in place, I couldn’t figure out how to display my annotations.

So I put my map-based projects on hold… until yesterday, that is, when I came across this easy-to-understand 3-part tutorial with sample code that very clearly shows how all the pieces are put together. A simple “Dude, where’s my car” app shows how to gets your current location, then allows you to place a marker at your current location.

Now, the original developers intent was simply to provide an example of how to use MapKit, so I’m not chiding them for lack of foresight in any way… but in its current state, it’s a bit too simplistic to be really useful as a parking app. But it could easily be tinkered with to provide additional functionality to make it useful:

  • allow you to add markers at a location you define (in case you forgot to set where you parked when you were there)
  • allow you to set a timer to let you know when your meter is about to run out (or in SF, when the two-hour period of time for people without permits has expired)
  • store location info when you exit the app (’cause as is, you lose it when you answer a phone call, etc.)
  • etc., etc.

Regardless, for whatever app you need a map, this project is a great start for learning how to get started with MapKit.

Page 1 of 212