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.

Comment

 
---

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.

Comment

 
---

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…1). 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.

Comment

 
---

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?).

Comment

 
---

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.

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.

Comment

 
---

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.

Comment

 
---

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(/\n/)
pre = `echo "display qlocal(*)" | runmqsc queue.manager.pre | grep QUEUE`.split(/\n/)
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.

Comment

 
---

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.

Comment

 
---

Typophile Film Festival 5 Opening Title Sequence

Good stuff. Awesome.

http://typophile.com/node/61864

Comment

 
---

EuroBasket 2009 — Day 3

I didn’t get to see the match, as it was too early, but France did it: they won against Russia! 64–69. They have been led almost the whole match, but they have always been in the game. Diaw has done a very good game, along with Parker (again) and Turiaf. Very good victory which puts them at the top of the new group E, along with Greece which destroyed Israel 106–80. Croatia in the meantime beat Macedonia 81–71; Macedonia will be the next opponent of the French team.

Next on the schedule was Slovenia–Spain which I had pointed out as a match to keep an eye out for. And it didn’t fail to entertain! Although Slovenia was led by 15 points at the end of qtr 3, they managed a crazy come back (especially thanks to Dragić, who managed 2 unbelievable steals) and in the 4th quarter came back to -5 with 32s to go… Quick fouls and a shaky Spanish team allowed Lorbek to score the equalizer on the buzzer, 78–78, finishing the amazing turnaround to drag Spain into extra-time. Unfortunately, the price paid was a bit too high (too many fouls), and Spain just walked through the extra-time to win 90–84. At the same time, Turkey confirmed their supremacy over Group D and won against the Polish home team, 69–87.

Germany–Latvia was to be tense, as the 2 teams were contending for the 3rd place, synonym of qualification for the next round. And tense it was1! Latvia have been in the lead most of the game, and needed 8pts to go through. And with 22s to go, they had them (57–68) until Jagla scored a 3 pointer, followed by 2 free-throws. The game finished 62–68, and Latvia was out. They can have regrets, as they only scored a 19/38 on free-throws…

Finally, Lithuania needed a win to go through, and they got one. But how painful it was… Bulgaria seemed to be in good shape, but after a series of missed 3 pointers in the second half, and under the pressure of a bossy Lavrinovic, they just collapsed and lost the 4th quarter 27–13. Lithuania won 84–69, which is rather severe, considering they have been led for most of the game. Great Britain lost 59–77 to Serbia.

This Day 3 was the last of the Preliminary Round, and Israel, Bulgaria, Latvia and Great Britain are now out, and the other teams are now in 2 groups for the Qualifying round:

  • Group E: Greece, France, Croatia, Germany, Russia, Macedonia
  • Group F: Turkey, Slovenia, Serbia, Spain, Poland, Lithuania

The points gathered so far are kept (except the ones gathered against eliminated teams, if I understood correctly, because it’s hard to find a proper description of the competition system), and the last 2 teams of both group will go home.

Matches to watch on Friday and Saturday: Russia–Croatia, France–Macedonia, Turkey–Spain, Lithuania–Slovenia.

1 It appears that Kambala (“better than Rocky” indeed) elbowed Hamann in the face after the match, and the latter had to be brought to the dentist for a broken tooth. Kambala will more than likely face a lengthy ban.

Comment

 
---

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.

Comment

 
---

Installing Rubygem on Cygwin

  1. Download the rubygem tgz from RubyForge,
  2. Type the following commands:
$ cd /tmp
$ tar xvzf rubygems-1.3.5.tgz
$ cd rubygems-1.3.5
$ ruby setup.rb install
$ gem update --system

If you’re behind a proxy, you can run gem by setting the following environment variables:

export HTTP_PROXY=http://x.x.x.x:80
export HTTP_PROXY_USER=bozo
export HTTP_PROXY_PASS=pipo

Comment

 
---

EuroBasket 2009 — Day 2

Crazy, crazy day. Absolutely crazy.

It started with a major upset: Germany beating Russia. I told you to keep an eye out for this match yesterday because Germany did look dangerous – and they did not disappoint. At the same time, Macedonia was beating Israel 79-82 in what became Macedonia’s first win ever in the EuroBasket; Israel is now out of the competition with 2 defeats.

