Jeremy of all Trades Home


Modular Honeycomb Shelves with Hand-Cast Aluminum Brackets

After seeing this design for modular furniture on dornob (an architecture and furniture design website), I thought it would be cool to make my own. I designed the bracket shapes in Inkscape, converted them to G-Code with CamBam, and then cut them out of wood. I then took these wooden models to the local aluminum foundry (where they normally hand-cast things like pots and spoons). With the help of a friend speaking Lingala, I was able to get a good price per item (important since the hexagonal shelves I built have 34 brackets). The brackets came out a little bit rough, so I had to do some cleanup on them. I really like the finished product though! Check out the photos on Flickr.

And now you can view a tutorial on my new website CommentHow.com

February 15th, 2011 by Jeremy

Obgaektify - Datastore Grooviness for Google App Engine

A while back, I started playing around with Google App Engine (Java) and the lightweight, Groovy , Gaelyk. There’s also a great library written for using the low level datastore in App Engine called Objectify.

I decided to write a little Groovified wrapper for Objectify (which already does most of the work) and turn it into a plugin for Gaelyk. It adds a little syntactic sugar, and although it doesn’t have everything, it is working nicely for me so far. Check out the Obgaektify site to learn more.

February 15th, 2011 by Jeremy

Audacity SoundFinder Plugin

I modified the Silence Finder plugin that comes with Audacity, and turned it into a Sound Finder plugin. The original plugin let you specify the minimum time period and volume level needed to count as a silence, and then inserted a label at some point during the silence. This new Sound Finder plugin creates a label that stretches the length of each sound segment.

I’ve now used this to help me add text transcriptions to about 80 audio files in 4 languages (Beembe, Bekwel, Mbochi, and Teke). The default parameters have worked pretty well for me, but you may need to adjust them depending on your recording.

This is the Sound Finder dialog:

SoundFinderDialog

This is an example of the resulting labels. You can replace the labels with your own text. In my case, I will replace the numbers with a text transcription.

SoundFinderExample

Finally, here’s the plugin file that you can download. Put it in the Plug-Ins folder inside your Audacity folder. After restarting Audacity, you should be able to access the plugin from the Analyze menu.

soundfinder.ny

October 5th, 2009 by Jeremy

Directory Recursing Thumbnail Generator

Put this script in a particular directory (or change the directory specified in startDir variable
and it will recurse through all sub-directories, creating thumbnails of the images (jpg, png, gif, or bmp).
If you change the deleteOriginal variable to true, it will delete the original image for you afterwards.

import javax.imageio.*
import java.awt.*;
import java.awt.image.*;

def startDir = new File(".")
def deleteOriginal = false
def thumbWidth = 200
def thumbHeight = 150

startDir.eachFileRecurse{file->
	if(file.name =~ /\.(JPG|jpg|PNG|png|GIF|gif|BMP|bmp)$/)
	{
		def imgType = file.name.replaceAll(/[^\.]*\.(JPG|jpg|PNG|png|GIF|gif|BMP|bmp)$/, "\$1")
		def imgPath = file.getCanonicalPath().replaceAll(/\.(JPG|jpg|PNG|png|GIF|gif|BMP|bmp)$/, "_Thumb.\$1")
		println("$imgType, $imgPath")

		//load each image
		img = ImageIO.read(file)
		println (file.name + " " + img.width + "x" + img.height)

		//output scaled thumbnail image
		width = thumbWidth
		height = thumbHeight
		if(img.width < img.height){width = thumbHeight; height = thumbWidth;}
		BufferedImage thumbImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
		Graphics2D gThumbImg = thumbImg.createGraphics();
		gThumbImg.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
		gThumbImg.drawImage(img, 0, 0, width, height, null);
		ImageIO.write(thumbImg, "$imgType", new File(imgPath))

		if(deleteOriginal)
		{
			file.delete()
		}
	}
}
October 4th, 2009 by Jeremy

Unicode Files in Groovy

It took a little while for me to track down how to read and write Unicode-encoded files using Groovy. Here’s the answer:

 /*
Given a file called test.txt that's filled with text in UTF-8 format,
here's how to use Groovy to read it in, preserve the encoding, and
output it to a file called testout.txt, also in UTF-8 formatting.
*/
def inF = new File("test.txt")
def reader = inF.newReader("UTF-8")
def outF = new File("testout.txt")
outF.withWriter("UTF-8"){writer->
    reader.eachLine{line->
        writer.write(line)
    }
}
February 1st, 2008 by Jeremy

Dynamic Swing

 dynamicswing.png
//Groovy script that demonstrates dynamically adding and removing text fields from a Swing form

import groovy.swing.SwingBuilder

swing = new SwingBuilder()

addButton = swing.button(text: 'Add Field', actionPerformed: {addField()})
remButton = swing.button(text: 'Remove Field', actionPerformed: {removeField()})

frame = swing.frame(title:"Test Dynamic Fields", size: [200,400], defaultCloseOperation:javax.swing.WindowConstants.EXIT_ON_CLOSE)
{
	panel = panel()
	{
		vbox = vbox(id:'vbox')
		{
			hbox()
			{
				widget(addButton)
				widget(remButton)
			}
		}
	}
}

fields = []
fields << swing.textField(text: fields.size())

vbox.add(fields[0])

//frame.pack()
frame.show()

def addField()
{
	field = swing.textField(text: fields.size())
	fields << field
	vbox.add(field)
	vbox.revalidate()
}

def removeField()
{
	if(fields.size() > 0)
	{
		field = fields[-1]
		vbox.remove(field)
		fields.remove(fields.size() - 1)
	}
	vbox.revalidate()
}
December 14th, 2007 by Jeremy

Eagle Chest Finished!

Back in April, I started on a woodworking project to create a wooden chest. Now in November, I have finally finished it!

The chest was influenced by several elements from the immersing game Shadows of Angmar: The Lord of the Rings Online. One of the chests in the game had carved bird heads jutting out from the sides, and when I saw it, I was suddenly inspired to build one myself. I drew up plans for a simple square chest, capped by a triangular lid, with carved eagle heads for handles on the sides.

The lower front panel’s design is based on the design of Thorin’s Hall in Ered Luin, where dwarven characters start their lives in Middle Earth. The design was wood-burned onto the panel with a wood-burning tool, and then colored with colored pencils for wood, before being covered with a protective coat of spray paint.

The front lid panel bears a chart of stars and constellations. Each star has a pinprick hole in its center. When it’s dark and a light is placed within the chest you get a semi-accurate view of the night sky (star sizes and luminosities are not to scale).

November 21st, 2007 by Jeremy

Virtual Board Games

I’m currently working on a virtual board game engine written in Java. The idea is to represent game tokens with images (.png or .svg mostly), and allow the players to manipulate these tokens (flipping cards, rolling dice, moving pawns, spinning dials, etc.).

I’m using Ryan Gordon’s ManyMouse library to allow players to each have their own mouse which controls their own cursor. Permissions set on each token will determine what operations a given player can perform - moving, rotating, flipping, etc.

So far, the basics are coming along well. You can load in tokens, change between token images, rotate tokens, move tokens, and use multiple cursors to affect the environment. I’ll post more details as I make progress.

November 21st, 2007 by Jeremy

New Site

Every once in a while, I visit register.com to see if any good domain names with my name are available. I discovered recently that jeremy-brown.com was available, so I decided to snatch it up.

I installed this nice WordPress theme Dark LiquidCard, created by the French artist and designer Jori Avlis. Thanks Jori! With a few tweaks to the code, I was able to enable WordPress widgets in the sidebar. Now the site is up and looking good.

November 21st, 2007 by Jeremy