decreasoner on OpenBSD

decreasoner is a Discrete Event Calculus reasoner written by Erik T. Mueller (author of “Commonsense Reasoning“). This is how I build it on OpenBSD 4.7:

  • tar zxf ply-3.3.tar.gz
  • tar zxf decreasoner.tar.gz
  • cd decreasoner/software/relsat-dist/
  • tar zxf ../../../relsat_2.02.tar
  • gmake -f Makefile.linux
  • cp ./relsat ../../solvers/
  • cd ../..
  • cp ../ply-3.3/ply/lex.py .
  • cp ../ply-3.3/ply/yacc.py .
  • decreasoner.py executes sort -g. Unfortunatelly, OpenBSD’s sort does not support a -g switch and you have to change it to -n. See also a discussion of sort -g vs sort -n.
  • ./make.sh

Someday I think I may contribute a script that may (semi)automate the above…

Dune and eBook distribution idiocy

I like Dune. I like it a lot. So being the happy owner of a BeBook Mini, I decided to buy the 40th anniversary edition from eBooks.com. Unlucky me:

This book is only available to customers in the following countries: United States.

The same goes with other e-bookstores too. I am sure that there exists a perfectly standing reason in some legal universe that does not allow me to buy an eBook version of Dune because I live in Greece, while at the same time I can go to Eleftheroudakis, or Politia and buy the english version in paperback!

To make it even funnier, I can buy a Greek translation of Dune from e-bookshop.gr (which is what I did in the end). So if I live in Greece and cannot read the native language, I cannot buy the eBook version!

It seems to me that only O’Reilly, Apress and Manning “get” it about eBooks. The rest seem to try and reproduce their current business model in a new paperless medium. We’ve got news for you: An eBook is not a book. It is now time to understand that the book is the content and you’ve been selling the medium.

ΤΖΩΤΖΙΟΥ mode on

Χρειάστηκε να πάμε τον Χ. στο νοσοκομείο για να τον δει παιδίατρος (όχι κάτι σοβαρό τελικά). Στην επιστροφή προς το σπίτι πήραμε ένα παιχνίδι στον Θ. από το ELC.

Θ: Μαμά, πολύ καλός ο γιατρός που πήγατε τον Χ.

Και την επόμενη μέρα:

Θ: Πότε θα πάμε την Κ. στο γιατρό;

(Inspired by: Οικογενειακές ιστορίες των ΤΖΩΤΖΙΟΥ)

You’re welcome

Today is the 11th Annual System Administrator Appreciation Day. Make some time and go thank your system administrator. It will buy you 364 days of less BOFHiness and non-grumpy support. It will actually show to your system administrator that his unpaid overtime and weekends in the terminal room, are really worth the effort.

Not only is System Administration a thankless job, it is also considered an unneeded burden, a low profile and accordingly paid service. There are even people under the illusion that cloud computing will make system administration obsolete. For them I paraphrase what Bob Lucky wrote in May 1998: System Administration will be in danger of shrinking into a neutron star of infinite weight and importance, but invisible to the known universe. Do you really want to make a handful of us that important for you?

Who do you think is going to administer the Cloud? A system adminisrator. And, again to paraphrase Bob Lucky from the same article, that System Administrator will be extremely well paid, and his or her every demand will be immediately satisfied. That engineer will be the last keeper of the secret of the (cloud) universe: The Root Password.

To those who really do not see it, the Cloud does not make System Administration obsolete. It only changes the way it is practiced. There are Systems built on and into the Cloud that need administration. What the developers of those systems do not see, is themselves becoming the system administrators of the systems (with increasing complexity and dependencies that) they build.

Go and thank your system administrator today. Really do. He does provide you with at least an above the average service. For if he does not, you cannot even begin to do your job, no matter how important (or urgent) you think it is.

You’re welcome.

Cybersyn

