07.13.08

Speak & Spell!

Posted in Speak & Spell, website at 10:40 pm by Shannon

Those of you who remember the Speak & Spell will probably love my first attempt at a website redesign based around it.

So far, you can type letters using the keys, and it has sounds I recorded from my actual Speak & Spell. The text is much bigger than the real thing, so it can be read, but it is limited to 8 characters like the real thing. The sounds are somewhat delayed on Firefox, and the text is in the wrong place in IE… but you can see the potential!

The image is from a patent application made by Texas Instruments. Hopefully they don’t mind if I use it!

http://sha.nnoncarey.com/speaknspell/

06.28.08

Rails inconsistency

Posted in Uncategorized at 10:07 pm by Shannon

I like Ruby on Rails, but the design is sometimes inconsistent.

For example, consider the “text_method” parameter to the collection_select helper method. The argument forces you to call a method on the model object which returns the text which is used in the select list. That’s ok when you only want to display a single field from that object, for example “name”. It’s not ok if you want to display something more complicated, because then you’re putting display logic into the model. You’re supposed to use helpers for that! Since doing it right would make it ugly and more complicated, I end up giving in and doing it the wrong way by adding a method to the model. It frustrates me.

05.15.08

Fareed Haque

Posted in music at 10:45 am by Shannon

It’s nice to have a girlfriend who works for the Skokie Theater. I’m getting free admittance to see Fareed Haque tonight. Awesome.

03.04.08

Duo Melis

Posted in Uncategorized at 2:22 pm by Shannon

This blog is notably lacking in the subjects of music and art, so to help remedy that here is a video of the classical guitar duo I had the delight of hanging out with this weekend. http://www.youtube.com/watch?v=gXMOB1BvpwY

They are amazing musicians, not to mention hilariously funny and smart. Besides hearing a totally INTENSE and inspirational performance, I got to hear really funny and endearing stories about their adventures. Susana is from Spain, while Alexis is from Greece, so they’re doubly interesting to talk to.

Unfortunately, writing about it tends to deflate the experience. But I will update if they are in Chicago again. Until then, check out their website http://www.duomelis.com/

02.27.08

Brain dump

Posted in Uncategorized at 11:53 pm by Shannon

Delicious firefox extension - intelligent tag grouping to cut down on size of menu
Sage - load feeds by opening an rss of rss feeds
Particle system research. Bird for website redesign.
Embattle - write gtd to identify unresolved issues

02.05.08

Javascript Mergesort

Posted in Uncategorized at 5:34 pm by Shannon

A while ago, I couldn’t find any Javascript mergesort implementations, so I wrote one. The nice thing about mergesort is that it is “stable”, id est it retains the previous order of elements with equal value. Therefore it is great for sorting rows in a table on different columns sequentially. Also, the merge() function is handy for merging two sorted arrays into one big sorted array.

Check out Wikipedia for more info on mergesort and other sorting algorithms.

Here it is:

function mergesort(a,f)
{
	var alength = a.length;
	if(alength <= 1)
		return a;
	else
	{
		var middle = Math.round(alength / 2);
		var left = new Array(middle);
		var right = new Array(alength - middle);
		var result = new Array(alength);
		left = a.slice(0, middle);
		right = a.slice(middle, alength);
		left = mergesort(left, f);
		right = mergesort(right, f);
		result = merge(left, right, f);
		return result;
	}
}

function merge(a, b, f)
{
	var alength = a.length;
	var blength = b.length;
	var result = Array();
	var i, j, k;
	i = j = k = 0;
	if(alength == 0)
		return b;
	if(blength == 0)
		return a;
	while(i < alength && j < blength)
	{
		if(f(b[j], a[i]))
			result.push(a[i++]);
		else
			result.push(b[j++]);
	}
	while(i < alength)
		result.push(a[i++]);
	while(j < blength)
		result.push(b[j++]);
	return result;
}

The “f” argument is a comparison function that you provide. Here is a sample comparison function to get you started:

function compare(n1, n2)
{
	return n1 >= n2;
}

02.04.08

origin of heredoc?

Posted in Uncategorized at 4:55 pm by Shannon

I’m curious. Who knows the origin of the word “heredoc” or “here document” to refer to a way of representing string literals? It seems like such a strange name.

01.24.08

braindump - html 5

Posted in Uncategorized at 1:59 am by Shannon

As pointed out on slashdot, the first public material on HTML 5 is now available from the W3C. http://www.w3.org/TR/2008/WD-html5-diff-20080122/

It’s a major victory that frames have been completely removed from the language. They have always been horrible for the UI, security, bookmarkability, etc.

However, I take major issue with their choice to standardize innerHTML into the DOM. The only reason I’ve ever used innerHTML is because sometimes it’s impossible to get IE to behave any other way. IE’s poor lack of support for DOM is no reason to standardize a workaround though! Not only does innerHTML promote bad programming practices, it can all-too-easily lead to injection attacks.

10.14.07

Circuit Maker v1.0 Released

Posted in Circuit Maker at 11:01 pm by Shannon

I would like to announce that the afore-mentioned Circuit Maker program has been released. Bon voyage!

Working on Circuit Maker has made it clear how much work must go into preparing a program before it’s ready to be released to the public. I was using the tool over a year ago at ISU to make a new web app, and it cut development time in half. However, the same things that worked for me might not work for others, and so I had a lot of things to fix and add. I think I’ve accomplished what I set out to accomplish though. Thanks to Roy for his help and great ideas, and also to the rest of my old coworkers at the Dev team of Campus Life Tech Support at ISU.

08.16.07

Circuit Maker

Posted in Circuit Maker, SVN at 11:56 pm by Shannon

Circuit Maker is about to become an active project again, instead of a mere passing reference. What is Circuit Maker? It makes Fusebox circuits automatically. Given some simple settings, it creates Model, View, and Controller for a given entity in your Fusebox program. The concept is similar to Ruby’s scaffolding, except for two things. First, it wasn’t developed by Ruby developers so it’s not the same. Second, it doesn’t (yet!) model itself based on the contents of the database. One of the great things about it, though, is that it abides by a very organized structure and set of best practices which help application developers develop faster and better.

So tonight, I loaded up the svn dump to a new repository. It wasn’t easy though, because Circuit Maker used to be in a repository along with a bunch of other projects. As I found out, SVN does not have a feature which allows the user to split, or separate, a repository into more than one repository. Instead, the SVN dump file has to be run through svndumpfilter to remove irrelevant paths, and then it must be hand-edited to correct unwanted paths or changes in path structure (moves or renames to the directory containing the code). It turned out to be easier than I expected, but that was partly because CircuitMaker does not yet contain any octet-encoded files. This guy had worse luck.

Now that we have a workable repository, it is on! Roy and I are pretty excited to finally get this thing out there in the Fusebox community where it belongs. In a way, we’ll hopefully beat Fusebox to the punch when it comes to this kind of thing. There has never been a free/open source tool which is as sexy as this, and all Fusebox has is an inactive Trac page and some ColdFusion code. But if they do get something together, it might lead to some interesting fusion of concepts between Circuit Maker and it.

That’s all. Have a good weekend.

« Previous entries