Monthly Archives: September 2007

Historical Material from October 2006 – What is the Right License for Sakai?

This material was prepared for and submitted to the Mellon-Funded Retreat on Intellectual Property Issues held at Indiana University October 16-17, 2006.

I am publishing this on September 30, 2007 now that the Sakai Board has adopted the ECL 2.0 license for Sakai.

http://www.opensource.org/licenses/ecl2.php

If you read the whole document below and see my recommendation for an ECL 1.1 – this is *not* what happenned – instead the group came up with ECL 2.0 which is a tiny variation on Apache 2.0. I am pleased with the outcome – particularly since has OSI certified ECL 2.0. I think that the folks at the Indiana retreat did a great job and identified some precise use cases that clearly differentiate ECL 2.0 from Apache 2.0.

I did not attend the Indiana meeting because (a) I already had accepted an invitation to attend and speak at the Cal State CIO Retreat and (b) I was probably too emotional at the time about ECL 1.0 to be a positive contributor to the meeting :). Brad Wheeler and I agreed that I should submit my concerns formally and let the sausage get made – in retrospect this was a wise choice as everything turned out very nice – and I played a great round of golf in Santa Barbara looking out over the Pacific Ocean – it was the only round of golf I have played in the last 10 years.

The material below is my unedited submission to the Mellon-Funded Indiana Intellectual Property Retreat. Please read it in the context of October 2006.

Continue reading

Getting a Ruby Application Working on HostMonster

I recently bought an account to run my Ruby web sites at a place called HostMonster. This promised to have out of the box support for Rails – it seems trivially worth $120 for a year to save having to figure it all out myself.
I worked through their pretty clear knowledge base article. I created my tables using rake db:migrate instead of hand-making the tables in MySql – because I like abstractions!
I got the DB working and then when I clicked on “About your application environment” on the Welcome to Ruby page, I got my 500 error:
Application error
Rails application failed to start properly”
Nothing in the logs at all – it was clearly not starting Ruby – I was sure it was a little configuration error. I made a few fresh apps with the same results over and over.
So I called technical support – they really answered after about 5 monite on hold – the guy on the phone was not on a rails expert – he said to make a trouble ticket – which I did. Several days later I got a kind of generic – “did you look in the knowledge base?” response from Level 1 support. Grrrr. Yes – only for about 4 hours! And searched the forums and searched Google, and hacked my .htaccess etc etc.
I snarked back at Level one support repeating the problem – I told him that I just tried it *again* and it still was not working.
Then 9 days later I get a nice note from Level 3 support asking if it was all fixed – he checked my site and he though it was OK. I said “no it was not” and that I was tired of trying. I was about to think of my $120 as sunk cost and go to Deamhost where my pals have things working and so I could at least look at their stuff.
One day later the Level 3 guy (Thanks Jacob) got back with me with this message:
There were just permissions issues within the rails application. I tested imsti.rubylearn.com and is working now. You can’t view the application’s environment using the link from the default public page for security but it no longer give an error about the application failing. Also I would suggest using the dispatch.fcgi in your configurations.
I looked at the working directory and one that was broken and the problem was that my umask on UNIX had left group write permission all over the place. And Apache was silently saving me from a life of being hacked. I quickly did a hack on my other dirctory:
chmod og-w public
chmod og-w public/*
chmod og-w public/*/*
And my old directory started wrking slick as you please! Damn – I *knew* it was something simple.
Now I have to do this all the time so I whipped up a little C-Chell script that I now run in each newly minted rails application. Here is my script called fix-perm.csh
#! /bin/csh
foreach i ( ` find . -print` )
echo chmod ag-w $i
chmod og-w $i
end
I keep this in my rails_apps directory and use it like this:
cd ~/rails_apps
rails appnew
cd appnew
csh ../fix-perms.csh
Viola! Please let me know if this works for you. I wish that Hostmonster would add this to their knowledge base.
Just to be clear when you press “About my application environment” and see this message:
For security purposes, this information is only available to local requests.
This is working *properly* – it means that Ruby is running and giving you the message instead of RUby failing so you see the 500 error (above).
Again – thank to Jacob who did not give up – I was quite patient because I was busy on other stuff and glad they did not let the ball drop. Thanks HostMonster.

Using Ruby instead of Awk/SED/Grep/SH/Perl

I have been recently wondering if Ruby is a better language for script kiddie
stuff. The kind of stuff I use awk, sed, grep, csh, and sh to accomplish. Some crazy people use perl to do this. But some folks suggest that Ruby is good for this. This is a very different application from Rails – it is super-perl.

I read on the Internet somewhere that Matz had a plan to make a better and more consistent perl when he started Ruby and you can see that in its design and what it has out of the box.

I recently decided to switch to the iPhone (previous post) and had to switch from MeetingMaker to iCal / iPhone / Google Calendar. But all my contacts were in Meeting Maker – what to do?

Meeting Maker has a text export of the contacts – the file is tab delimited and they do line-ends DOS-style. The Apple Address Book takes VCARD format.

