Виртуальная песочница (тм)

Thursday, December 30, 2010

VAT Changes

The following changes are taking place with service prices. Starting on the 1st of January 2011 new government regulations in Latvia, Poland, United Kingdom, Portugal, Slovakia and Switzerland will change the rate of value added tax (VAT).

From 1st of January:
* VAT in Latvia will be 22% (currently it is 21%);
* VAT in Poland will be 23% (currently it is 22%);
* VAT in United Kingdom will be 20% (currently it is 17.5%);
* VAT in Portugal will be 23% (currently it is 21%);
* VAT in Slovakia will be 20% (currently it is 19%);
* VAT in Switzerland will be 8% (currently it is 7.6%). Read more...

Tuesday, October 26, 2010

Exec format error

Иногда shell скрипты берут выходной и отказываются работать, не смотря на то, что получили все права, в том числе и на исполнение (+x):

# chmod 777 test.sh
# ./test.sh
./test.sh: Exec format error

В этом случае нужно проверить, начинается ли скрипт сакраментальным
#!/bin/sh

Иногда это необязательно.
Спасибо Брайену О'Нейлу. :) Read more...

Thursday, September 30, 2010

MySQL: DATETIME vs TIMESTAMP

Знающие люди советуют использовать DATETIME.

Однако практически сразу, после того, как начинаем следовать их совету и использовать DATETIME, напарываемся на довольно неприятный MySQL bug - "Datetime field does not accept default NOW()". Разработчики отговариваются тем, что это не баг, а фича, и что это описано в документации.

С TIMESTAMP таких проблем не возникает:


create table LOG (
TIME timestamp primary key default current_timestamp,
MESSAGE varchar(200) not null
);
Read more...

Installing Vertrigo on Windows 7



1. Change the port in "C:\Program Files (x86)\VertrigoServ\Apache\conf\httpd.conf"
2. Run Vertrigo as Administrator.
Read more...

Wednesday, September 22, 2010

Why you shouldn't offshore your software development


public class Contact {
/// <summary>
/// Gets or sets the name of the first.
/// </summary>
/// <value>The name of the first.</value>
public string FirstName {
get { return _firstName; }
set { _firstName = value; }
}
}

Read more...

Wednesday, September 15, 2010

Russian Linux




Read more...

Thursday, August 26, 2010

Out of Office Assistant Messages

1: I am currently out at a job interview and will reply to you if I fail to get the position. Be prepared for my mood.
(Меня нет в офисе так как я прохожу собеседование о приеме на работу и отвечу вам, если меня не возьмут. Будьте готовы к моему настроению.)

2: I'm not really out of the office. I'm just ignoring you.
(Я не то чтобы не на работе. Я вас просто игнорирую.)

3: You are receiving this automatic notification because I am out of the office. If I was in, chances are you wouldn't have received anything at all.
(Вы получили это автоматическое уведомление, потому что меня нет на работе.
Если бы я был на работе, то вы бы вообще ничего бы не получили)

4: I will be unable to delete all the unread, worthless emails you send me until I return from vacation on 4/18. Please be patient and your mail will be deleted in the order it was received.
(Я не могу удалить все непрочитанные, бесполезные имейлы, которые вы мне отправляете, до тех пор пока не вернусь из отпуска 18 апреля. Пожалуйста, будьте терпеливы, и ваши сообщения будут удалены в том же порядке, в каком они были получены)

5: The e-mail server is unable to verify your server connection and is unable to deliver this message. Please restart your computer and try sending again.'
(Сервер не в состоянии определить соединение вашего сервера и не может доставить это сообщение. Пожалуйста, перегрузите ваш компьютер и попробуйте выслать сообщение еще раз.)
:)) Самое прикольное - это то, что когда вы вернетесь, вы насладитесь количеством тех идиотов, которые проделали это на самом деле)

6: Please reply to this e-mail so I will know that you got this message. I am on holiday. Your e-mail has been deleted.
(Пожалуйста, ответьте на данное сообщение, чтобы я знал, что вы его получили. Я в отпуске. Ваше сообщение было удалено)

7: Hi. I'm thinking about what you've just sent me. Please wait by your PC for my response.
(Привет. Я обдумываю то, что вы только что мне прислали. Пожалуйста, не отходите от своего компьютера в ожидании моего ответа)

8: Hi! I'm busy negotiating the salary for my new job. Don't bother to leave me any messages.
(Привет! Я занят на переговорах по поводу зарплаты на моей новой работе. Не утруждайте себя оставлением мне сообщений)

9: I've run away to join a different circus.
(Я сбежал для того, чтобы присоединиться к другому цирку)

10. I am on holiday, enjoying the sun rise, drinking light liquor, sitting at the ocean beach and watching nice young girls in extremely short swimming suits. Your e-mail has been successfully deleted, simply because it is useless. You deserve work, I deserved fun.
(Я в отпуске, наслаждаюсь восходом солнца, пью легкие ликеры, сижу на берегу океана и наблюдаю за симпатичными, молодыми девушками в крайне маленьких купальниках. Ваше сообщение было успешно удалено, просто потому что оно бесполезно. Вы заслуживаете работы. Я заслужил кайф.)

