jacob andreas [.net]

Toward a Relativistic Game Engine

January 2, 2010

An idea for a program I’ve wanted to write for some time now: a game with a physics engine that properly handles special-relativistic behavior.

This demo only shows length contraction (and not perfectly—you’ll notice that the sprites jump a little bit when there are abrupt changes in acceleration). I’m working on time dilation now, but it’s a much trickier problem. If you are a physics major / SR buff / at all interested please let me know—I need to talk to somebody who has a better sense of how all this is actually supposed to behave.

Synagogues: an iPhone Synagogue Locator

July 26, 2009

Ron Gejman and I are proud to introduce Synagogues: the premier synagogue locator for the iPhone and iPod Touch (and for the wandering Jew).

Need to find a local Jewish community?
Synagogues uses your current location to find nearby congregations from a database of almost 5,000 shuls. Use the built-in map to get a panoramic view of all the synagogues in your area and choose one based on distance or neighborhood.

Stuck away from home over Shabbos?
Synagogues allows you to search for shuls before you even get to your destination. You can call or email the shul to let them know you’re coming, ask about Shomer- Shabbat accommodations or check what time services start.

Prefer a traditional service? Want an egalitarian minyan?

No problem! Synagogues are listed by denomination.

Prefer a smaller shul? Need to know the Rabbi(s) name(s)?

We have painstakingly collected information ranging from size and leadership to fax numbers, websites, email addresses and more.

Best of all: if you see an inaccurate listing, you can email us from right within the application to let us know.

Help us spread the word and reach all of the lost and confused Jews without a synagogue to call their own.

To download Synagogues, visit our website at http://www.losttribeapps.com/ or search for “synagogues” in iTunes. Don’t forget to tell your friends!

Synagogues was co-developed by Jacob Andreas and Ron Gejman – stay tuned for the next application as we continue to make everyone’s lives (and everyone’s Friday nights) a little bit easier.

The Columbia Underground Listing of Professor Ability

July 10, 2009

CULPA is a general instructor review site for the Columbia community. Students post reviews of professors and TAs, and instructors can (at least in theory) post responses. We currently boast more than 17,000 entries, in every department and almost every class the school has to offer.

Columbia Underground Listing of Professor Ability thumbnail

CULPA was around long before I came to Columbia (it was started in 1997, so I suppose it was around before I even started middle school), but it’s changed a lot over the years. It started out as a huge chunk of custom PHP and was migrated to Ruby on Rails just before I came on board in early 2009.

Right after joining, I completely redesigned the site’s frontend, and worked with Ron Gejman to integrate syllabi, quotes and directory information into the website. In 2010, I added the Oracle, a tool to predict who will teach which sections of core classes.

http://www.culpa.info

Columbia Mock Trial Website

A website for the Columbia University Mock Trial team. The site is built on top of WordPress (inside a Wordpress-MU install that Columbia provides to student groups), and runs a custom theme. We use WordPress as more of a CMS than a blog engine: news items (mostly tournament results) are posts, but everything else goes in as pages. Nothing terribly fancy—tabbed page navigation across the top, a JavaScript countdown timer to important events and a photo gallery based on the NGGallery plugin.

cumt-screenshot-1

cumt-screenshot-2

See it in action at http://rtl.lamp.columbia.edu/sites/mocktrial/

Variations on a theme by Conway

May 10, 2009

Inspired by CS1004’s Game of Life assignment, I’ve been playing around with different rule sets for various cellular automata. One of the CAs I came up with, what we might call the “Goldilocks game”, produces some really nice-looking results. It’s defined as follows:

  1. Choose constants A, B, C and D.
  2. Define for each cell some temperature T, initially equal to zero.
  3. Define for each cell a value N, the sum of all its (8-connected) neighbors’ temperatures.
  4. If T = A, it is “hardened” and remains unchanged for the rest of the game.
  5. If N > B, set T := 0. (The neighborhood is “too hot”.)
  6. If C < N < B, set T := T + 1. (The neighborhood is "just right".)
  7. If N < C and N < D, set its temperature to 0. (The neighborhood is "too cold".)
  8. If no other condition was satisfied, the cell remains the same temperature.

A couple of my favorites are shown below. Click inside the applet to start/stop.

A=100, B=90, C=6, D=7

A = 255, B = 300, C = 10, D = 7. Note the marquee-style blinking dots that grow along the horizontal and vertical pathways.

Source code is available at http://projects.jacobandreas.net/cellular/src. I may try to put together an interactive version as well.

Ubi: Firefox geolocation for Linux

January 22, 2009

One of the coolest technologies to come out of the recent location-awareness craze is Wi-Fi geolocation: triangulating a computer’s position by looking up nearby wireless access points in a database, without any need for a GPS. Skyhook, the company that provides the geolocation software for iPods and iPhones, has also released libraries for developers on other platforms, and more and more location-aware applications are starting to emerge.

But somehow Linux users have missed out on all the fun. While Skyhook does provide Linux versions of their libraries, real applications making use of the technology are virtually nonexistent. Neither Mozilla’s Geode plugin nor Skyhook’s own Loki toolbar are available for Linux, and it’s not obvious that either plan on adding support anytime soon. There’s absolutely no reason why this should be the case—all the necessary resources already exist. So with all this winter break free time I’ve decided to try my hand at bringing Wi-Fi geolocation to the Linux desktop. The result is a Firefox extension I’ve called Ubi. Ubi provides a javascript API for accessing Skyhook’s geolocation tools, making it possible for websites to easily request position information.

