betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

03 May 2005

Zope: Using UTF-8 in the Management Interface (ZMI)

A small change for a big charset

To really use utf-8 unicode in your zope management interface (as of Version 2.7.X), go to the "Root Folder", click on "Properties" and add a property with the following settings:
Name: management_page_charset
Type: String
Value: utf-8

Why is that necessary? Why does it seem to work without it too? It somehow does, but when entering unicode into text fields, those characters will get replaced with html entities like {. Confuses ZCatalog searches and is impossible to edit.

Update 9.5.2005: One pushback with this solution is the handling of properties in the ZMI: On the properties tab all the choices for Unicode types ("ustring", "ulist", etc.) are gone. Even when I add properties with those types through a script, the display and editing of such properties is broken. I think some of the trouble is documented in this Zope Collector entry called " Zope unicode patch". But I believe there might be other problems too.

Posted by betabug at 12:18 | Comments (0) | Trackbacks (0)
09 May 2005

Trees for Page Templates

ZopeTree, ZTUtils.Tree, DTML tree, or... ExpansionTree?

After my last note on using ZopeTree (with patch), I had contacted the author and heard that ZopeTree will be all new and nice in Zope 3. But for the moment the lack of documentation made me look elsewhere. What I'm using now is ExpansionTree.

Expansion Tree has just a little bit more documentation. But it works nice for me, especially for storing state information in the SESSION. The tree generation logic is not in my Page Template, but in a method of my Python Product. Getting the state is done with a simple:

ctree = request.SESSION.get("ctree", '')
and after processing we can store the state again, approximately like this:
[...some other code...]
tree, rows, state = t.grow(root, ctree,
        request.form.get(todo_var, ''), default_state={})
request.SESSION["ctree"] = state
return {"tree":tree, "rows":rows}
Where the "return" will give back the values needed to display the tree in the ZPT (Zope Page Template).

Caveats: When the SESSION expires, the tree state is gone and the tree will be shown collapsed again. In this application I have set the SESSION to a long time, plus I have the tree in a default partially expanded state. But you may want to look into this.

Posted by betabug at 09:21 | Comments (2) | Trackbacks (0)
11 May 2005

The Strike is Here

"Workers unite!" and all that

Yes, Greece (or Athens) is on strike today. Yes, May 1st was postponed to May 11th. Workers unite! and all that. Asked my boss yesterday if we will be working. He said: "We are working, but if someone of you wants to go on strike, it's ok with me."

This morning I found the entrance to the metro blocked. No public transport for swiss geeks today. For a moment I looked out for a taxi, but they were all busy with 5 passengers each. So I returned home and borrowed my flatmates bicycle. The taxi would not have brought me luck, Athens centre is blocked from Omonia through Syntagma to Syggrou. Even with the bicycle I had to do some detours. But I arrived without problems and not very tired. The way home will be more interesting, lots of uphill battles to fight.

Posted by betabug at 09:37 | Comments (2) | Trackbacks (0)
17 May 2005

You are not enjoying the full potential of this CSS page

You don't want to, but we keep buggering you anyway

I browse a lot with lynx, a text only browser. Some websites do nice appearances with CSS, which is a fine thing. Among some of CSSs virtues is the ability to degrade the presentation gracefully for browsers that don't get CSS. Whatever happens, the content should come through for example in a text only browser like lynx. But some websites get on my nerves complaining about lack of CSS support in my browser.

Continue reading "You are not enjoying the full potential of this CSS page"
Posted by betabug at 07:13 | Comments (0) | Trackbacks (0)
21 May 2005

Dropping the Connection

But you can still listen to the radio

So on this nice Saturday morning I wanted to pick up my mail, just like every wellbehaving netizen does. But then, always after 2 minutes the connection dropped. If you haven't yet noticed from my weblog, I'm on dialup at home. Maybe there is some impulse beep on the line (e.g. for charges). It's too regular to be caller id. And then, it's OTE...

The provider is OTEnet, state owned, pretty big, and therefore impossible to get any information out of them. The main piece of insider knowledge to get a connection up with OTEnet from a Macintosh is that you have to switch off "Enable error correction and compression in modem" for Apple internal modems. Some people even recommend going to v.34 modem scripts. So far I did not have to use v.34. But I had a couple of disconnects at the 2 minutes mark before. Usually when I survived that mark, I could stay online for an hour without problems.

Not so today, today OTEnet persists. Tomorrow it may be different, letting me connect right away, or tomorrow it might not work at all. For the moment I'm sending my mails over GPRS through the mobile. It's not like I'm addicted to the net, but a bit of "keeping the conversation going" with friends and family is real good when you are far away. It's good to have some choices for Internet in Greece.

Posted by betabug at 12:45 | Comments (0) | Trackbacks (0)
23 May 2005

Writing a FAQ

Introduction to my plan. Why I'm doing a FAQ now. And how.

The question of making a "Mac and Greek" FAQ is on my mind for quite some time now. I've been bugging HelMUG to do something, but bugging others can only go so far. Now I'll try to do something myself. If someone else picks up the trail later on, only the better. So here is how I plan to collect and write down this FAQ...

Continue reading "Writing a FAQ"
Posted by betabug at 09:21 | Comments (0) | Trackbacks (0)

This time of year... and getting stuck

The sun and the shadow
Shady benches in the park Pedio tou Ares

So, still not convinced that Athens is beautyfull in spring? There's nothing like a day in the park. Except for maybe a day at the beach, which I will hopefully have soon.

At work I'm stuck, as usual. Programming is made out of short bursts of marching forward, building things nice and beautyfull. And then long hours of getting stuck with a seemingly simple problem. Filling files and files with ugly code, trying to get a clue what is actually happening. Wish I could sit in the park now.

Posted by betabug at 13:50 | Comments (0) | Trackbacks (0)
25 May 2005

Bot Attack

Referrer spam without referrer?

Starting from yesterday I am having lots of accesses by what appears to be a bot or spider. At first when I found my stats file inflating certain pages views, I had expected to have been hit by referrer spam. But there is no referrer. Only the blog part of my site is being targeted, the same URLs are hit again and again, sometimes more than 200-300 times. The browser ID string is always "Mozilla/4.76 [en] (Win98; U)"...

Continue reading "Bot Attack"
Posted by betabug at 17:11 | Comments (2) | Trackbacks (0)

Υιοθετείστε ένα ωράριο

Και μπερδέψτε εναν Ελβετό!

Πριν μερικές εβδομάδες έμαθα τη λέξη "υιοθετώ"[1]. Δηλαδή, θα την ξαναμάθω πάλι σε λίγες εβδομάδες, αφου θα την έχω ξεχάσει.

Σήμερα όμως άκουσα με ένα αφτί στην τηλεόραση[2] ότι ψάχνουνε κάποιον να "υιοθετήσει το καλοκαιρινό ωράριο". Συγνώμη, τι; Η μάνα του, που είναι δηλαδή; Αλλά δεν πειράζει, συνεχίστε να μπερδεύετε τον Ελβετό!

[1] Εγώ το'χα γράψει "ηοθετήζω" αλλά με διόρθωσαν.

[2] Ναι. Και εγώ βλέπω TV. Κάποιες φορές και μάλιστα με τον ελληνικό τρόπο, να είναι ανοιχτή και να την αγνοούμε. Συνήθως το κάνω για να είμαι "social" μόνο. Αλλιώς, βλέπω πολύ λίγο TV.

Posted by betabug at 22:15 | Comments (2) | Trackbacks (0)
31 May 2005

Athenener Trams mit deutscher Software?

...und sehr angenehmen Fahrtzeiten am Wochenende

Letzten Freitag war ich mit Freunden abends spät weg, in einem Lokal in der Nähe von Syggrou / Fix. Nachts um halb 2 begab ich mich auf den Nachhauseweg, natürlich mit dem Tram. Die Athener Trams fahren von Freitag morgen bis Sonntag Nacht im 24-Stunden-Betrieb. Sehr praktisch für Nachtschwärmer.

Ich musste zwar eine Weile warten (amüsierte mich damit, zu beobachten wie die Anzeige der zu erwartenden Ankunftszeit von 11 Minuten auf 13, dann auf 15 Minuten stieg und dann wieder langsam zurückging). Aber dann gings gemütlich Richtung Syntagma.

Im Tram ist dann die nächste Computeranzeige, die (wie hier im Eintrag über den öffentlichen Verkehr in Athen schon erwähnt) die nächsten 5 Haltestellen anzeigt. Als auf der Anzeige schliesslich "Syntagma" erschien, tauchte darunter auch ein kleines Wort auf. Ich musste aufstehen, um es lesen zu können: "Endpunkt". Hmm, nicht wirklich ein griechisches Wort. Sieht so aus, als ob die Software für die griechischen Trams aus einem deutschsprachigen Land kommt.

Posted by betabug at 09:46 | Comments (0) | Trackbacks (0)

Businesslunch in Greece

Some things are just a little bit different
Greek taverna

Just went and had "business lunch" with my boss here, in a small fish tavern 5 minutes drive from the office. This is what I call quality of life. Sure I might be making more money in Switzerland, but I would not be putting down a kilo of fresh fish at noon. Not to mention the sun. Did I mention the sun? I really happen to like the sun, even when in a few weeks it's going to be too hot to sit in the sun.

Even though Athens is trying to get all modern on us, international and styled in plastic, there are still a lot of small family style places around. This one has fish, others have cooked foods, some have barbeque style meats. And Ouzo. Well...

Posted by betabug at 17:46 | Comments (0) | Trackbacks (0)