infundibulum

dear all the people who prolly don’t read this blog anyways

May 2nd, 2007

Dudes, Ubuntu Linux is giving me all kinds of geekgasm. This distro is kickin ass & takin names.
It’s so asking for a smackdown, but I cannot fail to utter the long-foretold prophecy:

Year of Desktop Linux.

PENGUIN REVOLUTION

Why is installing Python stuff suddenly such a pain in the ass?

February 14th, 2007

It suddenly occurred to me today that I really don’t know what the right way to install Python packages is, any more.

This state of affairs drives me inSANE.

I’m just a run of the mill guy who uses Python for lots of stuff. And increasingly, I find that I just don’t bother to figure out how to install things that I might like to try, because I really just don’t feel like taking the time to install yet another installation system.

Maybe I sound like a whiney bastard or something, I don’t know. Maybe there’s something utterly heinous about $ python setup.py install that my little brain just doesn’t get, I dunno.

What I DO know is that I now officially loathe installing Python stuff. That means that I’m installing less Python stuff. Which means that I’m increasingly looking for Ruby stuff.

Which bums me out, because personally I like Python way more than Ruby.

Installing Rails (with readline and console support) on Ubuntu LTS

January 27th, 2007

Here’s what I had to do to get Ruby on Rails to run on Ubuntu LTS with a functioning console (and irb).

(By the way, Wordpress has kind of borked up the formatting of this post, there’s a plain version at:

http://ruphus.com/code/rails/railsonubuntu-howto.html

It comes down to:

  1. Random stuff
  2. Ruby (from source)
  3. Mysql packages
  4. Rubygems (from source)
  5. Rails (from a gem)

Building on posts by:

Thanks guys.

Preliminaries

Mostly via Ed Howland’s post (I believe termcap-compat, which he lists, is no longer necessary, since libc is up to 6 or uh erm… well I don’t rightly know, but that package wasn’t in the repos and everything seems to work for me without it! ☻).

sudo apt-get install gcc 
sudo apt-get install build-essential 
sudo apt-get install bison byacc gperf 
sudo apt-get install zlib1g-dev 
sudo apt-get install libreadline5 libreadline5-dev 
sudo apt-get install libncurses5 libncurses5-dev  
sudo apt-get install libssl-dev 

Build Ruby

Download the Ruby source:

wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5-p12.
tar.gz tar xzf ruby-1.8.5-p12.tar.gz 

And build it. Make some coffee, this takes a while. ☻

cd ruby-1.8.5-p12 ./configure make sudo make install 

Not sure why this is necessary (ActionMailer?)

apt-get install postfix 

You’ll also want Ruby’s documentation stuff:

sudo apt-get install  rdoc ri irb 

Mysql packages

apt-get install mysql-server mysql-common mysql-client libmysqlclient15-dev libmysqlclient15off 
apt-get install libmysql-ruby1.8 

Build Ruby Gems

We’ll be using this to install Rails:

wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz 
tar xzf rubygems-0.9.0.tgz cd rubygems-0.9.0 
sudo ruby setup.rb 

Build Rails

Actually the easiest part, I’ve never had trouble with this (knock wood).

sudo gem install rails --include-dependencies 
sudo gem install mysql 

Note that the mysql gem is really the DB connector for Ruby; it’s not Mysql itself. (We already did that.)

Afterword

Now that I’ve explained what worked for me, let me explain the problem I had, in case you’re interested or facing the same problem.

When I originally followed the steops in Richard Crowley’s post, everything seemed to install fine and Rails worked great.

But I found that my console wouldn’t work, just like Paul Ingles:

Loading development environment.
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require':
 no such file to load -- readline (LoadError)     
 from /usr/local/lib/ruby/1.8/irb/completion.rb:10     
 from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'     
 from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'     
 from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'     
 from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'     
 from /usr/local/bin/irb:13 

This means no readline in irb, and no script/console whatsoever, which I gotta have.

So I tried his solution, which consisted of building readline from source, and then building Ruby. I’m not totally positive (though I’m going to find out soon when I rerun this whole process on my laptop), but I think that the steps I’ve described above obviate building readline from source on Ubuntu.

And now this works! \o/

./script/console 

Leave a comment!

I’d really appreciate comments about this process, especially corrections or simplifications.

I’d also just like to get in touch with other folks running Rails on Ubuntu! Believe it or not not everybody using Rails is on OSX. ;-)

