sha.nnoncarey.com/blog

sin(Θ)

Duo Melis

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/

No comments

Brain dump

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

No comments

Javascript Mergesort

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;
}

No comments

origin of heredoc?

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.

No comments

braindump – html 5

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.

No comments

Circuit Maker v1.0 Released

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.

No comments

Circuit Maker

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.

No comments

Navteq in the news

Where have I been? Well, France and Spain to name a few. Until I get a computer desk, be satisfied with the latest article in the news about my company: Navteq charts growth of maps via technology

No comments

Today’s Annoyances

Today has been a buggy day at work.

First, I tried again to get Java Web Start working on an application. It launches JWS, but then my application hangs leaving a javaw.exe process in the background. From some searching on the forum, it seems that other people are having the same problem. In fact, it may be due to a bug in Java Web Start, which means there’s nothing I can do about it.

Next, I’m having a problem with Selenium tests on a PHP application which uses sessions. It took me a while to figure out why my test user would get logged out immediately without any error messages when running tests with the Test Runner instead of the Selenium IDE. I have ini_set(‘session.referer_check’, ‘stuffhere’); set to improve security a bit, but when I run the test suite through the Test Runner, $_SERVER['HTTP_REFERER'] is set to the Selenium Test Runner’s URL, which obviously fails the referrer check. And since errors were being pushed to a session that was immediately lost when the referrer check failed, I wasn’t seeing any errors. So what’s my solution? Well, for now I’ll have to disable the referrer check. It can be spoofed anyway… That means changing a fair amount of apps though… bleh.

1 comment

Embattle

I followed up on Friday’s idea for a collaborative editor, and for a day’s worth of effort I’m pretty happy with what I achieved. The tentative name is Embattle as in, “Grab your battle keyboard and engage in bloody melee with your fellow developers!”

I have Yahoo’s YUI and JSON to thank for my success so far.

No comments

« Previous PageNext Page »