Archive for the ‘Linux’ Category

Ronald P. Loui: The Best Student AI Work Is Developed in Gawk

August 15, 2007

Here is some surprising evidence that Perl should still be respected in spite of its “indecent” appearance. And while Gawk appears to beat Lisp at its own game in this case, it may in fact be because it has so much in common with Lisp.

Important Gawk Features based on Ronald P. Loui’s AI class experience:

  • Powerful String Processing Language Features
  • Powerful Constructions for Manipulating a Wide Variety of Data in Efficient Ways
  • Interpreted Language with a Short Learning Curve
  • Automatic Initialization, Implicit Coercion, I/O Support and Lack of Pointers
  • Regular Expressions
  • Associative Arrays
  • Relies on the OS to provide Data Organization, Debugging Tools, and Subroutine Libraries
  • Powerful Uniform Data Structure
  • Trivial Syntax
  • Encourages Bottom-Up Design and Exploratory Programming

If you don’t have time to master Lisp, Gawk might be a pretty good substitute….

(I found the link to the above article in the comments of an blog entry that really trashes poor RPG. Just reading through it I noticed a lot people love to make lame complaints about languages they know nothing about. Whether its Lisp or RPG, most of the things people get hung up on have either been addressed in the 20 years since the person last saw the language or that can be addressed by trivial modifications to a text editor. Anyways, old school RPG’s “program cycle” is very similar to the basic premise of gawk– sans most of the more lispy features, of course. RPG’s tight integration to the OS is is also very similar.)

Advertisements

PCLinuxOS 2007– Ready for Average Joes?

August 13, 2007

It’s a shiny little desktop; very crisp and tight. Firefox is a sweet browser and Synaptic is a great package manager. Sure enough if things don’t look like they work.

But now the bad news for PCLinuxOS 2007:

Weird Behavior: Running from the CD, it there’s a lag between creating new files and having them show up in the GUI. I haven’t reduced this to a set of repeatable steps and I wonder if this is even some sort of Twilight Zone thing or something, but there’s something non-intuitive going on here.

Base: Hey… Open Office has a clone of Access! But going in and creating a table, defining some columns… and hey… how do I set a primary key? Hmmm… can’t. Close the table to save it and I get prompted to add one… it adds a totally new field without giving me a chance to select the field I wanted to be the primary key. Open the table and start entering some rows… and the autonumber field seems to go haywire. Why is this program taking up space on the install??

Stupid question: Why doesn’t the CD Rom drive show up so that I can explore it and tinker with it?

Installation to USB drive is dodgy: The installation wizard seems to be wacked. You start off with an option to install to hard drive or to USB drive. If you select USB, you still see your hard drive on later screens of the wizard. This is particularly frightening on the partitioning screen. Your primary hard drive is the default drive being doctored even if you’ve already told the wizard that you’re doing a USB install.

The install wizard does its thing and then stops without giving a success message or new instructions. This is very confusing. I just have no idea if I’m done or if the wizard crashed or anything.

“Persistent Home” should work by default: After using the system, enjoying it, and setting up a bunch of packages, I shut down the system expecting it to all be there when I come back in. And of course… it’s not there! There appears to be a way to use KPackage and Kusbhome to keep your stuff from boot-up to boot-up, but you apparently have to download and install those packages– and log out and log back in!– in order to get this feature. Even then, installing the functionality is nontrivial and seems to require some special partitions to be set up on your USB drive. (And you seem to have to do this every time you boot up.)  None of the software gives you any obvious assistance in identifying the fitness of your USB drive for these purposes. In my case, I could persist my own files, but I could not figure out a way to persist my installations of Clisp and Emacs from session to session. This stinks all the more when such a feature should work automatically or at least be painless to implement.

IMHO: On logging out or shutting down, I should get a message warning me that I’m about to lose my work… and there should be an easy way to save stuff offered. On boot up I should have an option to use the persisted files in setting up the session.

Conclusion: I gave up on the Persistent Home scenario after wasting hours of time and risking sudden death to my hard drive via an accidental mouse click. I tried to go back and install the OS to the USB drive. Again, it’s not clear if 1 gig is enough space to store the installation and given the poorly designed Wizard, I can’t trust it to tell me such pertinent tidbits.

On my final attempt to make the installation work, I used the Installation Wizard’s partitioning tool to set up three partitions: a 470 MB / partition, a 94 MB Swap partition, and a 415 MB /home partition. The Wizard chugs away briefly on my USB drive and then stops.

I then fire up the Installation Wizard again (after rebooting, I think) and set the install to go to the USB drive to the existing partitions. It then copies files for about 15 minutes or so and then… it just stops. Looking at the drive, there’s boot, home, lib, usr, and root directories on the /home partition. And there’s just a couple files left over from my “Persistent Home” attempts over on the / drive.  Shutting down kicks me to an all-text log-in screen and I have to look up a Unix command to manually shut down the system.  Booting to windows log-in screen and then shutting down strangely leads to the crashing of some random file or memory address.  This is starting to get scary.

