Monday, April 11, 2011

Crafty - JavaScript Game Engine

A lightweight, modular JavaScript game engine to easily produce high quality games. Includes a large variety of components such as animation, event management, redraw regions, collision detection, sprites and more.

Sunday, April 3, 2011

MaxSquare: a fast and simple algorithm for maximizing photo thumbnail sizes

MaxSquare is an algorithm which calculates the optimal grid size for a collection of n images such that each image is allocated the largest possible square cell.

Wednesday, March 30, 2011

Coded Exposure Photography (Flutter Shutter Deblur, SIGGRAPH 2006)

In a conventional single-exposure photograph, moving objects or moving cameras cause motion blur. The exposure time defines a temporal box filter that smears the moving object across the image by convolution. This box filter destroys important high-frequency spatial details so that deblurring via deconvolution becomes an ill-posed problem.

Rather than leaving the shutter open for the entire exposure duration, we "flutter'' the camera's shutter open and closed during the chosen exposure time with a binary pseudo-random sequence. The flutter changes the box filter to a broad-band filter that preserves high-frequency spatial details in the blurred image and the corresponding deconvolution becomes a well-posed problem. We demonstrate that manually-specified point spread functions are sufficient for several challenging cases of motion-blur removal including extremely large motions, textured backgrounds and partial occluders.

Monday, March 28, 2011

