bouteillebleu: (Eye (rainbow))
Python Software Foundation moves to require that Python conferences have a Code of Conduct if they want grant money from the PSF for running the conference.

(In this case a code of conduct is a written statement, usually on the conference website, saying what behaviour is and is not okay at the conference. The PyCon US one is pretty good and has been borrowed or adapted for a lot of other Python conferences. It contains a useful but not restrictive definition of things that constitute harrassment, a list of people to talk to about harrassment or security concerns, and statements of what the conference will do about it.)

A PyCon IE attendee feels a little down about this, as it seems to be too "formal".

The first couple of paragraphs saddened me (I was worried it would be a whole post of "I've never encountered this problem, so I don't think it exists"), but I'm kind of glad for the last few:

I don’t know, makes me think about what is the general perception and behaviour of the development community. I know there is discussion out there about whether the geek population is welcoming to diversity or just a bunch of jerks that just can’t behave (and all the spectrum in between). I guess it just makes me sad to think that we may need "an adult" telling us not to say things that we already know that we shouldn’t. It’s 2012, we have no excuse.

As I say, I just feel a little... disappointed. Like thinking that there is something wrong in all that, that we are grow up and that things are not on the same level of friendly informality. That we need rules to ensure everyone feels safe. I guess that a small number of spoiler brats are just ruining the party to everyone else.

And Jacob Kaplan-Moss's comment on the post is excellent (he's written more about Codes of Conduct on his blog):

I think the discomfort you’re feeling is totally legit and valid – codes of conduct are kinda patronizing to the vast majority of people who know better. The fact that you don’t need a CoC to tell you how to behave is a good sign: it means you’re a Normal Person who understands how to make other people feel comfortable in your presence. But you have to understand that the CoC isn’t about you. It’s about making other people comfortable in settings that have traditionally been quite hostile to them.

As for me, I'm happy about this change - it means that maybe local-to-me Python conferences might not see Codes of Conduct as an afterthought or something nice but low priority. I'm not even sure whether PyCon UK got its Code of Conduct written before the "conference song" someone wrote.
bouteillebleu: (Pomowned)
I have a tiny website working. It is a ridiculous thing that combines random panels of a terrible webcomic.

It's the first thing I've ever hosted on a server I administrate myself, so here are some notes mainly for my reference.

Setup was Ubuntu 10.04 / Apache / mod_wsgi / Flask, with the Python Image Library to do the image extracting and combining.

Basic docs
* Linode Library has a basic guide to Apache configuration and a guide to setting up mod_wsgi on Ubuntu.
* Flask's documentation also has a guide to deploying with mod_wsgi; like the example above it uses virtualhosts, but the suggested file is different.

I ended up using a combination of the two.

Steps needed (very basic, fragmented, will refine)
* Make a directory in /srv/www/ appropriate to your site or something.
* Stick your files in there. Probably have your site stuff in a subdirectory.
* Put an apache.conf file in there; crib most of it from the guides above. Things you need to put in there:
- your domain name (ServerName)
- what path under that domain name the WSGI handler is going to use and what .wsgi file it's going to use to read it (WSGIScriptAlias)
- a DocumentRoot and Alias entries if you want Apache to serve some files directly rather than passing them through WSGI, e.g. robots.txt and static files like CSS
- ErrorLog / CustomLog entries for logging (see below)
* Make a some-appropriate-name.wsgi file in there too. Crib its contents from the guides above. What it needs is:
- your Python site's directory in sys.path()
- the Flask app object in your main file imported as "application"
* You now have stuff for a VirtualHost almost done but Apache knows bugger-all about it because it's in some random directory. So, two steps:
- ln -s /srv/www/yoursitedirectoryname/apache.conf /etc/apache2/sites-available/yoursitenameorsomething
- and then a2ensite yoursitenameorsomething - it uses the name you put for the simlink here, so make sure you haven't typoed it if you get a "Error: yoursitenameorsomething does not exist!". (It turns out spelling "" without leaving out the second 'e' is harder than you think.)

Error logs
* I have an ErrorLog going to error.log and a CustomLog going to access.log in my apache.conf for this site. There are also the /var/log/apache2/ logs.
* I also stuck LogLevel info into my apache.conf so there's a slightly greater amount of detail in my site's logs.
* From my attempts to get stuff to work, any errors that are thrown at "compile time" (as in, syntax or import errors that are thrown when the .wsgi script attempts to import my Flask app) turn up in my site's error.log. Errors thrown at "run time" (as in, when an HTTP request comes in but something in my code throws an error or exception) end up in Apache's logs.
* Actually they don't even do that unless I add
import logging,sys

into the .wsgi script, as otherwise the errors get swallowed up.

Actually getting those errors logged was the biggest problem, as before I managed that I didn't have anything to go on.

It turned out that (a) I was pointing at the wrong part of the filesystem when looking for the image files and (b) the directory for the cached image files wasn't writeable by Apache's default user. Both of these were pretty easy to sort out once I knew what I was doing.

Bard 0.1

Aug. 20th, 2011 10:05 pm
bouteillebleu: (Pocket watch)
Today I have finally started on a programming idea I had a while ago - something that uses the Python Natural Language Toolkit to mess around with poetry.

What I have so far is something that automatically generates (almost) iambic pentameter. It's getting the words from Hamlet at the moment (each pair of words in the output occur next to each other in the play).

It is very bad iambic pentameter, mind, because I'm not taking into account where the emphasis is in words. (There's a dictionary I can use to do this, but I'm not using it yet.) But here's its first creation:

with your sister be pardon and armour
with sleep to stand you his tenders for his
with honesty can well appear like you
with speed to fall a farm it will wear him
with this hand more like madness range as you
with ecstasy of something musty him
with it cannot tell my lowest note him
with equal thanks are naught s cap of frame
with the foils have ta to her virgin as
with entertainment than his base into

As you can see, it's got some way to go. Because the output's random, I can't tell if its love for "with" is accidental or a bug in my code; another few runs of the code should be enough to find out. (The "ta" and "s" are because I'm removing punctuation, which is its own entry in the word lists I'm using - the first is probably from "ta'en".)

Next up - recognising word emphasis properly, possibly using more data and trigrams rather than just bigrams, and likely uploading to Github.
bouteillebleu: (Bad day)
Geekery about Python and its curses (text-based GUI) module. Posted because I was trying to figure out what the problem was and wanted to share the pain.

Read more... )


bouteillebleu: (Default)

April 2014

272829 30   


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 20th, 2017 02:52 pm
Powered by Dreamwidth Studios