13: I will be out of the office for the next 2 weeks for medical reasons.
When I return, please refer to me as 'Loretta' instead of 'Steve'.
(Я буду отсутствовать на работе следующие 2 недели по причинам медицинского характера. Когда я вернусь, пожалуйста, обращайтесь ко мне "Лоретта" вместо
"Стив") Read more...

Wednesday, August 4, 2010







Увидел картину художника-абстракциониста - "Пингвин, поедающий яблоко, смотрит в окно." Я говорю художнику: "чертика забыли". А он глаза закатил: "Как вы меня задолбали! И с чего вы взяли что тут чертик должен быть?!"

Read more...

Tuesday, July 6, 2010

.NET vs Delphi: the "as" operator


public object Execute(object request) {
if (request is Request)
return service.Execute(request as Request);
else
throw new NotImplementedException();
}


CA1800 : Microsoft.Performance : 'request', a parameter, is cast to type 'Request' multiple times in method 'Wrapper.Execute(object)'. Cache the result of the 'as' operator or direct cast in order to eliminate the redundant isint instruction.<br />

Microsoft хочет, чтобы было так:


public object Execute(object request)
{
var r = request as Request;
if (r!=null)
return service.Execute(r);
else
throw new NotImplementedException();
}


потому что, как оказывается, "the "as" operator never throws an exception. Instead, if the indicated conversion is not possible, the resulting value is null." Read more...

Saturday, July 3, 2010

Javatar .Not

YouTube - Javatar .Not


See also "RailsEnvy.com: All Ruby on Rails Commercials"

Update 9-JuL-2010. С YouTube видео уже убрали: "This video is no longer available due to a copyright claim by Alley Music Corp." Однако по запросу "javatar .not" Google находит "about 44,200 results" in "0.35 seconds". Например, на New JavaZone2010.

Объяcнение шутки про Scala Johanson: http://www.scala-lang.org/ Read more...

Wednesday, June 16, 2010

How to create executable jar in NetBeans IDE

Why use a Eclipse if you can use a well-suited, fast and optimized out-of-the-box-IDE?
Вот и у меня тоже такие вопросы очень часто возникают... Действительно, why? И почему Eclipse всё ещё настолько широко используется для Java проектов?..

Easy as pie: (Netbeans 5.5)
right-click your project, "set main project", select your project,
"File", "PROJECTNAME Properties", "Run",
set your main class,
"Libraries", "Add JAR/Folder", select your wanted libs,
do a CLEAN build,
enter the build-path, enter /dist and be amazed --> DONE!

No Modifications/Hacks/buggy DiY-IDE´s, no cry

Вся фишка в том, чтобы сделать clean build - тогда оно само всё создаёт, и каталог, и архив. Read more...

Simulated Annealing (Алгоритм имитации отжига)

"Example. Given 100 workers and 500 jobs, find which workers should do what jobs to minimize the distance driven by all 100 workers. The location of jobs and starting location of all workers will have available their longitude and latitude, and a simple equation exists to calculate distance between longitude and latitude. Other constraints include skills, varying length of jobs, return to starting point with 8 hours, and several others. The Simulated Annealing technique (алгоритм имитации отжига) is a common way to solve this type of problem."

"На форуме, имхо, давно используется алгоритм имитации отжига. Постится хрень и идет расчет на то что - а вдруг она сойдет за отжиг? Мда. Было давно и всегда." :)

См. также

Read more...

Thursday, May 27, 2010

Oracle Magazine asked me:
"Which of the following publications do you read regularly, that is, at least 3 out of every 4 issues published?"

  • CIO

  • ComputerWorld

  • DM Review (Nov-2008)

  • Database Trends and Applications

  • Dr. Dobb's Journal

  • InfoWorld

  • JavaPro (2004-2005)

  • Java Developer's Journal

  • Java World

  • Linux Journal

  • Oracle Scene (UK Oracle User Group)

  • Profit

  • Select (IOUG) - Independent Oracle Users Group

  • XML Journal

  • Quest Q&A (Quest International online magazine) (Jan-2010, other archives, last issue; see also this and this)

  • Read more...

    Monday, April 26, 2010

    Threesome Chess

    Read more...

    Thursday, April 1, 2010

    Tuesday, March 30, 2010

    The world has changed. I feel it in the air...

    Цена транзакции Windows NT Server 4.0 указана в долларах.
    Цена транзакции Windows Server 2003 указана в юанях.
    Причём не где-нибудь, а на сайте Microsoft. Read more...

    Monday, March 8, 2010

    How to learn how much memory my video card has?

    You don't need to download anything, assuming you're running any version of Windows. All you have to do is click on the start button, then click Run. After the little box shows up, just type "dxdiag" (without the quotation marks) and press Enter. How much VRAM your video card has on board will be listed under the Video tab.

    Read more...

    Saturday, January 9, 2010

    "We are what we repeatedly do. Excellence, then, is not an act, but a habit." Read more...