May 13 2013

Use Tomcat URL rewriting to serve external images for Atlassian JIRA avatars

Atlassian makes some great workflow and knowledge management tools.  They are perhaps best well known for JIRA, originally used for tracking development issues.  In recent releases JIRA has become much more of team-friendly tool to manage projects during their entire life cycles.  As such there are a bunch of niceties such as personal profiles.

I recently installed and configured JIRA at Mullen.  We use ActiveDirectory (as I’m sure many of Atlassian’s clients do) and so I configured JIRA to delegate authentication to ActiveDirectory.  This means that users created in JIRA must have the same username as their ActiveDirectory account.  Mullen also has an internal personnel directory which has headshots of everyone in the agency with filenames that match their ActiveDirectory account (first initial, last name, e.g.: dfeinzeig).  I wanted to find a way to have JIRA use these pre-existing headshots without having to manage each user’s JIRA profile.

Continue reading

May 12 2013

Behold the power of default – How to set the default argument of a Django model field equal to a class method using lambda

Django model fields accept an optional default argument to set the default value of the field.  This can be either a value or a callable object.  A very common use for the default argument is to set created_at and modified_at datetime fields to  But default can be much more powerful than that.

Continue reading

Feb 5 2013

Install Cinder on Windows 7

We were fortunate enough to have Andrew Bell, the creator of Cinder, come to work and speak last Friday.  After he showed us the cool things you can do with Cinder, I spent some time this weekend installing Cinder and its dependencies on Windows 7.  There were a few snafus that I ran into, so I figured I’d document them here in the hopes it’ll make others’ lives easier.

Here’s the official install guide for Cinder on Windows.  For convenience, I’ve archived all of the things that you have to download into one zip file that you can download here.  It includes Cinder 0.8.4, Microsoft Visual Studio C++ 2010 Express Edition, the Windows Platform SDK, the DirectX SDK, and the QuickTime SDK. Continue reading

Apr 3 2012

Dear Netflix…

Oh Netflix, I am so conflicted about you.

Your online streaming is really convenient.  I love being able to watch series from beginning to end.  And it is reasonably priced for me.

Sometimes your streaming selection could be better.  (Not to be confused with Netflix red™.)

Your DVD service helps to fill many of those streaming gaps.

But your DVD service is overpriced.

Your dashboard is well designed.  I love the interface.  

Your queue management is horrible.  Why when I’ve watched something does its status in my queue seem pretty much unchanged?

Your suggested content is great.

You need to handle your browser support better.  It is ridiculous that the Firefox 11 update breaks your instant streaming and requires me to install an add-on that spoofs the Firefox 10 user agent string (User Agent Switcher for those having the same issue).  AND your browser compatibility information is incorrect as it lists “Firefox 3 or higher”, when clearly it should say “Firefox 3-10” given your browser support mechanism. Here is my Firefox 10 user agent string

“Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0”

and here is my Firefox 11 user agent string

“Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0”.  

You are seriously telling me that you can’t programmatically support that update?  *I* can support that programmatically.  Even if you can’t, you weren’t paying attention to when the Firefox 11 update was released so that you could manually update your allowed user agent list?  After Internet Explorer, Firefox has the 2nd largest share of the browser market.  Why wouldn’t you stay on top of supporting that?  And by supporting I mean simply updating your list of allowed user agents.  You could complete that code change in less time than it would take to create the ticket to track the issue.

You have THE BEST server error experience that I have ever seen (and fortunately for you, I have only seen it once – good thing I’m quick with my Print Screen key). *Brilliant* idea to provide a 100 or so streaming selections that so users could still watch something.

So that’s about 5 greens and 4 reds… I guess I’m sticking with you for now.  Please do something about your User Agent support.  That is probably the most annoying issue.  When I want to kick back and watch something to relax and forget about your other foibles, that browser support issue is REALLY (and ironically) frustrating.  FYI, here is the RapidRelease calendar for Firefox.  Please study it.  New releases about every 6 weeks.  That’s a lot of recurring opportunity to lose otherwise [very? mostly? somewhat?] happy customers.

Well, I’m off to find that Arthur and the Invisibles DVD that we’ve had sitting around since October 26th and still haven’t watched (no lie, and don’t laugh).


Another (happy?) customer

Mar 2 2012

Learn about UUIDs

A great post about UUIDs, the various types, and how they are calculated.

Mar 1 2012

How to add a UUID field in Django using Django Extensions and how to make it a read-only admin field

I’m using Django Extensions which is a great collection of extensions and utilities for the Django framework.  For a project I’m using it to generate and store UUID fields in several models.  I found an easy way to add that UUID field to my admin as read-only.

A sample model using Django Extensions’ UUID field (I chose to use a version 4 UUID):

 Python |  copy code |? 
from django.db import models
from django_extensions.db.fields import UUIDField
class SomeClass(models.Model):
    uuid = UUIDField(version=4)
    # ...other fields...

Sample class to show UUID as a read-only field:

 Python |  copy code |? 
from myapp.models import SomeClass
from django.contrib import admin
class SomeClassAdmin(admin.ModelAdmin):
    readonly_fields = ('uuid',)
8, SomeClassAdmin)

That’s it!  Very easy to implement a UUID and make it visible as read-only in the Django admin.  Note that you need at least Django 1.2. More here.

Aug 10 2011

Data Liberation Front Makes it Easy to Free Your Data from Google

Google’s Data Liberation Front has created a program called Google Takeout, which is supposed to provide an easy to use and bundled way to download all of your data from Google’s servers.  More here and here.

May 25 2011

Summary of PHP Frameworks and their Features

I found a great summary chart of PHP frameworks, that also includes some great information about their various features.

Take a look!

PHP Frameworks

May 14 2011

Archiving and extracting files using tar

I always have the hardest time remembering the command line options for tar.  Found a simple site that explains them concisely and figured I’d post the info here so I always know where to easily find it all.

To tar all files in a directory into a file named foo.tgz:

tar cvzf foo.tgz dir

To extract the contents of a tar:

tar xvzf foo.tgz

More information here.

May 10 2011

Centering DIVs with jQuery centerXY Plugin

Centering DIVs horizontally can be a pain, but it seems there are a couple of generally accepted, cross-browser compatible, solutions available (such as setting a fixed width with margin-left: auto and margin-right: auto).  Centering DIVs vertically can be much more challenging.  Not wanting to worry about nesting DIVs and making sure the CSS was set properly for each of those, taking into account the idiosyncrasies of each browser, (here is an article I have yet to read, but has received great reviews) I looked for a jQuery solution…

…And I found the centerXY Plugin for jQuery.  The plugin is extremely easy to use and centers DIVs both horizontally and vertically within its parent, with the ability to specify offsets for each direction if you don’t want it dead-center.  If the parent is the body, then the DIV is centered with respect to the browser window.

I have verified that the centerXY plugin for jQuery works correctly in:

  • Internet Explorer 6 (IE6)
  • Internet Explorer 7 (IE7)
  • Internet Explorer 8 (IE8)
  • Internet Explorer 9 (IE9)
  • Firefox 3.x
  • Firefox 4.x
  • Safari
  • Chrome
  • iOS (iPhone and iPad)