Showing posts with label computers. Show all posts
Showing posts with label computers. Show all posts

16 April 2010

Random Thoughts on the iPad

I find it is easier to justify ridiculous purchases when it's close to my birthday. Not quite two weeks ago I got myself an iPad. Since I've had some time with the thing, I thought I'd make a few random comments, in no particular order or relatedness.

First, I don't travel in teen or even tween circles, so it has been some time since I got called names relating to my sexual orientation. Yet mentioning that I had got myself an iPad leaves some complete strangers with the urge to call me things — online, at least, where being a flaming jerk is some sign of conviction. It's very odd. There's a lot of bruhaha about restrictions on the iPod, but I don't really have anything to add to it. Howard Stearns had more interesting things to say about the matter already, and better than I could. Besides, I've lived all my professional life neck-deep in the Unix and free software world and I've always managed to live happily in mixed environments — open tools on closed OSes, open OSes running closed tools — whatever can be made to work reliably without going over-cost is fine by me. If I really want to program an iPad directly, I can always fire up jsforth.

I personally cannot stand laptops — this is a quirk, I realize. They're too big to be really convenient, and too small to be comfortable to use for very long. That the iPad doesn't try to be a laptop is actually a plus for me. I've had an iPod Touch for quite a while, and while one can visit web pages, read documents, compose email or post to web forums from it, it's really not very nice. On the iPad, this is all much more pleasant. The device was made for casual browsing at a coffee shop, and I've adjusted to the freaky keyboard fairly quickly.

I've been waiting for something like an iPad running something like the GoodReader app for more than 15 years. While I may be a professional computer geek by day, when not at work I turn into the Dilettante Philologist. I do use some of my computer skills for my dead language work of course, but my computing needs are very different when I'm on the Philologist setting. I've transferred a large stash of journal articles, old books, Helmut van Thiel's magnificent editions of the D scholia on the Iliad and Odyssey, PDFs of my own notes on Greek work to the iPad. Now when I'm waiting at the dentist's office I can once again try to comprehend Matic 's paper, Topic, focus, and discourse structure: Ancient Greek Word Order; or Dale's classic three papers on the metrical units of Greek lyric verse. The iPad may be a bit heavy for a mobile device, but it weighs considerably less than the print edition of the unabridged LSJ, which I have at my fingertips in the Lexiphanes application. I can only hope someone will write an application to interact with the Perseus corpus.

On a whim, I downloaded Charlie Stross' Iron Sunrise into the iBook application. I'm about three-quarters through the book. I'm a big lover of the traditional book format even for casual reading, but I have to say reading on the iPad has been very comfortable. The amusement value the over-wrought page-turning animation passed quickly enough, and I can read for hours at a stretch without the thing distracting me from the novel. The only small complaint I have is about some of the typesetting. For chapter and major section starts Iron Sunrise was probably typeset with a few words in small caps, but that font didn't make the transition to the iBooks app. The first three words are in slightly large all lowercase. More careful editing would fix this.

All said, I love this device, mostly because I know I can travel a lot lighter in the future (I used to have to be content with the Middle Liddell, heavy enough in carry-on). For me, the iPad is mostly a way to interact with text — lots and lots of text. Thanks to some development time with the iPad Touch and the iPhone, the iPad is awfully good at that. It'll be interesting to see what the next five years bring to the entire industry around devices like this.

13 July 2009

Well, that's one way to curate

One thing I was concerned about after the death of Bill Harris was that his magnificent web site would silently disappear some day. I was happy to see this notice today:

Bill truly enjoyed sharing with all of you, and he greatly appreciated the contact he had with so many of you from around the world, especially in his latter years. We invite you to continue using and enjoying his web site. Bill Harris' web site will be maintained on the Internet permanently as part of the digital archives of Middlebury College.


I'm certainly not going to complain about this... but I still wonder what a librarian would think about this approach. "Just leave it there" may not be the best way to go in the long (permanent) run. I'm not sure anyone knows the answer to these questions yet.

12 November 2008

In Praise of Little Ideas

While it is true that there are plenty of science fiction authors who are writerly, whose language shows signs of care beyond the bare need to tell the story, it is nonetheless the case that most of such literature is read for the ideas. A good number of these ideas are conventional, a well-worn path the experienced reader of science fiction uses to get up to speed on whatever it is the author is about to do that's new.

Though I might appreciate The Big Idea in many of these books as a way to generate a story or to work out the idea, an awful lot of the time I don't consider The Big Idea terribly plausible. From time to time, however, I do run across a Little Idea — a one-off or a minor point — that strikes me as either absolutely true or a Really Good Idea.

