Праздничное.

День Австралии.

Оказывается, празничный салют, на который жители нашей деревни сбегаются потолкаться локтями к заливу, превосходно видно из окна моего кабинета на втором этаже. Точнее, было бы превосходно видно, если бы над всей округой не сидело облако, моросящее таким оченним дождиком. Облака этого, кстати, на радаре не видно.

В Сиднее жить с видом на салют подороже будет, однако.

Авторам Дилберта сегодня подвезли травы.

Могут же, когда захотят (или когда вставит?)

Еще одна причина, почему shelves в TFS лучше не пользоваться.

Я уже как-то писал, что “изобретатель” shelves в TFS – по всей видимости человек, одаренный особыми, неподвластными нам, простым смертным, качествам. По сути наличие в системе контроля версий “возможности” временно сохранить что-о  не в репозитории, а в каком-то странном четвертом измерении противоречит самой идее системы контроля версий. Какой такой идее, спросите Вы? Да очень простой – изменил код – коммить изменения. Если коммитить нельзя (кто сказал, что нельзя? Плюнь ему в рожу!), все равно коммить. Займи, но выпей, то есть, создай свой бранч, но коммить!

Отступления от этого правила, впрочем, обычно ни к чему плохому не приводят. Однако, вы видели хоть один программный проект, который протекал бы как обычно? Нюанс, как говорится в анекдоте.

Зарисовка с натуры – продукт ушел в печать, код заморожен. Релиз уже завтра (или позавчера), и тут тестеры находят баг. Или бажище. Или Баг Шредингера, который проявляется только в 50% случаев, если его искать специально. Как бы то ни было, баг есть. Исправить его – тоже “есть”. А вот теперь тот самый нюанс – коммитить изменения в основное дерево низзя!  Особенно если проект большой и тяжелый, решение о том, как и в каком виде подавать багфикс, может приниматься на самом верху – то ли хотфикс выпустить, то ли сервис-пак готовить, то ли забить и ждать новой версии. Пока политки играют в свои игры, программисты у себя в подвале решили изменения в shelve положить, дабы собрать-протестировать-провести code review. Сказано – сделано. А тут, не прошло и полгода, большие боссы постановили – сервис-паку быть!

Недолго думая, сделали бранч. И… обломались очень жестко. TFS позволяет делать unshelve’ код только в ту же ветку, откуда ему сделали shelve. И никак иначе. С SVN все проще, чем два байта переслать – svn copy, svn switch и следующий коммит будет уже в новую ветку. TFS же, к счастью, предлагает возможность сделать unshelve в другую ветку. Если установлены TFS power toys (как? У Вас еще не  установлены?), без которых в TFS 2005 даже банальнейшего tree difference нет, то можно из командной строки сделать tfpt unshelve /merge. К несчастью, это не всегда работает – в моем случае попытка завершалась маловразумительным сообщением вроде “Cannot determine workspace”.

Решать проблему пришлось дедовским методом – доставать beyond compare и тупо сравнивать каталоги на диске. Кстати, если кто рискнет повторить сей трюк – сделать зарание Check-out всего дерева в той ветке, куда собираемся коммитить – очень, очень хорошая идея.

A coolest gadget I ever heard of.

It seems ViewSonic wants to grab some of the pie already shared by Asus, Acer and MSI. They just announced a new netbook

I bet this computer will not leave any chances to competitiors in Russia. Its name “VieBook” sounds somewhat between “I will rock you book” and funny statement of intentions of sexual character.

Another example why global market can be a pain in the ass for marketologists.

New airport for Sydney in Somersby. Is it for real?

A few years ago we became proud owners of a book called “Sydney Region Outline Plan”. The book, printed in 1968 is nothing else but a large 111-page report about what Sydney and surroundings looked like back then and how they were expected to look today. Surprisingly enough, that was rather interesting reading.

In “Transport” chapter a few paragraphs were focused on that by 2000′ a second airport should be built in Sydney. No doubts it should have already happened. But it did not. I remember how amused I was when I learnt that the largest and busyiest air hub in southern hemisphere is closing for any flights every night. Well, to be honest, I could hardly imagine a modern city with the airport nearly in its center before!

Anyway, that book pointed a few options where second airport could have had been built. Of course, we already heard of options like “somewhere on West” or “in Richmond” but there was another interesting option – they were also talking about Wyong shire and even considered it as one of the prefferred options. Never happened though. Yet (?).

Well, this is all about a front cover of today’s “Central Coast Sun Weekly” – it says that the government is once again revisiting plans to build a new airport for Sydney and there  are “many feasible reasons” why it should be build in Somersby. Not far away from Wyong, but nothing new – they already shortlisted in in 1969 and there was a 500-people demonstration against it back in 1971 (see aph.gov.au).

I am not quite sure how feasible is it really – from my impression landscape here on Central Coast is anything but suitable for airports. I am not airport architect and I don’t know all the details – may be Somersby plateau is large enough for long runways required for A380, but that besides the point. Even the fact that some businesses have already backed the proposal (which is understandable) so as that it is not know yet how would it change the face of Central coast and affect the enfironment are not important yet. I rather curious about whether they decide or not finally? This discussion already seems to last for over 50 years.

Нед Келли. Автопортрет.

Случайно нашли сегодня.

Ned Kelly auto portrait, Wolombi

Вообще в провинциальном Новом Южном Уэльсе, похоже, очень, очень интересно.

Ну вот и мы прошли крещение

После почти трех лет в Австралии встретили хантсмена. У себя дома, разумеется.

Было весело.

Useful C++ template magic. Hiding nasty global static’s

In C++, often there is a need to provide and support single instance of certain class, accessible on demand from anywhere in the program. That is encyclopedic example given in many books promoting singleton pattern. For instance, if your program has a log file, it is strongly recommended that you make a class that encapsulates all logging and make it singleton. This approach, without any doubts, is much much better than making global static instance of the logger and then referring to it from whatever you need as it reduces number of cross-dependencies, an issue that stays among the most bad techniques making code less maintainable.

This is easy to understand – while there is nothing wrong in static variable, even in global static variable, we must ensure that it is initialized before it is used first, which is especially important if the object has to be created dynamically. And this is the problem Singleton pattern solves.

Take the example

// SomeSourceFile.h
#include "CoffeePlantation.h"
static CoffeePlantation g_Plantation;

// SomeSourceFile.cpp
#include "SomeSourceFile.h"
// Initialize the instance
g_Plantation = CoffeePlantation();

Note: coffee plantation…

Узнал страшное

У России есть своя сборная по крикету.

Я фшоке.

Буду оригинален!

Всех читателей, ЖЖ-друзей, rss-подписчиков и просто проходивших мимо, с Новым Годом!

До компутера дополз только сейчас, но Новый Год мы встретили с вот таким видом

New Year eve on Cahill Expressway

Вид с Cahill Expressway однозначно стоил того, чтобы выиграть билет и отстоять очередь!

12 visitors online now
12 guests, 0 members
Max visitors today: 13 at 11:14 am MST
This month: 13 at 02-02-2012 08:06 am MST
This year: 29 at 01-23-2012 02:50 am MST
All time: 45 at 02-23-2011 09:11 am MST