Then, Lithuania was beaten for the second day in a row by an amazing Polish team which showed that they really meant business. And in the end, business means +11 for the home team, putting Lithuania in a dangerous position: they must win tomorrow’s match against Bulgaria if they want to go through. Slovenia disposed of Serbia easily enough, never really threatened. The final result is 80–69, and Slovenia secured the top spot of Group C.

France probably thought it would be an easy task against Latvia, but it was far far from easy. Extremely perturbed by the zone defence of the Latvian team, the French started very slowly, but turned ahead at the end of qtr1. The second quarter was tough, with the first point scored after nearly 5 min for Latvia, who finished the quarter on a stunning 13–3. Fouls were raining on the French players, and the prospect of the second half was uncertain. But like yesterday, the French visibly upped their defence agressivity in the 3rd quarter, and the points started to come, notably from 3 pointers by Diaw and De Colo, and the unstoppable Tony Parker, who made a real show in the second half. He was absolutely everywhere: jump shots, penetrating and provoking fouls, free throws. It is hard to deny that France won mostly thanks to him. Latvia collapsed in the 4th quarter, and France finally won 51–60, and is now qualified for the next round. Meanwhile, Greece won against Croatia, 76–68 and is now assured to get the top spot in Group A.

Finally, it could have been an incredible upset: despite losing 84–76 to Spain, Great Britain have made a fantastic match, and only lost on silly turnovers, missed free throws, and lack of experience. Their 3-point scoring was quite impressive, and GB were leading +4 with 5 min to go against the World Champion. They were some very worried looks in the staff and on the pitch, whereas the GB fans were absolutely thrilled. Good stuff. It is however extremely very worrying for Spain who came very close to elimination tonight. In the meantime, Turkey carried out their good tournament with a 66–94 destruction of Bulgaria. Turkey will finish first of Group D.

Match to look out for tomorrow:

  • Macedonia–Croatia: game for the second spot in Group A
  • Russia–France: the clash in Group B. France have a lot to prove, and Russia will not want to lose a second day in a row. I don’t see France winning if they play like today, though.
  • Spain–Slovenia: Spain really have to wake up; and Slovenia will want to prove they are the leaders of this group C. I predict a major bollocking in the changing room for the Spaniards, and a visible recovery on the pitch. It should be good.
  • Lithuania–Bulgaria: I cannot possibly imagine Lithuania losing this one, but given the matches so far, you never know…

Comment

 
---

Find a Class in Jars (II)

This one is a follow-up to this post, finding a class in jars under a certain folder. But this time, it is obviously in Ruby:

require 'java'

def scanDir(className, dirname='C:') begin Dir.foreach(dirname) do |filename| next if (filename == "." or filename == "..") if File.directory?(filename) scanDir className, filename elsif File.fnmatch("**.jar", filename) scanJar(className, File.join(dirname, filename)) end end rescue SystemCallError $stderr.print "IO failed: " + $! end end
def scanJar(className, jarfile) entries = java.util.jar.JarFile.new(jarfile).entries entries.each do |entry| if entry.getName().to_s.index(className) != nil puts "#{jarfile}: #{entry}\n" end end end
if ARGV.size == 2 scanDir ARGV[0], ARGV[1] else puts "Usage: jruby search_jar.rb <class_name> <directory>" end

You then call it as follows:

jruby search_jar.rb MyNiceStub C:\application_server\lib

Edit: Ideally, something like Rake’s FileList would make finding the jar in subfolders a trivial task…

Comment

 
---

JRuby and Java Iterators

Java Iterators in JRuby behave exactly as you’d expect them to… It’s always a pleasant surprise.

require 'java'
# Iterator
list = java.util.ArrayList.new
list.add("one")
list.add("two")
list.add("three")
list.each{ |item| puts item.upcase }
# Enumeration
jar = java.util.jar.JarFile.new("jruby.jar")
jar.entries.each{ |entry| puts entry.to_s }
C:\>jruby -v
jruby 1.3.1 (ruby 1.8.6p287) (2009-06-15 2fd6c3d) (Java HotSpot(TM) Client VM 1.
5.0_15) [x86-java]

Comment

 
---

← Older Newer →