For example, in one book, the title of which I cannot even remember, is a scene in a giant space ship several kilometers in length. Charlie Stross has convinced me that travel between solar systems is monumentally impractical, as much magic as dragons and rings of power. In any case, in this book the computing subsystems all over the ship were a pain in the ass to deal with because they were all kept on isolated networks. It turns out most of the ship's computers were riddled with viruses and couldn't be connected safely. This, sadly, strikes me as all too likely, should it ever happen that we have a legitimate reason to build such ships.

In Vernor Vinge's most recent book, Rainbows End, he makes occasional mention of the "Friends of Privacy," an organization that produces lots of false information about people all over the internet, with the goal of concealing people who want a little privacy in a world of ubiquitous online presence and data recording. This seems to me at least a possible development, and, frankly, given the growth of the participatory panopticon, a desirable one.

I have recently been reading Neal Stephenson's latest tome, Anathem. Because it's Neal Stephenson book it has quite a few Big Ideas. You can read the overview at the link, but the main point I'm interested in here is the world of this book, scholars are sequestered away in things quite like convents — here called "concents" — while the outside world goes on without them. Once a year doors are opened which allow those inside and those outside to mingle for about a week. Within the concents populations are sequestered from each other, too, so that the "centenarians," for example, only encounter the outside world once every hundred years. Within the concents people select different specialties — physics, philosophy, math, etc. One brilliant Little Idea mentioned a few times in passing and with a minor role late in the book is the order known as the Lorites,

Lorite: A member of an Order founded by Saunt [< Savant — Wm] Lora, who believed that all of the ideas that the human mind was capable of coming up with had already been come up with. Lorites are, therefore, historians of thought who assist other avout in their work my making them aware of others who have thought similar things in the past, and thereby preventing them from re-inventing the wheel.


People who've spent a lot of time with me have heard me complain that the field of computer science seems so consistently and utterly ignorant of its own intellectual past. This is a field that desperately needs Lorites. Granted, about half of the time our CS Lorites would be saying one of three things — (1) Lisp did this in 1960-mumble; (2) Alan Kay's group did this in 1970-mumble; or (3) MULTICS — but there'd still be plenty of work for them. Lots of fields of study could probably use a Lorite or two in the department. It would certainly save wasted paper on pointless dissertations and books.

04 August 2008

Gentium in Emacs via Unicode

I spent a little time over the weekend tweaking my Carbon Emacs configuration. When I first started using it I had to spend several interesting hours to get it to use a Mac-ish font large enough that I didn't go blind. I settled on a 15 point Vera Sans Mono. Unfortunately, the Greek that it picks for this isn't so nice. So with a little more digging, I managed to get Emacs to use Gentium for the Greek, but it had to be tweaked a bit for size:


