see whatever…

jump to menu

August 30, 2005

a list apart new design

Filed under: Design — see @ 1:29 pm

Just read the thoughts of Jeremy Keith about the redesigned A List Apart site and I totally agree. To me it is one of the best yet not too flashy but very usable and adequate designs I’ve seen in a while and I especially like the simple but very effective hover effects on headlines (not the main navigation hovers, they are just ok).

But I also wondered why the site uses a 1024px fixed layout.

I use a standard TFT with 1280×1024 screen at home but still 1024 is too wide for my normal browsing behaviour having the bookmark or any other sidebar open. Then I have a maximum of maybe 900-1000px for the main browser window which is not enough for the new A List Apart.

I always thought a fixed design is not a good idea at all but I also know a liquid design is hard (although I normally try this for my own sites, if I succeed is another question ;) . But from a site showing best practices and cutting edge web technology I expect something better than the long ago claim “1024 is what everybody wants now”.

I just had a report on a major german website and only about 70% of the users actualy have a 1024px screen (whether they use the complete space for the browser was not even counted). But about 10-15% use 800px and another 10% have 1280px screens or even larger.
This might not be the general case for all sites but shows the problem quite well. With a fixed 1024px design you annoy people with smaller screens but also people with 1024 or bigger screens. Jakob Nielsen even complained onces that his 2056px (or so) wide screen can never be used to its full size, not even if he wanted to.

Nevertheless the design in general is just beautiful, I guess Jason Santa Maria is a really great designer (you should take a look on his photos, best ones I’ve seen for a long time).

August 29, 2005

retest 0.3

Filed under: Python — see @ 7:37 pm

Did some work on the regular expression test server via AJAX with a webbrowser. Something like this could be very nice for all sorts of apps, actually doing an application UI with HTML and CSS only is quite fun. I always thought I should take a look into a read UI toolkit like TKinter or wxWindows but maybe I even don’t need to at all.

Of course I ran into a problem with unicode (again) which was not a real problem but took me quite a long time to find out. I wanted the re results (normally a list or list of tuples) to be sent to the browser as a simple string (encoded as UTF-8), so I tried to convert it:

L = ['รค']
u = str(L)
u = u.encode('utf-8')

This produces always double escapes of the “umlaut” characters which therefor are displayed as escape sequences (‘\xe4′) in the webbrowser. In the end I simply converted the list of strings by encoding each string separately but this took me quite some time to find out. I was looking in all places where a missing encoding might have been broken but never looked into this stuff.

After writing a simple AJAX echo server it was easy to validate the basic framework was all right and maybe some people find the basic example useful:

import cgi
import BaseHTTPServer
import SimpleHTTPServer

PATH = ''
PORT = 8086

class EchoHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):

    def do_POST(self):
        length = int(self.headers.getheader('content-length'))
        qs =
        params = cgi.parse_qs(qs, keep_blank_values=1)
        txt = unicode(params['txt'][0], 'utf-8')

        # do something with txt
        txt = txt.upper()

        out = txt.encode('utf-8')
        self.send_header('Content-Type', 'text/xml')
        self.send_header('Content-Length', len(out))

