Dmitry님의 프로필Dmitry-Bond사진블로그리스트기타 도구 도움말

블로그


    10월 28일

    Photos discoloration (fading) - experiment finalization

    I just made some finalization for this experiment - have added a comparison with a new photo printout after 1 year is passed.
    So, we can see how discoloration progressing during the year and now we also can see how it affects the "master" photo used as a "master photo" in this test.
    (note: by "master" here I mean - the photo stored in album and used to compare with a fading copy of a photo)
     
    Accodring to the recommendations I have recently got on this topic - for the photos which are expected to be stored on open air I should use another photopaper - HP Premium Photo Paper or HP Premium Photo Paper Plus. These 2 has essentially better resistance to fading... at least HP claims that (there is a scale on a photopaper box with a "fading resistance" parameter). So, I have started a new experiment with HP Premium Photo Paper, let us look if things are better here...
    10월 27일

    Strange "New Rules" in Europe Embassies

    I was badly surprised by strange "new rules" in the Europe Embassies. :-(
     
    According to the old rules - I need to make:
    • first visit to city: 1 call to arrange interview + 1 visit to bank to pay fee + 1 visit embassy to submit documents + interview;
    • second visit to city: 1 visit embassy to take passport with visa.
    So, in total - all could be done by 2 visits to city - first item could be done by one travel around city, and the last item could be done by another travel to city 10 days later after the first.
    But now they hired VFS company to handle embassy participants and seems things getting essentially worser... :-(((
     
    Now I have to run around the city and find the only one possible bank to pay a service fee to obtain a special code to be able to arrange an interview.
    In the US embassy I can pay online - just over the phone using VISA or MasterCard. But here it is not the case - here I have to find that "Prominvest Bank", so - the only one possible variant to pay the service fee, and there are no options to pay online and no options to pay in any other bank. Of course that is very bad!
    As for me, seems for everybody aslo, it looks very stupid to link such payment to a sinlge bank with quite bad presentation in Ukraine.
    Another thing - after you paid service fee you cannot immediately call and arrange an interview - you have yo wait 1 day until they process payment...
     
    So, they have added non-flexible/non-convenient/non-avoidable item to the process. Thus, I have to lost more time on this. :-(
     
    Also strange thing - according to girls in a call canter "such rules are working in all Europe embassies". Hard to belive that Europe people can invent such strange thing. Perhaps that could be some "games" of UA guys...
     
    Update: just called VFS to arrange an interview. Girl on phone can only arrange an interview and nothing also. Funny... I thought they can answer some basic questions about forms and documents to submit for visa. :-\
     
    What I can suggest to make things good:
    • minimum - supports service fee payments through any bank;
    • maximum - supports online payments - over the phone (like in US embassy) or over the internet.
     
    10월 23일

    DB2 embedded SQL - data loading performance tests

    Keeping in mind some experience with mainframe databases and looking on big ammount of code gemerated by DB2 SQL precompiler I decided to test data loading performance.
     
    So, test case was - 4 embedded SQL cursors defined in C/C++ application. Data table with 60.000 data rows (data copied from production, so test data looks quite realistic, not like generated PART1, PART2, ... PARTN).
    Then application loading all data rows and store them in std::vector. Thus, test case is quite simple. And the difference between mentioned 4 cursors is:
    • cursor 1 - load 4 fields only;
    • cursor 2 - load all fields from table (20 fields);
    • cursor 3 - load all fields from table (20 fields) + have ORDER BY key field;
    • cursor 4 - load all fields from table (20 fields) + have ORDER BY non-key/non-idexed field.
    Here are some summary on test results:
    • test case for cursor # 1 =   958.853 mcs {ok} - less fields in select
    • test case for cursor # 2 = 2.189.540 mcs {ok} - more fields in select
    • test case for cursor # 3 = 2.323.017 mcs {ok} - more fields in select + ORDER BY by key
    • test case for cursor # 4 = 4.931.463 mcs {ok} - more fields in select + ORDER BY by non-key
    mcs is "microseconds". So, time-per-record is about 15-40 mcs. Taking into account that test was running on VM that is quite good performance. Looking on code generated by DB2 SQL precompiler I expected essentially worser results; good to know that I mistaken in such my expectations.
     
    Conclusions:
    • more fields in select decrease performance 50-70% but as time-per-record is still quite small then we can disregard it;
    • sorting resultset by key fields - almost no difference in performance;
    • sorting resultset by non-key/non-idexed fields - make things 2-3 time slower;
    • trimming spaces in all fields before storing values in a vector almost not affects the performance.
    Notes:
    • These results obtained on IBM DB2 8.2.x;
    • First data loading takes about 9-11 seconds, so before DB2 cached table it could takes essentially more time;
      thus if data is static (master data, translation tables and so on) - it is ok not to cache because DB2 do the data caching;
      but if there is some dynamic data... need to make extra testing on this. 
     

    ICQ spam - обманули... Ж)))

    Пришел спам по ICQ:

    Удовольствие которое ты никогда еще не получал. Девушки готовые говорить с тобой на любые темы. Виртуальный секс по ICQ и не только. Отправь xxx на номер xxxx и в твет получишь 5 случайных номеров ICQ, желающих прямо сейчас секса.

    Я бы проигнорировал, но выражение "на любые темы" что-то задело. Вот и спросил:

    а можно мне не секса, а обсудить особенности пострения моделей документов для клиентских приложений обработки сложно структурированных данных?

    А там робот на ответах 
     

    Отвечать не нужно :) не теряй времени, спеши воспользоватся сервисом ;)

    Вранье это все! Не будут они на "любые темы" общаться - только сиски/письки...  :-P

    10월 22일

    Принтеры от Hewelet-Packard - почувствуйте себя в жо...!

    Рекламный слоган в заголовке очень хорошо отражает текущую ситуацию с принтерами от HP - установить драйвер к принтеру это нерешаемая проблема!
    Последние несколько версий скачанные с hp.com имеют такую странную процедуру установки что удивляешься - КАКОЙ ИДИОТ ЭТО ПРОГРАММИРОВАЛ?!
     
    Сразу уточню: похоже что проблемы с установкой драйверов есть только под Windows Vista. Под Windows XP проблем не замечено. Позор HP! Windows XP уже давно не продаеться, уже Windows 7 вышла, а они все еще не в состоянии исправить свои пакованы с драйверами для Vista! И это при том что каждые 3-4 месяца оно собирают и выкладывают новый пакован. Видимо обратная связь у них уже давно не работает...
     
    А суть вот в чем - в процессе установки оно просит включить принтер и подождать, принтер оно находит и предлагает продолжить и тут-то начинаеться самое интересное - оно расчитывает на то, что Windows сама распознает устройство и поставит к нему драйвера. Но(!) Windows при этом спрашивает - "а где же драйвер?!"... А драйвер как раз в том пакете что как раз сейчас устанавливаеться! Ж-) И получаеться что установкщик ждет Windows, а Windows ждет установщик - т.е. замкнутый круг. В HP наверное полные дибилы пакованы с драйверами создают... :-\
     
    Т.е. установщик "от-HP" чего-то напрядженно ждет, при чем ждет долго и "самозабвенно" - а чего ждет непонятно. Ни логов, ни сообщений, ни поясненй к процессу ожидания нет. И каждая такая итерация ожидания занимает около 10 минут! И при этом каждая итерация "съедает" 450Mb на диске, т.е. - 10 итераций и места на диске уже почти нет!
     
    Что еще интесно - web site компании Hewelet-Packard ВООБЩЕ НИЧЕГО НЕ ЗНАЕТ о той модели принтера которую я купил! Офигеть! Т.е. произвели "выкидыш", продали и забыли, а может никогда и не знали. Т.е. принтер 100% HP, а именно - HP Photosmart D7163, но HP такую модель "не признают". :-\
    При этом я однажды уже писал им в support о этом - им пофиг, радостно ответили "спасибо, ваш запрос очень важен для нас", и тишина - за пол-года ничего не изменилось - как не признавали они эту модель так и не признают.
     
    Выскажу предположение что "офисные паразиты" (язык не поворачиваеться назвать это "планктоном", от планктона в природе польза есть и немалая, а тут - с пользой напряженка - слошное паразитирование) в HP сильно размножились - пора наверное отлов/отстрел производить.
     
    А вот нашлось же - РЕШЕНИЕ! ОФИГЕТЬ! Я и не ожидал что сработает! Ж-)))
    Есть такая програмка - DriverMax - позволяет проиндексировать все драйвера установленные в системе + сделать backup + проверить наличие обновлений. При этом оно ведет свою собственную базу обновлений - видимо собирает со всех компов где он установлен и создает summary по драйверам, чтобы все клиенты могли видеть какая версия драйвера распосленяя для определенных устройств. Честно говоря я опасался ставить последние версии драйверов - а вдруг оно не для vista?! или "левак" какой-то. Но тут уж была безвыходная ситуация - пришлось запустить DriverMax и просканировать систему на unknown hardware, а потом проверить, а что он предложит на online drivers update - и в списке был один элемент который выглядел подходяще - USB Printing Support 10.1.1.3, при том что в составе Windows Vista версия этого драйвера 6.x - я решил риснуть - поставил 10ю версию... И ОНО ЗАРАБОТАЛО! Перестало виснуть при печати фотографий, все остальное тоже отлично печатаеться. Возможно помогло также и то что компьютер перезагрузился в момент когда установщик от-HP чего-то там ждал - т.е. и HP-шные файлы остались в системе и USB print driver от MS обновился.
     
    Но правда установщик от-HP после перезагружки сразуже сказал что у вас тут все неправильно установленно и нужно все удалить и по новой все устанавливать, но я просто пристрелил тот процесс - чтобы он глупостей не наделал.
     
    Попробую пофантазировать на тему - а
    А чего бы я холтел от HP:
    1) хорошо тестировать установочные пакеты драйверов чтобы они работали!
    Поставлять в Microsoft базу обновленных драйверов для всех своих устройств - чтобы сама Windows могла все это найти.
    Чтобы была альтернатива:
    а) или полный пакет установки с разным "програмным мусором" от HP;
    б) или только пакет с драйверами и минимальным набором;
    в) или только маленький файлк с драйверами без дибильных и сложно-навороченных установщиков - т.е. только *.INF + *.DLL.
     
    2) чтобы эти с@%#ки ОБУЗДАЛИ СВОЮ НЕПОМЕРНУЮ ЖАДНОСТЬ и продавали свои чернила на разлив вместе с заправками.
    Или же делали картриджи большей емкости - особенно цветные. А то эти гады слишком уж привыкли жить "не посредствам" - ломить 20$ за 4мл чернил которых хватит максимум на 10-15 фоток - ЭТО УЖЕ СЛИШКОМ!!! :-(
    Чтобы двигались путем унификации расходников, а не плодили типы картриджей для каждой можели принтера, так, что потом их фиг найдешь где купить! :-\
     
    Уточнение:
    Похоже я рано обрадовался - под Windows Vista оно все же глючит. На печати больших фоток оно стабильно виснет. А под Windows XP стабильно работает.
    И что интересно - если загружаюсь на том же компьютере в WindowsXP (со второго HDD) то все отлично печатается - и большие фотки без проблем печатает и все работает. А на том же железе под Vista - фиг! Фотки не печатает. :-(((
    Хорошо хотя бы документы из под висты печатает без зависаний... :-\
     
    Посколько в основном работаю я под Windows Vista, а печатать фотки иногда таки нужно, при чем печатать не отрываясь надолго от работы. То в итоге я поставил драйвера для этого принтера на laptop с Windows XP - похоже что из под XP оно отлично работает - не виснет, позволяет отправлять на принтер здоровенные фотки (~5000x4000pixels) - ну т.е. все что неработает под Vista под XP живет без проблем. Печатать c laptop все же быстрее чем перезагружать комп в XP со старого HDD, а потом обратно грузиться в висту.
     
    10월 20일

    Creating/deleting domains from Microsoft - the complete shit! :-(

    That crap (I meant - Windows Server 2003) deleted all users from system and left only Administrator and Guest. :-(
    What idiot in Microsoft did approved to implement it?!?!?!
     
    So, create domain and delete domain will reset system to some initial state - no users, no groups. All services relay on that just fail.
    I think it must save some part of the system state and rollback to the state it had before creating the domain... at least that is the thing very nice to have.
     
    Crap!... I have to reinstall lot of software because of that. :-(
    IBM DB2 was completely destroyed by that action - services cannot start, uninstall does not work and so on - full set of "nice features" :-\
    Fortunately, after 2 install/uninstall actions (with some hijacks tricks) DB2 seems starts to working fine. So, system is restored and working.
    10월 16일

    Processes synchronization from command line (part 3)

    Part 3 - Queue of Processes to Start.
     
    The idea is to prepare queue of processes to start and left it for automatic running within specified time intervals. In my case - I can select which builds to run and left it - system will start automatically all builds I selected to run.
     
    So, let us begins with the queue file. Here is example:
     
      ;! LastRunTime:2009-10-16-18:04:00; TimeDelta:10
      BEX 
      BIM Mks;Clients;NtServers
      BTS
      ORD Mks;MksLabels;Clients;NtServers;Tandem
     
    The idea behing queue file is to keep number of identifiers pointing to the processes I want to start. Also it has some parameters - "LastRunTime" and "TimeDelpta" - when it did start last command and time difference (in munites) between the commands. Line prefixed with ";" interpreted as a comment, the "!" in a command interpreted as a line with parameters. The only parameters it supports are - "LastRunTime" and "TimeDelta".
     
    And then there could be following code (for *.BAT/*.CMD files or for system scheduler or cron):
     
      SyncUtil ProcessQueue builds.q %ComSpec% /k build_main.bat
     
    You can run this command every 1 min, 3 min or 5 min - does not matter - just run it using the system scheduler or cron.
    Every run of "SyncUtil ProcessQueue" will take the "LastRunTime" parameter value from specified queue file, compare it with the current time and see if specified number of minutes (TimeDelta) passed after the last run. If yes, it will remove the top item from the queue and start specified command with parameters specified in first (removed) line.
     
    For example: if curren time is 18:04, October 16, 2009 and the mentioned command configured to be running by cron every 5 minutes and we use mentioned queue file (see queue file example above) then we will have following commands executed:
     
      at 18:14 it will start the %ComSpec% /k build_main.bat BEX 
      at 18:24 it will start the %ComSpec% /k build_main.bat BIM Mks;Clients;NtServers
      at 18:34 it will start the %ComSpec% /k build_main.bat BTS 
      at 18:44 it will start the %ComSpec% /k build_main.bat ORD Mks;MksLabels;Clients;NtServers;Tandem
     
    And before every command run the top item removed from the queue.
     
    Note: it is not related to the idea I'm describing but just for information - identifiers "BEX", "BIM", "ORD" here are the BuildID - the name of specific component to build. Extra parameters like "Mks;Clients;..." are optional and defining the set of build steps to be performed - if need to synchronize sandbox of source files, if need to build client components and so on.
     
    Thus, using this approach we can organize list of processes to run (perhaps also we can use the synonym - "list of jobs to execute"). In my case it is important when building all (or number) of product components because every build consume lot of system resources and if all builds will start at the same time system can fail. So, better to start processes one by one within specified time intervals. In other words - this is a kind of "load balancing" for the system.
     
    Some more details for this part:
    • queue file is locked only when it is trying to open it, so most of the time you can modify it;
    • on opening queue file SyncUtil use the exclusive access, so other applications cannot modify it;
    • you can easily add new lines to the end of queue file to make more processes started in some time;
    • also you can modify "LastRunTime" and "TimeDelta" parameters in a queue file;

    Интальянцы - кросавчеги! Ж)

    Интальяский контингент НАТО заплатил Талибам "за спокойствие" на своем участке- http://korrespondent.net/world/1000910.

    Молодцы ребята! Нафига воевать?! Бизнес - вот это дело! :)))

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

    10월 14일

    Processes synchronization from command line (part 2)

    Part 2 - Accesing the single resource.
     
    Sometimes system need to organize a queue to access specific resource. It could be environment on a mainframe computer or some specific hardware - anything that cannot handle multiple connections at a time or if multiple connections can lead to some problems. The SyncUtil also can help with it - it supports the resource access queue - special entity controling who use specific resource at the moment and put all others to a queue for waiting.
    See the picture:

    In my case resources that need a synchronized access are - the Tandem NonStop environment, HP-UX environment, Linux environment. So all these environments located on remote or local servers and they cannot be accessed by multiple clients at the same time because of some specific limitations (single logon, conflicts at initialization scripts - whatever). Other examples of synchronized access I have seen at sites are - 3rd part hardware boxes doing some specific things.

    So, in terms of code examples it looks like following (for *.BAT/*.CMD file):

      set QFile=c:\AccessQueues\tandem-xx63.q
      SyncUtil WaitAndLock %QFile% %BuildID% 50 20
      set ExitCode=%errorlevel%
      if "%ExitCode%" neq "0" (
        echo Cannot lock environment for build!
        goto end
        )

    As you can see SyncUtil has the "WaitAndLock" function which wait until resource is free and try to allocate it for usage. The %BuildID% parameter is the unique identifier describing the client which is trying to access the resource. So, every client trying to use the resource should have own unique identifier in %BuildID%.

    Another important parameter - the %QFile% it should be a full path to the queue file used to access specific resource. In my case I have a number of such files:

    Other parameters in this code example - 50 and 20 are - the client priority and the waiting poll time. Thus, different clients can have different priority, 00 is highest priority, 99 is lowest. And waiting poll time is an interval in seconds between attempts to got access to the resource. In my case it has no sense to make attempts frequently than once per 20 seconds. In my system I have following queue files:

    • D:\queues\tandem-xx63.q  - all processes trying to access the $XX63 environment on Tandem use this queue file;
    • D:\queues\hpux.q  - all processes trying to access the HPUX environment use this queue file;
    • also a number of *.Q files at - D:\R????\build\bin\build.q  - but these ones used for other kind of synchronization I'll describe in a next part.

    Thus, the rule is following - the one resource = the one queue file.

    And finally, after specific script finished to use the resource it should execute following code (for *.BAT/*.CMD file):

      SyncUtil UnLock %QFile% %BuildID% 20

    to report that resource is released and can be used by other clients.

    As you can see this approach is quite simple - not too much script code is used to implement and also the good thing - SyncUtil source code is also very simple - 900 lines of code in Borland Delphi 5 for all with command line parsing and help and diagnostic messages printing. The simplicity usually is the good thing.

    Some Technical Details on Implementation

    The queue file content looks like following:

    ; Queue file.
    ; (pri), (timestamp), (WaiterID), (WaiterPID), (WaiterParentPID) [, optional data ]
    50,20090714-145858.734,VSH,0000086C,00000370
    50,20090714-150311.110,ORD,000007F1,00001103
    50,20090714-150334.345,MDC,00000459,000001F3

    Lines started with ";" (semicolon) are comments. All other lines are records inserted by clients waiting for access to specified resource. In a single line data fields delimited by commas, and fields meanings are - priority of this clients wait request, timestamp when this record appears in a queue file, the client id (it is the %BuildID% value from code example above), the client PID, and PID of parent process for the client reqested access to the resource.

    Note: PIDs here used to validate if process reqested access to the resource is still alive or not. If SyncUtil find that specified process is no longer exists this record removed from the queue file and if resource was locked by this client it is released so other clients can start to use the resource.

    Another interesting part here is the queue file concept. The idea behind - SyncUtil always opening queue file in exclusive access mode, so only a single instance of SyncUtil can use the queue file at the moment. The exclusive file access here is something similar to the transactions in a database - it is a guarantee that file changes will be consistent, have no conflicts, data overlaps and so on. But please note that to make a deadlock it is enogh to open a queue file for view (or edit) in any text viewer/editor holding files opened (for example - open file for view in FAR)! Thus, to keep system running normally please avoid opening queue files for viewing for a long time because it could freez the access to resource. 

    See also: Part 1 (http://dmitry-bond.spaces.live.com/blog/cns!D4095215C101CECE!765.entry)
    See also: Part 3 (http://dmitry-bond.spaces.live.com/blog/cns!D4095215C101CECE!784.entry)

     

    10월 12일

    Processes synchronization from command line (part 1)

    The utility and approaches described below could be helpful in different automation scriptings. In my case this is used in the build procedure, but it could be anything also - systems integration processes and so on.
     
    Part 1 - Wait while processes finished.
     
    So, imagine - if you need to start a number of different processes, wait until all of them successfully completed and then start another process.
    Here is the picture:
     
    To help in such kind of scripting I'm introducing the SyncUtil.exe - command line utility controling OS kernel sychronization objects on the shell process level.
     
    In this particular example I'm talking about the "events". Perhaps the "event" term is not so good to describe this entity but in the Windows OS documentation it is called "event". While in real it is behaving like a "flag" - flag is ON, flag is OFF. In the OS documentation it sounds like - event is signaled, event is non-signaled.
    The wait operation works only for signaled events, it means - you can wait until events change state to signaled but cannot wait for events changing state to non-signaled.
     
    So, using this approach we can organize synchronization between different shell processes.
     
    And here is first code example (for *.BAT/*.CMD file):
     
      rem reset 3 synchronization events
      SyncUtil SyncEvent RESET ClientBuild,NtBuild,CustomBuild
      rem ... then start 3 processes
      start "Bulding clients" /min "%ComSpec%" client_build.bat %CfgFile%
      start "Bulding NT servers" /min "%Db2SqlLib%\bin\db2cmd.exe" nt_build.bat %CfgFile%
      start "Building custom components" /min "%ComSpec%" custom_build.bat %CfgFile%
     
    this command resets all 3 specified events - ClientBuild, NtBuild, CustomBuild and then starts 3 different processes. We cannot tell for sure what of these processes will finish 1st and what next, so amount of work for every process could vary.
     
    Note: as you can see we use command "start" to start processes, and the 1st parameter of "start" command is the window title - it is very important to set correct window titles for shell windows, so we can see for every shell window what it is actually doing. Also helpful command is - "title" it allows to set title for current shell window. So, please consider to use the "title" command to make shell window title indicating current operation.
    Systems which are not using shell window titles look quite unfriendly and non professional. Frankly, I do not understand how customers can stand it when system running lot of shell processes and even software vendor cannot tell for sure what these processes are doing at the moment and if it is successfull or not? ;)
     
    The next step - waiting while all 3 started processes completed:
     
    :wait
      SyncUtil SyncEvent WAIT AllOf:ClientBuild,NtBuild,CustomBuild -1
      set ExitCode=%errorlevel%
      if "%ExitCode%" == "0" goto continue
      if "%ExitCode%" == "1" goto wait
      goto sync_err
    :continue
     
    So, this part waiting while all 3 events signaled and then continue. List of events could be prefixed with one of "AllOf:" or "AnyOf:" - it means wait until all of specified events signaled or wait until any of specified events signaled.
    The "-1" is a timeout parameter (in seconds), so you can specify for how many seconds it should wait, of course -1 means - INFINITE wait.
     
    At the end of every of these batch files - client_build.bat, nt_build.bat and custom_build.bat - should be following code:
     
      set EventName=...
      SyncUtil SET %EventName%


    It is clear that instead of "..." there shold be:
    • for client_build.bat EventName=ClientBuild,
    • for nt_build.bat EventName=NtBuild and
    • for custom_build.bat EventName=CustomBuild.
    Next possible step - if we need to run multiple inspances of script with such kind of synchronization.
    It is easy to do it if we add extra prefix (or suffix) to the event name. For example:
     
      set BuildInstance=%TIME::=%
      set BuildInstance=Bld%BuildInstance:,=%
      SyncUtil SyncEvent RESET %BuildInstance%-ClientBuild,%BuildInstance%-NtBuild,%BuildInstance%-CustomBuild
     
    So, as you can see - we using current time as a build process instance ID. Usually quite difficult to start 2 processes at the same time (if time resolution is 1/100 sec). So, for example if current time is 17:08:03,93, then BuildInstance value will be "Bld17080393". Using this approach we can easily start multiple processes which use such kind of synchronization without conflicts on event names.
     
    The Technical Issue to Keep in Mind
     
    On the first glance it looks simple and provided code examples usually working but(!) here we have a technical issue - if some of started processes set event before main process started to wait for events the waiting will be endless! It happens because events does not exists in the scope of currently running shell process. And here we can use another function of SyncUtil - possibility to start a process with predefined set of events. For example:
     
      SyncUtil CreateProcess ClientBuild=0,NtBuild=0,CustomBuild %ComSpec% /c build_main.bat
     
    Note: as you can see we use just a list of events delimited by ";" or "," as well as list of events with default event states - use the "=0" after name of event to set event to non-signaled or "=1" to set event to signaled state. By default all events set to non-signaled state.
     
    The "CreateProcess" function of SyncUtil will intialize specified events, enable inheritance and start specified process, so the build_main.bat will run within the scope where all specified events already defined and all child processes can reuse them. So, you can use "SyncUtil CreateProcess ..." in cases when specified set of events need to be defined in the scope of shell process and all child processes.
     
    It is interesting that if specified event exists in the scope of some process then other processes can reuse it (SyncUtil try to call OpenEvent first and only if OpenEvent fail it calls the CreateEvent with security descriptor enabling full access + handle inheritance). For example if we execute the command:
     
      SyncUtil CreateProcess Ev1=1;Ev2;Ev3 %ComSpec%
     
    then we will have a process holding events Ev1, Ev2, Ev3. And any other process in a system can "see" these events. But if events did not exist the other processes will create own copy of event object and change its state which of couse lost after process exit. That is why wait operation will work fine only after it started - because while SyncUtil running the wait loop events exists in a system and other processes can change state of these events.
     
    Thus, it is up to you:
    • create new process holding predefined set of events before dealing with synchronization events in your script or ...
    • create a separate process holding all synchronization events used by your scripts or ...
    • assume that child processes will not change events state before the wait operation started.

    See also: Part 2 (http://dmitry-bond.spaces.live.com/blog/cns!D4095215C101CECE!781.entry)
    See also: Part 3 (http://dmitry-bond.spaces.live.com/blog/cns!D4095215C101CECE!784.entry)

     

    What idiots are working in ZOTAC?!?

    Actually this is rhetoric question. I got it just after I cleaned up cooler on video card in my computer.
     
    So, video card looks good by parameters listed on a box:
     
    But as discovered it has quite stupid technical implementation - the active cooling system on a video card completely feeded with a dust in 3-4 month only!
    So, EVERY 3-4 month EVERY customer of this product HAVE TO disassembly computer, plug out video card, DISASSEMBLY the cooling system and CLEANUP it MANUALY from a dust!... So, question in the topic is absolutely rhetorical after that.
     
    Of course the question - what if not to cleanup cooler? Ya, for normal office work - almost does not matter - even if cooller does not work at all. But of course - I do not need nVidia GeForce 8600 GT 512 Mb GDR3 RAM for normal office work! I need this GeForce for games + some specific graphical applications. So if you want to play some games on weekend work with some graphics... that could be a big problem! On my computer H/W monitor reported GPU reach temperature about 72^C degrees! And game started lagging, slowing down and crashing from time to time which is bad and irritating. After cooler was cleaned up - temperature drops to max=64^C and game start working obviously faster and stable.
    So, absolutely for sure - this is critical hardware bug in the ZOTAC product. :-\ I doubt they can supply a "fix", so seems I have to apply "temporary fixes" in form of cooler cleaning from time to time...
     
    Experiencing this dust cleaning issues I starts to think that good passive cooling system is essentially more better and reliable than any active cooling systems on no-name/idiotic hardware vendor products.
    For example - on my old video card (ATI Radeon X1300 by Gigabyte) I had a passive cooling system and the small $3-improvement can make it active:

    Practice did show - it perfectly works!

    So, my conclustions are

    • or pay 30-50$ more for the good hardware;
    • or buy hardware with passive cooling and then make it active by yourself

     

    10월 9일

    Программирование и Тестирование

    Как быстро можно что-то закодить/напрограммить, и как потом сложно "рожать" к нему тесты.
    Вроде ж все так просто с алгоритмом и реализацией, а потестить... сколько там вариантов оказываеться! :-\
    Похоже что я был очень оптимистичен когда сказал что сделаю тесты за день-два... уже третий пошел, а конца еще и не видно. Ж)
     
    При чем интересно что бизнес компоненты тестировать гораздо сложнее чем какие-то скриптовые или workflow-овские движки - у бизнес компонент вариантов почему-то ощутимо больше...
    10월 7일

    Электро-обогрев

    Холодно. Да еще и квартира холодная - на углу дома, две комнаты торцевые.
    В детстве помню дома было до 12 градусов дома, а мне было нормально. Видимо дети легко к этому приспособливаются, а вот взрослым сложнее почему-то...
    Так вот, решил я заценить - а сколько же съедает электро обогреватель DeLongi (KH771225). Вот табличка с замерами:
     
    тариф прогноз
      показания электро счетчика кВт 0,1872  за день за месяц
    15:45              6 891,10         1,80   0,34  8,09  250,70 
    16:45              6 892,90         2,10   0,39  9,43  292,48 
    17:45              6 895,00         2,10   0,39  9,43  292,48 
    18:45              6 897,10         1,50   0,28  6,74  208,92 
    19:45              6 898,60         1,80   0,34  8,09  250,70 
    20:45              6 900,40         1,80   0,34  8,09  250,70 
    21:45              6 902,20         2,00   0,37  8,99  278,55 
    22:45              6 904,20         1,63   0,31  7,32  227,02 
    9:45              6 920,50            -     0,00  0,00  0,00 
     
    Алгоритм был простой - раз в час снять и записать показания счетчика, а после ночи - записать показания через 10 часов после последней записи. Обогреватель при этом был включен на средний режим, регулятор на 5 (максимум там 6). Как видно из ночных показания чистое потребление электроэнергии = 1.6 кВт/час. Полная мощность обогревателя 2500, на среднем режиме, почти на максимуме регулятора, получаеться 1600. Т.е. если его не выключать, то за месяц электричества набежит минимум 230 грн, и это только за обогрев! Многовато. Действительно - газ дешевле.
     
    По эффективности обогрева - в одной комнате, там где обогреватель, держиться 20 градусов, в остальных, без обогрева, 15 - 17 градусов.
     
    Кстати, вспомнилось. Давно, году эдак в 1996, ездил к знакомому в село, типа совсем глубинка. Так там почти все дворы были отключены за неуплату и у всех конфискованы счетчики и щиток. Но(!) при этом все "по-тихому" подключились к проводам на столбах и "жрали" электричество немерянными объемами. Например - на ночь включали 3-4 калорифера - утром в доме как в парной. Ж-) Но у нас условия не те - тут все считаеться и за все платиться. Да и гнилое это дело - на шару чем-то пользоваться - развращает.
     
    Так что видимо нужно найти какой-то оптимальный режим работы обогревателя чтобы платить меньше. :-\ Интересно только насколько это возможно - найти такой режим?...
    10월 4일

    Half-Life2: Rebellion - кидалово :-\

    Оказываеться оно проходиться за 30-40 минут. Это если "на тормозе", т.е. когда не знаешь как проходить и зависаешь на некоторых местах надолго. А если сразу врубиться, то за 15-20 минут. Мало... :-\
    10월 3일

    О чем писать в блоге / What to blog

    Я могу конечно писать и о программировании и о политике, о людях, законах мироздания и т.п., но... нету времени. Практика показывает что сравнительно небольшая заметочка в блоге "съедает" от 1 до 3 часов времени! А если появяться еще и коментарии то времени уйдет заметно больше.
    Поэтому я пишу разную "мелочевку" - то на что не уходит много времени. Т.к. во-первых я не писатель блогов, я писатель програмного кода. А во-вторых, блог - это типа как "проба пера".
    :)
     
    ----------
     
    Of course I can blog here lot of different stuff - programming techniques, politic, people, laws of the universe, etc. But practice show that even small note in blog takes about 1-3 hours of time. That is too much for me, usually I do not have that time. And if there will appears comments on a note in blog it could "eat" even more time.
    So, I'm blogging here different kinds of small things which is not take lot of me. It is because I'm not the blog writer but the program code writer.
    :)

    Kyiv Views

    I decided to create the "Kyiv Views" photo album with photos of KYIV in different times.
    So, it is just for everybody to look on KYIV, see what it is in different aspects.
    Of course current set of photos are not completed, I think I'll add more with a time.
     
    10월 2일

    Киевское "Элит Такси" - редиски... :-\

    Я обычно не особо волнуюсь по поводу такси - взял первую попавшуюся визитку из тех что в почтовые ящики кидают, позвонил и поехал.
    Последние несколько раз ездил "Элит Такси". Первый раз вроде бы все было ok. А дальше фигня какая-то началась - не водители попадаються, а быковатые дибилоиды какие-то. Это чмо всю дорогу бубнило - и то ему не так и это чего-то не то. Припарковаться ему видите ли негде - сцуко начал стонать как только приехали на место. А потом еще и накинул 20 минут ко времени простоя. Гавно а не таксист! Не буду больше ездить на этом такси! :-\
     
    Не писал бы тут, так я иначе забываю - если снова приспичит ехать снова же позвоню на первый попавшийся номер. А так - раз записал значит запомнил. Как говорил мой бывшый шеф - "я не злопамятный, я запишу". :)
    10월 1일

    Поездка в Турцию

    Сразу скажу - нам очень понравилось. Много положительных и острых впечатлений.
     
    Вот из острых впечатлений, например, можно вспонмить как жена решила купить коврик на местном ковровом заводике, а в процессе выяснилось что не один а парочку... Ж-) меня потом почти неделю "подплющивало" по этому поводу. Не потому что я жадный, а потому что денег уже почти не было, впереди еще 4 экскурсии и наверняка захочеться фоток или мелочи какой-то, а тут еще за коврик нужно заплатить.
     
    Место отдыха = Majesty Mirage Part Resort, Goynuk, возле Кемера. Оператор = Tez Tour. Надо сказать что очень все классно организованно! Tez Tour - хорошо!
     
    Ну а теперь о том о чем не следует забывать когда едешь в Турцию и вообще когда едешь куда-нибудь, а также просто заметки о путешествии:
     
    * В отеле из обслуживающего персонала многие разговаривают по русски. По английски столько не говорят сколько по русски. А вот в аэропорту наоброт - там почти все говорят по английски и мало кто понимает русский.
     
    * Нужно много мелких долларов или евро - на соки, на чаевые, на фотки, всякие вкусности, сувениры и т.п. 
    Но радует то, что размер чаевых не так важен как их наличие. $1-2 почти всегда более чем достаточно.
    А вот у нас в Украине были случаи когда охреневшие официанты в мелких рестаранчиках брезговали мелкими чаевыми - 2-5 грн видители это "не чаевые".
     
    * Хитрожопый чувак на рисепшене сразу поселил нас в какой-то "левый" номер, пришлось выяснять че за фигня. Т.е. это вполне типичная ситуация - даже в супер отеле это легко может случиться. Т.е. нужно просто выяснить это на месте. В нашем случае парень на рисепшене с невозмутимым лицом переселил нас в тот номер который мы заказывали.
     
    * Просто сидеть на пляже или возле бассейна - скучновато, лучше брать экскурсии, много экскурсий. Именно так мы и делали и не прогадали.
    По той же причине брать большой номер брать бесмысленно - все равно мы там почти не живем - все время где-то путешествуем. Из 8 полных дней отдыха в отеле мы были только 3. Ну т.е. представления о жизни дома нужно оставить дома! На отдыхе все иначе - там режим дня как-то сам собой меняется. В нашем случае - ранний подъем (около 6:00) и ранний отбой (около 22-23:00).
     
    * Рафтинг/каякинг - спуск по порогам на горной речке - супер! Жаль что мало - всего-то 2,5 часа в воде + 1 час на остановки по ходу, я бы еще поплавал!
    Дайвинг тоже очень классно! В следующий раз нужно будет еще попробовать джип-сафари.
     
    * В средиземном море почти что нету ни водорослей, ни живности, ну т.е рыбки есть, а вот водорослей, крабов и т.п. - нету. Хотя водичка красивая, прозрачная, голубая. И очень соленая. Первый день немного пекло кожу с нерпивычки. А потом привык.
    Видимость под водой обычно не меньше 4-5 метров - это классно. Взять на прокат маску там нельзя, нужно было брать с собой.
    Берега, камни, редкие ракушки тут офигенно острые - очень легко поцарапаться, выбираться на них из воды достаточно сложно. Берег на пляже отеля там мелкая галька - там все хорошо. А вот когда вывозят куда-то поплавать - в лагуну у скал и т.п. - то там выбраться на берег очень сложно и рискованно.
     
    * Из живности в море видел стайки различных рыб и по форме и по раскраске, видел рыбок которые живут в песке - они там прячуться, видел одного единственного малюсенького черного крабика. Когда были на дайвинге - там видели громадные стаи различных рыбок, кормили их с рук, видел разбитые останки больших ракушек (где-то с ладнь взрослого человека и больше). Нашел странную мертвую рыбку, тигровой раскаски, с белым брюхом, не похожая на обычных рыб. Медуз не видел вообще. Кстати, отдыхающие часто кормят рыбок в море - приходят на мостик с кусочком булки, крошат и бросают в море - там сразу такой "движняк" начинаеться - кучи рыбок бросаються на хлебушек. :)
    Также видел много морских ежей - у Мышиного острова там их кучи. Но кажеться они ядовитые, у меня была небольшая царапина на пальце - так очень чувствительно припекло через пару минут после того как я их потрогал. Пришлось быстро вылазить из моря на яхту, спрашивать чем лечить. Но немного йода и лед помогли - через час-полтора все прошло. Кстати, видимо у них яд контактного действия - т.к. расцарапанная ладонь никак не отреагировала, а только палец которым трогал ежика.
     
    * Что еще интересно - раны здесь почему-то не воспаляются. Уже 2й день серьезная рана на руке, поцарапался об ракушки на опоре мостика, спокойно себе заживает и не болит - я о ней просто забываю. Помню похожим образом поцарапался дома - так почти 2 недели болело несмотря на лечение, а на средиземном море достаточно просто купаться в море - вот и все лечение. И через неделю от раны только след остался.
     
    * Чувак на раздаче фоток в Памукале - жлоб! Предложили ему 10$ за 3 фотки, а он просил $4 за фотку, так не согласился гад, предпочел выбросить в мусорку.
    Хотя похоже тут с ценой на фотки полный беспредел - за 1 фотку дерут от 4 до 15$! Т.е. по $4 за фотку это еще "очень хорошая цена" сравнительно с остальными. Теперь вот жалеем - хорошие были фотки, нужно было заплатить... Но тогда мы сравнивали с нашими ценами и по $4 за фотку казалось ОЧЕНЬ МНОГО.

    * С мясом тут напряженка - только курятина, иногда рыба и все! Остальное - овощи, сыр и разные комбинации из них.
    Единственно где было более-менее нормальное мясо - местный турецкий рестаран. Ну и нужно помнить что свиней они не едят, не готовят и не разводят, т.е. будет только говядина и баранина.
    Фруктов здесь дают много, но у большинства из них какой-то нейтральный вкус. У еды часто тоже вкус нейтральный, хотя надо заметить что голодать не приходиться - т.е. кормят очень хорошо.
    Вино только красное и белое - два вида на весь отель.


    * Своеобразное мороженное - интересной консистенции, оно тянться. Попробовать интерсно, ну а дальше - на любителя.

    * Записаться в ресторан - большущая очередь и нельзя записатья на дату, только на завтра. Ну и сам ресторан больше как реклама - демонстрация видов еды. Хотя турецкий ресторан был очень неплох. 

    * GPRS в роуминге одурезно дорогой! В сумме вышло около 400 грн за 4 коротких сеанса - только почту проверить на hotmail.com. Похоже что GPRS оплачиваеться поминутно + трафик, а минута в роуминге дорогая. Я протупил на этот счет - пытался погуглить кое-чего и online переводчиком воспользоваться поэтому так много и набежало. :-(

    * По ночам вокруг твориться дурдом - дискотеки для детей (до 21:30) и потом до 3:00 ночи (иногда и дольше) для взрослых.
    И в соседних отелях тоже самое - и часто если свои уже давно закончили, то у соседей все еще гуляют. Нам это сильно не мешало - мы за день так напутешествовались что уже были пофиг те гулянки вокруг, но принять это к сведению стоит.
     
    * Интересно что для местных отдых стоит заметно больших денег. У нас получилось на двоих $300/день с перелетом и трансфером, а местным тоже самое без перелета и трансфера минимум = $400/день. Почему-то не поощряют турки турков отдыхать в отелях. Ж-)
     
    * Получаеться что неделя нужна на "раздуплиться" - понять что к чему, какие развлечения и сервисы есть и т.п., выйти из привычного состояния, перестать сориться с женой... Но тут-то как раз и наступает конец отдыха. Жаль, я ведь только-только "въехал" в тему... Улыбка
     
    * Если экскурсовод в своих рассказах упоминает какой-то предмет, типа ковры, вино, камни, иконы и т.п. - можно быть уверенным вас по ходу экскурсии завезут на соответсвующую фабрику или заводик где вы сможете это купить. Вот нас таким образом завозили на ковровый заводик, текстильный супермаркет, в винную лавку, иконную лавку, заводик по обработке камней - издения из оникса. И почти везде мы купили какую-то мелочь - вот такой у турков бизнес. Не могу сказать ничего плохого об этом - вещи действительно хорошие и вобщем-то не такие уж и дорогие. Хотя с ковриками есть ощущение что нужно было торговаться дальше... Ж-)
     
    * Когда возвращаешься назад нужно учитывать вес багажа! Разрешаеться 20кг на человека. За превышение доплата - по $5 за кг. Проще что-то перегрузить в ручную кладь - ее почти никогда не взвешивают. У нас вышло 5 кг лишних, пришлось доплатить...