Archive for the ‘Uncategorized’ Category

Android maps tip – tap on an address in gmail to open maps

Saturday, April 10th, 2010

Here’s an interesting maps tip – when someone emails you an address, like 825 Walnut Street, Philadelphia, PA 19107-5195 (Walnut Street Theater) you can tap the address part in the gmail app and it will automatically open the google map application to that address.

Very handy, as it doesn’t underline the address like a link, so you don’t know you can tap the address unless you know the tip.

Does html5 video work in Android?

Wednesday, April 7th, 2010

In the interest of finding the right answer by posting (possibly) incorrect information, here goes.

Transcode an H.264 video to something that works great on the ipad/iphone: video: avc1, 29.97 fps, 380 kbps, 480 x 370 Audio: mp4a, 44 kHz, 64 kbps

Put together a page and view it on the iphone/ipad:


<!DOCTYPE html>
<html><head><title>html5 test</title></head><body>
<video id="movie" width="480" height="370" poster="http://example.com/still.jpg" controls>
<source src="http://example.com/video.mp4" type="video/mp4">
Your browser does not support html5 video.
</video>
</body></html>

View it on the iphone/ipad – wonderful html5 video plays.

View it on Android 1.6 (G1) – Nope, get “Your browser does not support html5 video”.
View it on Android 2.1 (Nexus One) – See the poster image, and if you add the onclick hack below the video will play in the media player.
View it on Android 2.2 (Nexus One) – See the poster image, but clicking the poster does nothing, cannot view video.

When will Android support html5 video?

Update:
Found a message from Dan Morrill html5 video is not supported at this time in the browser.

Update 2:
Some people have found some level of success by adding onclick="this.play();" to the <video> tag, but this doesn’t always work, for instance it used to work with Android 2.1 on the Nexus One, but since upgrading to Android 2.2 it no longer works.

postMessage doesn’t work in IE if you mix http and https

Tuesday, April 6th, 2010

What’s the point of implementing postMessage if you can’t communicate across http and https versions of your page?

http://msdn.microsoft.com/en-us/library/cc197015%28VS.85%29.aspx

Django forms remove : (colon) in label

Friday, March 12th, 2010

Django forms add a colon “:” to each label by default. You can turn this off by setting label_suffix="" when you create your form.

10+ releases a day takeaway

Sunday, February 21st, 2010

I found this via the etsy “code as craft” blog: http://velocityconference.blip.tv/file/2284377/

My big takeaway is validation of something I have always done – code configuration by user/bucket/site is a “good thing”. It’s so much easier to roll out changes to a select population and deal with changes that way. Something I like to do using django groups. It is a sort of a/b testing, but just a little different. Very useful.

boxee app won’t load

Saturday, February 20th, 2010

I’m very grateful there is a boxee.log file written, otherwise I would not have thought that boxee was going to try to load the main.xml~ instead of main.xml by default!

AppEngine Design Philosophy

Saturday, February 13th, 2010

I suppose I knew in the back of my mind, you’re not going to need it now, but eventually you will need to shard this*. So if you’re going to do anything in appengine, my advice is: just shard everything from the start. You’ll save yourself a world of hurt later on.

http://code.google.com/appengine/articles/sharding_counters.html

* This could be anything, it needn’t be just counters.  Now the article is all about write contention, but it also demonstrates a very good approach to sharding data in the abstract.  Depending on what you’re doing this is a very useful thing to do.

Adding feeds for the buzz

Wednesday, February 10th, 2010

Found this today via jlapenna’s buzz on how to add more feeds to your buzz:

http://www.google.com/buzz/bradfitz/PPjHXDhANAC/Want-to-connect-your-blog-or-some-other-feed-to

Very useful.

Bit by ModelForms

Tuesday, January 26th, 2010

Put all the callable defaults you want into a Model, the ModelForms aren’t evaluating them properly in Django 1.0.4. Luckily there is a patch: http://code.djangoproject.com/ticket/11940

Getting started with virtualenv

Thursday, January 14th, 2010

I’m working on a few django sites all at the same time, and keeping the PYTHONPATH environment variable set correctly was getting to be a pain, and virtualenv seemed like it took a lot to set up – or that’s the way it looked from all the other blog posts out there.

So I took the plunge, and I’m happy to say it didn’t take all that much effort to go from a homebrew environment hack to using virtualenv.

Install Virtualenv

This works for me, but note, I have to use python2.5 (because of Google AppEngine) and I’m on OSX or ubuntu all day long.

sudo easy_install-2.5 virtualenv

That’s it.  A lot simpler than I originally thought with all those other articles mentioning pip and zc.buildout.

Use virtualenv

It turns out using virtualenv is a lot easier than I thought also.  A lot of the articles talk about using pip to install dependencies, etc.  I’m sure pip is great and once I start rolling it out I’ll probably never look back.  But for now I have a relatively small set of teams to manage, and everyone uses their own setup that works for them.

There’s only two setup steps and then you can use virtualenv.  You don’t have to change your source control unless you really want to.

First, set up the new environment:

virtualenv --no-site-packages --python=python2.5 my_env_name

Then you activate the new environment:

source my_env_name/bin/activate

Now you are running with an empty environment.  You need to perform your dev environment setup in this python virtual environment.   But you only have to do that once.

Switching environments just means sourcing the right activate script.  After a couple of alias changes in bash I’m all set.