;;; Greek extended
(set-fontset-font
"fontset-default"
(cons (decode-char 'ucs #x1f00)
(decode-char 'ucs #x1fef))
"-apple-gentium-medium-r-normal--18-180-72-72-m-180-iso10646-1")

;; "Greek and Coptic" U+0374 - U+03FB
(set-fontset-font
"fontset-default"
(cons (decode-char 'ucs #x0374)
(decode-char 'ucs #x03fb))
"-apple-gentium-medium-r-normal--18-180-72-72-m-180-iso10646-1")


Yes, it really does take an 18 point Gentium to match a 15 point Vera Sans Mono.

My next step was to tweak the fontset to include Cuneiform (via the nice Neo-Assyrian Assurbanipal font), but MULE, Emacs' internationalization library, chokes on Unicode code points in in the 0x12000's where Cuneiform lives. I suppose my commentary on the Enûma Eliš focused on interpretive dance will have to wait.

30 January 2008

Arc, or, Láadan for Programmers

Paul Graham, six years after announcing it, has released arc, his new dialect of lisp.

One of the odder corners of my library — for most people at least — will be the section that has all the books on constructed languages. Of course there's Esperanto, but Klingon is represented along with several works on Tolkien's languages. I also have the second edition of A First Dictionary and Grammar of Láadan by Suzette Haden Elgin (neatly abbreviated SHE). SHE is a linguist by training, but is also a science fiction writer. She created Láadan not only for a series of books, but as an experiment to see if a language designed specifically to represent the views of women could change society, sort of an informal test of the Sapir-Whorf hypothesis. Láadan is thus presented as representing women's views better somehow. I've never really been convinced that it does so — I know more gay men who have learned the language than women — but there is no doubt it does represent the viewpoint of one extremely intelligent woman.

Arc is just Láadanified lisp. It represents the particular views of one particular lisp programmer. He may be aiming at a hundred year language, but all I can see is perfectly conventional lisp with a few common functions spelled differently and a few parentheses eccentrically deleted.

This was my first warning sign:

It's not for everyone. In fact, Arc embodies just about every form of political incorrectness possible in a programming language.


Whatever one's feelings about speech codes, I think it's safe to say that any time someone warns you, or brags, that they're about to be politically incorrect you're almost certainly in for some first class assholism or lunacy. I've not previously seen it used in a programming language context, but it seems to hold here, too.

At long last, Graham's vaporous Microsofting of lisp is over. I need to prepare some Homer (I'm taking a class again this semester), but I think I'll spend some time this evening refining my Common Lisp betacode to unicode conversion library, and maybe play with Hunchentoot some more.

20 January 2008

A new convert to the LOOP facility

Some Common Lisp programmers hate the LOOP facility, some don't.  I used to fall into the first camp, for various reasons, the most important of which is that LOOP is effectively a specialized looping language grafted onto lisp.  Normally I'm a big fan of a single syntactic mode for all corners of a language (like the lisp family, or Smalltalk, quite unlike C or, god help us, perl).

I've been working on some basic forecasting and time series code recently, and I have to say, when you're looping over different time series and smoothing windows, LOOP results in neater code than almost any language I can think of. Here's a simple moving average forecast (in the interest of space, all examples have my anal-retentive sanity checking assertions removed):

(defmethod single-moving-average ((data sequence) (order integer))
(let ((n (length data)))
(/ (reduce #'+ data :start (- n order))
order)))


For such simple sums, the functional style reduce does the job. Once you get to a weighted moving average the math starts to get tricker. As I was thinking about the many, many traversals of sequences I'd be doing, I decided to check out LOOP more seriously by reading a chapter from Seibel's book I had previously skipped, 22. LOOP for Black Belts. I started to develop warm feelings for LOOP immediately. For starters, it does a great job of encapsulating the various sorts of set-up and tear-down you have to do when rolling your own loop so the mechanical bits for doing loops don't infest the rest of your code.

One really lovely touch makes it easy to avoid the off-by-one error — and fussing about — that comes when you use zero-indexed arrays. The FOR clause may indicate exclusive or inclusive bounds, with TO n including n, and BELOW n going up to but not including it. So here's a simple weighted moving average function:

(defmethod weighted-moving-average ((data sequence) (order integer))
(let ((n (length data)))
(/ (loop for i from 0 below n
sum (* (elt data i) (+ i 1)))
(/ (* n (+ n 1)) 2.0))))


Now I didn't really have to use LOOP for this, but the code I think is somewhat cleaner. The SUM clause accumulates by summing successive values of the expression after it, and in this simple LOOP clause that final sum will be the value of the expression.

My biggest example of LOOP-fu this weekend is a weighted moving average smoothing function. It takes a sequence of data and a sequence of weights and spits out a vector of the smoothed data. In this implementation I simply take the original values at the edges of the data where the smoothing sequence is longer than available values. What I need to do at each step is apply the weight vector to a window of data to compute the moving average for that step. This brings out the other really lovely feature of LOOP: parallel loop values. Here's the scary result, somewhat un-lisp-like to my eyes, but clearer I suspect than I'd be able to produce with functional style tools and DO:

(defmethod weighted-average ((data sequence) (weights sequence))
(let ((d-n (length data))
(w-n (length weights)))
(loop with smoothed = (make-array (list d-n))
with start = (- w-n 1)
with end = (- d-n w-n)
with denom = (reduce #'+ weights)
for i from 0 below d-n
if (or (< i start) (> i end))
do (setf (aref smoothed i) (elt data i))
else
do (setf (aref smoothed i)
(/ (loop for j from 0 below w-n
for dj from (- i start) to i
summing (* (elt weights j) (elt data dj)))
denom))
finally (return smoothed))))


A LOOP within a LOOP! The underlined section shows the parallel loop indices, j going over the weights sequence and dj going over the current window on the data. In the outer LOOP I went a bit crazy and used a lot of its abilities — initializing temporary variables, LOOP conditionals, a FINALLY clause — with the results that look like an Algol-Lisp chimera.

If I were a code purist weighted-average would probably make me crazy. Good thing I'm not.

13 December 2007

Huffing Web 2.0: The "Web OS"

If you write a pile of AJAX and server code which fills our browsers with something that looks vaguely like a windowed desktop, congratulations on your innovation, and good luck rising to the top of the ever-growing pile of these. If your marketing people tell you to advertise this as a "Web OS" bop them on the head with a wiffle bat and tell them to try again. If you, the developer, are tempted to call it a Web OS, change professions this instant.

A desktop-looking thingie running in a browser is just a GUI app. It's an operating system as much as my first cell phone's a Cray supercompter.

16 July 2007

XeTeX equals classicist joy

When I first started Aoidoi.org, before Unicode was yet widely available, I used a very ugly combination of an HTML templating engine and long Unix pipelines to turn Betacode in fake tags (thanks to the template system) into GIF images of Greek. The pipeline started with the production of a LaTeX file, which was run through latex, then dvips, then ps2gif, after which all the LaTeX goo was cleaned up.

After not too many years of that I decided to go with PDFs, which let me actually save the work of LaTeX. Over time I have accumulated a lot of extra styles to do things like metrical symbols, and multiple levels of footnotes — which I hijack into something like what Pharr's Aeneid and many other student editions look like. But until now I have had to use a very nasty encoding scheme to represent the Greek:

\GRK{o>i m`en >ipp'hwn str'oton, o>i d`e p'esdwn,}
\footnotetextC[1]{
\bgrk{o>i} $=$ \bgrk{o< i}. \SP
\bgrk{o>i m`en ... o>i d'e}, ``some... others...'' with the main verb in
line 2, \bgrk{fa~is(i)}.
...


Nor have I ever found a usable polytonic Greek font that I could use in LaTeX which had a bold font available. Normally the headword in vocabulary notes or comments is in bold. It makes it a lot easier to find when you're moving back and forth between the text and the help.

But now I have XeTeX, a version of LaTeX that understands Unicode, so I can use real Greek in LaTeX source now. And, better yet, XeTeX is capable of using any TT or OT font installed on your system. So now I have several usable polytonic Greek bolds to use in commentaries. There's no single family that really makes me happy — either I like the Greek side, or the Latin side, not both. When Gentium finally has the promised bold, I'll be very happy. In the meantime I'm still trying to find the best mix of fonts to get something non-awful. Here's a current attempt, Sappho PMG 976, using Gentium for the main body Greek, all the Latin, and for the bold in the notes the lovely Greek Font Society (GFS) Neohellenic Bold. I'm very partial to their Didot face on the Greek side, and it has a nice bold, but something is wonky with the Latin side.

For amusement I used the GFS font inspired by a 16th century face, GFS Complutum, to typeset the first book of the Odyssey, Rhapsodia A. The backwards "y" looking thing is a nu.

If any Hellenist reading this post decides to grab XeTeX and play around, note that 1) you really want the fontspec extra and 2) you cannot use it with metre.sty. I have hacked at fontspec.sty so that it and metre.sty play nice. Contact me if you want a copy.

29 November 2006

Focusing the Mind

At my place of work 2006 started with three Unix sysadmins. It appears it's going to end with one, namely me. Today was my third day solo.

A lack of options, the saying goes, focuses the mind admirably. In my situation, that means I've been scripting like mad to make sure I get information in a timely way and don't overlook anything. And the last few days I've been coming home and writing even more code, but of a more complicated nature. Normally this would make me cranky, to be doing work programming in the evening, but since this particular project is intended only for me, I get to choose my language. I've been reacquainting myself with Common Lisp. I had forgotten how fun programming could be —

;;; Insert timed data point, returning the previous value (useful for
;;; some statistical models).
(defmethod update ((dh ts-datahistory) val &key timestamp)
(let ((ts (if (null timestamp) (get-universal-time) timestamp)))
(multiple-value-bind (idx daytype) (bin-index dh ts)
(macrolet ((ref-and-set (accessor)
`(prog1
(,accessor dh idx)
(setf (,accessor dh idx) val))))
(if (eq daytype 'weekday)
(ref-and-set weekday-history-ref)
(ref-and-set weekend-history-ref))))))


I don't know how many of my readers will understand that, but it just fills me with joy to use such a tool. Lexically scoped macros!

Next up, quality time with North & Hillard's Greek Prose Composition...

30 October 2006

Double Dipping the Surplus Value

I have been thinking recently, as I often have cause to do, on the wretched state of software. This has lead me to an economic analysis of the software industry, not something I'd normally indulge in, but now that I have the vocabulary for what was annoying me, perhaps I can dwell on some other matter.

"Surplus value" is a technical term, associated with Marx but by no means discovered by him, describing how capital accumulation takes place. Horribly simplified, surplus value is the difference between the selling price of something and the labor cost, with the idea being that it's mostly unpaid labor that makes value for a business (i.e., people aren't really paid for the full value of their work). As I said, this simplification is gross, but it's the basic idea, no great surprise nor particularly radical.

Whatever you feel is the correct relationship between labor and the pay for that labor, it seems to me that software companies who produce crappy software (that is, most of them) rely on not one but two sources of surplus value, first from their own employees, second from the poor shlubs who buy their software and then have to hire even more IT staff. How much of that expensive software companies are convinced buy would get any use if there weren't an army of acolytes running around tending to it?

What percent of the average IT budget (training and salaries) is devoted to necessary infrastructure and what percent to dealing with software that doesn't quite work as advertized?