inicio mail me! sindicaci;ón

EuroPython Day 1

The first day here at EuroPython was definitely amazing. It’s the first time I go to a conference abroad and I’m stunned about the environment. You can meet people you only “dream” about, happen to talk with Guido Van Rossum itself around the building and do some other nice things.

I think I can’t remember all the people I met or saw today… Jim Fulton, Andrew Dalke, Guido, Armin Rigo, Michael Hudson, Beatrice During, Michele Simionato, Antonio Cuni, people from Canonical, Googlers, Moshe Zadka and so on. There’s a LOT of python super stars here. You can learn only by overhearing them speaking :-)

I counted about 15 italians here for the conference but I think there are more around

I also did a lot of “chatting” with Google guys and Google recruiters, very nice!

The following is a summary of the talks (in order) I happen to follow today.

I attended a lot of talks, mostly ~30 mins long. Some were cool, some were not, some were exciting, some were kinda boring. But you can learn a lot of things and that’s what matter beyond all.

Ajax State Of The Art

This talk was about the advantages (and disadvantages) ajax brings to the developer and the various toolkits around. Here’s an outline of the stuff I heard and read:

    Tarek Ziadé -> Engineer Nuxeo, CPS developer
    
    Ajax -> Web 2.0 technology
    Web 2.0 -> techs, apps, social software
    2.0 apps -> delicious, digg, gmail, basecamp, blah blah
    
    classic model vs ajax model
    ajax model -> js code send request and process data asynchronously
    ajax brings interactivity, save bandwith, avoid flash to do animations,
    transforms web UI ergonomics
    
    bad things people say (true if you're not good at ajax) -> 
        search index won't index right, back button of browser, app doesn't work without js

    choose a good toolkit -> 
     1 - server-side js generation frameworks (SSF):
        - js generated by the server, ie. crackajax:
            - BAD: the code is not testable because the js is generated
            - BAD: the project seems dead
            - GOOD: very exciting concept
        - js generated by the server, ie. Azax:
            - describe in XML
     
     2 - low-level client-side framework (LLF):
        - a thin layer
     
     3 - client-side frameworks (CSF):
        - framework, ie. mochikit, scriptaculous+prototype
        - GOOD: TDD
        - GOOD: simple patterns for common use case
        - GOOD: community
        - GOOD: part of the framework sometime
        - BAD: another fw to learn

    The CSF approach is the simplest

    AJAX good practices:
        - accessibility still matters, your app should work without JS
        - DOM squatting
        - TDD with JS:
            - html static page == test fixture
            - no obscure plugins in Firefox
        - OO programming:
            - ajax library on top of the framework
            - reuse!
        - continuous integration in the python environment:
            - launch js and py test in the same move

    ajax is not a revolution!

    http://planet.ajaxian.org
    http://ajaxpatterns.org

Integrating Twisted With Existing Applications

Moshe did a really damn fast presentation about Twisted Matrix, deferreds and integration. Too fast IMHO.

    Moshe Zadka -> Twisted "super-user"

    - SocketServer
    - Twisted is high level:
        - finger example
        - deferred -> value that might or might not exist yet

    multithreading app -> problems with intercommunication, synchronization and more
    twisted app -> single threaded

    deferToThread works good but has problem with SIGCHILD and assume the code executed is thread-safe

    maybeDeferred it's used when you don't know if the function returns a value or a deferred. 
    If it returns a value the value will be wrapped in a deferred.

    Twisted has been written because asyncore and asynchat were difficult to use. 

    Why people always say Twisted is an overkill? 

Introduction to pywinauto

pywinauto is a tool to do windows GUI automation. Seems cool. Maybe someone can write something like this for X11 or OSX :-)

    Marcel MacMahon, Irish guy in USA

    formerly written as a C DLL, then C++ and finally Python + pyrex + ctypes

    SendKeys, send mouse input and so what

    refactored in 2006

    from pywinauto.application import Application
    app = Application.Start("Notepad")
    app.Notepad.Edit # request the dialog and the edit control
    app.Notepad.Edit.TypeKeys("Hello World!")

    You can send shortcuts, type text, send WM_XXX messages, clicking with mouse

    # blame MFC for that AFX stuff, example for paint
    canvas = app.UntitledPaint.Afx100000008
    canvas.Click(coords=(100, 200))

    # alt F for file and X to exit
    app.Notepad.TypeKeys("%FX")

    Improving ideas:
        - improve automating localized apps
        - script recorder
        - allow scripts to be easily distributed
        - integration with test tools
        - refactor mercilessly

    http://sourceforge.net/projects/pywinauto
    http://pywinauto.pbwiki.com
    http://pywinauto.blogspot.com

The Django Web Framework

This was one of the coolest speeches. Simon Willison is a bit fast but his speech was really good.

