Skip to content

Gary King

These are the stories that have been posted by Gary King category.

“you can’t fool a fool again” can you?


Published to unClog by Gary King September 08, 2008 11:53

Glenn Greenwald opines in Salon:

With last night’s cheerfully vicious speeches from Rudy Giuliani and Sarah Palin, the Republicans did what they always do in order to win elections: they exploited raw cultural divides while mocking, belittling and demonizing Democratic leaders. Yet again, they delivered brutally effective and deeply personal blows to the Democratic presidential candidate grounded in the same manipulative and deceitful yet very potent themes they’ve been using for the last three decades.

He goes on to say that it’ll probably work. I hope not. After all, it was President Bush who said (uTube)

hack? features. asdf. enh?


Published to unClog by Gary King September 05, 2008 14:11

I use timeouts in lift (so that you can stop run-away tests) and in trivial-shell (so that you can stop run-away processes). Both systems have included the file with-timeout.lisp and since my god hates duplication of error, this has long gnawed at the dark toast of my soul.

Thus is born trivial-timeout. So far, perhaps good. But (there has to be a but or why post) I don’t want trivial-shell or lift to depend on other systems: test frameworks should stand on their own (a dubious premise but one I hold) and trivial things should carry their own weight. How, then, can I get three systems to play well together without making my own life too painful?

As is my habit, I decided to leap to the first idea that came to mind (so that I can write about it and suffer the slings and arrows of outraging rivers). What I wanted to be able to do was say “Yoh, system, don’t load this file if some condition holds”. This is kinda/sorta what features are for so I thought that something like

...
(:module
  "timeout"
  :pathname "dev/"
  :components 
  ((:featurep-source-file 
    "with-timeout"
    :feature (not :com.metabang.trivial-timeout)))) 
...

would make sense and make it clear that the system should only (compile|load|whatever) the file “with-timeout” if the feature :com.metabang.trivial-timeout was not present in the *features* when it came time to (compile|load|whatever) it.

Since this isn’t part of ASDF, I added the following to my system defs:

(unless (and (find-symbol (symbol-name 'featurep) '#:asdf)
       (fboundp (find-symbol (symbol-name 'featurep) '#:asdf)))
(defun asdf::featurep (feature-expression)
  ;; thanks to Richard Kreuter for the initial implementation 
  (when feature-expression
    (etypecase feature-expression
      (symbol
       (member feature-expression *features*))
      (cons
       (let ((bool (intern (car feature-expression) 
         (load-time-value (find-package :keyword)))))
         (ecase bool
           (:and
            (every #'asdf::featurep (rest feature-expression)))
           (:or
            (some #'asdf::featurep (rest feature-expression)))
           (:not
            (not (asdf::featurep (cadr feature-expression)))))))))))

(defclass featurep-source-file (cl-source-file)
  ((feature :initform nil
      :initarg :feature
      :reader feature)))

(defmethod perform :around ((o load-op) (c featurep-source-file))
  (when (asdf::featurep (feature c))
    (call-next-method)))

(defmethod perform :around ((o compile-op) (c featurep-source-file))
  (when (asdf::featurep (feature c))
    (call-next-method)))

This may not be beautiful, but it does work.

A few notes:

  1. I do know about in-order-to ( ... (feature ...)) but this doesn’t seem to have quite the right semantics (or perhaps I just understand the semantics!)

  2. Currently, I’ve copied the code into three system files but I’m going to arrange for it to live in one place and get copied around as part of my make process.

  3. I’d load to hear of other better (or, what the heck, worse) ways to accomplish this task. Don’t disappoint me!

Enjoy the fall.

reality based reporting


Published to unClog by Gary King September 04, 2008 14:40

This piece from the AP goes out on a limb and actually checks some facts. Just when you thought that reporting was all and only about what people said, someone notices that the best model of the world is the world itself (thanks to Rod Brooks for that last).

Hope springs eternal.

Announcing: some Lisp software updates! (finally)


Published to unClog by Gary King September 01, 2008 17:00

I’ve been wicked busy the last many months and the pace of my life looks to continue along the same tack (and in the same vein, even). That said, I really appreciate bug reports and patches and I will get them in something less than sidereal time so please keep ‘em coming).

  • trivial-http : 1.3.0

    Fixed lame HTTP GET sending HTTP HEAD requests (ack!). Also added a user-guide (well, let’s be honest and call it the start of a user guide) and did some minor tweaking of all things. Progress.

  • cl-containers : 0.10.3

    Bug fixes to dlist-containers and other tweaks.

  • [metatilities-base] : 0.6.4

    Aside from the unexciting pathname-without-name+type; there is nothing to see here.

  • moptilities : 0.3.10

    Mostly bug fixes to docstrings.

    Note that nothing should be read into the odd inverse version numbers for moptilities and cl-containers :-)

  • trivial-shell : 0.1.10

    Brought in Stephen Compall patches (thanks!); did some documenting and other minor cleanup. Finally exported get-env-var.

Enjoy.

I just got Skype spam


Published to unClog by Gary King August 28, 2008 19:32

I just got a Skype text message claiming that Windows computer had malware on it. It would have been more convincing if I didn’t use a Mac. Sheesh. The problem with free to use is that it’s also free to abuse.

Computers talk to each other


Published to unClog by Gary King August 25, 2008 18:24

This is pretty funny.

<http://www.brainhat.com/mp3/alisha1.mp3>

It’s amazing and horrible at the same time.

Parallax — not just an evil yellow parasite anymore


Published to unClog by Gary King August 21, 2008 20:26

David Huynh has put together a beautiful web interface to the Freebase dataset. Very nicely done.

(check out the Wikipedia if my title was confusing)

interesting blog on all multi-core stuff


Published to unClog by Gary King August 20, 2008 02:28

I’d never heard of it until today but this blog looks like an interesting resource for those of us who keep pining for multiple-core-everything. One odd thing is that I’d never even heard of Clik and here it’s gone and won an award and everything. Guess I need to read more!

Stuff (with I hope no nonsense)


Published to unClog by Gary King August 12, 2008 01:19

Two quick software updates:

  • ASDF-Binary-Locations sees some love from Marko Kocic with improved support for ECL.

  • ASDF-Install gets a teeny-tiny tap on the documentation front. Whenever I look over the tutorial, I wish I could make myself make time to update it. I’ll have to keep living in hope.

I’ve got updates for Tinaa, Log5 and other bits and pieces in the pipeline (though the pipeline remains clogged (no pun intended) so no promises).

share peace,

shocking: the domain iamwhati.am is not taking


Published to unClog by Gary King August 09, 2008 03:30

Hurry, hurry, hurry. Grab it before some evil fundamentalist does (sorry, but from where I sit, all fundamentalism is fundamentally evil).