My son uses Jython!

Yesterday my son came home from school and told me that he has to learn programming with Python. “We downloaded an app where learning is easy – you can start out of the box”, he said. That made me curious and I asked him to show what he had done so far.

They downloaded TigerJython (http://jython.tobiaskohn.ch/index.html), which uses Jython 2.7.0 under the hood. The exercises he made were steering a turtle to draw lines. Pretty cool for beginners!

I offered him to help if he should be stuck. He had 2 questions:

  • can I define a function with more than one argument?
  • can I share functions between two .py files?

So we wrote the first module to import from. This worked well, and you got here a somewhat proud father that helped build something his son can use today…

 

 

Advertisements

Attention with starting vncserver on Ubuntu

At work I have an Ubuntu machine which is always up and running. Therefore I want to connect to it from everywhere. The idea is to have some sort of remote desktop / desktop sharing tool.

NoMachine stopped working for me a couple of years ago. And I admit I never tried the newest version since then.

xrdp does work, but I never got the keyboard mapping right.

Today I tried vncserver, and wondered why the installation description(s) let you create a separate user. Now I know:
I called vncserver with my regular account. Besides not being able to connect from the remote client, I was not able to login to the Ubuntu desktop natively any more! After a long despair time, and with the help of my colleagues (Ctrl-Alt-F1 for console login…), I found the root cause in the logs: My ~/.Xauthority file was owned by root, and my regular user had no rights to change it during login.
My advice to you is: create a separate user if you really feel you should try out vncserver.

So finally I gave X2Go a go, and this worked! The Windows client often crashes when you manage your sessions, but once all is set up it works as desired.

Please be aware: Your remote mileage may vary …

Concat two git repositories in fast-import format

Today I spent a few hours wrapping my head around the documentation of git fast-import, especially the part of restarting an incremental import from the current branch value. The documentation says it should be written as:

from refs/heads/branch^0

or, since the current branch usually is master, as

from refs/heads/master^0

There is also a short answer on nabble. But I could not find an example of how to really edit the input file.

The solution is simple:
Edit the first commit of the second input file without adding a new blank line (the file is named ‘research-git-dump.dat’ in my case).

Before:

commit refs/heads/master
mark :1000000000
committer Bubba Gump <bubba.gump@shrimps.com> 1206025332 +0000
data 6
my commit comment

M 100644 :2430 MyProject/myfile1
M 100644 :2439 MyProject/myfile2
:

After:

commit refs/heads/master
mark :1000000000
committer Bubba Gump <bubba.gump@shrimps.com> 1206025332 +0000
data 6
my commit comment
from refs/heads/master^0
M 100644 :2430 MyProject/myfile1
M 100644 :2439 MyProject/myfile2
:

Doing this, the second import went like a charm.
I was able to concat two git repositories created by cvs2git:

$ git init --bare merged.git
$ cd merged.git/
$ cat ../custom-git-blob.dat ../custom-git-dump.dat | git fast-import
$ cat ../research-git-blob.dat ../research-git-dump.dat | git fast-import
$ gitk

… and gitk was happy!

Agile Architecture

The last 3 days I had the pleasure of attending an Architecture Workshop hold by Stefan Toth (@st_toth). We were designing and building a Lego Mindstorm ball path in 3 iterations.

AgileArchitecture

He challenged us with difficult requirements, time restrictions, risk based priorities and much more. The team had great fun and learned a lot about the daily architecture work on the way.

Thanks, Stefan!

P.S.
You can read more about Stefan here (in German)

Dear Reader,

to be honest, I only have a vague idea why I should and what I could write here.
Sometimes my thoughts move away to a special event, idea or finding from the last day(s). Maybe there is a value in writing it down?