EuroBasket 2009 — Day 9

Day 9 was the last day of the Qualifying Round.

Once again, I didn’t get to see the match as it was too early. And maybe that’s just as well… Lithuania didn’t manage to shine on the last day. They are leaving the tournament with yet another defeat, this time 10 points against Serbia (79–89). Yes, lots of key players were missing from this group, but it doesn’t explain everything: Lithuania was literally not at the level. The coach already announced he was quitting his position.

Poland did not manage to surprise Spain in the second match. Spain won quite easily, 90–68. Spain will meet France in the quarter finals, a match Vincent Collet is not looking forward to…

Finally, a brilliant match between Turkey and Slovenia. Slovenia have being in the leas for most of the game, but Turkey proved to be a very tough opponent, threatening to break through at key moments. Once again Ilyasova has been amazing, Lakovic and Nachbar also. Turkey missed a last basket in the finishing seconds, leaving them 2 steps behind Slovenia, 67–69 – their first defeat of the tournament. This match confirms all the good things I think of this Slovenian team, but showed also some weaknesses that could have proved fatal had Turkey capitalised on them. Turkey was slightly under their usual tempo, but still very very strong.

Next, then, the Quarter Finals!! All actually very interesting, against old rivals.

Russia–Serbia
France–Spain
Turkey–Greece
Slovenia–Croatia

Great menu. Let’s hope France will remain undefeated till the end of the tournament… Though that Spain match will be quite hard.

Subversion: Commit Pre-Hook to Enforce a Code Freeze

It is almost all done for you in this script. Copy this script in /path/to/svn/<repos>/hooks, call it pre-commit, change the permissions to make it executable. Then, all you have to do is add the following below the if there is bogosity comment in test_path_change:

### Test the path change as you see fit.  If there is bogosity,
### write to sys.stderr and return non-zero.
if "trunk/" in path.lower():
  sys.stderr.write("Code Freeze: Nothing can be committed to trunk anymore.")
  return 1
return 0

Simple (if you don’t have any file/directory containing the word “trunk/” somewhere…). It is interesting to note the "blah" in string python notation which I have just discovered—quite handy.

^{1} You’ll then have a bit smarter, like checking the presence of the word branches, etc.

EuroBasket 2009 — Day 8

Yet another crazy day in EuroBasket. 3 matches with a very close score.

In the first game, Russia and Macedonia fought hard, but in the end, the title holders prevailed: this means Macedonia is going home, but they have achieved quite a brilliant tournament. Not much to say about this game, as I didn’t see it… Russia won 71–69.

On the second match of the day, France remain unbeaten thanks to a buzzer beater scored by de Colo. The whole game was nerve wracking, but once again France gave this impression of always being in control, despite being led by 9 points. The finale was quite amazing, and for once Collet left Tony Parker on the bench for the last quarter, a golden occasion for the players like de Colo, Bokolo to gain confidence — and to see what the team would behave like, should TP be unavalaible for some reason. Also a good way of proving that the Parker-dependency is not that strong! The final score was also 71–69.

Finally, despite a brave effort and a fantastic Jagla, Germany could do nothing against their worst opponent of the night: themselves… Was it inexperience or lack of concentration, just as the German team looked about to take hold of the game, they conceded silly turnovers: 20 turnovers in the whole game! Really frustrating when, in the end, it was just a 2 point matter: 68–70. So Croatia are through, Germany are out, but they really have themselves to blame for losing this last game.

deutschland.png

EuroBasket 2009 — Day 7

The match of the day is without contest Serbia–Turkey: it has been a fantastic match, quite aggressive in defence. Serbia managed to overcome a -7 deficit in the 4th quarter to get the draw (64–64) at the end of official time, despite a basket on the buzzer for Turkey that was subsequently refused by the referees; the extra time was as crazy, and Turkey finally won thanks to 5–0 in extra-time. Ilyasova has been imperial, rebounding (11) and scoring amazing 3 pointers (4/6). Arlsan has once again been key to this victory. Turkey remains undefeated, just like France, and by the look of last night match, they have the strength and the patience to go a long way. This Serbian team looks also very good, despite being very inexperienced.

Earlier in the day, Spain sent Lithuania back home. Lithuania eliminated in the Qualifying Round. It also means Lithuania need a wildcard to go to Turkey 2010… Nobody would have put their money on this before the start of the competition, but after their defeat against Spain yesterday (84–70), this is the reality: Lithuania did not make it through the Qualifying Round.

Poland were also beaten by Slovenia (76&ndash60) despite a heroic first half, but they just could not withstand the level of game, and gave away an awful lot of silly turnovers. Lorbek and Lakovic have had a good day behind the 3-point line and there was not much Gortat et al. could do to contain Slovenia. Polan now must win against Spain if they want to remain in the competition (and potentially send Spain back home too?).

polska2.png

EuroBasket 2009 — Day 6

There is not much Germany could do against a well-organised Macedonian team: 26–14 in the 3rd quarter, and a series of turnovers killed Germany’s hopes of getting out of this game victorious. The final score was 86–75.

The game between Russia and Greece was quite good, and despite Russia being in the lead most of the game, Greece was still at striking distance. The zone defence proved to be tough to the Greek team though, and Russia won this crucial game, 68–65.