I went into the BIOS and moved _USB HDD, USB FDD, and USB CD options to the top three positions of the boot order. There’s a message there saying that “USB BIOS support must be enabled for USB boot” but I don’t know where to go to affect that change on my IBM ThinkPad. Booting up without a DVD in the drive and with the USB stick plugged in leads to a message saying, “Invalid system disk, replace the disk and press any key.”

This is altogether a very frustrating experience. This OS is just slick enough that I want to move to it and use it as much as possible. But I don’t trust the software and fear that I will inadvertently fry my machine with an accidental mouse click. I can only conclude that the USB install is not the default approach that most people use with this platform… and that most people using it tend to set aside a half dozen gig on their hard drive and install there instead.

I’m rooting for this distro and would very much like to be a satisfied non-customer… but at this point I’d have to say that the Wizards and the documentation for the install process are very poor.  Other people seem to have had a good experience with it, but I’m not there yet. From my perspective, I’d have to say that we’re still a ways from having Granny install and use this thing on her own….

Setting Up PCLinuxOS 2007 for Lisp Hacking

August 6, 2007

So I picked up a copy of PCLinuxOS 2007. Pop it in the drive, answer a few dialogs, and voila… we have a shiny new desktop. Time for some Emacs action!

I open up a Konsole and type in ’emacs’ and… I hear the whirring/clunking sound of a Millenium Falcon failing to make the jump to light speed. Hmm…. I guess we know what side of the holy wars these PCLinusOS guys are on!

So I go into the Package Manager. It looks a lot like the Cygwin version, except its very easy to search it and get around in it. I mark the emacs package for installation and “Apply” the changes. Things seem to go smoothly enough and I switch back to the console. I type in ’emacs’ again and… there’s that clunking sound.

So I cruise over to the “Start Menu” thing and go to “More Applications” and “Editors” and there’s nothing over there about Emacs. This is weird… I figured the system would just know we had Emacs now…. I log out and log back in hoping that things would magically appear and it still doesn’t work. I start muttering under my breath and try everything I can think of to make it work. But I just can’t do it.

A Linux machine that can’t run Emacs. Pathetic! In exasperation I go to the PCLinuxOS site and register a sign-on name for their forums. I’m thinking, man… these dudes are going to “RTFM” me so bad…. It turns out that I have to wait for an administrator to activate me so I go back to trying to make it work on my own. (That red spot on the side of my cube? Oh, its nothing….)

I decide to go back and read the fine print on the packages… and obviously… I find out that I need more than the emacs library to run emacs. I need emacs-x11, too. So I install that puppy and… hey, we have emacs! Woo-hoo! (And it magically appears in the “Start Menu”, too, just like I expected….)

Now I need to get some CLisp cracking away in there. I use the Package Manager to get CLisp… pull up a Konsole and type Clisp to make sure its there. Sure enough, it’s hanukka again. There’s no Slime package, unfortunately. So I switch back to Firefox. (Did I mention that I had internet access completely painlessly? I hardly paid attention to the configuration questions on that when I was first booting up, but it just worked anyway. Nice.)

I google slime, download slime-2.0.tgz to the desktop, drag it over to the /home/guest folder, and then right-click “Extract Here” to unpack it. This works fine. Now I just need the file path to Clisp. Piece of cake, right?

Argh! Now I end up bloodying up the other side of my cubical…. I try a couple of grep’s from the Konsole… I do a half dozen searches from “Start | Find Files…” and nothing works. Why is looking up a file so difficult?!

I fire up Google for this one and come back with a “find -name clisp” command. I type this in from a root Konsole after going to the very bottom directory with a series of “cd ..” commands. Aha! There it is! Now I make new file with Emacs and cut and paste the following commands into it from the Slime readme file….

(add-to-list ‘load-path “/home/guest/slime-2.0/”) ; your SLIME directory
(setq inferior-lisp-program “/union/usr/bin/clisp”) ; your Lisp system
(require ‘slime)
(slime-setup)

I saved the text file as “setup.el” and loaded it with M-x load-file. After that I tried M-x slime… and we were ready to rock. Not quite ready for Lemonodor fame, but I’m glad to be here anyway.

And PCLinux 2007 does look pretty sharp, if I do say so myself. The GUI is very crisp, you (obviously) get native access to all the classic Unix commands, and you can switch between up to four different “desktops” at once to keep from shuffling windows so much. That last feature, combined with Firefox’s ability to keep multiple browser tabs in the same application instance, can cut back on a lot of clutter and make it very easy to get around.

(Emacs 22 appears to try to do a lame imitation of Notepad’s word wrapping by default! Don’t be fooled! I thought at first that the carriage returns would go away when I cut and pasted to other applications. Then I noticed that cutting and pasting between Emacs and other windows appeared to be altogether disabled! I could paste stuff to Emacs… but couldn’t get stuff out of it!? This just wasn’t a problem on Windows, strangely enough. I reluctantly switched to KWrite and used ctrl-J to clean up the carriage returns one paragraph at a time. This was way too big of a pain; there’s got to be an easier way to do this…. On the bright side, it appears that Firefox has a spell checker that automatically kicks in no matter where you’re typing stuff in. Nice!)