Django doesn’t convince me yet. Its regexp based URL mapping and its ORM seem quite ugly but the tool as a whole rocks. The community rocks. Seems pretty good.

    Simon Willison http://simonwillison.net

    Web dev on journalism deadlines

    examples:
        - ljworld.com: kids game, leagues, parents sign for text messages for events
            - 360° photos of the places

    charateristics:
        - clean URLs
        - loosely coupled components
        - designer-friendly templates
        - less code
        - really fast development

    core components:
        - URL dispatching with regexp

        def index(request):
            s = "Hello, World"
            return HttpResponse(s)

        def index(request):
            name = request.GET['name']
            s = "Hi, " + escape(name)
            return HttpResponse(s)

        - models: orm, convenient but you gain more control if you need it

        class Poll(Model):
            question = CharField(maxlength=200)
            pub_date = DateTimeField()

        class Choice(Model):
            poll = ForeignKey(Poll)
            choice = CharField(maxlength=200)
            voites = IntegerField()

        - templates:
            - template filter takes value and apply some kind of transformation to them
            - conditionals {% if edibles %}
            - common headers and footers (include a-la-PHP is not the best choice)
                - template inheritance (like cheetah template):
                    - base template (base.html) with {% block %}
                    - the actual template override blocks needed
                    - when combined the not overriden parts are common troughout pages
                    - you can extend templates

        - loosely coupled
        - localization support written in two months
        - translated in 20 different languages (like ukraniane, welsh, japanese)
        - forms are boring but in django...:
            - manipulator API (validation rules)
        - admin package to do every kind of administration of the website (builtin)
            - drag & drop interface

        - generic views, data object serialization, syndication framework, middleware, authentication and authorization

        - success stories: ljworld.com, kusports.com, lawrence.com, chicagocrime.org, tabblo.com

        170+ sites, 90+ contributors, 1900+ mailing list readers, 900+ on the dev ml

    http://djangoproject.com

Index & Search: itools.catalog

Itaapy software has developed an indexing tool and currently maintains it for real because the use it internally.

    Mr. BELMAR-LETELIER, Luis

    - create a catalog in memory

    from itools.catalog.Catalog import Catalog
    catalog = Catalog(fields=[(), (), ...])

    - prepare some data to index

    - index a couple of pages

    - catalog.search() with boolean queries also

    - phrase  search with queries.Phrase class

    - queries.Range for ranges searches

        query = queries.Range('mtime', last_week, today)

    - Catalog.unindex.document(document.id)

    - queries.And, queries.Or

    - integrated with Zope

    - it can index incrementally
    
    - fast

Factory monitoring with Pylons, XML-RPC and SVG

