Monday, June 15, 2015

Nine Inch Nails Reanimated

view the live demo here:

above, vectorized version of "Star Fuckers Incorporated" music video

Sunday, June 14, 2015

Thursday, June 4, 2015

Spaceship Earth - part2

At the moment, mankind is quickly destroying the Earth's natural environment and each other. Spaceship Earth helps us see the Earth as a permanent home, rather than something we are simply going to ditch in a couple billion years when the sun becomes a hostile red giant star. We need to start working together now to clean up the environment, and make sure all races and cultures can first live in peace, and then voluntarily cooperate to create this mega structure. No other species can save the planet, so we better step up and get to work now on a real peace plan.

Spaceship Earth Near Light Speed

After living in peace and harmony for millions of years, humanity and the entire earth reach relativistic speeds.

Blender Scene

Created with Blender 2.74

Saturday, May 23, 2015

vectorized video compression

Not every type of video needs high resolution and frame rates to look good. For music videos, 4K at 60fps is overkill, and a waste of bandwidth and power. Traditional video compression operates only on pixels, and removes detail in low contrast areas, leading to blocky artifacts.

My compression technique is optimized for a stylized output, and a much smaller data stream. It mixes SVG vector graphics with super compressed low resolution video. The video stream is resized to 240 pixels wide, and frame rate dropped to 8fps, this makes the file 10X smaller than the original compressed version. The backend pre-computes the SVG each frame using Potrace. Each SVG file is recompressed with SVGO, which can reduce the file size by another ten percent or more. As the video plays it triggers reloading of the SVG overlay frame, to compensate for the delay, the server is hardcoded to return two frames ahead of the requested frame.

You can view the live demo at heroku. Note this is a free and limited account, so if the site gets busy try again later. note: heroku is limiting my connection rate, so svg playback is limited to 4fps

Thursday, April 16, 2015

Unreal Engine4 Plugin - hello world linux

Get my fork of Unreal Engine this fixes some c++11 issues and makes it compatible with my new project Rusthon, see this example plugin that links in a dynamic library and prints hello world. You can compile the plugin by running:

git clone
cd Rusthon
./ ./examples/ --output-dir=~/Documents/Unreal\ Projects/MyProject

Unreal has an build system based on C# scripts, and a naming convention that requires you to keep your folders, files and class names in sync. You also need to setup your includes to pull in from a single header, the so called "PCH" (pre-precompiled-header). The other problem in getting started with a simple plugin are most of the Unreal docs focus on Windows and OSX, and not command line usage from Linux. It took me awhile to figure out that Unreal was caching the build files, and how to properly clear them in the install script. See the install script at the top of

import TestPluginPrivatePCH.h
import ITestPlugin.h

def hello_rusthon() -> int:

class FTestPlugin( ITestPlugin ):
 def StartupModule():
  a = hello_rusthon()
  print a  ## should print 99
  raise std::exception()

 def ShutdownModule():

macro("IMPLEMENT_MODULE( FTestPlugin, TestPlugin )")

Monday, April 13, 2015

4D Navigation

This weekend I teamed up with Steve Favis on a nearly nonstop 30 hour hackathon for NASA SpaceApps 2015. We developed a navigation system that takes into account the physics of possible future events and jumping to reach its target goal. Checkout Steve's twitter for more info: @stevefavis

Tuesday, March 11, 2014

PythonJS 0.8.6 Released

Above, PythonJS is used to create a dynamic water physics demo that integrates: Three.js, Skunami.js, p2.js, and Pixi.js. The yellow 'blob' is created by an array of p2.js springs and particles that are rendered as metaballs using MarchingCubes in Three.js.

You can get the new PythonJS 0.8.6 release here. The new release includes many bug fixes and better inter-operation with external JavaScript libraries. Bindings and wrappers are no longer required to work with external JavaScript libraries, types passed to JavaScript functions will be recursively transformed into JavaScript types. Calling Python functions from JavaScript has also been improved. New experimental backends are also included that translate Python into: CoffeeScript, Dart, and Lua.

Sunday, February 23, 2014

pypubjs exports to Android

The Pypubjs IDE can now export to Android using Phonegap. This requires installing PhoneGap and the Android SDK. Phonegap is easily installed with one command sudo npm install -g phonegap. The Android SDK is more work to setup, download it and set your PATH environment variable to include: /tools and /platform-tools. You also need Oracle's Java, here is the steps I did to get it running in Ubuntu:

 sudo add-apt-repository ppa:webupd8team/java
 sudo apt-get update
 sudo apt-get install oracle-java7-installer
 sudo apt-get install ant

 export JAVA_HOME=/usr/lib/jvm/java-7-oracle

Code Visualization

I have integrated a new backend into PythonJS that translates Python code into a visual graph using vis.js. You can load code into the Pypubjs editor, and by clicking "graph" it will run the translation in the background and display the graph in a new window. This can be helpful if you are working with code written by someone else, and need a way to quickly understand it at a higher level.

source code

Friday, February 21, 2014

Fishing in a River of Trash - part2


I am working on an integrated development environment for PythonJS, called Pypubjs. Using Pypubjs you will be able to easily put together HTML5 projects written in CSS, JavaScript and Python, and quickly package binaries for all platforms: Linux, Windows, OSX and mobile using PhoneGap. The IDE itself is written in PythonJS and HTML5 using Node-Webkit and the Ace.js code editor with Darkstrap CSS by Dan Neu (a hack of Twitter's Bootstrap.

see source code

Thursday, February 20, 2014

Fishing in a River of Trash - part1

I had posted earlier this month about the garbage polluting the river that flows into Tarlac City here. 30Km downstream in the center of Tarlac City, things get much worse.

Passing through the city I often see people of all ages fishing in the river, despite its extreme level of pollution. Today I saw four young boys with a battery and two long prods shocking fish to catch them. They were also collecting coconuts from the river.

Tuesday, February 11, 2014

PythonJS to Lua

I recently refactored PythonJS into a better meta-translator and added new backends for: CoffeeScript and Lua. The regression tests now include benchmarks that generate the bar graphs below. I also merged the Lua.js translator to see what happens when you translate Python to Lua and then to JavaScript, the result is slower than PythonJS direct to JavaScript. The Dart backend has the highest performance. LuaJIT also performs well with about half the Pystones of CPython.

Recursive Fibonacci

(time in seconds, less is better)


(time in seconds, less is better)