Python Community Server: Development

A weblog about programming in Python, C#, Java, Perl and C++ - and the occasional comment on PyCS development
new: discuss community servers on the CommunityServerWiki!

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

[ Aug ] [ Oct ]

the locals
also available in XML
Copyright (c) 2002 Phillip Pearson
spread the dot


PyCS privacy fix

Robert Barksdale e-mailed me today to ask if it would be possible to get PyCS to not display the e-mail address you leave when you post a comment.

That's a pretty sensible idea, so I've implemented it. All it took was deleting one line of code, so it wasn't a big deal. However, it has a nice result: people can now safely leave their real e-mail addresses on comments.

I'm considering adding a variant of the "mail this blog's owner" pages that will let you e-mail comment posters (without seeing their e-mail addresses) if I have time. Hmm.

Comment on this post [ so far]

Setting up redirects in PyCS

Tech note here for you all. If you're running a community server and somebody switches from Radio to bzero, you'll have to set up a redirect so their permalinks don't break. Radio saves its archives as (year)/(month)/(day).html, whereas bzero saves them as (year)/(month)/(day)/index.html (so you can switch to PHP or ASP or something later without having to break your URLs).

It's quite different from setting up redirects in Apache: you have to write a little bit of code. More powerful than using Redirect statements in .htaccess files, but also rather trickier, it's similar to the way you'd do it with mod_rewrite:

rewriteMap.append( [ 'radio -> bzero redirection',
     re.compile( r'devlog/0*(\d+)/0*(\d+)/0*(\d+)\.html' ),
     ] )

That goes in /etc/pycs/rewrite.conf; it should work anywhere (although I've put mine at the end).

Using HTTP 301 ('Moved Permananently') redirects like this rather than META REFRESH makes sure that Google will find the new addresses.

Comment on this post [ so far]

More C++ compilation fun

At work I use a graphics library called Allegro. It's very nice: quick, reasonably reliable and also free and open source. It works on heaps of operating systems, although I'm only interested in Windows and Linux.

Today I've just plugged it into a new project, and I seem to be getting these warnings (10 of the same one, in alconfig.h and draw.inl) every time I include allegro.h

    ...\include\allegro\internal\alconfig.h(276) : warning C4312: 'type cast' : conversion from 'unsigned long' to 'unsigned char *' of greater size

I think it's a 64-bit portability thing. Hmm. How do I turn off checking for that?

    Configuration Properties | C/C++ | General | Detect 64-bit Portability Issues

Aha! That seems to have sorted it out ;-)

So there you go. If you get lots of C4312 warnings when compiling Allegro, turn off the 64-bit warnings.

Comment on this post [ so far]