skip to main | skip to sidebar

Monday, December 18, 2006

客観的なc計算機言語

Just heard from someone who wants to translate the c.l.o-c FAQ into Japanese. Sweet!

Monday, December 11, 2006

Copyleft

It is complete:



I no longer even own all the code I write in my spare time, on my own equipment.  :-)

Thursday, December 07, 2006

TGD - John on acid

I'm about halfway through my OmniOutliner document of notes made while reading TGD now....


There's a paraphrase in TGD saying that if the epistles of Saint John the Apostle represent John on pot, then the book of Revelation is "John on acid". What makes this observation more interesting is that it may be literally true - or at least closer to the mark than the quip may at first appear.


There was a documentary by Tony Robinson on Revelation and the End of Days, called The Doomsday Code. The - frankly worrying - sentiments of some of the extreme christian right in America are the same as described in TGD; namely that the Middle East instability [inclusive] or global warming or the 2005 hurricane season herald the proximity of the rapture, and that rather than doing anything to help those caught up in these situations we should be actively encouraging the Apocalypse, and xtians should let their heathen friends know that, well, they told us so. In the course of describing modern End Timers, the documentary showed us where Revelation was penned.


There are tens of apocalyptic visions penned by post-Christ Jewish theologians, but only one has been included in what is now termed the canon of the New Testament. That book of the revelation of Jesus Christ to his disciple, John (which isn't accepted by the Eastern Orthodox as part of the divine liturgy) was written on the Greek island of Patmos sometime in the second half of the first Common Era century, and details two visions experienced by the John of the title (whether or not he be apostolic) while on the island. The other key fact to remember about Patmos is the abundance of fly agaric mushrooms, especially around the mouth of the cave of revelation.

TGD - begging the question

Many of the arguments pro-religious belief presented in TGD would form a nice corpus in a dictionary of critical analysis for the entry on "begging the question". However, Prof. Dawkins studiously avoids the phrase despite its rampant, repeated and some would say wanton applicability, and if I were ever asked to predict why (I haven't been, I just like the sound of my keyboard) I'd say that it's because the phrase is so frequently misused on both sides of the Atlantic ocean.


Indeed, when I was taught the phrase, the example I was given is that of proof of the existence of god: we can see the results of god's creation all around, therefore god created them, therefore god exists. That's about as short - and absurd - an example of the technique as can be demonstrated. In ordinary speech, people use the phrase "begging the question" to mean: the argument I have just heard is incomplete or fallacious, because it appears not to answer (or to directly raise) the following problem. Where the problem was not explicitly part of the argument. However, the meaning of the word "beg" should not be overlooked, and is key when calling an argument out as one that begs the question. In fact, it isn't the argument that begs the question: it's the conclusion which does so, and the conclusion is begged from the question. In other words, the meaning of the phrase is that an argument draws to a conclusion which already existed in its assumptions or axioms. My Latin isn't very good, but I might describe this kind of argument as QEQ - Said that which was said.


Let's look at, for example, the argument for the existence of purgatory (it's quite near the end of TGD which makes it easy for me to remember). The conclusion is that purgatory exists, and the justification is that people everywhere are praying for the souls of the dead because they believe that the souls are in purgatory, and surely prayer isn't pointless. I hope that going all slanty made the point in the argument where the conclusion was codified apparent - the reason we can be sure that purgatory exists because we are sure that purgatory exists. QEQ.


I realise that this had little to do with the thesis of TGD, but to beg the question is a cool phrase which should be used less, but with higher accuracy.

Tuesday, December 05, 2006

TGD - I'm not dead yet!

The title of this article is a quote from Monty Python and the Holy Grail - the body cart comes around the town to collect up the (presumably leprous) corpses, and along comes John Cleese with his ninepence and his cadaver. The only problem is that actually the corpse feels rather like he might pull through.


This is a situation which relates to the ever-decreasing sphere in which divine intervention can be invoked, such reduction being due to scientific advances. There are known cases where people have been thought dead and have "got better", or have been ruled out a long time before the actual event of their dying. As an example, a death through epilepsy can often cause the unfortunate to become unresponsive long before becoming dead, so that 'miraculous' events such as the body remaining warm for days after the death are recorded. While the meaning of the term "dead ringer" has nothing to do with the 19th Century safety coffin, such devices did exist. The whole purpose behind holding a wake was the hope that life might return to the deceased - because sometimes it did. Various poisons can lead to the body attaining a death-like state, while in fact the subject remains living; perhaps the most famous of these is TTX (the toxin carried by pufferfish); supposedly used by Vodou practitioners to create zombies. A good explanation of that is Ghosts, Vampires and Zombies: Cinema Fiction vs Physics Reality. The case of Wilfred Doricent, described in the arXiv paper, is recent: he died in March 1988 and was no longer displaying many of the symptoms of death by September 1989.


The point here is that there are modern cases where death is misdiagnosed. Given the modern equipment, techniques and advances in both theoretical and practical knowledge, one would assume that the rate of misdiagnosis of death has decreased over time (and in a related vein, the number of conditions which terminate terminally has decreased, too). How can we know, without even contemporary doctors' notes, whether a particular resurrection event was miraculous or just a case of mistaken interment? Pufferfish aren't particularly common around the middle East so perhaps Lazarus wasn't eating fugu but he may have had epilepsy, tetanus or a number of other conditions which were confused with fatality.


Returning to the parenthesis on terminal conditions, above, one can argue by progression that if there are fewer "terminal" conditions now in (kindof) 2000 than there were in 1800, then assuming no catastrophic dark age reversion there will be even fewer in 2200, fewer still in 2400 and so forth. So the ability to "miraculously" recover from a terminal condition should decrease over time too; not because the rate of miracles is decreasing but because the ability to explain the circumstances is increasing.

TGD - religion leaving the gene pool

If there was some kind of selection pressure which favoured, even in a roundabout way, predisposition toward religion, and if sexual selection naturally favours successful people (or those who exude success, anyway), then we have a (not too serious) quandary. Because the most high-profile adherents, the most apparently successful at religion, are often the clerics. Who are frequently celibate (or at least, are required to be: please do read the dictionary definition for nepotism though).

TGD Responses - selection for religion?

I'm going to do a few articles based on The God Delusion by Richard Dawkins. As this is a bit of a departure from the usual content of yon blog, I'll be sure to prefix the titles of each with TGD so that those so inclined can filter for/against them in their syndication readers. The articles will be a mixture of prose agreeing with parts of the book, arguing against parts, questions which the book made me ponder and for which I have no answer, and quips (I haven't yet decided whether to group these together or allow a post for each) answering specific ideas or even sentences. My only hope is that all of the articles - and the processes leading to their inception - are critical, in what I hope is the obvious intention of that word. Needless to say, I'll leave the punchline - my opinion of the binding theme of TGD and any changes it has had or not had on my views - until the final article.



I'll start this series by looking at his idea of religion having its roots in a "misfiring" of some advantageous trait which has been selected for. I would ask this question: why should that be so? In his description of evolution he explains the idea of a neutral mutation — one which overall has no positive nor negative effect on the fitness of the genome, but which can nevertheless become dominant (or at least prevalent). For instance, human earlobes either join at the bottom of the lobe to the face or they do not. I don't understand there to be any fitness advantage in either, yet at some time the allele(s) associated with earlobe stuck-to-facedness have, I presume, diverged from a common variant. Why couldn't theism be just one type of earlobe? What if the mean fitness of religious nonreligious "phenotypes" (I expect that's the wrong word…perhaps theotype is better) are not significantly different, and religious behaviour just happens to arise and have become common? I suppose there may be an answer to this, although if there is it wasn't presented in TGD.



There is a related argument in the book which I don't buy. In dismissing the idea of a straightforward selection pressure for evolution, Prof. Dawkins presents the Gedankenexperiment of a tribe who worship a war god, and whose religion dictates that they should go and fight the neighbouring tribes, in the course of which they acquire of course the resources of those other tribes, and propagate their seed further. The argument presented against this is that for any one individual it is more efficient to hang back while their companions do all the fighting, then to share a part in the spoils. Therefore the society would collapse, as no-one would want to do any fighting. This rather squarely misses the point of, for example Freya's D.Phil. thesis and the concept that a population based on cooperation (in this case the war-tribe, in Freya's case a biofilm) can in fact tolerate some fraction of "cheats" and that there is a stable state where proportion of cheats is non-zero but the population still thrives. Consider the British benefit system — some non-zero amount of money is spent on targeting benefit fraud, which keeps the fraud not at zero but at some level which both can be afforded and which leaves the spending justified. In fact, a canny war-tribe member would try to weasel their way out of the line of combat by arguing (rightly or otherwise) that they alone have some property that the average combatant does not possess, and would refer to the weaseling as "promotion" or officership.



Another potential explanation is an interpretation from Terry Pratchett, Jack Cohen and Ian Stewart's Science of Discworld series. In it, they describe the idea of "lies-to-children" in which various layers of falsehood are peeled back as a child becomes ready to accept the more complex, yet more accurate, explanations. What if this idea is extended to become lies-to-protoscientists? What if, as well as a moral Zeitgeist, there is a consensus of acceptable sophistication? So a society initially agrees that each tree, waterfall, star, planet etc. must have its own god, then finds that it can accept the god-of-concept ideas of the more recent polytheistic disciplines, then agrees that a single god, while more complex a solution, is palatable, all the while science is also working to provide the ultimate in sophisticated solutions: that which is born out of simple concepts, but which can be applied to give predictable and verifiable results.

Wednesday, November 29, 2006

e[Mac]s keyboard

It's about time someone made a UNIX keyboard for the Mac. I still love my Tactile Pro, and have obviously configured the caps lock key as an additional Control, but that key doesn't feel like the same buckling spring as the rest so it feels weird when I hit it. I just wonder now whether someone's going to make a keyboard with a Command key up there. Probably not, they never did for either the earlier Macs or the NeXT. It would be handy to be able to do cut/copy/paste without having to buckle my thumb or little finger under my hand...Matias' Optimise keyboard looks like it might be efficient but have a confusion curve.

Friday, November 17, 2006

Blasty from the pasty

Yesterday I had a little problem with the iBook, which was saved by some age-old knowledge from before the OS X release. Almost.



When I use an external USB mouse, I disable the internal trackpad. Now I wanted to take the computer into a different room in order to watch some TV (on the EyeTV), so unplugged all the USB stuff, plugged the EyeTV in....and the trackpad was still disabled. Now, a lesser person would have gone back into the original room, plugged the USB mouse in, and used it (or taken it with them). An equally lesser, but richer, person would own a Bluetooth mouse. But not I! I remembered a trick from the NeXT days, and returned my computer to trackpad-workingness in but a jiffy. Three jiffies.



The first thing to do is to log out - "as any fule kno" this is done from the keyboard by Command-Option-Shift-Q. At the loginwindow there still wasn't any trackpad activity, so I thought restarting the WindowServer might fix that. This is done by entering ">exit" as the username in loginwindow. Sadly, no joy. My next thought was to drop to a text console, unload the trackpad's driver kext, reload it and see what difference that made. Doing so requires entering ">console" as the username. However I decided not to pursue this as >console has been sadly broken throughout 10.4, and on some systems was broken in 10.3 too. It's annoying as occasional glitches where the graphical environment is FUBARed could probably be fixed in console mode. But this left one course of action. Enter ">restart" in the loginwindow and wait...



I should probably point out that I waited for the reboot longer than it would have taken to retrieve the mouse. But at least I wasn't defeated.

Wednesday, November 08, 2006

One reason multiple inheritance sucks

So I'm reviewing a book, and it happens to cover the way method lookups are performed in a particular language's object model. I'm not going to say what the book is because it's not relevant, and nothing discussed here has anything to do with that publication. But reading it made me realise just why even when the language allows it, my internal pain aversion system will always skip multiple inheritance as an option. Consider this Python code (with built-in python shell promptness):




>>> class One(object):
... def doStuff(self):
... print "One.doStuff()"
...
>>> class Two(One):
... pass
...
>>> class Three(One):
... def doStuff(self,x):
... print "Three.doStuff(%d)" % x
...
>>> class Four(Two,Three):
... pass
...
>>> class Five(Three,Two):
... pass
...
>>> a=Four()
>>> b=Five()


so, what is the method signature of a.doStuff() and b.doStuff()? Well, it depends entirely on the order in which the class hierarchy gets inspected, Python does things by leftright-bottomtop so both a and b inherit Three.doStuff(self,x). In the case of a, Four doesn't have doStuff() so it looks at Two, which doesn't so it looks at Three and finds it. However, Python also has another lookup mechanism (which was the only one available pre-2.3 or possibly 2.4, and can still be triggered by omitting the "object" superclass from One) which is left-bottomtop-right, so a inherits One's doStuff() and b inherits Three's. In the words of Peter Cook, that could confuse a stupid person...



So luckily Objective-C avoids this problem by only having an inheritance tree, and we can't add method implementations via protocols either. And my specific example is moot, because -doStuff and -doStuff: are different selectors.

Friday, November 03, 2006

if ([self isKindOfClass:[whore class]]) [self promote];

Bottom of the page, under Media Reviews. I've got another couple of review copies sat here, too...

Monday, October 23, 2006

We're off to see the Wozzard....

So, they said that Steve Wozniak would be there, and that he'd be signing books. So I took my book to be signed. That wasn't wrong, was it?


WozBook


N.B.: yes, I bought a copy of iWoz and had that signed too. But the iBook is cooler ;-)

Saturday, October 21, 2006

I feel sorry for...

The people credited with bringing GNUstep support to OCUnit a few versions back (at least one of whom I recognise as a competent programmer who really knows what they're doing), as the current version just won't work at all ;-).  It'll be more future-proof on the Apple platform, as it uses @try/@catch blocks.  However, as I want to use it on the GNU platform, this means a lot of #ifdef __NEXT_RUNTIME__ wrappers and NS_DURING/NS_HANDLER/NS_ENDHANDLER blocks...

Sunday, October 15, 2006

Best.  App.  Evar!

In the spirit of My Dream App, I've invented my own dream app.  BestAppEvar.app would be able to divine what needs to be done by detecting my brainwaves, and would then do it when I hit the button.  To make it easy for you to implement, I've already designed the UI:

So, why hasn't it been made yet?  Come on, you lazy coders!  The hardest bit would be the brain-computer interface, but there are example I/O Kit projects on the ADC site.

Monday, October 09, 2006

A spot of ultravaiolence, my droogs?

I'm currently having a Vaio VGN-S4M inflicted upon me.  I can't say I dislike it totally; the X-black screen is rather nice and it has one killer feature in that there's a (physical) radio kill switch on the front.  However, by and large I do dislike it.  The Centrino wireless jobbery is not fully documented, so only works with a binary blob driver which means it's useless for most of the operating systems I care about (it doesn't work in CEntOS, for instance, and I don't have the luxury of being able to switch to Ubuntu where I've heard better results are possible).  It seems to run very hot doing anything (including nothing), so the fan constantly winds up and down.  And it's a loud little fan.  The whole keyboard seems to bend a little when I press any key (although I'm used to the Tactile Pro, so probably whack a little harder than necessary...)  The only saving grace in the design is that PC manufacturers seem now to be getting over the desire to install legacy ports all over their laptops; but the thing's still closer to the size of a 14" iBoko (hi u.c.s.m) than that of its brother, the 13.3" MacBoko.

So, with a recent cash injection and an ADC hardware discount coupon both burning a hole in my pocket, as well as a desire to crack on with the ObjC 2.0 work on the c.l.o-c FAQ; it seems an Intel Mac and a copy of some virtualisation tech are in order.  The question becomes simple: do I jump now, and get a MacBoko or MacBoko Pro, or do I hold on in case the Core 2 Duo variants are around the corner?  Or I could even combine the two and get an iMac, keeping the Vaio for corridor worrying?  I'm tempted by the "buy now" approach, as I actually need^Wwant a new system now, not in January...

Wednesday, October 04, 2006

Init dead; no casualties

An interesting time if you happen to be an aging startup superserver; Ubuntu are to replace init with Upstart from "Edgy Eft". That's quite cool, the model in which everything needs to always come up and always in the same order put forward by both styles of init is long dead, and the system V style of init is particularly cumbersome (though someone at Apple clearly liked it, as they had both SystemStarter and watchdog in the past).



I'm actually both surprised and pleased to see a Linux distribution making the jump here, I've always considered them fairly conservative (apart from in throwing any old free package into the distribution; I mean from a "core stuff"[*] perspective. I know that FreeBSD attempted something with launchd last Summer, but the latter has too much mach_init magic which can't cleanly be excised.



[*]now Apple are going to start a CoreStuff API and sue me. Fantastic.



One thing from TFA saddened me (though I really ought to have expected it), and that's this:


To avoid reinventing the wheel, we first looked at how much effort it would be to use of modify the existing replacements to be able to do this. Sun SMF and Apple launchd were immediately ruled out due to licence issues. It was important for us that the solution be uncontroversially free so that other distributions might adopt it; many had already rejected these for GPL incompatibility reasons.


Yes, it's the standard "GPL first, utility second" argument. I have a fairly strong opinion here: if something works, and I can see that it works, and it works better than any alternative I have access to, I'll use it. That's why I'm posting this from OmniWeb on a Mac, despite [i]there being free web browsers around, [ii]my work involving Linux. I prefer to have access to the source, except where that involves a retrograde step in terms of utility. Anyway, I digress; the point here is that launchd is released under (well, depends which version you look at) the Apache licence, and OpenSolaris under the CDDL; both of which are free software licences, but are incompatible with the GPL on technicalities. That's nice if you really do want to split hairs, but GNU/Linux (if you like) is supposed to be a usable OS so shouldn't utility come first? Admit it, how many of you have uninstalled kaffe or gcj and are using the Sun jdk? More to the point, how many of you are using Apache (which is also released under the Apache licence)? It's time to get over it. I propose that if you want to work on a pure GNU system, you should indeed work on a pure GNU system and hie thineself over to the HURD mailing lists. I fully intend to, if a gobbet of spare time makes itself available soon...but more because I think the HURD's cool ;-).

Wednesday, September 20, 2006

GAH!

You can't use a java.awt.Color in WebObjects, because to use AWT at all on OS X requires connection to the WindowServer.  And unless you're mad, you probably aren't running your WOA as root.  This means I can't do things like, ooh, I don't know, making a PDF table have a white border instead of a black one.

Friday, September 15, 2006

WikityWebsite

Strange things can happen when I get bored.  There's a great little dashboard widget called WikityWidget, which lets you organise notes like a wiki.  Well, I thought, no point in only having my notes on one computer, why not scrape the wikits out of WW and put them online?


You may be interested in some source code.

Wednesday, September 13, 2006

Parallels may, in fact, be completely dumb

tyr:/Library/Parallels root# ls -l
total 16
-rw-rw-rw- 1 root wheel 40 Sep 12 15:52 .dhcp.en2
-rw-rw-rw- 1 root wheel 0 Jul 4 17:10 .dhcpd_configuration
-rw-rw-rw- 1 root wheel 0 Jul 4 17:10 .parallels_common_options
-rw-rw-rw- 1 root wheel 100 Jul 4 22:44 .parallels_license_2.2

Sunday, September 10, 2006

switching CPUs

I can waste a lot of time if an interesting question gets posed. The most recent culprit was Chris Ridd in uk.comp.sys.mac, wondering aloud if threads ever got shuttled between CPUs on a Mac. Here we go...



It certainly looks like the conditions for doing this through the API can never be met on a real Mac running xnu. All you can do is assign a thread or a task to a processor set, but not a single processor. Unless that processor happens to be the only member of a processor set. Thing is, on xnu there is only one processor set, which encompasses all of the processors. So there's no way to force your threads onto a particular processor in Mac OS X. The lack of multiple processor sets means that you couldn't have a box with, for instance, both a G5 and a Xeon running a single kernel, which is kindof sad in a way. It won't get missed, though.



It doesn't even look like there's an API to work out which CPU you're currently on. What you can do is get the port for the default processor set (the only processor set), then by manually furtling with the structs you can iterate through the CPUs (or you can ask your own mach_host_port for an array of the CPU ports). For each CPU you can get the thread queue, which you could compare with your own thread to see if it's the same. That'd be tedious, but would get the required information. Once there though, I don't see any way for the thread to move between any queues except the idle and run queues on its 'native' processor; so I think the answer is that no thread ever migrates between CPUs. I may be wrong, and am happy to entertain any information to the contrary.



Unsurprisingly with no API to do what I want, little useful code came out of this exercise. I found out how many cpus the system has, but that's it really.



Update 2006年09月10日 16:25 GMT - I hate this not knowing, so I decided to play the Ask Amit card ;-).

Subscribe to: Posts (Atom)
 

AltStyle によって変換されたページ (->オリジナル) /