Adventures of a Trench Coder

Throughout my career, when solving a problem related to a project,  I've made a habit of sending the solution to myself in an email. Over the last 15 years I've accumulated hundreds, maybe thousands, of emails. And now I've decided to write blog posts instead. Hopefully someone out there will find something in this blog that helps to solve a problem that I've already encountered.


HTML 5 - HTML ReadOnly vs Disabled

The difference between readonly and disabled attributes

Blog - Java - JDBC Code Examples for MSSQL

I had to use JDBC for a recent task. Here are a few simple examples of executing a simple query and also a prepared statement:

iOS - Getting the Height of the StatusBar in iOS

A snippet that will give you the status bar height, regardless of the orientation

iOS - Some Problems of Developing for iOS

Issues that I'm experiencing as a part-time iOS developer

JavaScript - Currying and Partially Applied Functions

A very simple example of currying and partial applied functions

Blog - Java Generics

A good little code sample to help with understanding generics in Java

JavaScript - Sorting an array of objects by a property

How to sort an array of objects by one of the object's properties

JavaScript - Be careful when using instanceof

If you intend to throw an error if an object is not an instanof some class, be careful of this mistake that's easy to make.

JavaScript - Handlebars - Calling a helper function from another helper

And a useful helper for populating select boxes.

SQL - Some Basic and Useful Cypher Queries for Neo4J

A few queries to help in getting started with Cypher and Neo4J

Blog - Neo4j Demo

A demo that I did on Neo4j

Blog - Bulk Import Data in Neo4j 2

How to import data from a text file into Neo4j version 2

jQuery - A Tip For When You Do Cross Origin Requests

I stumbled into an issue in IE when doing CORS ajax calls

JavaScript - Using Handlebars with Backbone and RequireJS and Precompiling templates

Here are 3 different ways of using Handlebars templates with Backbone and RequireJS

HTML 5 - Mobile Web Performance Optimizations

This is my summary of an excellent article that I read in Communications of the ACM (written by Nicholas Zakas) .

JavaScript - Getting Google Maps To Work With RequireJS

This can be a little tricky, hopefully this post will save you some time.

Python - Simple WebSocket Server in Python

Here's a simple websocket server that I found on github, which I modified very slightly.

Blog - Forward And Reverse Proxy Servers

Brief overview of proxying.

Android - Inspecting Your SQLite Database with adb

How to crack open your SQLite database from the adb shell

Blog - Overview of Forks, Threads, and Asynchronous I/O

Applications that handle multiple connections can be built in one of three ways; forking processes, using muliple threads, or using asynchronous I/O.

JavaScript - Example Of A Memory Leak

Here's something to watch out for in your code.

JavaScript - Notes From Chrome Developer Course at CodeSchool

I stumbled into this really great course on using the Chrome developer tools. Here are my notes...

Blog - Avro - Getting Started (also a good review on using classpath in Java)

Things I stumbled into when messing around with avro...

JavaScript - How To Copy An Array In Javascript

I bumped into this when I was working on a prototype, and discovered that there's a very easy solution...

JavaScript - RequireJS, Google Maps, and Pathing Issues

I learned a few lessons about getting Google Maps to work with RequireJS, and I learned a few things about paths in Requre.js.

JavaScript - Backbone listenTo()

Some notest on backbone's listenTo() method

C Programming - Example of a Binary Tree

A good little example of a b-tree.

jQuery - Use e.which for Keyboard Events

When dealing with callbacks for keyboard events, use e.which.

jQuery - remove() vs. detatch()

Both will remove an element from the DOM, but remove() will wipe out all data and handlers, while detatch() will leaves them untouched.

HTML 5 - Scolling on Mobile Devices

Some CSS tricks for scrollable areas

Book Reviews - Java EE 6 Pocket Guide by Arun Gupta; O'Reilly Media

Review of Java EE 6 Pocket Guide, by Arun Gupta

Book Reviews - Learning Cocoa with Objective-C by Paris Buttfield-Addison, Jonathon Manning; O'Reilly Media

This is a perfect book for intermediate iOS programmers who want to reinforce some of the fundamentals, and learn about new advanced concepts.

Python - My first attempt at a Python SQLite class to use in an app

Here is a simple class that is used to fetch data from a SQLite database for a python app

Blog - Markdown Reminders

Some self-reminders about working with Markdown syntax

SQL - SQLite Reminders

Some self-reminders about sqlite

Blog - Git Reminders

Some notes on using git

JavaScript - Publisher Subscriber Pattern

I've been playing with the pub/sub pattern.

JavaScript - Learning About Dust.js

I've been playing with Backbone.js and I discovered a templating tool called dust.js that looks really promising (these notes are not coherent , yet)

JavaScript - Notes on YUI Doc

Self reminders for using YUI Doc

JavaScript - Using JSON.stringify() on an object that contains cyclical references

I stumbled into this when using Google Maps, you can override object values in the output of JSON.stringify().

Blog - Overview of UX Testing

Here's my 10 minute introduction to usability testing, and how it rocked my world.

Blog - Three Google Analytics metrics for measuring the usability of your website

Funnels, bounce rate, and search terms can give you valuable insight into the usability of your website.

JavaScript - What is JSONP?

A quick reminder about how JSONP works.

Blog - Self reminder about BASE encoding

This is a self reminder about base encoding (binary, hexidecimal, and base 10)

iOS - Dealing with military time (and some regular expression stuff too)

Had to convert military time into AM/PM. I thought there would be an easier way to do it, but couldn't find anything. Here's what I did:

JavaScript - The main difference between forEach() and map()

While forEach() alters the array that it's called on, map() returns a new array.

SQL - Formatting a timestamp

Quick tip for formatting a timestamp in SQLite

SQL - How to query the version of a sqlite db

Here's a quick one, but I've had to look this up more than once, so I thought I better blog about it

iOS - How To Find The Line Number Of An Error

As a beginner, one of my biggest pet peeves about working with iOS, was not being able to see the line number that caused an error in the debugger.

JavaScript - When using setTimeout(), setInterval(), or requestAnimationFrame()

Remember that the scope of 'this' will be global when your callback function runs in setTimeout(), setInterval(). or requestAnimationFrame().

SQL - Adding a Time and a Date and then Converting to Timestamp

This took me longer to figure out than it should have.

iOS - Quick Tip - Keyboard and becomeFirstResponder

Quick Tip - Keyboard and becomeFirstResponder

Android - Links To Android Articles On The Old Blog Site

To see a few posts on Android, visit the old blog site. Hope to get back to android development soon.

Book Reviews - WebGL: Up and Running by Tony Parisi; O'reilly Media

If you're a web developer looking for a quick introduction to 3D graphics, then this is the book for you.

jQuery - A quick note on the detach() method..

Here's an interesting little observation I made about the detach() method