Πρωτοδιάβασα για το Cybersyn σε αυτό το blog post του Mike Trick. Πρόκειται για ένα τηλεπικοινωνιακό δίκτυο που έστησε στη Χιλή η Κυβέρνηση του Αλιέντε με μηχανές telex (που βρήκε σε αχρηστία από την προηγούμενη Κυβέρνηση). Project manager του έργου ήταν ο Stafford Beer (ένας πρωτοπόρος της Επιχειρησιακής Έρευνας που πίστευε στο συνδιασμό Cybernetics και managemet). Το έργο έτρεξε από το 1970 έως και το πραξικόπημα του 1973.

Όπως φαίνεται και από το άρθρο του Guardian η μεγαλύτερη επιτυχία του έργου ήρθε στην απεργία του 1972 με 50000 φορτηγατζήδες να κλείνουν δρόμους:

Food and fuel supplies threatened to run out. Then the government realised that Cybersyn offered a way of outflanking the strikers. The telexes could be used to obtain intelligence about where scarcities were worst, and where people were still working who could alleviate them. The control rooms in Santiago were staffed day and night. People slept in them – even government ministers. “The rooms came alive in the most extraordinary way,” says Espejo. “We felt that we were in the centre of the universe.” The strike failed to bring down Allende.

Θυμίζει κάτι αυτό; Το Cybersyn και 200 φορτηγά πάντως τα έβγαλαν πέρα. Στη δικιά μας περίπτωση τα φορτηγά και τα βυτία επιτάσσονται, αλλά ακούω πως δεν είναι εύκολο να ελεγχθεί εάν θα τηρηθεί η επίταξη καθώς δεν υπάρχει ο κατάλληλος μηχανισμός (δεν ξέρω, μπορεί να είναι και λανθασμένη η εντύπωση αυτή).

Μέχρι να εκδοθεί από το MIT Press το “Cybernetic Socialism“, το οποίο και θα περιγράφει την ιστορία του Cybersyn, ίσως θα είναι χρήσιμο να μεταφραστούν από κάποιον τα τμήματα της τεκμηρίωσής του που είναι στα Ισπανικά.

Μπορεί να μάθουμε και κάτι.

Update: Ένα λεπτομερές blog post για το Cybersyn.

GPS info

Χρειάστηκε σήμερα να πάω σε ένα νοσοκομείο που δεν ήξερα που είναι. Είχε ιστοσελίδα και βρήκα τη διεύθυνση. Περιέργως, το nuvi ενώ είχε το δρόμο, δεν είχε τους πρώτους 100 αριθμούς της οδού.

Δε θα ήταν καλή ιδέα εάν νοσοκομεία και λοιπά δημόσια κτίρια (δημαρχεία π.χ.) εκτός από την οδό, είχαν και το GPS location στη σελίδα επικοινωνίας; Οι χάρτες που έχει κάποιος στο GPS παλιώνουν, οι οδοί αλλάζουν ονόματα, κατεύθυνση και αρίθμηση, τα web site δεν ενημερώνονται, αλλά το στίγμα μένει σταθερό.

BeBook Mini: Μετά το πρώτο βιβλίο