Usually faced with this, I write some sed, awk, and shell script stuff – but this looked a little too nasty for that. Usually when I am writing multiline awk programs in separate files to get the job done, I realize that I have gone too far. Often I fall into something like Java at that point and kind of have to start over – but ultimately I get it done in Java feeling kind of bad about it.

So this was the perfect high-motivation situation for me to try Ruby on the command line.

Short story isthat I really liked it – it is simple but powerful – want to make an object? Do it. Want to split lines – do it? Want to ready the whole file into a string and break it into an array of strings based on CRTL-M – do it.

All in all I ended up with a pretty nice Meeting Maker to VCard conversion script. I will likely clean it up, add some doc, and then release it – I include my basic version below.

Continue reading

IMS Tool Interoperability – Alex Balleste of University de LLedia

Alex Balleste spent the last two weeks at the Unviersity of Michigan working with me on IMS Tool Interoperability. We got a lot done including:

  • We have developed a REST profile for IMS TI 1.0
  • We have developed extensions that allows the TI Proxy tool to do configuration and permission setting for the tool and have added it to the Deployment Descriptor and to the LaunchRequest.
  • We have extended the Sakai IMS-TI JSR-168 portlet that supports all of the launch descriptors including the original, SOAP Lite, and REST as well as the Authz and Config extensions – this interoperates with 1.0 compliant placements as well. This portlet works in Sakai and any other JSR-168 compliant portal.
  • We have developed sample tools supporting the IMS TI REST profile that are written in Java, Ruby, and PHP.

iPhone Conversion – I resisted for over 24 hours

Yeterday morning I bought an iPhone from my nephew – the plan was too expensive for him – so he cancelled it and I bought his 4G iPhone from him.
I have used Treos for years now and really grown to like them – I really like the form factor of the Treo 680. I was going to experiment with the iPhone for a few weeks on Wifi before switching.
But holding the iPhone the past day in my hand it was only a matter of time before I could not resist its lure. 30 hours after it was in my posession – the Treo 680 is off and I am 100% iPhone. Here is my experience.
iPhone Advantages
I *like* the keyboard – I thought I would not like it but in just a few hours it has grown on me – and it is better than the Treo for typing already.
The gestures take some getting used to – but they work. I instinctively grabbed my Treo stylus to see if it would work – nope – the iPhone wants a finger or thumb and works well. Also there is no need ot use a fingernail – I like that. I always scraped the paint off keys on the Treo when I used a fingernail.
I thought calendar was going to be a problem – but I am about to switch to Google calendar for my work – so along with Spanning Sync I am totally off Meeting Maker and on to Google Calendar + iCal + iPhone – full two way synchronization – most excellent. They let you use a perfectly good working copy for free for a while and then you pay like $15.00. What a deal. Apple Corp should buy these guys and include this in Leopard.