Remote git diffs with bbdiff

  1. See previous post about key exchange.
  2. Add the following to .gitconfig:
    [diff]
        tool = "bbdiff"
    [difftool]
        prompt = false
    [difftool "bbdiff"]
        cmd = /home/mihaip/bin/bbdiff "$REMOTE" "$LOCAL"
    
  3. Create bbdiff on the remote machine with the following contents:
    #!/bin/sh
    
    source_machine=${SSH_CLIENT%% *}
    for arg in "$@"
    do
      readlink -fn $arg
      if [[ $arg == /tmp/* ]]
      then
        scp $arg mihaip@$source_machine:$arg
      fi
      echo -n " "
    done | xargs ssh mihaip@$source_machine /usr/local/bin/bbdiff --wait --resume
    

Saturday, March 26, 2011

Google Application Utilities for Python

Same set of utilities used to build and run internal Python apps at Google:

  • Simple application startup integrated with python-gflags.
  • Subcommands for command-line applications.
  • Option to drop into pdb on uncaught exceptions.
  • Helper functions for dealing with files.
  • High-level profiling tools.
  • Timezone-aware wrappers for datetime.datetime classes.
  • Improved TestCase with many of the same methods as unittest2, plus helpful flags for test startup.
  • google_test setuptools command for running tests.
  • Helper module for creating application stubs.

Friday, March 25, 2011

xStats

xStats provides simple charts to help monitor your code performance.

  • FPS: Frames rendered per second. The higher the number the better.
  • MS: Milliseconds needed to render a frame. The lower the number the better.
  • MEM: Megabytes of memory used. Make sure it doesn't keep incrementing.

Editing files remotely

  1. See previous post about key exchange and get_source_machine
  2. Install FUSE and SSHFS.
  3. Ideally, mount the remote directories you're interested to the same path on your Mac. Most recently I've used:
    sshfs mihaip@snowberry.local:/D \
        /D \
        -oauto_cache,reconnect,volname=snowberry-mihaip
    
  4. Add the following to your .bashrc:
    bbedit() {
      source_machine=$(get_source_machine)
      for arg in "$@"
      do
        readlink -fn $arg
        echo -n " "
      done | xargs ssh mihaip@$source_machine /usr/local/bin/bbedit
    }
    

Growl notifications from other machines

  1. Install growlnotify
  2. Set up public keys so that the other machine can SSH into the Mac without prompting
  3. Add the following to .bashrc:
    get_source_machine() {
      echo ${SSH_CLIENT%% *}
    }
    
    function growlnotify() {
      if [ "$AT_HOME" = "true" ]; then return; fi
      source_machine=$(get_source_machine)
      ssh mihaip@$source_machine /usr/local/bin/growlnotify \
          -n "command-notifier" \
          -m \"[$PWD]\" \"$1\" 2> /dev/null
    }
    
  4. In the Growl PrefPane, the notifications can be styled for the command-notifier "Application." (I like Music Video)

Wednesday, March 23, 2011

Using the Google V8 Javascript Engine in Java

V8 Java Bridge that allows any JavaScript code to run and call back to any provided Java methods.

Monday, March 14, 2011

JVM Crash in Development App Engine server after Mac OS X Java SE 6 Update 4

Restoring the previous JDK (from Time Machine) to /System/Library/Java/JavaVirtualMachines/1.6.0.3.jdk and pointing Eclipse at it worked for me.

Sunday, March 13, 2011

Backbone.js

Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.

Underscore.js

Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects. It's the tie to go along with jQuery's tux.

Underscore provides 60-odd functions that support both the usual functional suspects: map, select, invoke — as well as more specialized helpers: function binding, javascript templating, deep equality testing, and so on. It delegates to built-in functions, if present, so modern browsers will use the native implementations of forEach, map, reduce, filter, every, some and indexOf.

CoffeeScript

CoffeeScript is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.

The golden rule of CoffeeScript is: 'It's just JavaScript'. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript implementation, and tends to run as fast or faster than the equivalent handwritten JavaScript.

Friday, March 11, 2011

d3.js

D3 allows you to bind arbitrary data to a Document Object Model (DOM), and then apply data-driven transformations to the document. As a trivial example, you can use D3 to generate a basic HTML table from an array of numbers. Or, use the same data to create an interactive SVG bar chart with smooth transitions and interaction.

Tuesday, March 8, 2011

Monday, March 7, 2011

Chef - Opscode

Chef is an open source systems integration framework built to bring the benefits of configuration management to your entire infrastructure.

Thursday, March 3, 2011

boilerpipe

The boilerpipe library provides algorithms to detect and remove the surplus 'clutter' (boilerplate, templates) around the main textual content of a web page.

Instance/web API running at http://boilerpipe-web.appspot.com/.

Wednesday, March 2, 2011

visionmedia/express - GitHub

Fast (and small) server-side JavaScript web development framework built on node and Connect.

Sunday, February 27, 2011

Varnish: Notes from the Architect

"I have spent many years working on the FreeBSD kernel, and only rarely did I venture into userland programming, but when I had occation to do so, I invariably found that people programmed like it was still 1975."

Monday, February 14, 2011

Watir

"Watir, pronounced water, is an open-source (BSD) family of Ruby libraries for automating web browsers. It allows you to write tests that are easy to read and maintain. It is simple and flexible."

Used by Facebook.

Graphite - Enterprise Scalable Realtime Graphing

Graphite is a highly scalable real-time graphing system. As a user, you write an application that collects numeric time-series data that you are interested in graphing, and send it to Graphite's processing backend, carbon, which stores the data in Graphite's specialized database. The data can then be visualized through Graphite's web interfaces.

Used by Etsy.

Etsy also has StatsD (blog post) which is a daemon that increments/times can be sent to, which aggregates them and sends them to Graphite.

Friday, February 4, 2011

ack 1.94 -- better than grep, a source code search tool for programmers

"ack is a tool like grep, designed for programmers with large trees of heterogeneous source code."

Unicode code converter

Convert input text to various representations and escaping levels.

Also related: Text Escaping and Unescaping in JavaScript.

Sunday, January 16, 2011

sam-mccall/node-plate

Syntactic sugar for running async functions in sequence.

Also Do.

Friday, December 31, 2010

web-page-replay

"Record web pages using a local DNS and a local web server which act as proxies and records performance metrics in addition to the actual resources."

Saturday, December 25, 2010

Node Inspector

dannycoates/node-inspector - GitHub: "Node Inspector is a debugger interface for nodeJS using the WebKit Web Inspector."

Thursday, December 23, 2010

Introducing Knockout, a UI library for JavaScript

Knockout is a JavaScript library that makes it easier to create rich, desktop-like user interfaces with JavaScript and HTML, using observers to make your UI automatically stay in sync with an underlying data model. It works particularly well with the MVVM pattern, offering declarative bindings somewhat like Silverlight but without the browser plugin.

Tuesday, December 21, 2010

CSS Timing Bookmarklet

This bookmarklet loads this script which uses querySelectorAll on all the selectors in loaded stylesheets and then sorts their eval time.

Thursday, November 25, 2010

DNode

substack's dnode at master - GitHub: "DNode lets you expose a JavaScript function so that it can be called from another machine using a simple JSON-based network protocol. That’s relatively straight-forward... but DNode is designed for asynchronous environments, and so also lets you pass callback functions which will be translated in to references and used to make remote method invocations back to your original client. And to top it off, there’s a browser client library so you can perform the same trick over a WebSocket between a browser and a server."

Monday, November 15, 2010

creationix's step

A simple control-flow library for node.JS that makes parallel execution, serial execution, and error handling painless.

Monday, July 5, 2010

JSRegexTeststand v2

Simple single-page app that assists in dynamically developing and testing JavaScript regular expressions. Think of it as a REPL for JavaScript regexes.

Saturday, June 19, 2010

jsctags

ctags-compatible code indexing solution for JavaScript

Thursday, April 22, 2010

Akihabara

Set of libraries, tools and presets to create pixelated indie-style 8/16-bit era games in Javascript.

Thursday, April 15, 2010

Node.js


Evented I/O for V8 JavaScript.

Thursday, April 1, 2010

Easy Performance Profiling with Appstats

Easy Performance Profiling with Appstats

Monday, March 29, 2010

App Engine JavaScript SDK

"App Engine for JavaScript! With App Engine, you can build web applications using the JavaScript programming language, and take advantage of the many libraries, tools and frameworks for JavaScript that professional developers use to build world-class web applications. Your JavaScript application runs on Google's scalable infrastructure on top of Java and Rhino, and uses large-scale persistent storage and services."

Sunday, March 28, 2010

Recipe: CloudKit

"CloudKit is Jon Crosby’s neato web app that vends schemaless-but-versioned JSON objects via a RESTful web API."

objectify-appengine - Project Hosting on Google Code

"Objectify-Appengine provides the thinnest convenient layer which addresses these issues, yet preserves the elegance of get, put, delete, and query."

MongoDB

JSON key-value store

Saturday, March 27, 2010

Using a Caching Proxy Server for Web Demos

Simple python caching proxy server: run your test once against the proxy server in 'record' mode, and then after that you can use the server for consistent local playback.

Super Awesome Buttons with CSS3 and RGBA

Mercurial: The Definitive Guide

Alternative Mercurial guide.

Friday, March 19, 2010

Hg Init: a Mercurial tutorial by Joel Spolsky

For when I want to actually learn a DVCS:

Mercurial is a modern, open source, distributed version control system, and a compelling upgrade from older systems like Subversion. In this user-friendly, six-part tutorial, Joel Spolsky teaches you the key concepts.

Thursday, March 18, 2010

Gecko Memory Profiler

Add-on appears to be stuck at Firefox 3.5-only though.

Labs/Memory Profiler - MozillaWiki: "Memory Profiler is an experimental Labs project that attempts to make debugging memory use in web pages easier.

For more information about the tool's design and rationale, see Atul's blog post entitled Web Application Memory Profiling, Take Two."