$100 laptop could sell to public

January 10th, 2007

BBC: $100 laptop could sell to public

Mr Bletsas said that a philanthropic organisation would be formed to organise the orders and delivery of the laptops.

“It’s much more difficult to do this than making the laptop,” he said.

The aim is to connect the buyer of the laptop with the child in the developing world who receives the machine.

“They will get the e-mail address of the kid in the developing world that they have, in effect, sponsored.”

Wow, I’ll buy two, maybe four. That’s so awesome.

A Hmong Messianic Script… and Linguistics and that Whole Religion Deal.

December 21st, 2006

Long title, huh?

Long post.

I finally got around to ordering Mother of Writing : The Origin and Development of a Hmong Messianic Script from Amazon.

Anyway, I’ve only just begun to dig in, but the book is about a rather mysterious writing system which was invented for the Hmong language, spoken primarily in Laos, but also in France, Canada, Australia, China, Thailand, French Guyana and the United States.

This isn’t to be confused with the various roman-script systems for writing the language, which are rather interesting and worth a post in their own right– no, the book is about a totally distinct script called Pahawh Hmong. You can see images of it at Omniglot under Pahawh Hmong alphabet.

The alphabet is believed by some Hmong to have been the divinely inspired creation of Shong Lue Yang (Soob Lwj Yaj).

(And by the way, eek the Wikipedia article on the Hmong language is abysmal…)

The book was written by a Christian missionary. I found it pretty interesting trying to peel back the layers of who was trying to interpret whom (and what). Yang himself was a (not exactly Christian) missionary, and part of the book was written by one of his followers. But the part which is strictly linguistic can be read without regard to any of that stuff, and the Pahawh Hmong is certainly a fine and interesting piece of orthographic engineering.

The topic of the intersection of religion and linguistics is something which kind of gets my blood boiling. Linguistics is a science, and it should be treated as such. But because missionary “work” overlaps so much with linguistic research, we end up with that the new language codes have a religious organization as their authority… And I mean the authority. As in, the ISO calls these guys up and asks for “the answer” on linguistic nomenclature.
Now, think about that for a second. What if the ISO called up the “Intelligent Design” guys for authoritative answers on biological classification? Maybe they should call up a proper psychic to resolve disputes on whether global warming is real.

I kid, slightly.

So why is the linguistics world okay with being reduced to being the authority on “Ancient, historical, and constructed languages,” while SIL is the authority for… most of the languages on the planet, and most of the languages for which you really need unyielding impartiality?

Note to self: Stop being lazy

July 16th, 2006

You know, there’s this programmer saying that goes “lazy is good.”

For instance, if you understand how to use libraries, and you use them, then your code will be shorter and easier to understand and maintain.

I’ve discovered repeatedly that that is in fact true, as far as it goes.

But it’s directly opposed to the other programming maxim: RTFM

The discovery, for me, is that in point of fact RTFM’ing is in fact easier in the long run, often.

(And before I describe this, I should point out that I really don’t care who thinks I’m clueless about what. I only care about what I think I’m clueless about. Because if I think I am clueless about something, well, by the demiurge, I am.)

Case in point:

When you go digging around for tutorials on how web servers work, you eventually run into this thing called “CGI.” Which you later learn means “Common Gateway Interface.” Which fact you dutifully attempt to absorb:

Oh ho ho, yes, old chum, why, that’s the Common Gateway Interface! It’s so… why, it’s Common!

