Monthly Archives: August 2007

Blog Entry from my PDA

It just occurred to me that I could simply use the web browser to post blog entries directly. Since the blog software is pretty light bandwidth wise it works Ok. So this means my blog will be even more like a kitty-blog journal. This week I am off to Heerlen NL to visit the Open University of NL and then on Wednesday I am off to Tilburg NL to participate in the Ticer Digital Libraries ala carte 2007 course and then back Saturday. I am typing this as the door closes on my flight from Newark to Amsterdam.

OzzFest – Detroit

I am on the bus to the airport at 7:15 AM entoute to Open University of the Netherlands and the Ticer Digital Libraries course in Tilburg, NL. I am pretty foggy due to lack of sleep (no alcohol was involved). I was at OzzFest with Brent yesterday.
Pictures and Video
OzzFest is amazing – it is like a controlled explosion – it is like a real festival – starts at noon and goes to midnight with about 10 bands – finishing up with Ozzy Osborne.
We had a good time – early in the day they do less well kinown bands at the second-stage and there is a continuous mosh pit – you come and go as you like and get as close as you like / dare. We watched two bands with rest periods in between. We got close to a mosh pit – about four layers of people away – at one point a dude came flying out in our general direction and scattered the people and almost knocked us all down. Just close enough to get a sense – not so close to be in any dnager.
We moved at a slow pace because of Brent’s crutches so we walked and sat a lot.
As the day moved into evening, we switched to the main stage – five great bands -I kept in my earplugs 50% of the time to make sure I could hear Ozzy :). We had great seats with good sight lines – and thank heaven we were not on the lawn.
Ozzy was great – all in all a great way to spend the last day o summer vacation.
The bus is pulling up to Detroit Airport so I have to cut this short.

This is great fun – Future Casting – Education 2020

Take a look at this – it is very fun and cool.
rtsp://educause.rmod.llnwd.net/a680/o1/edu2020.rm
I like the “out of the box” thinking this video makes me think about.
My problem is that its hypothesis is that teaching and learning will become increasingly about technology and not about humans. I just don’t believe this.
My problem is that what we need to know is always increasing – so just at the moment that we think that we have the perfect BA degree on a CD – things change and we need to know more – the world and society and technology is constantly changing – we always need to understand the newest and latest and that which is only emerging at this moment or the day after tomorrow.
The only thing that can teach us that which is not yet known – is a human – frankly we all learn at the edge of knowledge together and then write down what we learn for others to follow and clarify.
But other than this problem of ever-expanding knowledge – the video is a blast to watch.

Ruby Fun

Well I figured out a few things.
How to make a ruby app set up to use sqlite3
rails app-name -d sqlite3
How to properly install sqlite3’s dll – put it in ruby/bin
How to check to see if you have a gem installed
gem list sqlite3
I am working towards a nice simple version of rails that will run on Windows and Mac from a USB stick.
On the Mac, I am happy with Locomotive. On Windows – I like InstantRails – but do not like MySql as the database.
The SQLite browser is dang cool and dang simple to install on both mac and PC.
http://sqlitebrowser.sourceforge.net/
Textmate is a very very fun editor for the Mac and Rails. It instant-installs right from Locomotive. Sweet.
On the PC – I like e-texteditor http://www.e-texteditor.com/
The dang sweetest thing so far is
After running
ruby script/generate model Thing
And making a simple database migration script like this:
class CreateThings < ActiveRecord::Migration def self.up create_table :things do |t| t.column :key, :string t.column :value, :string end end def self.down drop_table :things end end Then run this: ruby script/console And type this: x = Thing.new x.key='123' x.value = 'fred' x.save Absolutely sweet - able to interact with the ORM from the command line - dang dang dang. Hib can eat its heart out. I still am confused as to why folks don't use SQLite3 all the time for simple stuff - like for teaching. These one-click installers should all use SQLite3 IMHO. Also I wonder why people ever use anything other than migrations using the DB-independent syntax to populate/organize tables. Urg. It is too bad that the ruby / rails stuff does not put consistent line-ends in place. Some things work in vi others fail in notepad.exe - ah well - a good reason to get a sweet editor like TextMate or e-texteditor - and pay for them. TTFN - time to go buy some more 1GB USB sticks and a USB-2 controller.

Ruby – First (almost) disappointment

