Learn to Program with Minecraft on Ubuntu

I've recently bought my 10-year-old daughter the book "Learn to Program with Minecraft". It seems to be a great book to start learning programming in Python, especially for kids who love playing with Minecraft.

Unfortunately there's a number of software packages to install, and the instructions are only available for Windows PCs, Apple Macs and the Raspberry Pi (which comes with everything pre-installed), and as my tri-boot iMac boots into Ubuntu Linux by default, I wanted to set them up on this OS.

Fortunately I found this excellent guide written by David G. Johnson, which explains step-to-step how to get started on Ubuntu. The bad news is, the instructions didn't work straight away for me, because the versions of the packages involved have moved on since he wrote that blog post, so I've spent a few extra hours to get it sorted.

I'll try to write down a summary of the instructions here, and then I will explain why as of today one can't simply follow David's guide as is.

# Install Java 8, Python 3 and friends
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install python3
sudo apt-get install idle3
sudo apt-get install python3-pip
sudo apt-get install git

# Compile the Spigot server, please note --rev 1.8.8
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
git config --global --unset core.autocrlf
java -jar BuildTools.jar --rev 1.8.8

# Configure the Spigot server in a few "simple" steps:
# 1) Start it, it will crash because you haven't accepted the EULA license:
java -Xms512M -Xmx1024M -jar ./spigot-1.8.8.jar
# 2) Edit file "eula.txt" just created in the current directory and replace "eula=false" with "eula=true"
# 3) Start again Spigot with the same command shown in 1), this time it will work. Type in "stop" at the prompt to make it exit again. This step is required to create the "server.properties" file and the "plugins" directories, which will be needed later on.
# 4) Edit the file "server.properties" to change "gamemode=0" to "gamemode=1", and "force-gamemode=false" to "force-gamemode=true" (this is to start in Creative Mode rather than Survival Mode, or your child will soon get upset).

# Download and install the Python Minecraft API
wget https://github.com/py3minepi/py3minepi/archive/master.zip
unzip master.zip && rm master.zip
sudo pip3 install ./py3minepi-master

# Download Raspberry Juice and put it in the "plugins"  folder of the Spigot server
wget http://dev.bukkit.org/media/files/875/204/raspberryjuice-1.7.jar
mv raspberryjuice-1.7.jar plugins

# Download Minecraft and make sure you have a paid-for account you can play with, for instance in Single-Player mode
wget https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar
java -jar Minecraft.jar

# Now you should be ready to go, without any automation script you would have to do the following every time:
# 1) Start the Spigot server and leave it running (one of the last few lines scrolling on the screen should mention Raspberry Juice):
# java -Xms512M -Xmx1024M -jar ./spigot-1.8.8.jar
# 2) From another terminal, start Minecraft:
# java -jar Minecraft.jar
# 3) In the Minecraft Launcher (the first screen you get when you start the program) select "Edit Profile" and then from the "Use version" drop-down menu select "release 1.8.8".
# 4) In Minecraft select "Multi-Player", then add a server, name it "Minecraft Python World", select host name "localhost", press "Done" and then click the play icon to join it.
# 5) Free the mouse pointer from Minecraft by pressing "Esc", then from a third terminal start IDLE, the Python Shell & Text Editor:
# idle3 &
# 6) Copy these commands in the IDLE Python Shell and verify that you don't get any error and your player gets teleported to the coordinates specified:

from mcpi.minecraft import Minecraft
mc = Minecraft.create()
mc.player.setTilePos(0, 120, 0)

# If everything works fine, you may want to create a script for your child to start Spigot, Minecraft and IDLE. This is a sample script:

#!/bin/bash -e
idle3 &
xterm -e 'java -Xms512M -Xmx1024M -jar ./spigot-1.8.8.jar' &
xterm -e 'java -jar Minecraft.jar' &

Unfortunately double-clicking the script didn't start it as expected, so I created a desktop icon named Minecraft.desktop with the following content:

[Desktop Entry]
Exec=bash -c '/absolute/path/to/previous/script.sh;$SHELL'

Ok, now as promised a brief explanation of what I've had to change compared to David G. Johnson's instructions.

If you build Spigot today, by default you get version 1.9; at the time of writing, there's no Raspberry Juice available for this server, the latest version being "Raspberry Juice 1.7 for Spigot / CraftBukkit 1.8.1".
As such, when building Spigot using my instructions, you have to override the default with option "--rev 1.8.8"; and when starting Minecraft you have to specify in the drop-down menu of the Minecraft Launcher that you want to use the same version, "release 1.8.8".
Apart from this, his instructions worked beautifully, so you may want to follow his guide. Thanks David!

About my daughter and the book, we've just started and I still don't know if she will get a grasp of Python anytime soon; but the whole kit costs around 35 GBP (half of which for the book and the other half for the Minecraft license), so it's not much; or maybe just the price of the book if you already have a PC/Mac/Linux license and/or own already or plan to buy a Raspberry Pi, which as I said comes with everything pre-installed.


Back to the Sixties