And then, you go and you bang your head against whatever tutorials you can find.

But see, you still haven’t RTFM’d. Because you still don’t know how a web server works, because you don’t know how HTTP works.

Now this can be a slippery slope, because you don’t know how TCP works, and networking, and hardware, and, and, and, well, and sooner or later you hit Heisenberg, right? (Then there is no F’ing M.)

Eheh.

Like, today for some god forsaken reason I tried firing up this weird little builtin Python module called CGIHTTPServer. Which is kind of surprising, really — it’s a web server that you can start up from your command line, (if you have Python), like this:

$ python -c 'import CGIHTTPServer; CGIHTTPServer.test()'

Whammo, web server. You open up http://localhost:8000, and there’s a web server, which will actually run CGI scripts, which you put in a directory called cgi-bin, in the same place where you run that command. And you can put Python cgi scripts in there.

And it spits out log messages and everything.

It’s nutty, I tell you.

Now I mean, I’ve actually “known” how all this HTTP/CGI/blah blah works for a long time. But there’s something about finding a minimal arrangement that generates much grokkery:

Oh, that’s why there has to be a blank line after that Content-type: text/html; charset=utf-8\n thing… it really does separate the headers from the body… Oh yeah right, the difference between a GET and a POST is just obvious, you see the URL in the logs on a GET

And so on.

I think the programmers who are naturals are people who can look at some new problem, and they can say “okay, I know what I need to accomplish, I think I need to R this much of TFM in order to get to the point where I can start being lazy…”

In other news I’m a complete and utter insomniac.

Whoa.

June 26th, 2006

Just, whoa.

I’m not even sure I would want to run that.

Ubuntu Rocks

June 13th, 2006

I’ve been a Redhat/Fedora guy for… well… years. I started with Redhat 5 or something like that.

But recently I decided to try Ubuntu, just for the heck of it, and I’m glad I did.

I’m a Linux guy, but I won’t deny that there are still issues with Linux from an everyday kind of perspective. Some things that have never worked well for me:

  1. Sound.
  2. Dealing with an iPod.
  3. Hibernating.
  4. Package management.
  5. Default UTF-8/Unicode support all over the place.

Ubuntu is beating Fedora on all of these accounts, so far. Hibernation works! That’s never worked for me, ever. Of course, I’m not up to date on my Fedora installation so maybe it’s equally good there nowadays.

But I have to say, I’m so happy with the Ubuntu install on my laptop that I’m thinking of installing Ubuntu over the Fedora install on my desktop as well.

Some Ill-thought Out Ruminations on BEAM Robotics and Moore’s Law and Futurism and Singularities and Crap like That.

June 5th, 2006

For me reading about futurism is a kind of antidote to the suckiness of reality. And in some ways it’s a guilty pleasure. Because I was one of those people who was disappointed when that Stephen Wolfram book sold out and I had to wait two weeks to get one. And because I was one of those people who didn’t just read “The Singularity is Near,” I actually went and bought Kurzweil’s other book — the one where he tries to sell you power shakes.

I read all that crap.

And most of it really is crap, most of it really is bad science fiction.

But the thing is, the numbers are real. Mostly it’s crap because nobody can say anything intelligent beyond the general observation “uh, something is happening here.” As soon as they start to try to predict it, well, they may as well be Jerry Falwell.

Thing is, though, you don’t have to be a televangelist to believe that humanity is going to smack up into some shit we ain’t never seen before. You just have to understand exponents.

Now, the accepted story among the futurati goes something like this: okay, see, we have Moore’s Law, which means that computers get faster and faster. And the getting-faster is getting faster. Which means, well, if you take the derivative of the function you’re plotting of fastness, that function is going up too. Up up, all around.