When you are learning a new language, when something is different often the first reaction is that it is bad – after all we fear change.
As I was learning about Ruby objects, I was learning that all members variables are private and that the only way to get at the variables was through setters and getters. I got used to setters and getters when I went from C++ to Java – it has always bugged me that I had to add 10 lines of code and 8 lines of comments just to access a dang member variable the “cool Java” way.
With one of the tenents of Ruby is to dispense with unnecessary cruft – “convention versus configuration” I was surprised when all the books immediately introduce setters and getters right away. I would have thought that there would be a simple way to do this – code like this bothered me:
class Thermo
def set_temp(x) # a setter
@temp=x
end
def get_temp # a getter
@temp
end
end
And they described this in books as if this was a *good thing*. To me it was crap and too much “me-tooing” Java patterns – it was the absolute antithesis of “convention not configuration” – it was overblown syntax – something I hoped to get away from in Ruby – but here in Chapter 3 – was creeping cruft – when would it end? And with this crufty syntax needed for *every* member variable – as far as I was concerned – Ruby was already a failure at delivering on “convention not overblown wasteful, repetitive, and redundant syntax”. Grr. I was only a few weeks into the new language.
So I started reading my five Ruby books and looking in the indexs and searching for things like “ruby sucks” and “ruby setters and getters suck” in Google and trying to learn if there were others as peeved about this as me. I found some peeved folks – and even some folks peeved about this issue. But somewhere along the line I got a clue.
Actually I had a clue all along – ActiveRecord does *not* use the setter/getter pattern faux-Java style – and since ActiveRecord is written in Ruby – it must be doing something much niftier than faux-Java setters and getters. You just refer to
thermo.id
Not
thermo.get_id thermo.set_id(1234)
To get the Id of an active record object – I liked that – how do they do that? So the hunt was on.
By the way there needs to be a newbie list where people like me can ask dumb questions like this and get a boot to the head to quickly learn this stuff. Like dummies@ruby.org or some such.
So I was sure there was a better idea – there was hope. I will bypass all the pages that I waded through until I found this one.
http://www.ruby-doc.org/docs/UsersGuide/rg/accessors.html
It shows two patterns of setters that make a LOT of sense – far more sense than the drivel above. I will switch to his code here:
class Fruit
def kind=(k)
@kind = k
end
def kind
@kind
end
end
f2 = Fruit.new
f2.kind = “apple”
f2.kind
Now that is a sweet syntax – particularly when accessing and setting the member variable. Kind of like C++ again – operator overloading – a nice clean syntax that allows me to do things “in context” – working with the compiler as my pal rather than pounding it with syntax as in Java (sorry – still a little bitter about the loss of operator overloading when I left C++ five years ago).
Of course – Ruby does this one better below.
This *is* “convention over configuration” – or at least “don’t repeat yourself”. “Don’t repeat yourself” is a very important concept in programming as it keeps us from making transcription mistakes. So the super-sweet Ruby-regains-absolute-advantage syntax is as follows:
class Fruit
attr_accessor :kind
end
f2 = Fruit.new
f2.kind = “apple”
f2.kind
Ah – I am back happy with Ruby again – no wasted moves – all graceful – like a ballet dancer – I can express what I want in a concise syntax that clearly communicates my intent to the future reader of the code. And if I want to add a little “special stuff” to my setter – simply drop back to the attr_reader and do my own setter as in the previous example.
Whew! I was kind of grouchy with Ruby for a few hours – but I am feeling better now – and in addition the Ruby approach is am improvement beyond C++ and Java IMHO – simple syntax for simple situations with the option to go deeper using more syntax only when there is a real need.
Also I got a little back on the operator overloading front… Cha-Ching.
Let me know if there is a mailing list to help me get through these mental blocks more easily.

Pedagogy: Teaching with Sakai – pre-class start

I will be putting up notes about how I am teaching with Sakai – I will code them all with the string pedagogy in them to make searching easier in amonsgt all the nerdy posts as well.
So far I am having great fun with Sakai – pre class start I have made my course site and published it – I have very few tools enabled:
Announcements
Polls
E-Mail Archive
I set it up knowing that students are still adding and dropping the course – as soon as they see it – they see the “welcome announcement” and are told to review the E-Mail archive.
I am taking a very valuable (both to me and the students) poll to gauge student experience level and am involving the students in the book selection via the E-Mail archive.
I make it very clear in the welcome announcement that any pre-class start participation is completely *optional*. Being able to later delete announcements is pedagocialy important to me because once class starts – the pre-class announcement is no longer relevant at all and would be distracting if I could not delete it.
This is a good reason to let faculty pre-setup and publsh their classes under their own control – not waiting for tech support to run some script. I will reveal Sylabus, Resources, iTunesU, etc on my schedule – not tech support’s schedule.

Continue reading

I just got SVN to work on hostmonster.com

I tried SVN 1.3 and SVN 1.4 – it would not get through configure.
SVN 1.2.0 worked – but it even spewed some errors – but it worked well enough to get command line svn working – which was all I cared about.
cd
mkdir dev
cd dev
curl -O http://subversion.tigris.org/downloads/subversion-1.2.0.zip
unzip subversion-1.2.0.zip
cd subversion-1.2.0
./configure –prefix=`pwd` –without-berkeley-db –with-zlib –with-ssl
make
make install (this failed with an error message)
./subversion/clients/cmdline/svn help (yay)
cd
alias svn=~/dev/subversion-1.2.0/subversion/clients/cmdline/svn
mkdir zap
cd zap
svn co https://source.sakaiproject.org/contrib/csev/trunk/scripts/ zzz
This bit was helpful:
http://www.hostmonsterforum.com/showthread.php?t=1294&highlight=subversion

Open Letter to www.1and1.com

I sent this letter to 1and1 tech support – figured I would share it here.
Domain: dr-chuck.com
I just wanted to drop you a note about Ruby on Rails hosting. I really like 1and1 a *lot* – I have used it for four years – and while I started in the free professional package – I have spent a lot of money and felt that my 1and1 services were a good value – I am so pleased that I put 1and1 ads on all my main pages.
Recently I became interested in Ruby on Rails – I initially tried to get ROR running on my 1and1 account and was even thinking of adding a second hosting plan just to do RoR – but since it was hard to set up – I decided to go with a service that simply supports RoR directly – hostmonster.com.
I will stay with 1and1.com – probably forever for my basic web hosting and domain name stuff – but as my interest grows in RoR – I will naturally begin to do new work at hostmonster.com.
So I am just wishing and suggesting that you come up with a supported RoR service – I would be happy to pay another $5-10 for it and happy for it to be another service. I really would like to stick with one vendor – keeps my life simpler for these hobby web sites.
Thanks for such a fine service.
Dr. Charles Severance
www.dr-chuck.com