Lior Gradstein’s Blog

Archive for January, 2009

How to teach chess to a 3 year old kid? That’s a good question. I wanted to teach Ido chess for a long time, but each time I tried, he lost focus after 2 minutes, even just for teaching him just rook movements.
I decided I needed to plan it a little more, make it much more fun, and “embed” it in mini-games. It seems to work much better now, but that’s maybe because he matured a lot.

Here are some ideas (some not yet implemented):

  • Using a DIY plastified chess board, allows me to show/play different positions really fast, anywhere.
  • Colorize squares where a piece is allowed to go :

    Array

  • Pawn race games (no en-passant rule yet).
  • Really small games (must not go over 5 minutes) with reduced chess set (for example Queen and 3 pawns vs Knight, bishop and 3 pawns).
  • Checkmate in one, using DiagTransfer program to draw series of chess diagrams. This program works only on Windows, but it works fine with Wine.

    Array

    For quick single diagrams, I found wbeditor, an online javascript diagram generator.

There’s a thread (french) about experience from different teachers, giving really good advices.
Most notably, Véronique Houck who has 15 years of experience of teaching chess to kindergarten/maternelle children. She wrote two books (in french). One is named Bibou & le monde des échecs, and the other one Le jeu d’échecs au cycle2. It’s not so easy to find, but using Google, you can find shows many links.

I’ve not yet read them. I’ll make a review when I get them.

  • 1 Comment
  • Filed under: chess, kid
  • Mediawiki allows one to send Recent Changes (RC) to a UDP port.
    The ip address is defined by the variable wgRC2UDPAddress, and the port by the variable wgRC2UDPPort. It’s a really good idea that it’s a UDP transfer, since there is no need for any ACK, so Mediawiki doesn’t block if there is nothing listening on that port.

    These parameters must be set in the LocalSettings.php file, like this, for example.

    $wgRC2UDPAddress = ‘127.0.0.1′;
    $wgRC2UDPPort = 9390;

    I wrote a really simple python program (more a proof of concept) that receives the data, cleans it, and then prints it to stdout :

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    #
    # vim:syntax=python:sw=4:ts=4:expandtab
    import SocketServer
    import re

    HOST,PORT = , 9390

    class MyUDPHandler(SocketServer.BaseRequestHandler):
       def handle(self):
           print re.sub(r\x03\d{0,2}’, , self.request[0])

    if __name__ == ‘__main__’:
       server = SocketServer.UDPServer((HOST, PORT), MyUDPHandler)
       server.serve_forever()

    I plan to make it into a complete project that will send the data/notifications using Jabber(XMPP).

  • 0 Comments
  • Filed under: mediawiki, python
  • You installed Mediawiki some time ago, and now something bothers you: aren’t you tired of having an intermediate page named “Login successful” saying “You are now logged in to” before being allowed to go to the page you wanted to go? I am.
    I found there’s a hook that is called just when a user successfully logs on (UserLoginComplete), and even an extension named RedirectOnLogin that does the redirection for you, BUT to a fixed one. It seems the hook doesn’t give you the page you previously were before the login request.

    So to correct this, I just found a dirty hack. That means you’ll have to patch the source, meaning also that you’ll loose some flexibility when upgrading Mediawiki :-(
    Anyway, if you still want to do this, here is the magic stuff:

    Edit the file mediawiki/includes/specials/SpecialUserlogin.php and look for the function successfulLogin().
    At the end of it, just add (it’s just one line):

    header(‘Location: ./index.php?title=’ . $this->mReturnTo);

    That’s it. You’ll get redirected to the previously accessed page automatically! Really cool.

    This has been successfully used on a Mediawiki 1.13.

  • 0 Comments
  • Filed under: mediawiki, software
  • Photos of Ido and Oren

    2009-11-22 14.53.56.jpg2009-11-22 14.53.40.jpg2009-11-22 14.33.25.jpg2009-11-22 14.33.14.jpg2009-11-22 14.30.32.jpg2009-11-22 14.28.49.jpg2009-11-22 14.05.22.jpg2009-11-22 14.05.12.jpg2009-11-22 14.05.07.jpg

    Search engine optimization by SEO Design Solutions