gnumatt.org

Rejuvanation

Posted by Matt M. on September 10, 2007 at 08:48 AM

Programming Collective Intelligence has me excited about web development in a way I haven't been for a few years.

Even got me doing stuff in python.

John Backus

Posted by Matt M. on March 21, 2007 at 01:28 PM

Sometimes it seems like we're quick to forget the great engineers and scientists who make our world possible. More people know who Anna Nicole Smith is than say Jon Postel. I've been really pleased to see all ink spilled on the passing of John Backus. While I knew about Fortran and BNF I didn't realize how bright and forward thinking the guy behind them was.

Conventional programming languages are growing ever more enormous, but not stronger. Inherent defects at the most basic level cause them to be both fat and weak...

[via Scott Rosenberg]

That is from the opening of an ACM paper he wrote advocating for functional programming instead of conventional procedural programming. Functional programming took a back seat to Object Oriented programming, but in recent years it has seen a resurgence. I imagine part of this is because we've also seen a sort of return to the mainframe/dumb terminal model of computing with web servers/browsers. Of course it doesn't hurt to have Google championing functional programming with their map/reduce algorithms.

It's great to see someone willing to look beyond their own innovations (Fortran isn't functional) to find a better way. I hope I can see my own flaws as clearly.

Comments: (disabled) Tags: Development

Building Something Good

Posted by Matt M. on December 03, 2006 at 12:38 PM

Yahoo launched a new TV site and then got repeatedly bashed in the comments by users. I was surprised to see the normally snarky Techcrunch comment on how this is a good thing for Yahoo. The idea being that Yahoo is soliciting feedback and acting on it.

It reminded me of my own recent woes trying to figure out a useful way to translate an email message into a blog post or comment. The problem was that what may be useful in an email message (quoting every message in the thread, signatures, etc) are mostly noise once you structure them in a web site. Recent events have reminded me of the importance of feedback. I've started trying to think of a way to collect feedback inside the web app as to what's noise and what's signal in a posting.

I also noticed that others have problems gatewaying HTML emails out of mailing lists as well.

Comments: (disabled) Tags: Development

Emails in a Blog

Posted by Matt M. on November 21, 2006 at 10:11 AM

I run a mailing list for local movie buffs. I've always been frustrated by the web based archives that the list software creates. Basically I want to be able to use it the way I use a blog. I want to tag posts, search by author, full text search, permalink, 2 level message threading (instead of the n level of threading it currently does).

I quickly wrote something to pull new emails out of a pop3 account and post new messages via the MetaWeblog API to a Wordpress blog, and then followup emails as comments to the post. While this was a little tricky because of broken Microsoft mail clients and Wordpress comment throttling threading it more or less works.

The big problem is that emails on a mailing list are not blog posts. People have giant signatures, Microsoft adds garbage markup, people will reply to a message and start a completely new thread, some email responses contain copies of every message in the thread. What might be considered a feature in email is noise in a blog post or comment.

I can't figure out how to handle all the noise in each email. I'm beginning to think the whole experiment is misguided because people use the mailing list more like an instant message chat, than a place for discussions needing to be archived.

Comments: (disabled) Tags: Development

Professional Goals

Posted by Matt M. on July 14, 2005 at 07:25 PM

This weekend I should wrap up the last of my freelance projects. This will be a marked difference from how I've been living for the last five years. Prior to this I've always had professional responsibilities to other people in addition to a regular job. It's the end of an era for me and I'm planning on focusing my free time on DVDs from the various AFI lists, the 2002 Sight and Sound list and writing two applications in Objective-C/Cocoa on OS X.

I'm not giving up on the web stuff though. I passed the MySQL 4.1 Core Certification this week. I'm taking Zend and MySQL 4.1 Pro in a few weeks. I have a Dallas movie related site to build out with Plone, and another blog search/discovery related website in Ruby on Rails.

I will only be posting technical/professional on csbgroup.org from now on. gnumatt.org will exist solely as a personal outlet, one that hopefully be updated more often.

Comments: (disabled) Tags: Development

WordPress and RSS feeds

Posted by Matt M. on April 02, 2005 at 06:15 PM

Consider this a public announcement. A number of friends have made the jump to WordPress in recent weeks. Unfortunately this has broken their RSS and Atom feeds. The feeds return a 404 file not found error code when you try to load the pages. So livejournal, bloglines, netnewswire, pulp fiction and any number of other RSS aggregators can no longer follow the sites.

Only one of the WordPress sites I read managed to avoid the problem. Not only did he avoid it but he even sets Last-Modified and ETag headers. Be still my beating heart!

At any rate, this is a known bug and downloading a newer version of wp-blog-header.php should fix the error. This has made me start thinking about creating a webtest script for testing my own sites after software upgrades.

Comments: (disabled) Tags: Development

Converting ISO 8601 YYYY-WW to unix time

Posted by Matt M. on November 28, 2004 at 12:44 AM

I recently began work on a small project that involves displaying a weekly view of a calendar. I want to use a url like /index.php/weekview/2004/04 where 04 is the week number. There are many standards for calculating which week of the year one is in. Microsoft even has their own ideas about calculating weeks.

The W3 recognizes ISO 8601 as the standard for most date and time formats but not the 8601 Week format specifically. Still 8601 is as good a standard to use as any. It turns out that working with the 8601 week can be quite involved. J R Stockton's page about calendar weeks is hands down the best online resource about the topic I found.

So, how can I work with the YYYY/WW dates and the MySQL database I'm planning on pulling this data from? php and MySQL are both happy to work with unix time, and for my purposes that is fine. This means converting the YYYY/WW dates, but thankfully most of the heavy lifting can be done by php's date command.

function ywtounix($year,$week) { // We need to use a 0 based week and 8601 is 1 based $week—; // Calculate the beginning of the year. The nice thing is // that this calculation is always relative to the year // so it automatically takes leap years into account. $boy = date('w',mktime(0,0,0,1,1,$year)); // Now do the math for adding or subtracting days based // on how far we are from Thursday (the basis for 8601 // week numbers) switch ($boy) { case 0: $daynum=$week*7+2; break;// Sunday case 1: $daynum=$week*7+1; break;// Monday case 2: $daynum=$week*7; break; // Tuesday case 3: $daynum=$week*7-1; break;// Wednesday case 4: $daynum=$week*7-2; break;// Thursday case 5: $daynum=$week*7+4; break;// Friday case 6: $daynum=$week*7+3; break;// Saturday } // Now add the number of seconds that have occurred // since midnight to calculate our unix time return mktime(0,0,0,1,0,$year)+($daynum*86400); }

or the tighter version

function ywtounix($year,$week) { $day_adj=array(2, 1, 0, -1, -2, 4, 3); $daynum = ($week-1)*7+ $day_adj[date('w',mktime(0,0,0,1,1,$year))]; return mktime(0,0,0,1,0,$year)+($daynum*86400); }

Sadly, this solution wasn't quite so obvious to me before I started this. Also it took me a ridiculous amount of time to figure out and test the day adjustment constants.

Amusing date trivia: At some point Alaska lost 11 dates after we purchased it from the Russians and changed them from the Julian to Gregorian calendar and moved the International Date Line. There's gotta be some kind of clever historical thriller in that somewhere.

Comments: (disabled) Tags: Development