Wednesday, June 28, 2006

RDF impressions at YAPC


While attending YAPC 2006 in Chicago, I've been once again impressed with the need to get a set of RDF tools working in Perl. There are so many interesting tools that could be implemented if only there were some basic RDF modules. We need something to do for RDF what DBI does for database access, but with flexibility that matches RDF's. I've heard that RDF::Helper may be a start in that direction, but it doesn't look nearly visionary enough. One of my highest priorities is to get this basic RDF toolchain working. I could use Redland, but I really want my RDF-related modules to work regardless of the implementation that a user chooses. For instance, at work, I developed an application that stores it's data as RDF in a Sesame repository. I should be able to switch from Redland to Sesame by changing very little code and have everything Just Work.




Here's a short list of some of the RDF modules that I want — and the inspiring/reminding talks where appropriate.




  • RDFI — Generic RDF interface like DBI for RDF

  • I attended Joe McMahon's talk about Designing for Pluggability which reminded me of the importance of interchangeable parts and modifiable parts in modern software design. RDF is a great match for this pluggable design approach because it allows plugins to extend the data model as well as the code. I've been working on a timecard application for a while and I keep coming back to RDF as the perfect, extensible data model for that application. I don't want to write all the functionality into the core application. If someone wants to record the color of their hair at the time they clocked in, they should be free to extend the data model to accomodate that desire. That data should then become a first class citizen available for querying (SPARQL) and modification like any other data.



  • RDF::Sync — synchronize the RDF in two repositories

  • During the lightning talks, Jesse Vincent presented a brief segment (during Adam Kennedy's talk) where he described the ideal situation where one's data lives on his laptop and out on the net. He wants to get off the airplane and have his laptop data automatically sync with the data that's stored out on the net.


    I've wanted this same thing since I often switch between: connected desktop, connected laptop, disconnected laptop. I'm sick of trying flawed approaches to synchronize my bookmarks. When I'm off in the wilderness and want to find an email that I saw three months ago, I don't want to wait until I can get a net connection again. My data should be where I want it, when I want it.


    Because RDF can be used as a universal data storage format, and it's easy to synchronize that data between different repositories, I think that RDF is a great solution to this problem.



  • RDF::MSG — calculate the minimum self-contained graphs for an arbitrary RDF graph.

  • RDF synchronization and RDF signing both require a technique for splitting an RDF graph into atomic chunks. The technique is easy to implement, I just have to bundle it into a handy Perl module and toss it on the CPAN






Ingy döt Net gave a mostly incoherent lightning talk (by design, I'm sure), but amidst the swearing and random auditory noise, there were some good pieces about an idea that he called CogBase. I didn't get a chance to talk with him about it afterwards, but his notion seems to coincide with an idea I've had for a while: a single, versioned repository for all my data like contacts, email, bookmarks, websites visited, …. I think that RDF is the solution to this universal database. Look at the Description section of the CogBase module and compare that with what the RDF data model provides. 8 of the 15 requirements are already met by RDF. Solutions for versioning and access control issues are still an open question within the RDF community, but I don't think they're insurmountable. With those two pieces solved only the item about object-orientedness of schemas is still missing.



There are just too many cool apps that can be built once the tools are in place. I just need the time and resources to work on it. Let's see if I can implement it in less than the 3 years these ideas have been rolling in my head. Maybe next year I'll submit a collection of talks about RDF




  • Introduction to RDF

  • Using RDF as a Data Model

  • Extensible Applications with RDF



or some such.

Wednesday, June 21, 2006

Review: Rackmounted.com


I've been using Rackmounted as my
provider for dedicated hosting for about a year now. During that time, the
service has been excellent. They provide one of the most
inexpensive dedicated server
packages that I've found anywhere. We've had no problems with the server and
responses to service tickets have always been prompt.



The event that prompted this review is that a little past midnight, our
server went down. I noticed it this morning and was unable to access the
server via SSH (even though I could ping it). I submitted a ticket to
Rackmounted and waited for an automated email response indicating that the
ticket request had been received. After a few minutes, one didn't arrive, so
I submitted another ticket. Within a minute or two, a
representative from Rackmounted called me on the phone. He said that he
noticed I had sent a second ticket and assumed that his email responses
weren't getting through, so he wanted to make sure I knew what was going on.
He was going to restart my server. Within a couple more minutes, everything
was back up and running.



Great service. One more reason to get dedicated server hosting from
Rackmounted.com



Thanks Rackmounted

Friday, April 07, 2006

Ephesians 6:17 - sword of the Spirit


As I was finishing the book of Ephesians this morning, I came across a marginal note I made while learning Biblical Greek. The note clarifies a single relative pronoun in Ephesians 6:17. We read Paul's counsel to take ... the sword of the Spirit which is the word of God. The question: what is the sword? Or in other words, what is the referent of which. The traditional Protestant view is that The word of God is the sword of the Spirit (Matthew Henry). Namely, the referent for which is sword. However, in Greek, the grammatical gender of a relative pronoun agrees with its referent. In Ephesians 6:17, the relative pronoun is ὅς (singular neuter). The referent therefore must be neuter. sword is μάχαιρα (singular feminine) and Spirit is πνεύματος (singular neuter). So the referent of which is Spirit. The Spirit is the sword and the Spirit is the word of God. Translating Ephesians 6:17 by dereferencing the relative pronoun gives something like And take the helmet of salvation, and the sword of the Spirit, which Spirit is the word of God:




So what? The point is that the sword Paul counsels us to take is the Spirit not the written word of God. A solid knowledge of the scriptures is commendable, useful and wise, but it does not provide the active, dividing power which the Spirit of the Lord provides. For it is the Holy Ghost which will show unto you all things what ye should do.

Thursday, April 06, 2006

Migrating a Catalyst app from mod_perl to FastCGI


There's a web application that I developed at work which runs under the
Catalyst MVC framework for Perl.
Catalyst is fun to develop in, but this particular application has a lot of
code and made for very large Apache server processes. The result was a lot of
swapping on the server and really slow shutdown times for the Apache
process. I decided to migrate the application to FastCGI. Finding all the
configuration details was a bit of a pain, but the final steps are simple.
I've restated those steps here to save you (and me) some time.



Migrate to CGI




I found it easiest to make sure the Catalyst application was running under CGI
without trouble before beginning the FastCGI portion. It also helped me to
create an empty Catalyst application to make sure none of my code was
responsible for failure.




> catalyst TestApp



In your httpd.conf file, add directives like this
(assuming you have mod_cgi already installed and loaded).




Alias /testapp/ /absolute/path/to/TestApp/script/testapp_cgi.pl/
<Location /testapp/>
SetHandler cgi-script
Options +ExecCGI
</Location>



Now you can visit http://server/testapp/ to see the default Catalyst
screen.



Migrate to FastCGI




Once that's working, move the app over to FastCGI. You'll need to install
mod_fastcgi (available from
FastCGI's webpage) or install
mod_fcgid (a compatible
alternative). Now change your Apache directives to the following:




Alias /testapp/ /absolute/path/to/TestApp/script/testapp_fastcgi.pl/
<Location /testapp/>
SetHandler fastcgi-script
Options +ExecCGI
</Location>



The only changes in the above configuration are to add fast to
testapp_cgi.pl and cgi-script. Once
that works, you can replace the TestApp locations and names with the
ones for your real application.




Some documentation online mentioned using Apache's Action
directive. I wasn't able to make that work, but Alias
seems to do the trick.


Sunday, March 12, 2006

The Question of Abstraction


As I recently read The First Epistle of Paul the Apostle to the Corinthians, I was reminded of an issue with hermeneutics. Namely, to what extent are the words of the prophets and apostles to be abstracted from their original context when deriving doctrine?




This example may demonstrate the point, however the question of abstraction is general and I'm not necessarily concerned with this particular application. We read in 1 Corinthians 5:11




But now I have written unto you not to keep company, if any man that is called a brother be a fornicator, or covetous, or an idolater, or a railer, or a drunkard, or an extortioner; with such an one no not to eat.



It's obvious how the Corinthians to whom this letter was sent were intended to understand the statement. But how is everyone else intended to understand this statement (or any statement from the Scriptures). In answer to the question For whom is Paul's statement proscriptive? there is a seemingly infinite continuum from concrete to abstract:




  • only the Church of God which is at Corinth (see 1:2) which received the original epistle

  • all saints of Paul's time regardless of geography

  • all saints facing problems of fornication, idolatry, etc (see 5:1) regardless of geography or time

  • all saints with or without such problems regardless of geography or time

  • all persons regardless of religion, geography or time




These are but a few conclusions that could be drawn about the applicability of this particular statement. The problem arises in that a strictly concrete application of Paul's statement makes the Scriptures purely an historical document with little use for modern application. However, abstracting Paul's statement to apply to every circumstance certainly loses some of the context the author originally intended and in this case even condemns our Lord himself for associating with publicans and sinners. Whatever one's particular view on the matter, it's clear that practically any doctrine could be reasonably supported by appealing to a convenient location and the concrete-abstract spectrum.




I have a solution to these issues, but that will wait for another entry ... (I'd make Fermat proud).

Saturday, March 11, 2006

Aravis, not the mountain range


Bouquetin à la Tournette
Originally uploaded by Loin des yeux.
Our daughter's name is Aravis. She's named after the character in the C.S. Lewis novel The Horse and His Boy. I searched for other photos on Flickr tagged with her name and came across some beautiful images of the Aravis Range in France. This one is particularly spectacular.

Saturday, February 25, 2006

Review: Blink by Malcolm Gladwell


My wife and I finished Blink: The Power of Thinking Without Thinking by Malcolm Caldwell a couple nights ago. It was really a
fascinating book. The psychology experiments the author mentioned were amazingly clever. I
was particularly intrigued by the studies of the facial muscles and
cataloging all the possible expressions and their meanings. It was humorous to imagine university professors staring at each other and making faces. Nevertheless, the dedication of spending 7 years of one's life studying a single topic in such depth is admirable.




My wife and I disagreed with a couple conclusions the author made in the
book. The most egregious one was in the last chapter. He was talking
about blind auditions for symphonies and orchestras and saying that
the blind auditions had made classical music better. The disagreement
we had with is that he seems to have
forgotten his chapter on Pepsi vs Coke sip tests. In that chapter, he discusses the fact that Pepsi consistently performs better than Coke in blind sip tests. That success rate was what motivated Coca Cola's failure with New Coke in the 1980s. The point of the chapter was to say that nobody drinks soda at home in the form of a sip
test. Therefore, it doesn't really matter which cola performs better in that test. When people drink cola, they are aware of the packaging and all the associations they have with the brand. That awareness affects their experience of the beverage.




We saw that as exactly the problem with the blind auditions:
people don't listen to an orchestra or a symphony behind a blind. They
observe them in the concert hall. A conductor is perfectly
justified in choosing a musician based upon her appearance or the
expectations of his audience. If the audience is going to be distracted
from the music because a female is playing the french horn, that
detracts from the musical experience. Of course, when seleting members of an orchestra for recording purposes, blind auditions are rational.




Overall, the book was fascinating and makes for some good, light reading. I recommend it.

Tuesday, February 21, 2006

Tooltips with Javascript or CSS


For the Wyoming Liberty Index, I created a quick webpage using Catalyst and Perl to help rate the bills of the 2006 legislative session. On one page, I wanted to display the ratings of the bills with comments appearing as tooltips for the ratings. My first attempt was to use the title attribute on the abbr tag, but browsers only display a short summary of the title attribute as a tooltip. I wanted to display the entire comment.



CSS




My first solution was to use pure CSS tooltips. I had to make two changes to get it working in Internet Explorer. First, IE doesn't support the :hover pseudo-class on tags other than a, so I had to change the outermost tag on my tooltips to be a instead of span. Secondly, by hacking on Eric Meyer's pure CSS popups code, I determined that unless you have the following CSS somewhere, Internet Explorer won't display the tooltips.




a:hover {
background : white; /* a color other than default */
}


Javascript




After I got the CSS hacked into shape and working acceptably, I discovered Alessandro Fulciniti's simple Javascript tooltip library. I had investigated a bunch of Javascript tooltip libraries and they were all too complex. Fulciniti's approach is simple and clean. It keeps Javascript, XHTML and CSS separated, the way it should be. With a few minutes hacking, I had it doing exactly what I wanted.




Thank you Alessandro.

Thursday, January 26, 2006

Unable to login to Linksys WAP54G


I recently installed a Linksys WAP54G wireless access point to replace an older Linksys wireless router that was forced into service as an access point. The WAP54G has worked fine as an access point so far (about 1 week), but I was unable to login to the access point's web-based management utility. When I visited 192.168.40.10 (the IP I had assigned to the access point) I was prompted for my username and password. Page 38 of the manual indicates that the administration username is admin and the default password is admin. However, all that got me was 401 Unauthorized It turns out that the admin username is actually , yup no username.




So, to log in, I just left the username field blank and entered the password. Hopefully it's just the documentation that has errors and not the hardware. I noticed another curiosity on page 37 of the manual. Apparently, snmp is the standard e-mail protocol on the Internet. Hmm, that's not what RFC 1157 says. Fortunately, the body of the text correctly indicates the purpose of SNMP. I notified Linksys about both errors.

Tuesday, January 17, 2006

Review: The Skeptical Environmentalist by Bjørn Lomborg


My brother lent me his copy of The Skeptical Environmentalist. After both reading State of Fear by Michael Crichton, we read several of the books that Crichton listed in his bibliography. So far, The Skeptical Environmentalist has been the best. As my brother described it, this book is an almanac of statistics on controversial topics.




The essential premise of the book is that conditions in the world are getting better. The author examines numerous objective ways to measure the state of the world and in almost every instance concludes that we are better off now than our predecessors were. The data also indicates that these trends will continue into the future. Its focus and methodology remind me very much of The Ultimate Resource 2 by Julian Simon (which inspired Lomborg to study and then publish this book.)




I highly recommend this book. My simple summary would be: Don't be afraid because human ingenuity can solve the world's problems. All we have to do is rationally evaluate the various challenges we face and triage the results. Or, to paraphrase a great statement (from an unrelated book), "The earth is for the use of man that he might have in abundance"

Tuesday, January 10, 2006

Review: Cascading Style Sheets: The Definitive Guide, 2nd Edition by Eric A. Meyer


For my job, I've been doing a lot of work on automated reports lately. The logic of the reports is written in Perl and the generated content is HTML. I've used CSS on some projects before, but decided to buy Meyer's book to learn some more of the details. I've been using the book as a general instruction guidebook and also as a reference while working on the automated reporting project.




Foremost, I am really impressed with CSS and the people who designed it. I haven't found a technology as useful as this in quite some time. When learning about a new technology, I evaluate it by roughly tracking how frequently it inspires me with new ideas. For this book, I'd say that rate was about one new idea every 15 to 20 pages. At 430 pages, that means about 20 new ideas.




Meyer's writing style was clear and concise. I wish he had found a synonym for affect, but that's a minor annoyance. He used frequent diagrams to illustrate the details of CSS in particular situations. He provided a good mix of prose, code and illustrations. I was particularly pleased with the chapter on CSS for non-screen media. Since management will eventually print my reports, that chapter was particularly valuable.




The book provided a good background and taught me many aspects of CSS that I hadn't originally noticed. Some portions of the book were a little too detailed. If I wanted to be reading the CSS spec, I would go and read the spec. Which brings me to the best CSS resource I've found on the web (now that I have enough background to understand it better): the CSS3 Selectors specification.

Tuesday, January 03, 2006

My PDA Wishlist vs. Palm TX


As I posted earlier, it's time for me to buy a new PDA. I have a tradition of keeping a memo on my Palm with a list of the things I want out of my next PDA. Well, I decided to buy a Palm TX. Here's how the TX matches up against my wishlist.




In the following list, red items are missing from the TX. Everything else is present.




  • Small form factor

  • Large screen area

  • Customizable input area

  • Few steps to open the device

  • Able to replace an MP3 player

  • FM transmitter for playing music

  • Huge memory (~10 gig)

  • Wi-fi

  • Three day battery life without charging

  • Backlit color screen, usable as a flashlight

  • Cell phone

  • GPS

  • Low-res digital camera

  • Thermometer

  • Barometer

  • Accelerometer

  • Barcode reader

Monday, January 02, 2006

Review: Palm Tungsten T (long term)


I've owned a Palm Tungsten T for almost 3 years now. I use it every day and for several different applications. It's time to buy a new PDA (for reasons stated below) and I thought I'd write a review of the Tungsten T covering the whole range of ownership.



Externals




Initial reviews that I read about the Tungsten|T indicated distaste for the slick surface of the metal case. The case surface is quite slick and when my hands were dry, I almost dropped the device a couple times. However, I almost always use the device with the plastic screen cover attached to the back of the device. The plastic cover sticks to my hand much better than the case does, so the slickness of the case turned out not to matter.




The surface of the case loses its finish easily. At numerous places on the device, the bare metal is visible where the grey finish came off. The finish came off the most along the bottom edge of the device near the application buttons. Fortunately, the gray finish matches the bare metal fairly well, so the flaking produced a pleasing rough look.




The feel of the application buttons is still nice and crisp. All the buttons work as they did fresh out of the box. I used the center button on the D-pad more than any other button. I took to using the Tungsten|T as my main watch. So I often took the device out of my breast pocket and clicked the center button to see the time. The center button was a bit too small and too protected. In the winter, I was unable to depress the center button with my gloves on. That meant that to see the time, I had to remove my gloves. The voice recording button is placed such that I often bumped it accidentally. That would turn the device on and then I find myself in the voice memo application the next time I turned the device on. However, this was only a minor annoyance since it never actually recorded a voice memo.




The headphone jack and external speaker were the most suprisingly useful feature of the Tungsten. I didn't expect to use either one, but I found myself carrying the Tungsten in my pocket playing music while I cleaned the house. Or I'd use it on the road with a headphone to bring music with me on travels. I ended up buying a 512MB SD card so that I could put my most-played MP3s on the device (the included Real Player MP3 player was sufficient for my needs). I liked the external speaker so well that I have included it in my wishlist for my new Palm.




The power button gave me some trouble. After about two years, it began to work only intermittently. Often times, it would go for a week without working and then starting working again for a few months. Towards the end of the third year, it only worked about half the time. Fortunately, the button inside the D-pad and moving the slider both let me turn on Palm anyway.




The SD card slot worked without any troubles. The stylus silo and the stylus both worked well. The Tungsten|T has the best stock stylus I've seen with any Palm device. As I've mentioned in another blog entry, I began to dislike having to depress the stylus to take it out of the silo. The magnet in the bottom of the stylus silo held the stylus sufficiently tightly, except when I ocassionally dropped the Palm from out of my breast pocket. Then it and the SD card scattered across the pavement.




The form-factor and the sliding button pad were the most unique features of the Tungsten|T when I bought it. The first few months, I liked the sliding button pad, but after that, it was just annoying. I detail the reasons in my other blog entry on the subject. I liked the small form-factor, but the sliding pad is too much to pay. It was a clever idea, but turns out to be best in concept and less workable in application.



Screen




The screen on the Tungsten|T is very nice. I found it readable in all different light conditions. The colors are bright and crisp. It was clear enough that I replaced my collection of wallet photos with JPEGView. I always used screen protecting platic sheets on the screen, so it still has no scratches.




Data Input




The graffiti recognition on the Tungsten|T seemed quicker and more accurate than on my previous Palms. Unfortunately, after about a year and a half, the digitizer began to degrade. I would have to recalibrate the digitizer about every other day. After a few months, I needed to recalibrate every day. Now I can't write 5 characters without recalibrating. One frustrating result is that I will try to tap-off an item on my to do list and the Palm will clear off the one above or below the one I wanted. Then I have to track down the one I accidentally checked, restore it, recalibrate the digitizer, tap-off the desired to do item.




In consequence of the annoying digitizer effects and the slow input required by Graffiti, I've decided that a keyboard is probably the best type of input for a PDA. My first serious PDAs were HP 95LX, HP 100LX and HP 200LX palmtop computers. I loved the little keyboard. It was accurate and quick for data entry. I think the Tungsten C and the Treo have the right idea.



Accessories




Really the only accessory that I ever used with the Tungsten was the charging/hotsync cradle. The cradle is solid and receives the PDA easily. I have two complaints. The transformer has the wall plugs attached directly to it. That means I cover two sockets on the power strip when I should only have to use one. The second complaint is that I have to bring the whole cradle with me when I travel so that I can recharge the battery. My wife had a Sony Clie PEG-N610C. With that PDA, the power cable could be detached from the cradle to make traveling more convenient. Fortunately, I can get about three days out of the Tungsten without a charge, so for weekend trips, the bulky charge cradle wasn't an issue. Basically, I think that Palm should have included a more portable charge cable with the stock Tungsten|T. I wouldn't even mind not having a proper cradle as long the charge cable was compact enough for travel.



Summary




I've enjoyed my Palm Tungsten|T. It was leagues better than my beloved Handspring Visor and it gave me higher expectations for what a PDA should be. It was solidly built and survived many bumps and drops. Three years is a decent stretch (although five years should be expected). The cost of ownership for this Palm worked out to about $7.30 per month. I'm willing to pay that.