JambaLaya development at WWDC

June 13th, 2008

So far WWDC has been very useful. I came with a checklist of about 10 items I wanted to add to JambaLaya but was having trouble with and I got them all more or less knocked out. Among those:

Custom font bundling - there’s some black art here and it took two days to find the guy who knows how that works. It is possible that people downloading JambaLaya have been getting it rendered with really ugly fonts. If you’ve downloaded it and it doesn’t look like the picture, I’d like know because I think I’ve been getting fooled by system installed fonts. Fixed.

JambaLaya Screen

Key indicator highlighting on key range mapping. I couldn’t get this to draw reliably due to threading issues. Fixed. Makes it much easier to see where your keys are because hitting a key on the keyboard animates it in the mapper.

Adding side chain routing to audio unit views - since these are often carbon views (ICK) adding UI is kind of nasty - but someone suggested I stick a drawer on the bottom - cool. It was kind of tricky to get working with carbon window but we made it work in the end. Expect side chaining and other custom add-ons to appear in audio unit views.

Clock and Tempo. For working with things like Stylus RMX adding ways to communicate song tempo and beat clock. JambaLaya will also get the ability to both supply timing or sync to external timing and will get transport controls.

Some other goodies I’m not talking about yet. :-)

Expect 1.1.0 early with all the bugs fixed by next week. New features as I get time.

In other WWDC news, iPhone app development is HOT HOT HOT. I confess to developing iPhone envy looking at how much use people get.

Rails is Magic

May 22nd, 2008

And I hate magic. First, I confess that I probably still don’t have a full command of all ruby’s features - I’m just getting the hang of mixins and some of the wacky compositional capabilities.

I’ve just deployed my first soup to nuts rails application. Well, nearly. It certainly starts fast. Generate ActiveRecord classes for your tables using scripts and you’re off and doing basic CRUD.

However, its the little things that made the experience less than satisfactory. First - the changes in behavior moving from development to deployment were nerve wracking. I have rails running under apache on my laptop, no problem. On my production server, I cannot get byte one to come out of rails. Webrick works fine. Mongrel works. Rails cgi produces no errors, and no output. Even apache logs are totally silent. I don’t get it. For now it is running under mongrel - but I’ll have to put that behind apache and front it using modproxy. Irritating as hell.

Second, I set up memcachedкомпютри втора употреба on the advice of friends and was going to use it for my session cache. But it turns out that objects don’t get saved in the memcached - apparently you can only store plist kinds of structures. Objects get dropped. I spent several hours beating my head against this using the usual hammer for this nail - require_dependency. However, after listing every blessed model class as a dependency, it was still dropping a collection of objects. Back to the file based session cache.

Another thing that drove me nuts is all the magic values you can’t use for attribute names. I inherited this database and admittedly a bunch of columns and tables are stupidly named - however I kept running into problems with collisions with ActiveRecord extensions.

Another thing - camel vs underbar lowercase. You generally specify relationships as lower case names, that ActiveRecord uses to infer a class name. For instance, you specify the relationship as purchase_order and it figures you have a class PurchaseOrder that keeps its data in a table called purchase_orders with a foreign key purchase_order_id. This can all be overridden, but understanding which form to use where got pretty trying.

Reciprocal relationships - at some level of circularity, ActiveRecord falls over with stack level too deep on save. It isn’t even a very complex graph that does it in. It became necessary to remove a bunch of back references to get a save to work properly.

Overall, I’d say towards the end I spent more time debugging magic gone awry than I did building application functionality. So I have to chalk it up as a real learning experience, but not one I’m looking to repeat anytime soon. The lack of decent debugging facilities was really crippling - especially coming from seaside. ActiveRecord is cool, but it isn’t trouble free. Doing basic inheritance was a huge exercise in wackiness I’m not eager to repeat. If I hadn’t had a big old mysql database to build on top of, I probably would have used seaside instead.

So enough slamming - its not all bad. One thing that helped a LOT was the discovery of ActiveScaffold AS is AMAZING! I was able to throw together a coherent admin interface with it very quickly - its customization options are very powerful, and in the end I think the back office app will be about 80% AS and 20% task oriented workflow. That’s brilliant. A data driven sensible ajax interface almost instantly. Very cool.

I may do more ruby apps, there are some seriously powerful go-fast kinds of technologies, but much of the time savings this go-round was lost to flukey behavior that changed from environment to environment, and really lame debugging tools.

Rails is definitely a very mixed bag.

Quick Ruby Thoughts

April 29th, 2008

I have to say I’m liking a lot about Rails. Ruby, not so much. Probably the most annoying thing about Ruby is the syntax. It is MUCH too complicated and after working with it for awhile, I still don’t quite understand all the rules. Things that puzzle me:

dot notation vs non-dot notation. When to use which?

collection.select {| x | x > 5 }

vs

collection select {|x | x > 5}

they both seem to work. Also, use of parens around argument lists - also seems to be optional. Two different block definition syntaxes is also annoying.

Less syntax would be most welcome.

Hoppin’ on the Rails

April 4th, 2008