polska.png

France remains undefeated, despite being led all first half in their match against Croatia. Croatia managed a very good first half, with a lead up to 9 points. But once again France came out of the locker room decided to turn the situation around, and that’s exactly what they did in qtr 3, with a brilliant Tony Parker, and good few 3 pointers. Croatia lost patience and panicked, and finally let the game slip away, despite coming back to -4 in the last minute. The game ended 79–87.

EuroBasket 2009 — Day 5

23 points. 6/22 (27,3%). These are yesterday’s figures. Lithuania have lost against Slovenia, and they’ve lost big. Never really dangerous, atrocious in 3 pts, taking bad decisions against a strong Slovenian defence, Lithuania collapsed and are now fearing for the rest of the competition. It is hard to think that maybe Turkey 2010 could be without Lithuania… On the other hand, Slovenia look like they have the team to go far: Lakovic and Lorbek have made an amazing match and have hurt the Lithuanian team very badly. The game finishes 58–81.

Earlier in the day, Turkey had confirmed their current strength by beating Spain 63–60. The 4th quarter started close (49–48), but was a festival of turnovers, shots a bit too short and silly fouls (Gasol), peaking with an absurdly lousy defence where Arslan (1.90m) concluded a lay-up after getting rid of 4 Spanish defenders (esp. Pau Gasol, 2.14m and Reyes, 2.04m).

In the last match of the day, despite showing a brave face and coming back at very close range in qtr 4, the Polish team didn’t manage to surprise the Serbian team, and lost the game 72–77. They are now in a very perilous situation along with Lithuania at the bottom of Group F, and that’s even before receiving Slovenia.

Matches to watch next: Macedonia–Germany. No mistake allowed for Germany; Croatia–France; Spain–Lithuania, Lithuania cannot afford to lose; Serbia–Turkey.

Two Spoonfuls of Sugar

I was asked the other day to compare 2 queue managers in different environments (say, for the sake of argument, “test” and “pre-prod”) and to create the queues missing from “pre-prod”, and to delete the ones missing from “test”. I started going through the queue managers to list the missing and extra queues manually, and then I realised that there were many more queues to be updated than expected, so it had to scripted.

This is a classic “compare two lists” exercise, and I thought my new-found Ruby knowledge might come in handy.

Listing the queues for a given queue manager is nothing complicated:

$ echo "display qlocal(*)" | runmqsc queue.manager.test | grep QUEUE > tst.txt
$ echo "display qlocal(*)" | runmqsc queue.manager.pre | grep QUEUE > pre.txt

Finding the queues to be created and deleted is basically a subtraction between the 2 sets. And that’s where using Ruby makes things ridiculously easy:

tst = []
pre = []
IO.readlines("tst.txt").each{ |queue| tst << queue.to_s.chomp }
IO.readlines("pre.txt").each{ |queue| pre << queue.to_s.chomp }
puts "Queues to be created"
puts tst-pre
puts ""
puts "Queues to be deleted"
puts pre-tst

And you might wonder: why not do it all in Ruby? Ok. So if you like it full of syntactic sugar, the whole thing could be packed into a single script, and that would give something like:

tst = `echo "display qlocal(*)" | runmqsc queue.manager.test | grep QUEUE`.split(/\
/)
pre = `echo "display qlocal(*)" | runmqsc queue.manager.pre | grep QUEUE`.split(/\
/)
puts "Queues to be created"
(tst-pre).each{ |elt| puts elt.gsub(/\\s*QUEUE\\(([^\\)]+)\\)/, ’DEFINE QLOCAL(\\1)’) }
puts ""
puts "Queues to be deleted"
(pre-tst).each{ |elt| puts elt.gsub(/\\s*QUEUE\\(([^\\)]+)\\)/, ’DELETE QLOCAL(\\1)’) }

Deadly. Don’t forget to brush your teeth.

EuroBasket 2009 — Day 4

Day 4 was the first day of the Qualifying Round.

France made the show last against Macedonia, who at no time had any hope of getting even close. Tony Parker, Boris Diaw et al. did the points in quite a spectacular manner, leaving the FYROM players helpless. The game ends with the French bench, and a severe 83–57. France is therefore already qualified for the quarter finals, and look like they are getting stronger and more organised.

Earlier, Germany didn’t manage to shake the strong Greek team. The match ends 76–84. Russia had more troubles to get rid of Croatia who, despite a slow start, managed to stay well in the game, and contend with the title holders. The game was tie until the last minute (55–55), but the Russians stayed strong to pull the final victory: 62–59.

Tell Rails not to Use Plural in Table Names

The tables I am working with do not have an “s” at the end of their end. This link explains how to tell Rails that your tables should not be pluralized, rather than using set_table_name in every single model classes:

  1. In config/environment.rb, add the following:

    ActiveRecord::Base.pluralize_table_names = false
    


    You may have to add require ’activerecord’ at the top of the file.

  2. For exceptions, you can obviously still use set_table_name:

    class Post < ActiveRecord::Base
      set_table_name "posts" 
    end
    

In my quest for singularization, I also came across this link which deals with plurals, albeit in a different context.