May 2012
2 posts
Saaspose: Cloud based document conversion &... →
Appears to be a versatile service for barcode recognition and OCR. This could come in very handy.
May 25th
Protip: Store file imports for better support /...
If you run a service which allows one to import data, say maybe by uploading a CSV file, than do yourself a favor and store the original file in a place where you can access it later for support or debugging. Our service allows a person to upload a CSV file containing postal addresses and it has about 8 columns that need to be in a certain order. Before our code starts to actually process the...
May 18th
April 2012
3 posts
Postgres search: normalizing accented characters
As part of my move from Sphinx to Postgres Full-Text Search I needed a way to normalize accented characters. My data contains lots of diacritics, a common example is the varietal name “Grüner Veltliner”. My users do not want to enter that Umlaut each time they want to search for this varietal. Fortunately there is an awesome Postgres contribution package called “unaccent”...
Apr 30th
Sidekiq: alternative to Resque for background...
Mike Perham of Dalli fame has written an awesome library called Sidekiq which enables background processing via threads. Resque is a popular background processing solution and its what we use at Batch. It’s battle tested and for the most part has stood up well. However, it feels heavy-weight because each Resque worker is a distinct process. Which is where Sidekiq comes in: it uses a pool...
Apr 26th
Switched from Sphinx to Postgres Full Text
I’ve recently migrated two Rails projects from Sphinx search to Postgres Full Text Search. Mainly because the applications were small and I didn’t see the benefit of running another service, hence another point of failure. In both cases the number of documents and the level of search activity were not very high, so it was not a question of load on the Postgres server. In one of the...
Apr 25th
1 note
March 2012
2 posts
Quickbooks + Ruby
Recently I needed to integrate my Rails app with Quickbooks. Looking around on GitHub I didn’t find any fresh libraries.  Intuit has their Data Services API (currently at v2) which exposes a REST API to their customer data. Its a pretty clean API. Its annoying that it uses XML but Intuit is hard at work on v3 which will support JSON so thats nice. But anyways, I didn’t find any good...
Mar 10th
Bundler install error: ArgumentError: invalid byte...
I upgraded my Rails app to 3.2.2 and was doing a deploy via Capistrano and during the bundler install process the deploy bombed out with the following error: ** [out] ArgumentError: invalid byte sequence in US-ASCII ** [out] An error occured while installing will_paginate (3.0.3), and Bundler cannot continue. ** [out] Make sure that `gem install will_paginate -v '3.0.3'` succeeds before...
Mar 2nd
1 note
February 2012
2 posts
Writing a basic image filter in Android using NDK
I needed to implement some image filters on bitmaps for my Android project. I first attempted the filters in pure Java but it turns out to be too slow and consume too much memory. Bitmap handling in Android has always been a pain point and there is too much memory overhead. To get access to the underlying pixel data from a Bitmap in Java you use Bitmap.getPixels() which returns an integer array...
Feb 22nd
Feb 7th
January 2012
1 post
6 tags
Java: Joda DateTime on the wire, long values in...
I’ve begun development of the Android app for Batch and we use REST/JSON as our API. Dates in JSON are represented as strings like: 2012-01-07T01:06:37Z I am also using the wonderful ORMLite framework to persist my objects in a local SQLite database. I would like to store my dates as UNIX timestamps using a type of “long”. By doing this I can do date filtering much faster by...
Jan 10th
65 notes
December 2011
1 post
WAL-E for Postgres WAL archiving / backup →
Been using WAL-E for Postgres continuous archiving / backup and I have to say I really like it. Super easy to setup and start rolling. Point-In-Time-Recovery has never been so easy…
Dec 21st
October 2011
2 posts
Logging to Rails.logger from a Resque job
I had various Rails.logger statements in my Resque background jobs but they were never hitting the the actual log. Turns out the problem was due to ActiveSupport::BufferedLogger flushing. What happens is that by default the flush period is 1000 statements, but since a given Resque job has such a short lifespan the flush period never gets reached. The solution is to turn on auto flushing for the...
Oct 18th
Generate Excel friendly CSV from Ruby with UTF8/16...
I needed to generate an Excel friendly CSV file from a bunch of UTF-8 encoded data, coming from a database. I could generate the file just fine and it looked OK in vi or TextMate but when opened in Excel all of my diacritics (umlauts, etc) would be rendered as gibberish. Which made me think it was more of an Excel issue, because they appeared fine in TextMate, for example. The answer ended up...
Oct 17th
July 2011
3 posts
“I think in general engineers tend to not care as long as people stay out of...”
– Robert Accettura - How do engineers at tech companies feel about their non-engineer colleagues?
Jul 28th
PostgreSQL trigger to update a tsvector column
One method of implementing full-text search in PostgreSQL is by storing your searchable content in a tsvector column. You can add a GIN index on this column for super fast full-text search, but its not required. The idea is that you have, for example, a title column that you want searchable. So you make a tsvector column and then store the search index for the title column in the tsvector...
Jul 23rd
Processing Resque jobs in Ruby that are queued by...
I am using the awesome Jesque package to process jobs from Resque. We have a mixture of Ruby and Java workers. All our workers accept a Hash of arguments. In one case I needed to create a job from Java to be consumed by a Ruby worker. To generate the appropriate argument structure I ended up making a dummy worker class like: and I materialize the Job like so: Using this technique I can properly...
Jul 8th
June 2011
2 posts
Connection Pooling in JDBC with Postgres and...
I was trying to get connection pooling in JDBC with Postgres going and looked into using the Commons DBCP and Pool libraries.  The problem is that the examples on how to get started dont refer to the released versions of the libraries but instead refer to trunk and the current refactoring.  Thus: the basic “PoolingDataSourceExample.java” doesnt work as advertised, based on the...
Jun 30th
4 notes
CRON gotcha
Programs and scripts in /etc/cron.{d, hourly,daily,weekly,monthly}/ are ignored if their names contain characters outside a very strict list. Most notably, dots. So if your program ends with .sh, .pl, .py or whatever, cron will silently ignore it.
Jun 27th
April 2010
1 post
Origin of Company Policy
Start with a cage containing five monkeys.  Inside the cage, hang a banana on a string and place a set of stairs under it.  Before long, a monkey will go to the stairs and start to climb towards the banana.  As soon as he touches the stairs, spray all of the other monkeys with very cold, high-pressure water.  After a while, another monkey makes an attempt with the same result — all the other...
Apr 5th
November 2009
1 post
“The issue was a company called Zynga, which makes online games, like FarmVille,...”
– http://www.fakesteve.net/2009/11/why-mainstream-media-is-dying.html
Nov 9th
September 2009
1 post
Innovation
An old boss who now works at a market research corporation contacts me every once in a while and tries to recruit me. He thinks I would be a good fit. I keep saying how much I prefer to “keep my hands dirty in technology” and how it would never be a good fit. This is what he said in response: “dude, you would…. a client just gave me a free copy of Windows Server 2008...
Sep 17th
September 2008
1 post
Vice Fund
Ok, who wants in? My Vice Fund will consist of: gaming companies (slot machings, casino operators, etc), alcohol & tobacco companies, entertaintment companies (stripping, escort services, etc) and others of a similar vein. The whole gamut. Lets do it!
Sep 16th
1 note
August 2008
1 post
Internet Censorship is On it's Way. The i-Patriot... →
Aug 6th
July 2008
3 posts
“When you’re paddling up a waterfall and your tire pops, how many pancakes...”
– http://www.reddit.com/comments/6t97j/Legalizing_LSD_could_create_hundreds_of_thousands/
Jul 25th
1 note
Shirky’s Law and why (most) social software fails →
Jul 24th
“Just learn to love the atomic bomb for fuck’s sake.”
– Oliver, in response to why Netflix+Roku has a crappy selection of old movies and nothing new and the movie industries bullshit licensing.
Jul 19th
1 note
June 2008
1 post
“Be conservative in what you do, be liberal in what you accept from others.”
– Jon Postel c. 1981
Jun 12th
2 notes
April 2008
1 post
“It’s probably good that he spends so much time trying to figure out how to...”
– As said by Jeff in reference to Gary trying to do something in CSS.
Apr 29th
February 2008
1 post
Feb 7th
January 2008
4 posts
Jan 21st
Who owns my data? →
Jan 11th
WatchWatch
Hilarious! “Everybody, get the fuck out!”
Jan 9th
Jan 7th
March 2007
1 post
“He who makes himself a beast, frees himself from the chains of being a man.”
– Hunter S. Thompson
Mar 24th