Nuntio Vobis Gaudium Magnum! For the first time in several (10? 12?) years, my weight expressed in Kilograms starts again with a 6, rather than 7 or 8, as I lost about 20 Kg during last year.

In fact, I was around 89 Kilograms this time last year, and the scale showed me 69.9 this morning (for those people - Britons I presume - not familiar with the International System, I went down approximately from 14 to 11 stones):

Interestingly, I lost most of the weight during the first 4 months, and then I struggled for 8 months to get past the "support" and be able to "see the six" like in the old days (I seem to remember that I was 68 Kg when I was in high school).

With Easter celebrations approaching, it's very likely that I'll be back in the seventies soon, but for me it's a great result nonetheless!


Advice needed for the purchase of a thin client

In a month's time I will have an extra room added to my house, and I will gain my study-room back (I had a pretty large one whilst living in Italy, i.e. until 2010). As such, I will have enough space to accommodate again a desktop computer permanently standing on my desk (while for the last 5 years I've had to keep my laptop on my, err... lap).

Actually I do already have a pretty powerful nano-server I built myself with spare parts, but as it didn't have enough space for it I had to keep it beneath the telly and used that as a 1080p monitor when available (i.e. when nobody else in the house was watching TV!).

The plan now is to keep the server where it's been for the last few years (also because that way it can benefit of a wired Gigabit Ethernet connection) and buy a thin client to keep on my desk, which will then stay connected to the server through a VNC session (this apparently weird setting is what most people are used to do every day at work anyway).

I'm now undecided between these two machines:

  • HP Slate 21: A giant battery-less Android tablet. The 21" screen is HD and touch-screen. The processor inside that is an NVIDIA Tegra 4, so I could also have sentimental reasons to opt for this one.
  • LG Chromebase: The desktop version of a Google Chromebook. The 21.5" display is HD but not touch-screen. The processor is unfortunately an Intel Celeron but while this name doesn't make my heart beat faster I have to admit that any Intel processor of the last 10 years would be more than capable of keeping a VNC session alive.

The two devices sell for comparable prices, come with keyboard and mouse and in the colour I want (yes, as you guessed being white is a requirement). So the choice mostly goes down to Android vs. ChromeOS, which is a tough one as these days the two OSes can do mostly the same things.

Every suggestion will gladly be accepted.


Are British workers really working harder than Italian ones?

Another stereotype I heard from average Joe is that British workers have to work many more hours a week to keep their salaries to a good standard and the GDP of Britain high, whereas workers in the PIGS deserve a lower income and possibly a sovereign default because they spend most of their time in siestas or sipping coffees whilst watching sports on telly.
Again, fact checking depicts a completely different situation. These are the official statistics from OECD, with the "average annual hours actually worked per worker" in 2012 reporting these numbers for some European countries:
  • Greece: 2034
  • Italy: 1752
  • Portugal: 1691
  • Spain: 1686
  • United Kingdom: 1654

Wow... Not just one, but all the PIGS work more than Britons! Thus the reason they deserve a sovereign default must be something else (and might have something to do with their politicians perhaps).


Are British taxpayers really pumping money to Italy?

After witnessing the umpteenth complaint about all the money British taxpayers have to pump to Southern European PIGS countries (yes Alan, I'm thinking of you!), I eventually decided to have a look at the EU budget myself.
The results are quite interesting, and despite the EU website having pulled off the best report they had (warning: broken link) Wikipedia is still quite clear on the matter.
Basically the complainants are right when they claim that the United Kingdom is a net contributor: in 2009 they put in the pot 3.8M Euros more than they received. But they are wrong when they think that they are pumping money to countries like Italy, as Italy is the third largest net contributor with a wider loss of 6M Euros (with Germany and France in first and second position, with 8.7M and 6.4M Euros respectively).
My conclusion is that before blaming the foreigner, or the different, or the ugly, or someone with a funny accent, or simply someone with a better weather, you'd rather get better informed.


Letter to Google

Dear Google,

I used to be a 100% Google user: Gmail, Talk, Reader, Maps, Blogger, Apps, Drive etc (even Wave and Buzz, I think we were 13 in the world using them).
I liked all the products, and I felt having one big (non-evil?) company taking care of all your needs was probably a good thing (especially if all these tools were free, with non-intrusive ads and a clear privacy policy - apart from PRISM of course).
But now, day after day, you are forcing me to leave and use alternative products (oops sorry, sometimes I forget that *I am* the product!).

We all know Reader has gone: and the reason I'm upset with this is that none of the alternatives is (for my needs) comparable to it. I am now using Feedly, it's *almost* as good as Reader but on some of my devices it runs noticeably slower that the good old Reader (here I am not referring to The Good Old Reader app!).

Then Finance: it's good on the desktop browser but the app was almost s**t when it appeared on the Android Market (it wasn't a Play Store yet). Like many other products, it will improve, I thought. Has it improved? Nope. It's still the old s**t app but I end up using it anyway because there are not many alternatives around.

