Archive | June, 2008

CouchDB 0.8 – First Release Since Joining Apache

25 Jun

Congrats to the CouchDB team.  Download the 0.8 release here.

Update: for you OSXers like me, check out Jan Lehnardt’s CouchDBX.  One-click install and management of couchdb on Leopard/Intel macs.

Netflix’s DRM Turned Me Into a Pirate

25 Jun

Ok, so I was a pirate before I attempted to get Netflix Watch Instantly working, but the truth isn’t as controversial.  Here’s the story: I read on Lifehacker, via Joystiq, that it’s possible to play Netflix’s ‘Watch Instantly’ offering via an xbox 360 extender on my TV.  Awesome!  I no longer have to go download TV shows from less-than-reputable sources -  I can legitimately pay to watch these shows and support them.

(more…)

ROFLCOPTER… Literally.

24 Jun

When I first saw this beautiful behemoth on newegg, I sprayed cheap wine everywhere from laughing so hard (the wine may have had a hand in the laughing so hard).    I messaged a friend with a link to the case and the text, “ROFLCOPTER” without realizing the pun (stupid wine).  My friend messaged back, “literally.”

I then proceeded to add it to my cart… Hey now – 2x 25 cm fans – don’t judge me!

OpenPoker Source As a Learning Tool

20 Jun

In a previous post I mentioned an article about using erlang to write multiplayer servers.  The author of the article referes to an open source project he created called OpenPoker which he released under dual licenses – GPL, Commercial.  Unfortunately, he later decided to stop supporting the GPL version of the project and removed all references to his source, but a simple google search for openpoker turns up the source code in the first few results as of this writing.

Besides being a good lesson in how nothing really every dissappears from the internet, I mention it because studying the source has given me a lot of insight on how to approach a multplayer server in erlang.  I highly recommend checking it out, even if you don’t use a single line of code from it.  At the very least it’s a great working example of how to implement gen_server.

Also here’s a good primer on gen_server.

Iphone Web Is Not The Real Web…

18 Jun

… until they add support for flash.  Period. The recent news about the whole SproutCore framework for iphone web apps just doesn’t do it for me.  Venture Beat puts it well when they say:

Do you want a browser that lets you use hypothetical “open” applications that will be developed in the future, or one that lets you browse the web as it exists right now? You know, the web where many popular sites are built on Flash technology? Yeah, me too.

Someone should write a dystopian story about what would/will happen when Apple creates their own little sterile corner of the web where only apps built for their framework/libraries/safari javascript engine work properly.

Erlang, CouchDB, Yaws and MochiWeb Amazon Machine Instance

14 Jun

I call this my erlang playground instance.  Here’s what’s installed:

  1. Ubuntu Server Hardy 8.0.4
  2. Apache 2 listening to port 80
  3. Erlang R12B-3
  4. CouchDB 0.8 listening to port 5984
  5. Yaws v1.76 listening to port 8080
  6. MochiWeb Library

The instance ID is ami-12ae4a7b and I’ve made it public so feel free to use it to your hearts content!

I plan to add to this instance whenever I find time.  I definitely want to get SSL socket communication going using this tutorial.  I’m also interested in Kevin’s virtuerl project over a hypotheticalabs for quick and easy VM management because the whole reason I’m going through the trouble of doing this on EC2 is I think development on any erlang system should start and end with multiple physical machines.

Maple Honey Mustard Glazed Salmon with Garlic Steamed Veggies

13 Jun

Actionscript 3 AIR Application

11 Jun

I’m toying with the idea of distributing the Space Survivor game as an AIR application rather than embedded in the space survivor site (or concurrently with). Took me a while to find information about how to build an AIR app from just AS3 source, so I thought I’d share. Requires Flex Builder 3:

  • Create a new Flex Project and specify that it is a Desktop application

  • Follow your normal project-creation procedure
  • After the project is created, Make a new Actionscript file – name it whatever you want.  Make sure your Class extends Sprite or MovieClip.
  • Right click the newly created .as file and mark it as your default application:

  • Copy and past this, or write something similar in your main AS file:
package
{
	import flash.display.NativeWindow;
	import flash.display.NativeWindowInitOptions;
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.display.StageScaleMode;

	public class SpaceSurvivor extends Sprite
	{
		public function SpaceSurvivor()
		{
			var options:NativeWindowInitOptions = new NativeWindowInitOptions();
			var mainWindow:NativeWindow = new NativeWindow(options);
			mainWindow.activate();
			mainWindow.title = "Space Survivor v0.0.1";
			mainWindow.width = 1024;
			mainWindow.height = 768;
			mainWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
			var shp:Shape = new Shape();
			shp.graphics.beginFill(0x0000FF);
			shp.graphics.drawRect(0,0,100,100);
			shp.graphics.endFill();
			mainWindow.stage.addChild(shp);
		}
	}
}
  • Finally, hit the Run or Debug button and voila!  You’re good to go.

Also, look for more information here about petitioning Adobe to make a ‘Run as Desktop App’ an option for new Actionscript projects.

Static vs Dynamic Typing

10 Jun

Couldn’t have said it better than this.

Static typing works best when there is lots of complexity, but like breath mints for a drunk, we are just making it easier to get away with what we know to be a mistake anyway.

Creating a Dynamic Starfield in Actionscript 3 Using the Flint Particle System

9 Jun

Spent a few hours this past weekend sqeezing every last bit of efficiency out of a starfield generator for Space Survivor.  Fortunately, this was made extremely easy with Richard Lord’s very fine Flint Particle System.

The basic concept:

  • Set up 4 particle emitters just outside the 4 edges of the screen
  • Feed the Starfield a velocity vector from your ship’s movement engine
  • use the velocity vector to give each generated particle a velocity opposite that of the ship
  • use the built-in garbage collector of the Flint Particle System to destroy stars that go off screen

There are still some issues with it, like pre-filling the screen with stars, but here’s a demo of it in action.  Code is below the fold:

(more…)