The presenter was a kinda eccentric British aged man who’s using Python to monitors productions in a private company.

    Rob Collins, Agile Data Ltd, rob.collins@agiledata.co.uk

    example of factory monitoring:
        - bottling line
        - monitoring systems
        - pda monitoring

    evaluated frameworks: cherrypy -> turbogears (break thru upgrades) -> django -> pylons + myghty

    hardware monitor -> [XML-RPC] -> log files -> (manual editor)
                                     |
                                     |- log file reader
                                     |- simpy
                                     |
                                     |
                                     v
                                     pylons web server
                                     |- pda
                                     |- web browser

    evaluated graphics: jpegs, pngs (the clients wanted IE adv. features)
    they choose to install FFox 1.5 or Opera9 in the clients computers
    produced with svg inline in XHTML pages (doesn't work in IE)
        - disabled caching with meta tags
        -  is a group (automatically links contained parts, no image mapping)

Programming Avalon with IronPython

This talk was very nice. As a former .NET developer I saw a familiar environment with a total different approach.

    .NET FW (1.0, 1.1, 2.0, 3.0) -> CLR -> IronPython (or C#)

    WPF, WCF are inside .NET 3.0

    IronPython:
        - beta
        - bit unstable
        - pretty complete (the python implementation)
        - missing c-library (no datetime, no socket so no networking)
        - can consume .NET objects but not export classes to .NET

    import clr
    clr.AddReferenceByPartialName("PresentationFramework")
    from System.Windows import Application, Window

    app = Application()
    window = Window()

    window.Title = "Hello world"
    window.Height = 300
    window.Width = 300

    app.Run(window)

    Random mapping between DLL and namespaces in .NET
    MUST read the documentation to know where a function is located

    event handling:
        button.Click += on_say_hello

    XAML

    MS gui designer for XAML (Expression Interactive Designer CTP)

Distributed Source Code Management tools

They, at Itaapy, choosed Linus Torvalds’ Git/Cogito tool to do DSCM. I’m a satisfied Mercurial newbie user (written in Python) so I quite know what distributed tools brings you. I’ve migrated my whole SVN local repository to Mercurial, now I have to learn it better.

    Mr. BELMAR-LETELIER, Luis

    leaving CVS in 2002

    why choose DSC:
        - to work offline
        - don't need to do write access to everybody
        - each dev is responsible for his own tree
        - low infastructure cost -> no root access to set up a CVS repository,
            no +w on group, no umask funky config

    1 - 2002: arch/tla:
        - easy doc 100 pages
        - tools: tla, blah blah

    2 - 2004: objective achieved
        needs:  fine control of the business releases,
                easying simultaneous work of many devs
                precise state of each release

    arch/tla -> git/cogito

    git is made by 3 layer: fs manager, git (internal structure) and cogito (tools)

    gitweb, web interface

Source code management for a distributed team.

This talk was a nice conversation between two Canonical developers about DSCM tools and how they work with Launchpad and in Canonical.

    Steve Alexander & Robert Collins, Canonical Ltd.

    www.launchpad.net
    75k+ LOC Python
    20 devs
    many countries and timezones

    Bazaar bazaar-cvs.org:
        - launchpad
        - ubuntu projects

    branch based development, distributed merge

I missed the Unicode talk but I was talking with a couple of Google devs.

Bub-n-bros

Bub-n-bros is a Pygame videogame written by Armin Rigo. It’s a huge use case for pygame, networking, compression and broadcast videogaming. Really nice talk and funny also. Here its basic model:

    the server sends images to the client once with tcp
    the server sends a list of coordinates and indexes of the images list with udp (compressed)
    client send key presses to the server with tcp

I jumped the latest session of talks, I don’t exactly remember why.

The final part of the day was the massive, huge, fantastic, amazing talk by Mr. Alan Kay connected via VoIP from Los Angeles because he was sick and couldn’t flight to Geneva :-(

He went straight to our conscience and mind with a talk titled “Children First”. Why that? Because we, I agree completely, have to think about people use our stuff. Children are the future, that’s not demagogy, they really are the future. But what are we doing for them as developers? That’s what he tried to explain us about importance of education, learning tools, authoring and the one laptop per child project. I think I’ll remember this talk for the rest of my dev and not dev days.

    Alan Kay is connected to us through a VoIP program

    He was in Japan when he got sick.

    Shuttleworth started talking with Guido and Alan Kay.

    Help people in the 3rd world (and the 2nd too).

    1968 - Flex machine by Kay and Ed Cheadle. Studied not for computer professionals powered by LOGO (Seymour Papert)

    computing machine for children, more like a book than a PC. People don't really care about children, look at the educational system.

    Nicholas Negroponte: 100$ laptop. 6-8 millions laptop built next year

    How to buil that:
        1 - non profit organization who sells directly to government, -50%
        2 - -25% software, free sw
        3 - price of the display -> new kind of displays
        4 - harddisk costs -> flash memory

    India government is going to buy this PC

    100$ hw + free sw + authoring & UI + content & pedagogy + mentoring

    tech people should start think about people not gates and programming languages

    we aren't like frogs

    we are basically fools. the world is not as it seems... (betty edwards' table)

    eyes and brain are foolable

    "we see things not as they are, but as we are." - The Talmud

    scripting language inside squeak with traits (seems english)

    native support to stuff like kanji

    amazing animations system

    intuitive interface to manipulate the scripts

    ie. they learn the word for "changing speed" is "acceleration" with the program
        they learn about randomness and so what

    ie. sound synthesis is animation and they start playing with sound, frequency and so on

    ie. following a gradient: simulate organisms searching for food

    ie. text document manipulable with drag&drop

    real science with 11 year olds

    Galileo was a human being able to think like a child

    "to know the world, one must construct it" - Cesare Pavese

    ie. making a movie to learn the gravitational acceleration

    the children make a model to investigate acceleration rules

    everything is an object in the squeak environment

    they learn the basics of phisycs and maths (accel, decel)

    the kids need media authoring because they learn using stuff.

    This plugin should be done in Python. More Python devs than Squeakers

    Is a WYSIwiki. No edit mode. Everything done visually
    
    All in Squeak now

    ~ 2.8mega bytes of code
    ~ 50k methods
    ~ 57 bytes per method
    ~ LOC ~ 230k
    ~ 10 dev

UPDATE: GvR wrote a summary of the interview: Alan Kay’s EuroPython Keynote – Children First

This was a wonderful day. I think I’m gonna go to bed now, tomorrow I have a lot of tracks to follow and hopefully meet other people too.

Related posts

  • A bit of PyPy in the realm of Zope
  • PyPy Sprint Day 3
  • Reflector becoming better
  • Landed in Switzerland
  • Atom.NET and downloads
  • Gravatar

    has said,

    July 4, 2006 @ 4:58 pm

    > pywinauto is a tool to do windows GUI automation. Seems cool. Maybe someone can write something like this for X11 or OSX

    Dunno about X11, but GUI scripting via the System Events application is a standard feature on OS X. You just need to enable access for assistive devices in the Universal Access system preferences. For example, to paste the current clipboard into TextEdit:

    !/usr/bin/env pythonw

    from appscript import *

    se = app(’System Events’)

    app(’TextEdit’).activate() se.processes['TextEdit'].menu_bars[1].menus['Edit'].menu_items['Paste'].click()

    HTH

    Gravatar

    Lawrence said,

    July 4, 2006 @ 10:55 pm

    That seems kinda cool. Thanks for the hint!

    RSS feed for comments on this post