Third and final example, and I get really pissed off about this: Google Talk. I loved it. Simple, fast, reliable, threads were archived on Gmail, it was a great tool. But one day I "upgraded" to Hangouts; please note that in doing that, you should know that there is no "downgrade" path if you don't like it, it'll just replace Talk and if you uninstall it there is not the old app waiting for you on the Play Store any more. I clearly didn't think about it.
Well, Hangouts has at least two problems. The first, well known to most, is that there is no user status available from your contacts. Not a problem for you maybe, but for me... well, I would chat wife or sister only if they were online, otherwise I would use a text or ring or simply wait.
Second problem: the GUI. It's certainly my fault, as one of my devices is 3 years old and has a screen that does not fit the entire interface. Result: I could use Talk on that phone, now Hangouts is completely unusable and there is no easy way to get Talk back. I might switch to eBuddy or http://imo.im soon.

Dear Google, if your Big Plan was to bring more users to Google+, you should have had it better integrated with Reader and the other tools, not kill them or screw them up.


      A User


Multicore Challenge and David May

I've recently visited the UWE for the first time to attend the Multicore Challenge 2012.

From left to right: Jonathan Mitchener (TSB), Said Azmoodeh (Imagination Technologies), Mike Bartley (TVS), Simon McIntosh (Bristol University), Jim Cownie (Intel), David May (XMOS).
Amongst other things, which can all be found on the official TVS webpage containing the slides, I've found extremely funny the description that Professor David May has given of the law that goes under his own name:

Software efficiency halves every 18 months, compensating Moore's Law.

which could be also written:

The amount of memory used by software doubles every 18 months, compensating Moore's Law.

This law was conceived for the software world, but now (given that the topic of the conference were multicore chips, and for May "multicore is not a challenge any more, but an opportunity") he's also provided an interesting corollary for the hardware world:

The number of cores used by software doubles every 18 months, compensating Moore's Law.

To find it funny you must be an engineer. Personally I find both the versions extremely amusing (because they are true...).

Another interesting thing that he said is that all the patents related to the Inmos Transputer expired last year - so it would be possible for instance to create an open-source clone and publish it on something like www.opentransputer.org.... Not that I could be personally interested in doing this: the Transputer had a Stack Machine Instruction Set, something that I can't say I appreciate that much (especially in AD 2012...).


Nuclear plants around Bristol

Some days ago my sister told me that I shouldn't be happy to have four nuclear plants in my area.

I have just checked, as usual on Wikipedia, and apparently this is exactly what this map says:

Then I followed the links to the four nuclear power stations and I found that:
  • Berkeley has been decommissioned between 1989 and 2001
  • Oldbury has one reactor that will be closed in June 2011 and another one in 2012
  • Hinkley Point A has been decommissioned in year 2000
  • Hinkley Point B should be closed in year 2016

So the only long-term harm could come from Hinkley Point B, if it will not be closed in 2016; or from a new "Hinkley Point C" if this will be actually built.

Anyway I have also checked the air distance between Hinkley Point and my current house and it's more than 30 miles, a distance which is usually be considered quite safe... especially in countries which do not experience strong Earthquakes.


Missing SATA connectors...

Everybody who knows me, also knows that I am extremely lucky.
Today I was going to assemble a Micro ATX computer to be used at home, since the old one (the Soltek Qbic) died some months ago and I had to use only the notebook (using which I miss my 10K rpm WD Raptor).
The mobo was an ASRock P4i65G, but during the assembly at a certain point I had to stop because I was unable to connect the SATA cable... because the connectors are missing!

As you can see there are just some straight pins on the PCB board and it is impossible to connect a SATA cable on them:

Obviously if you check the official picture from the ASRock website the connectors should be there! This picture (rotated and with the red circle added by me) is taken from the official page of the mobo:

 So I'm going to ask for a replacement from Amazon, and keep fingers crossed.


Comparison Table for Relocation from Italy

I recently had to evaluate pros and cons about moving from Italy to another country, and I ended up compiling the following table:

Obviously the table is very subjective, so I have to explain some items and cite some sources.
European Union and the Euro Currency are quite obvious.
The Metric System is used in Europe, but even if both Ireland and the UK switched to this system, it seems that you can live in Ireland using it only, but that in the UK and Canada the Imperial Units are still in widespread use. Furthermore, in the States you will have to learn the Customary System...
This is a map of the world with RHD (Right-Hand Drive) countries and LHD (Left-Hand Drive) contries in different colors:
About quakes, I've been talking about seismic risk in a previous post; now I just want to make clear that I'm marking the States as "dangerous" since the only State I could relocate to is California, that is known to be waiting for the Big One.
About queens and kings someone could argue that they are way better than some prime minister, but I decided to include this row anyway...
About guns and rifles freely available at the grocery shops (Tesco or Wal-Mart or your preferred ones) it's easy to understand that I do not agree (at all) with this degree of freedom.
And finally, I listed the countries officially taking part in the invasion of Iraq in 2003 (as you can see, officially Spain has been present for some months and Canada is absent).
This post has no conclusion: I could only note that the countries with the best non-weighted scores are France and Ireland.