Archive for the ‘computing’ Category

keyboards

February 6, 2007

Besides the more well-known Das Keyboard, there’s also the less well-known HHKB. It’s about the same price, but it’s way cooler, handier. I wonder why the ‘über-keyboard’ is so often the unprinted keyboard instead of the elegant one, maybe it’s just the website looks.
HHKB photograph

(I guess I’d better just be nice to read instead of waiting for some Paul Graham-like essay just to slip into my head. That apparently doesn’t work for me. Well, one has to try…)

November 30, 2006

$ cat foo.qck
(print "Hello, world!")
M-x gen-foo
M-! parrot /tmp/quackfoo.pir
Hello, world!
$ cat /tmp/quackfoo.pir
# -*- mode: pir -*-
# auto-generated PIR from Quack Lisp code.
# For more info, see http://cvs.codeyard.net/Quack.

include "quacklib.pir"

#.namespace ["quack"]

.sub main :main :lex
  init_quack()
  $P1 = find_global "PRINT"
  $P2 = new "LispString"
  $P2 = "Hello, world!"
  $P3 = new FixedPMCArray
  # QAST tail call
  .return $P1($P2, $P3 :flat)
.end

# Local Variables:
# compile-command: "parrot quackfoo.pir"
# End:

:-D

Runtime macroexpansion is evil, indeed

October 16, 2006

I’m trying to implement an Arc-like Lisp dialect, and my code currently runs in an interpreter run within an interpreter (only made to bootstrap the Parrot code). I just finished implementing cond (I’m not implementing if in terms of cond as PG may do, the other way around makes the code simpler), and all the code that used cond was getting rather slow. Not strange, really, as I had been expanding macros at runtime. (It’s the easiest way, they are first-class objects like in Arc.) So, I made some assumptions for the bootstrapping code to allow for a simple ‘compile-time’ (well, it’s between read-time and eval-time) macroexpander. Running it on a part of the macroexpander itself took some time and memory:

code screenshot with timing

Next thing to do: make the interpreters cons less.

Parrot gets cookie

September 17, 2006

Before I encountered Lisp, I had been using Perl for a while. Nowadays I’m mostly toying with an unfinished unofficial Arc implementation. Surprisingly the two got together: Parrot, the expected Perl 6 virtual machine, is made to support other languages as well. There are already projects for Parrot implementations of APL, Basic, Befunge, Brainfuck, CL and dotnet, to name a few. The list includes a mostly working Python implementation.

Another plus: it uses continuations everywhere (not what you’d expect be necessary with Perl), so it’s ideal for a Lisp dialect host. You can use CPAN, wxPerl, SDL, sinp.py, interact with Perl and Python, and so on. There’s just one implementation, targeted at portability, so you don’t have to bother with your favorite CL implementation not supporting platforms.. Perfect. I love it.

Caught by a CrackerTracker

September 8, 2006

Our friends group has this forum. It’s really useful for chatting about topics that concern the whole group and multicasting (birthday) invitations. It is rented at some host that probably decided to get rid of all phpbb insecurities at once, and installed a filter. It now features a really impressive button showing a key and ‘ctracker’ on it. After that, there is (at story-time) ‘blocked 33 attacks’.

So I really wanted to know what counted as an attack. Apparently, POSTing a simple SQL injection query didn’t trigger it. Or anything I’d try to send it. So, I went to cback.de, who made the tool. According to the GPLv1′d source (well, it didn’t even mention a version number), it triggers when you put things like ‘UPDATE FROM’, ‘.htaccess’, ‘chr(‘, or ‘php_’ in the query string (the url part after a question mark). Which makes me think, is this real security, checking only the query string?

I mean, 80% of the places in phpbb where you can submit info to PHP use POST.. If I went for security, I’d seek for leaks there.. I’d bet adding this CrackerTracker added no security to the forum; it did make the host look stupid. I mean, just me posting a ‘don’t click here’ link to search.php?php_is_nice shocked users, who got accused of something completely innocent (besides spoiling logs).

They would get a simple page labelled ’security alert’ in red, telling them that they tried to attack the forum, and that they had been logged. And, they increased the ‘hit counter’ on the way.. :-)

Unexpectedly, others (non-friends) also followed the link. En masse. In less than 2 days, the counter increased by over 1100. Sorry, host, didn’t mean to help you brag about your safety..

Notes:

  • The link is not to our forum.
  • It may be that WordPress visited the link itself a couple of times, to check if it really existed. So, I already substracted 20 clicks from 1,1E2, resulting in 1,1E2. For the convenience of otherwise confused readers, I wrote down 1100, which is the same value but with a different uncertainty. (They still nail me at school if I write down 1080 in a test!)