The browser is cool – but I need to learn the gestures – I wrote some code in Sakai to make the Sakai PDA portal work well with the iPhone browser and checked it late last night – it was kind of counter intuitive. Tell it that we have a narrow device – keep lines short and use large fonts… Hmmm. But it does look much nicer when you follow their style guide.
I love the WiFi – love it – love it – love it. I wish there were a way to store passwords for logging on to protected Wifi places. This would be a good feature to add.
I love the larger screen resolution – I love the fact that the keyboard is not there when you don’t need it – I can read more of E-Mail and understand it better. Funny when the keyboard pops up it feels more like a Treo and there is not enough screen real estate to compose non-trivial responses.
Mac integration is sweet – it just *knows* my mail settings and address book- one sync does it all.
Transfering my old ATT/Cingular to the iPhone was a snap using iTunes. I had to extend my contract – but I kept my rollover minutes. I will save $20.00 on my data plan too. Luckily I was only 4 Mo into this contract. Since I bought the phone used all I lost was 4 Months.
I just swapped my Cingular SIM into the iPhone from the Treo – connected to iTunes – and 10 minutes later I was making iPhone-calls.
The ATT and Cingular folks at the Meridian Mall store and at ATT tech support were really nice to me and helped me along with timely answers.
I like sending photos to my blog using real mail instead of MMS (on the Treo). I am happy to have a real mail client that will queue and retry outbound mail if the network is down. I can also queue up picture mail and then blast it out when I hit a Wifi hotspot.
Also think about this – when I am home or in some other free Wifi zone – I am *not* using the data plan – brilliant. Absolutely Brilliant – particularly when you are trying to keep the data plan reasonable. This means an auto-log in feature for Wifi would save ATT money! Because when I am at my coffee shop with free Wifi with a login – I will be lazy and use my data plan instead of the Wifi because it is fewer clicks.
I am looking forward to going internationally because with WiFi I can actually do Mail reading duriung meetings now – I am too much of a cheapskate to pay data while I am international – but Wifi is free many places.
I like YouTube – it seems to have more stuff than the Apple TV Yotube – I can lay down and watch all of the Rails Commercials or the Apple versus PC commercials from a chair – great fun.
IPhone disadvantages / Treo advantages
I generally hate any help while I am typing – I am finding and turning off any predictive stuff. It keeps changing words I type – thanks but no thanks.
I miss the five way navigation on the Treo – I could do things from memory with click sequences – it means that I need to look at the iPhone more (at least until I have it memorized).
Manipulating web pages works well for things like the New York Times that is a bunch of div rectangles but not so well for something like Sakai which are single pages – I want to move around and zoom – as if it were a photo – and it keeps looking for little square divs in the “newspaper” – kind of frustrating – it is a browser well sutited to read the New York Times it would seem. Of course – why am I complaining – the iPhone browser is far better than anything else on the market. but it would not hurt to look at Blazer and the different modes – Blazer has some nice tricks Apple might want to borrow.
I really wish the Camera had a “Mail this picture” button without having to go into the Album, find a picture and mail it from there. This extra workflow is nasty and will force me to keep my on-phone album very small – Sad. The use case that is needed is “Take this picture and send it to a pre-configured address like flickr in a single click”. Treo is not perfect but the Treo supports this work flow slightly better than the iPhone. What I want is a solution that is better than the iPhone and better than the Treo 680.
Also the photo sending program on the Treo has “Quick type” so you don’t have to type things over and over. For me all I do is put Flickr tags in – so it is two clicks to add “tags: sakaiger” to the message on the Treo – this will be very painful in the Apple – so some sort of way in the keyboard for me to put commonly used strings available as macros would be very nice. This would be useful in any app using the keyboard – although the clever design would contextualize the macro strings to the application which is being used.
As bad as the Treo camera is – the iPhone is worse in some situations – the iPhone is worse in low light and up close – when the light is good – the iPhone takes nice pictures. But I am really surprised since it seemed that the Treo 680 was really bad with pictures compared to Motorola phones I have – and the iPhone is worse in the low light or close situations. Hmmm. I don’t get it.
There is something weird with the iPhone camera – if you just point it and wiggle it around – it is like it morphs and bends the picture – it is almost like there is some compression/decompression going on that is motion-estimation (like MPEG) based becuase it seems to get confused with gentle rocking motion. I can only guess that the camera has MPEG in hardware (not yet used) and that we are using it (for now) as a still camera. As a still camera we are decoding it to still frames and grabbing them. Perhaps I am just seeing things or perhaps I am looking for something to complain about because I am missing my cute little video recorder from my Treo 680.
I wish the new Gizmo widget worked on a iPhone. I had not yet tried it – but it is the kind of fun thing you can do when the platform is extensible.
iChat would be nice – where is it? Probably not there to keep the data plan from being overrun. I doubt that there was a technical or software development timeline reason to hold it back. It is either marketing or data plan that is holding it back
Conclusion
All in all the nicest surprise is that I like the keyboard and that the iPhone calendar/iCal calendar can be made to work with Google calendar. Once I got the calendar working – the rest was almost insignificant. Switching was to be a matter of hours not weeks.
I can see a lot of improvements to the UI – that would not be hard – and could be done in a patch release. But that would probably have to wait unti the next hardware platform.

Ruby: IMS Tool Interoperability

Well I wrote my first Ruby application. It was an IMS Tool Interoperability endpoint. It has REST Web services and stores sessions in a database. It meets the REST profile for IMS Tool Interoperability.
My overwhelming feeling is that Ruby is absolutely amazing – I now know why Steven Githens uses sash. Having a console to test code even before you put it into a controller is simply amazing.
One thing I was amazed by is that I have to stop and think some times – because code is written so quickly and debugged so quickly – you actually have stop and think more often – the typing of the code is not the rate limiting factor – how well you have throught through your problem *is* the rate limiting factor.
In Java there is so much cruft and the speed of the debugging cycle is so plodding – I have gotten to the point in Java that I can do designs whlie waiting for a compile or server restart. In Ruby there is no such slack time – so I find I need to get up and walk around once in a while to let the idease anneal in my mind. After I settle back down and have the ideas worked out – making them work in Ruby is done in a flash.
Probably my biggest peeve about Ruby/Rails is a lack of a book that tells you everything that you can do – all the books I have are example after example – and they are all too simple – because they are solving a small problem they never who you how to do a subtle thing like declare that a column in a database is not null.
I need a reference manual. Here are some sites that are helping me not go too crazy:
http://www.railsapi.org/
http://zamples.com/JspExplorer/content/rubyUG/
Using Google with things like this works sometimes
ruby string class
rails activerecord class
I use this to find stuff in Java by typing
java string class
But I am looking for a definitive 10000 page manual for Ruby and Rails. I am tred of poring throush 20 line examples :)
I am also really liking Model-View-Controller – but there does seem to be something eauivalent to Components that I am missing. Where do you do things like performance tune, cache, etc etc. I think the Model is too thin of a layer to do it – and the Controller is not the right place either.
I do like the Rails abstraction between View and Controller. I have a lot yet to learn but the fact that Urls are abstracted feels very portlet like and WSRP like.. Hmmm. Me likes.
All in all it is amazing that I need to stop and think because things get coded up so quickly.
Here is a picture of the running app in Sakai:
IMS Tool Interoperability in Ruby
I need to move the from my desktop to a server so others can use it.