And then the story inevitably turns to “what is intelligence?” Because, if you have a machine which is hella fast, then eventually you’ll be able to model all those… squishy neurons, as if they were circuits. You’ll be able to assign a bit to represent each neuron in a brain, or at least to enough of them to model a functional blob of gray muck, and then, VOILA PEOPLE, VOILA, intelligence.

Which is of course, so much baloney.

At least, it’s very easy to see that it’s baloney if the people are all also assuming that our current concept of “software” is going to play any role whatsoever in creating these emulations. Lemme tell you right now, intelligence is not going to pop out of a Java virtual machine. Or even Perl 6!

I mean, yeah, there will “programs” going on and software and CPUs and all that, it’s just that people won’t write the programs. The programs will be hopelessly complex, and for all practical purposes, they’ll be organisms. What “programmers” will do (Kevin Kelly has some great stuff about this in his book Out of Control) is sit around trying to figure out ways to kill the software. Mung it up. Because the software will have self-healing capabilities, and the efforts directed at munging it up will result in improvements.

Or at least, that’s what all the software astronauts will tell you.

But that’s baloney too.

(Now I’m getting pretentious.)

See, there’s another revolution, and this one gets less respect, because mostly it’s only ever gotten any public attention in the form of toys and vacuum cleaners. Like this one:

Here’s another one:

Most people aren’t aware of the revolution that’s underlying these things. One was designed by a guy from Los Alamos, the other is from MIT.

The funny thing is, they’re both based on a lack of technology. They don’t depend on complicated programming and processing. They work like animals (the dumb ones) work. Their sensors are tied directly to the actuators. The interaction of the objects with the world “creates” intelligence.

If a Roomba were set loose on the parking lot of Mall of America, assuming the highly impossible scenario that there were no cars on it, it wouldn’t look very intelligent. It would sort of just, uh, go.

But when you see it get stuck in a corner and repeatedly attempt to get it self out — turning, bumping, wiggling — you can’t help but think to yourself, “god, it’s so… dumb, the way it tries so hard to get itself out of the corner.”

What you maybe don’t think about so much is the fact that you called it dumb in the first place. I mean, yeah, it’s dumb — it also sucks up dirt! And besides, what do you want for a couple hundred bucks?

That toy, on the other hand, the Robosapien… that thing costs less than a hundred bucks, and it’s easily as entertaining as one of those fancy schmancy Aibos. It’s fun just to watch it walk around. It’s fun to watch it walk around in the same way that it’s fun to watch a cat walk around. And my cat likes to watch my dad’s Robosapian walk around. And I’m pretty sure she likes to watch it because… well… it’s fun.

Does the cat think that toy is alive?

Well, duh. Of course.

The purest example of this sort of approach to “intelligence” is something called BEAM robotics (which, incidentally, was founded by the Robosapien guy, who got a fair share of inspiration by studying stuff the Roomba guy was doing).

BEAM is about building robots without processors. In fact, as I understand it (and I haven’t succeeded in building a BEAM robot myself, though I’ve tried), they actually design the “circuits” expressly to be slow. Slow enough to function in the physical world.

I think the insight behind this geeky little hobby is a profound one. Because this is what will happen:

  1. People continue building silly little robots that do amusing pointless things by sending simple signals from one sensor to another.
  2. Wireless networking devices get ridiculously small and cheap and ubiquitous.
  3. Somebody figures out how to put the damn things on the internet.
  4. People start building little robots that do… not so pointless things by sending simple signals to each other.

Then hell breaks loose.

A wee introduction to Event Handling in Javascript

April 27th, 2006

This has been sitting around on my hard drive so I decided to finish it up:

A wee introduction to Event Handling in Javascript

As always, I’m more interested in “learnability” than… well, anything else.

Actually, I’m starting to think that it would make more sense to just start learning about this stuff by ignoring it — one could just learn how to use jQuery to do all such stuff, rather than touch event handling at all. But jQuery is still in heavy development, and anyway, you can do a fair amount of neat stuff with simple event handline.

In any case, there it is.