I’ve got two new clients - on is taking over expansion of an existing Ruby on Rails application. The other is the replacement of the application I wrote in the previous article. I want to stick a new codebase on the existing database. Since rails excels at CRUD and I’m short on bandwidth and hand-off-ability is a concern with the new development, I’m going to use rails for that one too.

I mean, I can only learn so many frameworks at once. So here we go - working through Agile Web Development with Ruby on Rails.

Software Design Tip: Minimize Number of Languages

April 1st, 2008

I was recently asked about taking over support for an existing application. I’ll leave out what it does - suffice it to say it is web based, has a simple 3-5 page UI for the public to buy something, and about a 15-20 page set of back end interfaces for trained customer service and admin people to use. So less than 30 screens overall mKay?

The application was said to be written in Java. I know Java - I don’t like it, but I know it. If its small, I could be persuaded to pick up the maintenance.

However, I got a source drop and I was totally appalled. First, it suffers from the usual Java framework-itus.

Its J2EE - so we got Jetty container. They used Hibernate - so we have generated Java code based on some XML schema files. There’s also a mysql database - which duplicates the information in the Hibernate XML schema files. It uses cocoon - cocoon make use of xml and xsl to define navigation and transformations. There is also reporting that uses xsl. Workflows use flow - more xml only they used the Javascript extension so the workflows are actually defined using server side javascript.

Got all that? We have Spring, Coccon, Flow for Javascript (flowscript), Hibernate, Jetty, Javascript, Html, CSS, SQL, XSL and god knows how many dozens of distinct flavors of XML. For a 25 page web app. Wait, did you notice I didn’t mention Java? There is Java - the Hibernate generated classes are used - but indirectly - they may as well not exist at all since all the application code is some fractured XML or Javascript fragment stashed who knows where.

It seems we’ve lost track of something here. “Locality of Reference” In general, all the stuff that deals with the product selection page ought to be visible by looking into the file representing that page, then maybe drilling into components. The problem here is that, everytime I have to drill down, I have to switch languages. And context switches are bad for programmer productivity - mKay?

I’ve turned down the job. I don’t have time to learn all that junk for this little app. The client needs a new installation - for 25 pages that do mostly CRUD to mysql. If I do it, I’m thinking plain old PHP with an ORM. If I can find an ORM for PHP.

So far I’ve looked at Doctrine (not yet ready for production but it looks cool), Propel - and some others. The really off-putting bit is their slavish insistence on creating the xml mapping file - just like Hibernate. Of course, I have an existing database. The XML file they want is in the db. It just isn’t XML. Still, all the information is available for query - so why are they bothering me with this junk? Read the damn schema and make me some classes. I’ll eliminate the many to many mappings by hand. Sheesh. No wonder there’s a software crisis.

Hey framework people, stop making me write monkey code - figure out how to eliminate extra work - not make it. One meta model is enough.

Who do ya gotta do at Google

March 25th, 2008

Google wouldn’t know harmful content if it sucked them off for $50.

Google! Fix this stopbadware flagging nonsense!

They are totally unresponsive despite repeated requests for review. They don’t even mention what they object to - I’ve read their guidelines - I see no problems. As far as I can see - Google IS the badware.

Google boycott starts now. Because this is evil.

Mike Arrington, Software Pirate

March 24th, 2008

The ever clueless and abrasive Mike Arrington says something even more ridiculous than usual. I can see both sides of the Bebo thing and frankly, social networking makes me yawn. I have no patience or interest in it. Seems like a phenomenal waste of bits to me. Musicians uploaded their music without expectation of compensation. So sure, they’re probably not ‘entitled’ to a payout. OTOH, Bragg’s point is well taken - the musicians made them successful and it would be a nice gesture to give back. But I wouldn’t hold my breath on that. They’re internet entrepreneurs. Thus greedy bastards by definition.

OTOH, the thing that really ticks me off is this little comment by Arrington.

…it costs exactly the same to produce one copy of the song (the first one) as 10 million copies. Simple economics takes over. Free.

Which, if true, implies that Microsoft ought to be giving away Vista, Office, and everything else. Because Music is Software. It costs as much to develop as software, it takes every bit as much time, talent, and skill.

Just because you can make a second copy for a buck, doesn’t mean that’s all it is worth. If it costs $30k to record a song (which is kind of typical these days), and we are expecting to sell 100 copies, then this song needs to make $300 per copy to break even. If its 10 copies, then its $3000 a copy. The same economics apply as software. Just like there is free software, shareware, and commercial software, there are many business models around music. No single model is right all of the time.

Arrington should stick to his little blog about the shiny things - he obviously knows fuck all about the economics of creation.

Music IS Software

March 24th, 2008

Reprinted from my old blog - written in 2002.

I’ve been having a discussion with Amy Wohl on this copyright stuff. I don’t think I’ve quite made the point I’m trying to make. I think I’m a witness to one of the greatest hypocracies ever placed squarely in the public eye.