def run(server_class=BaseHTTPServer.HTTPServer,
    server_address = (PATH, PORT)
    httpd = server_class(server_address, handler_class)

print 'serving on (localhost) %s:%s' % (PATH, PORT)

The server expects a single “txt” parameter via POST which it simply turns uppercase and returns.

August 24, 2005

retest server and AJAX

Filed under: Python — see @ 11:14 pm

I did my first AJAX project today. I always wanted a simple re test for Python regular expressions and thought a web frontend would be just as suitable as anything. Doing the frontend was simple. The server for the AJAX calls not too difficult either. It is simply based on the Python SimpleHTTPServer which I also used for the restserver I did a while ago. I never used POST with it before but that was easy after some googling, looking in the online Python documentation and some books I have around (“Python Network Programming” is quite nice BTW).

For the AJAX part I saw Ian Bicking’s post on JSOlait some time ago and looked into it a bit more. Quite nice and quite simple for someone used to Python. I do know Javascript but never really looked into HTTPRequest yet so using a library was much simpler.
Only problem was that I did not thought about serving the static HTML and doing the AJAX calls from the same server. I used Apache for the HTML first and wondered why JSOlait complained about not being able to connect. Googling turned out that security constraints in Firefox prevent Javascript to do calls to a different server than the containing page comes from (naturally, should have thought about that myself).

The rest was quite easy and I guess I develop the script a bit further which might come in handy when using re the next time.

August 23, 2005

encutils 0.5a1

Filed under: encutils,Python — see @ 10:53 pm

Released even another version. Finally implemented (or better used a python cookbook recipe) for XML auto encoding detection (BTW, is that actually right licensewise, on the cookbook site I could only find a short note like “usage free”).

Of course I could have linked to the recipe but this way it is more convenient and I changed a small bit as well. In case no encoding can be “autodetected” "utf-8" instead of None is returned which is IMHO more to XML 1.0. I may be wrong of course but there will be quite a few versions of encutils to come anyway as there are a few todos left…

I wonder if anyone actually needs or uses this module anyway, for now it is more or less an exercise in understanding the spec dependencies, the whole encoding thing and maybe even improve my Python a bit (the buildlog function is definitely a thing I will use for quite a few things as the logging module is nice but a bit complicated to set up for a simple log).

August 21, 2005

Python API docs

Filed under: cssutils,encutils,Python — see @ 1:44 pm

The one thing about Java I like are the javadoc files in a standard format, Python does seem to have a few more than a standard one but I guess that is ok.

I generated API documentation for both cssutils and encutils with epydoc. The inline documentation being in reStructuredText format anyway this was quite simple. I did not recognize before that epydoc (aside from its own markup) supports ReST markup , a simple command line switch or __docformat__ = 'restructuredtext' in each file is sufficient (thanks to the docutils mailing list!). A few adjustments in the comments and a nice package of docs is done. Actually an editor supporting ReST while writing code would be very nice, maybe this is coming out of the docutils project sometime but I guess not in the neat future. Would I be a better programmer I would have a try but I guess it would take me years to do that… (and I should at least try to finish my own projects before that).

August 17, 2005

encutils 0.4 released

Filed under: encutils — see @ 10:01 pm

a new release which at least acknowledges a possible XML declaration of a document. No autodetection (of a possible e.g. BOM) is done yet. I wonder if the guessEncoding function should do this anyway, I guess an optional parameter (like useBOM) would be better than enabling this by default. Depends what you want to do with the script (if anything ;) . The specs should be followed and to the useBOM seems a good way

August 16, 2005

encutils work

Filed under: encutils,XML — see @ 7:05 pm

I was working on encutils and wondering if the algorithms to find the encoding from a HTTP header, XML declaration, HTML meta information and also default encodings for content-types are complete. It is quite complicated as quite a few rfc and specs are defining the problem. I hope I have these complete (probably not ;) , maybe I should post it to xml-dev, or is there a better newsgroup/newslist?

August 14, 2005

cssutils 0.8a4 released

Filed under: cssutils — see @ 11:08 pm

and another alpha release… the only change actually is in the csscapture script which downloads all referenced CSS files for a given URI (currently HTML pages only, XML should follow…).

of course the script relies on the cssutils parser which is not perfect yet but works reasonably. i hope i find the time to write some more tests to be sure where problems are. and i need to work on the docs. i updated the website with a short example and also included 3 example scripts with cssutils in the example folder but still a lot of stuff should be documented explicitly. also i am still looking for a ways to autogenerate HTML docs for the package which is documented with ReST. Fuzzyman (thanks) pointed me to pigeon, i’ll take a look into it as soon as i find the time. also a good opportunity to look into python eggs which seems to be used by pigeon…

August 13, 2005

cssutils 0.8a3 released

Filed under: cssutils — see @ 7:07 pm

today I fixed the bugs I introduced during development of the alpha 3 release… some details due to a user request have been added which also showed the (a bit sad) state of the parser itself. the API works and the parser too but it not even near the spec. a lot of stuff like escaped characters "\"" , nested { } blocks etc need to be resolved.

the parser needs to be redone (completely I guess) but the package is now as usable as all releases before (including the older 0.6x releases). even the script seems to work which is useful to download all CSS stylesheets for a given URL. imported stylesheets need to be added and also handling of XML files but otherwise it does work.

Due to my current lack of time I will develop the package further but unfortunately at a slower rate. I guess redoing the parser would be the best but actually doing some useful scripts like finishing the capture script seems much more fun. well, let’s see…

August 10, 2005

parser trouble…

Filed under: cssutils,Programming — see @ 9:43 pm

while redoing the cssutils parser (again) I am running into problems (again). being not a “real” – meaning not trained as – programmer and therefor probably lacking some basics especially in parsing I cannot get my head around how to really do it. I might try out pyparsing but am not sure if that is sufficient.

the rest of the package seems right and is improving (at least that’s what I think) but the parser definitely needs rework…

sometimes I wonder if it would have been better to study informatics instead of design. on the other hand I would lack quite a few other things then…

Powered by WordPress