Monthly Archives: December 2012

Uncompressing Data with the Deflate Algorithm in Java

The code shown below is an implementation of the Deflate algorithm written by Nayuki Minase, and slightly simplified by myself. As of this writing, the original version can be obtained at the URL http://nayuki.eigenstate.org/page/simple-deflate-implementation. Specifically, I simplified it by squeezing … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Rendering a WAV File Using HTML5 and JavaScript

The code included below uses the FileReader.readAsBinaryString() function of JavaScript to allow the user to load a .WAV file from the local machine and display its waveform as an image. For an online version, visit http://thiscouldbebetter.neocities.org/wavvisualizer.html. UPDATE 2013/04/30 – I … Continue reading

Posted in Uncategorized | Tagged , , , | 7 Comments

Uploading and Displaying an Image from a File Using HTML5 and JavaScript

The JavaScript code included below uses the FileReader feature of the File API to allow the user to choose an image file from the local computer’s filesystem and display that image in the browser. <html> <body> <script type=’text/javascript’> function main() … Continue reading

Posted in Uncategorized | Tagged , , , | 21 Comments

Programming a Simple Music Synthesizer in Java

The code given below uses the WavFile class from a previous post to build a text-to-music synthesizer. import java.io.*; import java.util.*; public class MusicSynthesisTest { public static void main(String[] args) { parseAndSynthesizeSong(); } private static void parseAndSynthesizeSong() { Music.Song songToSynthesize … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Loading, Editing, and Saving a Text File in HTML5 Using Javascript

The HTML and JavaScript code below makes use of some features of HTML5 (specifically the “Blob” object, the File API, and the “download” attribute of the “a” tag) to allow the user to load, edit, and save a text file … Continue reading

Posted in Uncategorized | Tagged , , , | 203 Comments

Building NetHack with MinGW and GCC

NetHack! It’s simply the most fun you can have with letters! Well, I mean, unless you count reading. Below is a list of steps to compile the open-source game NetHack from the C source code. 1. Download and install MinGW. … Continue reading

Posted in Uncategorized | Tagged , , , | 4 Comments

Programming A Primitive Orrery in JavaScript

My intent with this was to build a simple physical model of the solar system that, while it might not be exactly right in terms of particulars, still got the physics more-or-less correct. Without using any differential equations, just brute … Continue reading

Posted in Uncategorized | Tagged , , , | 7 Comments