Perhaps I’m in a unique position. It could be that
I have special powers of insight. I can’t tell.
I know this much. I’ve been a professional
performing and recording musician as well as
songwriter. My one public triump was winning a local
radio sonwriting contest in Albuquerque New Mexico
around 1985. I was proclaimed “The hottest band in
New Mexico”. Technically it was a recording project
performed by myself, computers and friends.

I am presently a professional software sytems architect and developer.

And I am amazed.

The very short thesis is that somedevelopers are simultaneously calling for greater access to music, video and entertainment by while insisting that software is different and must be more protected.

The argument for pushing for online access to music is that the increased sales more than compensate for any losses from pirating. The recording industry is labeled as fearful and unwilling to trust the users. Those music people ought to be ashamed!

The take away is that improved access to creative works increases sales. I think this is true.

These same people bristle at the suggestion that improved access to their creative works might also improve sales. Now we’re holding a gun to their head they say. Releasing my ten year old source code will ruin me!

The software industry is trying to rely on the same mechanisms that the recording industry relies on. That copying a work is technically infeasible and should stay that way. The music industry used to keep control by releasing inferior copies that degraded with successive generations of copying. The software industry keeps control by refusing to release source code.

With the advent of digital music, the music industry has lost its built in copy protection. Yet the software people say “have courage”. “Increased exposure will increase your sales.” The numbers seem to imply that this is true.

Of course, if we turn the tables and require the same of software developers they cry “foul”.

Fueling the fire is the rising indignation regarding the ever growing term of copyright. A couple of legal luminaries have begun to fight this on the grounds that the public good is being subverted in the name of corporate profits. A really good explanation of why copyright terms aren’t forever is described in this paper by legal professor Glenn Reynolds.

For those with short attention spans, the paper basically says providing permanent copyright impedes progress because nobody can afford to build on the work of the past. But no copyright impedes progress because nobody is incented to produce new inventions if they can’t make money from them. So a middle ground - limited term copyright (or patents - these also expire) - allows inventors to both build upon the work of the past while getting paid for their work. Its a good mechanism that has been subverted in the name of corporate profits. Because long term copyright holds our culture hostage.

A great example is the Happy Birthday song. It is said to be among the top 3 best known songs in the english speaking world. But it remains encumbered. Unlike the music of the great composers which is all in the public domain now, the song Happy Birthday, truly a core part of our culture, remains a hostage of Warner Communications. This is the best example of copyright abuse I know of.

Of course the software people all agree. Those greedy corporations! Free Mickey Mouse!

The upshot of this uproar is that people are beginning to realize that long term copyright holds our culture hostage, that creative works ought to eventually pass into the public domain.

Even software works.

But they don’t. When a software company goes bust or simply changes direction, old products die. They don’t get updated. The source code disappears. Files written by the software containing content owned by other people become inaccessable. Imagine if this happend to all of our creative content.

The original music business was so primitive that songwriters made money by selling you the sheet music to the song and you had to perform it yourself. Completely open source. Still, Stephen Foster and Scott Joplin made plenty of money in spite of sharing. Today, their works are in the public domain and they are a much loved part of our history and tradition.

Sadly, this isn’t happening with software. Although if Lessig gets his way, that will change and source code will be escrowed to be released into the public domain at the expiration of copyright. This is the duty of the copyright holder and beneficiary.

I suspect that part of the fear among closed source developers is that their work will be borrowed piecemeal and new products built upon it without their being compensated. But they get a ten year lag before that will happen. Thats better than Van Halen got when Tone Loc sampled the opening drum riff for “Jamie’s Cryin” for his “Wild Thing”, or the deal David Bowie and Queen got when Vanilla Ice borrowed the signature riff from “Pressure” for his “Ice Ice Baby”.

It would be very hard to argue that Van Halen lost any record sales to Tone Loc or that David Bowie and Queen lost sales to Vanilla Ice. The financial loss isn’t real. In much the same way that casual Napster downloaders weren’t going to buy the music they pirated anyway, the loss is impossible to quantify in any financial way.

Its called fair use and in general its good for everybody. But it takes courage to see it. Source code must pass into the public domain on expiration of copyright. Its the right thing to do for everybody.

JambaLaya site updated with documentation

March 20th, 2008

mainscreen.png

Today I uploaded a whole bunch of shots and comments - primarily to serve as a proxy for a user’s manual. It is such a straight forward simple app, I can’t imagine it needs much of a manual. Basically live music performance oriented MIDI and audio processing.

Anyhow, check it out. http://www.audiofreakshow.com

About the only thing preventing a full on launch is the back end stuff to take payments and issue serial numbers, and finishing up the serial number handling in the application. It doesn’t adequately cripple things if there is no serial yet. Few more bottlenecks to install checks into. Also, one little bug with lyric editing. Minor, but a little annoying.

Curse You Google!

March 20th, 2008

A friend sent me an email telling me my site has been blacklisted by Google - largely because some spammer (die, spammers, die) hacked a message and put a bunch of link spam in. I really have to question the security of wordpress. If they can’t keep it clean, I’ll have to migrate to something else.

There is an interface to request removal from the blacklist, but while you can be blacklisted in seconds, it apparently takes several days to get off of the blacklist. Nice.