Πριν κάτι μήνες αποφάσισα να πάρω ένα eBook reader. Βασισμένος σε ένα άρθρο του Peter Viscarola στο NT Insider και σε αυτό το post του Κώστα, ήμουν ανάμεσα σε κάποιο BeBook ή κάποιο Cybook. Επιπλέον, για eBook reader και λοιπά accessories, δεν ήθελα να ξοδέψω περισσότερα από €300. Κατέληξα στο BeBook Mini (με οθόνη 5″). Reader + 1 κάρτα SD 2G ~ €260. Ακολουθούν σκέψεις για το reader μετά την ολοκλήρωση της ανάγνωσης του πρώτου βιβλίου σε αυτό.

  • Μπορείτε να παραβλέψετε το ελληνικό manual.
  • Το BeBook έρχεται φορτωμένο με μερικά βιβλία (30 στα Ελληνικά) από το Project Gutenberg και με 8 βιβλία από τον Καστανιώτη.
  • ePaper rocks! Έχω μείνει απόλυτα ενθουσιασμένος από την απεικόνιση.
  • Είναι ανθεκτικό στις πτώσεις. Μια κυρία στο λεωφορείο το χύπησε κατά λάθος, προσγειώθηκε με την οθόνη και δεν έπαθε τίποτε.
  • Δεν είναι για όλα τα PDF ή τουλάχιστον για τα περισσότερα που με ενδιαφέρουν (και που έχουν δίστηλα, σύμβολα και σχήματα). Από την άλλη, εάν το eBook είναι φτιαγμένο για αυτές τις συσκευές, είναι εξαιρετικά ευανάγνωστο και δε χρειάζεται να καταφύγει κανείς σε zoom ή rotation για να μπορέσει να το διαβάσει.
  • Εάν επιθυμεί κανείς ένα general purpose PDF reeader, να αγοράσει ένα iPad. Καταλήγω στο συμπέρασμα πως οι ιδανικές διαστάσεις για μια τέτοια συσκευή είναι κοντά σε αυτές του A4 ή του US Letter. Οτιδηποτε άλλο σημαίνει πως ο χρήστης κάνει υποχωρήσεις.
  • Το BeBook Mini, συνεργάζεται άψογα με το Adobe Digital Editions. Είναι επίσης ορατό σαν εξωτερικός σκληρός δίσκος.
  • Σου δίνει την επιλογή να ανοίγεις PDF είτε με το Acrobat Reader, είτε με το XPDF, αλλά μερικές φορές το να κάνεις switch από το ένα στο άλλο δεν είναι προφανές.
  • Αναρωτιέμαι, μια και όλοι όσοι κατασκευάζουν eBook readers τα δίνουν μαζί με κάποια βιβλία από το Gutenberg, εάν κάνουν και δωρεές σε αυτό.
  • Το μηχάνημα έχει και MP3 player και δυνατότητα για text-to-speech. Δεν τα έχω δοκιμάσει.
  • Με τη μπαταρία να αντέχει 7000 “γυρίσματα” σελίδων, δεν είναι ανάγκη να κουβαλάει κανείς φορτιστή στις διακοπές.
  • Διάλογος συναδέλφων στη δουλειά: “Ωραίο είναι. Τρέχει Debian;”, “Όχι ρε, τρέχει Acrobat Reader”. Για να είμαστε δίκαιοι τρέχει Linux 2.6.21.7.
  • Είναι εξαιρετικά εύκολο στο χειρισμό του.

Μέχρι να βγει κάποιο tablet που να τρέχει Android και να παρέχει κάποιο συνδρομητικό service στα Google Books (συμπεριλαμβανομένων και αυτών που είναι “κλειστά”, wishful thinking) είναι μια χαρά επιλογή για διάβασμα στο λεωφορείο.

Update #1: Μια χαρά τα λέει ο Steve Bellovin.

Update #2: Introducing Google eBooks: more than 3 million titles from your choice of booksellers & devices http://goo.gl/iEdK1

/* Now reading: Conquest in Cyberspace */

loop

for (i = 0; i < strlen(string); i++) {
  :
}

This is a C version of a loop that I recently bumped into while copy-pasting some code. In the above loop strlen(string) is called strlen(string) times instead of just once (unless the length of string changes while in the loop):

int len;
:
len = strlen(string);
for (i = 0; i < len; i++) {
  :
}

Unless the compiler detects this and optimizes the loop, this is very bad practice. Yes, most of the compilers do detect this, but this does not mean that the programmer must rely on the compiler's optimizations. What if it does not get optimized in the end?

This is not a rant about wasted CPU cycles. It is mostly a rant about laziness in our thinking.

The Slow Loop