Ubi screenshot

Installation

  1. Register for a Skyhook API key.
  2. Install Ubi
  3. Enter your username and realm in the Ubi preferences dialog
  4. Enjoy!

Try it out

Once you have the extension installed, check out the demo website I’ve set up. It finds nearby pizza parlors using Yahoo! local search. If you get an error the first time, make sure you’ve configured your user information properly, and try refreshing the website. If you want to develop your own application, download the client javascript library.

Other notes

The source code is included in the xpi—you can unzip it the way you would a regular zip file. Because the Skyhook library is proprietary licensing gets a bit messy: my code is all GPL, but the included binary is subject to their TOS (more information is included in the LICENSE file included in the extension).

This is really just a proof-of-concept, and the actual interface is likely to change radically in the near future. Error handling is miserable right now; my next project is to make the program more responsive about what’s going wrong.

Bugs? Security holes? Brilliant suggestions? Patches? Leave a comment or send me an email at jda2129 [at] columbia [dot] edu.

Photon 2 Wordpress Theme

December 13, 2008

Now that the Wordpress Theme Directory is up and running again I figured I would release the theme I’ve been using for this site.

photon-2.screenshot

As with the original Photon, the theme is designed to be lightweight and legible. The fixed width content column floats centered, and the sidebar hides itself when the page width is too small.

The theme includes support for a custom widget sidebar and the new wordpress caption feature.

I’ve ironed out all the bugs I could identify, but there are likely more. Please let me know if you find any.

As always, feedback is greatly appreciated.

Download at http://wordpress.org/extend/themes/photon.

Changelog

2.0
First release
2.1
Fixed left margin bug in IE7
2.2
Fixed page display problem
Made nested lists display properly
Fixed bottom margin on iframes embedded in the sidebar
2.3
New option to show sidebar on right side
New option to show full posts on index page
Position of search box tweaked
2.4
Corrected preview issue in functions.php
2.4.1
Corrected preview issue in functions.php (for real this time)
2.4.2
Fixed display issue in archive.php
2.4.3
Added pingback url to header.php
2.5
Respect user’s preferred number of posts per page in index
Tweaked date display and wrapping on search, archive and category pages
2.5.1
Next/Previous links at top and bottom of page now point in the same direction

Virtual Bouncing Ball with OpenCV

More games with red gloves and a webcam.

As always, it’s dead simple: regions of the image are cut off at a specified threshold and the contours are identified. A very small (and rather poorly implemented) physics engine then bounces the ball off the identified contours. It’s surprisingly fun to play with.

Collision detection algorithm cribbed from http://blitzbasic.com/codearcs/codearcs.php?code=998, and the angle of reflection calculation was accomplished with a little help from http://www.gamedev.net/community/forums/topic.asp?topic_id=61069.

Since I’m feeling organized, the code is already available here

Enjoy!

OpenCV X Input

July 18, 2008

More fun with the marvelous OpenCV library. While red is still a convenient color to track, I’m no longer using real vegetation. Instead, I found an old pair of gloves that do the job quite well.

How it works

(Edit: rather embarrassingly, I seem to have accidentally deleted the source code for this project. However, you should be able to figure out everything you need from camshiftdemo.cpp in the samples/ folder. I apologize for the inconvenience.) Found it! Go to this directory and download redglove.cpp for examples.

A brief explanation: I’m no longer using the library’s object-tracking algorithms. Instead, the mouse is just tied to the position of the “average” red pixel, with some trivial logic for throwing away outliers. Once the bounding box of the glove drops below a certain width, a click event is triggered.

(Edit: I simulate clicks and mouse motion with the XTest library.)

(The interaction is not normally this laggy, but istanbul clobbers performance when compositing is enabled. Disable compositing, you say? I need my exposé: the window buttons on a taskbar would be too small to use reliably. The system’s not perfect. Yet.)

Some thoughts:

The click interaction really needs to be improved. There’s just enough “wobble” between the camera and an unsteady hand to make it very difficult to click without dragging, and perspective makes the rotate gesture almost impossible to execute when not dead center.

In the same vein, it would be good if I could get the program to even roughly judge the distance of the glove to set the threshold for click events dynamically.

Once I get the kinks ironed out of the current setup I’m going to try moving up to two gloves, but I think I have a way to go first. Glove-in-air interaction will never be a good model for desktop use, but I could see this being useful in applications (games in particular) that require only gross input.

CompizTomato: the FCI revolution

July 14, 2008

Some firm produce, a good webcam and a new era of Fruit-Computer interaction.

A few days ago I was looking for a v4l2 wrapper and stumbled across OpenCV. I’ve been hooked ever since. It’s an open computer vision library that provides a simple interface to a lot of sophisticated image processing.

As a little test of the system I hacked the sample blob tracking application to send signals to Compiz over DBus when the tracked object moves to the side of the screen. The tracking can be a little flaky so I needed a brightly colored object that would stand out against the background. We happened to have some tomatoes lying around in the kitchen, and thus was born CompizTomato.

As you can see from the video, the recognition is not perfect but certainly seems to get the job done. I can use it with only slightly diminished accuracy while sitting right in front of my computer against a busy background. Further testing has also revealed that I can also track my head and wobble from side to side, but it’s not quite as fun and considerably harder on the neck.

Without further adieu, the video:

http://www.youtube.com/watch?v=cD9ZMjy_rkE

Older »
fine print

All content in public domain unless otherwise specified. Powered by prgmr, FreeDNS, Wordpress and vim.