А я брахаць ня ўмею, дык і завыў Below are the 28 most recent journal entries recorded in the "Abu Antos'" journal:
October 30th, 2012
04:33 pm
[User Picture]

[Link]

Уходит эпоха
A friend of mine recently retired from a career with Unisys; he’s done well enough that he can still afford to keep a house in Hawaii and Upstate NY.

His last big project was developing a new printer interface for whatever it is that the System 360 has become.

The stock printer interface from IBM wasn’t fast enough to handle the large volume of paperwork that comes out of Albany, so he developed a new printer interface just for the state of New York and wrote device drivers for it in Macro Assembly.

Tags:

(10 comments | Leave a comment)

January 30th, 2012
02:25 pm
[User Picture]

[Link]

Buddhist databases optimize one-row tables!
DUAL was originally a table and the database engine would perform disk IO on the table when selecting from DUAL. This disk IO was usually logical IO (not involving physical disk access) as the disk blocks were usually already cached in memory. This resulted in a large amount of logical IO against the DUAL table.
Later versions of the Oracle database have been optimized and the database no longer performs physical or logical IO on the DUAL table even though the DUAL table still actually exists.
http://en.wikipedia.org/wiki/DUAL_table#Optimization

Tags:

(2 comments | Leave a comment)

February 6th, 2009
09:55 am
[User Picture]

[Link]

Трохзначная лёгіка наносіць удар у адказ. / Three-valued logic strikes back
Аналітыкі адлавілі багафічу. IN працуе як звычайнае параўнаньне з кожным значэньнем са сьпіса ( x IN(a,b,c) == (x=a OR x=b OR x=c) ), таму калі ў сьпісе значэньняў у IN трапляецца NULL, x=NULL неазначана і рэзультат нечакана пусты. Лечыцца дадаткам IS NOT NULL у падзапыце.
CREATE TABLE #temp(i int, flag bit NOT NULL)
INSERT INTO #temp VALUES(1, 1)
INSERT INTO #temp VALUES(2, 0)
INSERT INTO #temp VALUES(NULL, 0)

--returns 2 and NULL
SELECT i FROM #temp WHERE flag=0

--returns 1
SELECT i FROM #temp WHERE flag=1

--you would expect this to return 1, just like the query before, but it returns nothing!
SELECT i FROM #temp WHERE i not in (SELECT i FROM #temp WHERE flag=0)

--this corrected query returns 1, as it should
SELECT i FROM #temp WHERE i not in (SELECT i FROM #temp WHERE flag=0 AND i IS NOT NULL)

Current Music: Лаэртский - Карлица
Tags: ,

(3 comments | Leave a comment)

January 22nd, 2009
02:06 pm
[User Picture]

[Link]

Хозяйке на заметку
Прошло 52 года с создания транслятора формул, более известного как FORTRAN. Однако даже в наши дни
великий и могучий дотнет не умеет по умолчанию парсить экспоненты. Лечится, правда, тривиально:
вместо decimal.TryParse(Value, out decValue) надо добавлять немного шаманских заклинаний и писать decimal.TryParse(Value, Globalization.NumberStyles.Float, Globalization.CultureInfo.CurrentCulture, out decValue)

Tags:

(14 comments | Leave a comment)

August 6th, 2007
04:05 pm
[User Picture]

[Link]

Граблі strike back
Why would this code
StartDelay := GetTickCount();

repeat
   Application.ProcessMessages;
until (abs((GetTickCount() - StartDelay))) >= PauseLength;

suddenly stop working? Because )

Tags:

(6 comments | Leave a comment)

July 17th, 2007
04:17 pm
[User Picture]

[Link]

Funny bug
You would think that "next line" after the condition that raises an error would be the line after "End If", not the one right after "Then"...
On Error Resume Next
Dim c As Collection
   'comment out to show the bug
   'Set c = New Collection
   'c.Add "Shit"
   'since c wasn't initialized, accessing it's property raises an error
   'you'd think that Resume Next will go to the line after End If, but...
   If c.Count > 0 Then
      MsgBox "Shit happened"
   End If

Tags:

(14 comments | Leave a comment)

May 17th, 2007
04:01 pm
[User Picture]

[Link]

І яшчэ пра мову / More on language
Здагадайцеся, што робіць функцыя, камэнтарам да якое я паставіў такую цытату / I used this quote as a comment to a function - guess what that function does.

But I knew that I never would forget that jaunty, happy voice, or his drooling as he talked, or the habit that he had of counting on his fingers - God knows why he did it as if he were in continual fear that he might have lost one of them in the last few minutes.

Адказ: падлічвала дліну чысла (12345 ->5, 999 -> 3 і г.д.) Называлася, канешне, CountDigits

Imported event Original

Tags: ,

(3 comments | Leave a comment)

April 7th, 2007
03:22 pm
[User Picture]

[Link]

Граблі
Наступілі на граблі, бо трэба чытаць весь TFM, а не толькі першы сказ
UPDATE (column)
Tests for an INSERT or UPDATE action to a specified column (ага, падумалі суворыя тэхаскія парні, вось гэтае UPDATE() нам і падкажа, ці ўстаўляюць значэньне ў поле) and is not used with DELETE operations. More than one column can be specified. Because the table name is specified in the ON clause, do not include the table name before the column name in an IF UPDATE clause. To test for an INSERT or UPDATE action for more than one column, specify a separate UPDATE(column) clause following the first one. Aле фіг вам, сказалі мелкасофтаўцы, бо IF UPDATE will return the TRUE value in INSERT actions because the columns have either explicit values or implicit (NULL) values inserted.

Imported event Original

Current Mood: working
Current Music: Moe Tucker - Dogs Under Stress
Tags: ,

(2 comments | Leave a comment)

February 27th, 2007
06:26 am
[User Picture]

[Link]

FizzBuzz in QB
Народ выйобваецца на хаскелях і рубях, піша FizzBuzz
А на родным кьюбасіку ўсё лягчэй!

10 DATA "", "", "Fizz", "", "Buzz", "Fizz", "", "", "Fizz", "Buzz", "", "Fizz", "", "", "FizzBuzz"
20 DIM A$(15)
30 FOR I = 1 TO 15
40    READ A$(I)
50 NEXT I
60 FOR I = 1 TO 100
70    j = I MOD 15
80    IF A$(j) <> "" THEN PRINT A$(j) ELSE PRINT I
90 NEXT I

Tags:

(7 comments | Leave a comment)

February 5th, 2007
07:41 am
[User Picture]

[Link]

Ruby was made by Microsoft!
Ruby was made by Microsoft! In 1990!

Tags:

(Leave a comment)

November 17th, 2006
05:55 pm
[User Picture]

[Link]

Цудоўнае ад [info]9000@lj

Configurator configurator = new Configurator(configuration);
configurator.configure();

http://yole.livejournal.com/341510.html?thread=1655302#t1655302

Tags:

(4 comments | Leave a comment)

October 5th, 2006
10:20 am
[User Picture]

[Link]

Дыялёгі
[info]syarzhuk@lj: Якая ў нас прыгажосьць! У VB6 ствараюць MSXML2.ServerXMLHTTP40, які вызывае ASP-старонку, якая гэтаксама цераз HTTP вызывае другую ASP-старонку, якая ўжо робіць, што трэба. Я дзьве гадзіны дэбагіў, пакуль да гэтага дайшоў
[info]ilvyanyatka@lj: Гэта бізнес-плян. Калі код добра дакументаваны й лёгка чытаецца, дык яго лёгка скрасьці. А ваш код ніяк не скрадзеш!

Сяржук - Ты ўсё на Delphi пішаш?
[info]shura_by@lj: C++
Сяржук: жудаснах
Шура: Я сначатку таксама так думаў, а потым прызвычаiўся :-)

Microsoft FxCop - нешта ў вас занадта памылак шмат.
Сяржук - а што, калі я табе скармлю тваю-ж бібліятэчку?
FxCop - 1 breaking error in FxCopCommon.dll
Сяржук - Ага! сказалі суворыя сібірскія мужыкі й пайшлі валіць лес двуручнымі піламі

Tags:

(Leave a comment)

May 23rd, 2006
05:29 pm
[User Picture]

[Link]

Antipatterns Public Morozoff and Private Ryan

Tags:

(1 comment | Leave a comment)

May 1st, 2006
12:38 pm
[User Picture]

[Link]

In defense of strict type checking
Ёсьць рэчы, за якія трэба забіваць. І мова праграмаваньня, ў каторай false - гэта 0, 0 - гэта NULL, а NULL - гэта valid std::string - адна зь іх.

There are things that deserve killing. And programming language, in which false is 0, 0 is NULL, and NULL is a valid std::string, is one of them.

Inspired by http://ygam.livejournal.com/133442.html

Tags:

(3 comments | Leave a comment)

April 13th, 2006
11:01 am
[User Picture]

[Link]

SQL Server stinks!
SELECT Round(59999.0 * 0.155,2)
9299.8500 - correct

SELECT Round(Cast(59999.0 as money) * Cast(0.155 as float),2)
9299.8400000000001 - wrong!

Fix:
SELECT Round(Cast(Cast(59999.0 as money) * Cast(0.155 as float) as money) ,2)

Tags: ,

(2 comments | Leave a comment)

December 21st, 2005
03:56 pm
[User Picture]

[Link]

CircumCHAR(1)ion
Толькі што змарнаваў амаль паўгадзіны, спрабаваў зразумець, чаму мая функцыя ў SQL Server выдавала лабуду. Тый-жа самы запыт, калі яго пусьціць напрасткі, працаваў як трэба. Пікантнасьць дадавала тая абставіна, што функцыі Transact-SQL Debugger дебагіць нельга, толькі працэдуры. Ў рэзультаце знайшоў - памылкова апісаў параметр як CHAR(1) замест CHAR(10) (дрыгнула рука маладога хірурга), а сэрвер, замест таго каб пакрыўдзіцца, што-ж ты, гад, апранаеш дзіцячыя гольфікі на здаровага бугая, паслухмяна абразаў значэньне. І гэта пры тым, што яшчэ 8 год таму ў InterBase магчыма было аб'яўляць свае дамэны!

Just wasted almost half an hour trying to understand why my SQL Server function was returning garbage. The same query, when ran directly, was working as expected. Bonus insult points to MSFT for making it impossible to debug functions with Transact-SQL Debugger (stored procedures only). Finally found the gotcha - mistakenly declared an input parameter as CHAR(1) instead of CHAR(10). Instead of screaming in my face, SQL Server was obediently circumcising the value. And boy, back in 1998 InterBase allowed me to create problem-specific domains!

Tags: ,

(Leave a comment)

October 19th, 2005
10:52 am
[User Picture]

[Link]

[programmism] DateDiff
You would think that the T-SQL function that is called DateDiff would return the difference between the two dates. For example, if your two dates are 10:53 and 10:54 (the difference is 1 minute), and you want to get the difference in hours, you would expect that 1 minute difference would be rounded to 0 hours. It does happen with 10:53 and 10:54, however, you'll be surprised when you calculate the difference between 10:59 and 11:00. A quick check shows that the difference between '1/31/2005 23:59:59' and '2/1/2005' (1 second time interval) is equal to 1 minute, 1 hour, 1 day and 1 month depending on the first argument to DateDiff!
SELECT DateDiff(ss, '1/1/2005 1:00:00 AM', '1/1/2005 1:00:01 AM')
SELECT DateDiff(ss, '1/31/2005 23:59:59', '2/1/2005')
SELECT DateDiff(mi, '1/1/2005 1:00:00 AM', '1/1/2005 1:00:01 AM')
SELECT DateDiff(mi, '1/31/2005 23:59:59', '2/1/2005')
SELECT DateDiff(hh, '1/1/2005 1:00:00 AM', '1/1/2005 1:00:01 AM')
SELECT DateDiff(hh, '1/31/2005 23:59:59', '2/1/2005')
SELECT DateDiff(dd, '1/1/2005 1:00:00 AM', '1/1/2005 1:00:01 AM')
SELECT DateDiff(dd, '1/31/2005 23:59:59', '2/1/2005')
SELECT DateDiff(mm, '1/1/2005 1:00:00 AM', '1/1/2005 1:00:01 AM')
SELECT DateDiff(mm, '1/31/2005 23:59:59', '2/1/2005')


Of course, it is mentioned in the help - "DATEDIFF Returns the number of date and time boundaries crossed between two specified dates", but who in their right mind decided to implement it like that??? Note to self: only use DateDiff for seconds (ss), as others are not helpful at all..

Current Music: Reverend Glasseye And His Wooden Legs - Black River Falls
Tags: ,

(11 comments | Leave a comment)

August 31st, 2005
11:49 am
[User Picture]

[Link]

AVG - integer division
http://community.livejournal.com/ru_programming/278230.html

Tags: ,

(1 comment | Leave a comment)

June 14th, 2005
06:44 am
[User Picture]

[Link]

[Праграмізм] Smooth Switch Operator
Заўжды лічыў, што наяўнасьць апэратара break у switch statement (ці, што тое-ж, магчымасьць не ўжываць break у асобных галінках) у С-падобных мовах праграмаваньня ёсьць перажыткам старых часоў і недаглядам сьвятое тройцы томпсан-рычы-керніган. У нейкай кніжцы чытаў, што калі выклалі код Джавы, чытачы на мільёны радкоў і тысячы, switch'аў знайшлі аж 2 выпадкі, дзе switch быў без break і, здаецца, абодва былі памылковымі.

Таму вельмі цікавы асэнсаваны прыклад ужытку switch без break пры разгортваньні цыклаў. Хак, канешне, але прыкольна.

Tags:

(Leave a comment)

March 18th, 2005
07:30 pm
[User Picture]

[Link]

Zen of Visual Basic
Dim Everything As Object

If Everything Is Nothing Then
   MsgBox "Everything Is Nothing"
End If

Tags:

(Leave a comment)

February 22nd, 2005
06:58 am
[User Picture]

[Link]

[Programmism] Выбор языка для Web-программирования
Свинский Хамелеон [info]porkchameleon@lj спрашивает:
во ты можешь объективно и кратко объяснить тупому - почему везде они требуют ASP(.NET)?
Меня заебало читать безликое фуфло, пропагандирующее Майкрософт, я хочу человеское мнение.

Наш ответ Чемберлену )

Current Music: Throbbing Gristle-Greatest Hits (Entertainment Through Pain)
Tags:

(31 comments | Leave a comment)

February 10th, 2005
07:12 pm
[User Picture]

[Link]

па кроплі давіць зь сябе індуса
Трэба зрабіць праграмку, якая робіць амаль тое-ж, што й старая, але мяняе другі парамэтр і па другіх законах. У старой кут мяняўся ад 0 да 180, адпаведна, была канстанта
   HALF_CIRCLE = 180;
У новай кут трэба мяняць да 360. Падумаў, што калі ўвадзіць новую канстанту, дык гэта-ж трэба яе апісваць і мяняць назву канстанты ў кодзе. Зь цяжкасьцю падавіў жаданьне перарабіць на
   HALF_CIRCLE = 360;
каб не мяняць код
 

Tags:

(12 comments | Leave a comment)

07:39 am
[User Picture]

[Link]

Programming Productivity
Прачытаў кніжачку Capers Jones - Programming Productivity. Выйшла ў 1986 годзе, ў прыкладах аўтар параўноўвае праграмістых на Асэмблере, PL/1 і COBOLе.
Пры гэтым шмат якія праблемы - адсутнасьць стандартных мэтрык, няўлік падчас ключавых фактараў і г.д. - засталіся й зараз і даюць тэмы для артыкулаў, напрыклад, Спольскага. Уразіла адно назіраньне:
A 50-hour workweek is 25% more than a normal 40-hour week. If a new tool or technology is installed that improves productivity by 25% in real life, which is not a trivial amount, it may result in nothing more than the personnel going home on time and not working Saturdays. While this is valuable in human terms, project management will see no perceptible cost or schedule reductions from the technology, since what was eliminated was unpaid overtime.
As surprising as it may seem when first considered, a tool or technology may have to yield more than a 30% increase in real productivity before its influence can even be measured, since a 20% or 25% gain may be absorbed merely by reduction of unpaid overtime

Проста Аліса за люстэркам нейкая!

Адкапаў шыкоўны дыск - 9 альбомаў Dead Can Dance у MP3. Вось так, людзі дэкаду працуюць, ствараюць Музыку зь вялікае М, запісваюць - а прадукт іхнае дзейнасьці можна набыць за якія тры баксы, таньней, чым папоўднічаць.

Ранішняя чытанка:
Jailed for using a nonstandard browser

ЖЖ-спасылкі, ўсе з дзёньніку цудоўнай [info]aculeata@lj
Чья гора
Дзіўны вершык
Подумаешь. Это и я умею
По вине бедных
Там-жа ў камэнтарах спасылка на казку [info]dimkin@ljЗлодзей

Bonus: Why do you hate freedom?

Current Music: Dead Can Dance - Into the Labyrinth
Tags: ,

(Leave a comment)

January 14th, 2005
06:45 am
[User Picture]

[Link]

Access SQL <> SQL Server SQL -2
Раз пайшла такая п'янка, распавяду пра баг, што мне найболей запомніўся. непраграмістым не чытаць )

Current Music: Pitchshifter - The Remix War
Tags: ,

(3 comments | Leave a comment)

January 13th, 2005
10:00 am
[User Picture]

[Link]

Access SQL <> SQL Server SQL
А вы ведалі, што вось такі запыт:
SELECT A.Field, B.Field, C.Field
FROM A LEFT JOIN B ON A.Key=B.Key
       LEFT JOIN C ON A.Key=C.Key
працуе ў SQL Server'ы, але выдае памылку ў Access'ы? Дык ведайце. Лечыцца проста:
FROM (A LEFT JOIN B ON A.Key=B.Key)
       LEFT JOIN C ON A.Key=C.Key
Current mood: recovering from a botched attempt to downgrade an SQL Server-based app to an Access-based one.

Tags: ,

(2 comments | Leave a comment)

December 23rd, 2004
03:06 pm
[User Picture]

[Link]

[Праграмізм] Dontcha just L-U-V Perl?
#!/usr/bin/perl -w
use strict;

#...

sub process {
    my $str=shift;
#    my $rest;
   ($a, $b, $rest) = split(/\s+/,$str,3);
    if (defined($a)){
        print OUT "$a\t";
    }
    if (defined($b)){
        print OUT "$b\n";
    }
   if (!defined($rest)){
        return (0);
   }
    process($rest);
}


Калі не прыбраць значок камэнтара перад my $rest; , то Пэрл, натуральна лаецца на неаб'яўленую зьменлівую $rest . Пытаньне: чаму Пэрл ня лаецца на неаб'яўленыя $a і $b ???
Адказ )

Tags:

(2 comments | Leave a comment)

August 12th, 2002
05:33 pm
[User Picture]

[Link]

Сiненькi сьцiплы бульточак
Каля паловы часу application developer'а йдзе не на ўласна распрацоўку праграм, а на барацьбу з чужым кодам - third-party APIs, controls, etc. Пры гэтым у мяне, здаецца, з ростам квалiфiкацыi гэты адсотак расьце, бо даюць правiць усё больш кавалкаў, да якiх другiя проста ня ведаюць як падступiцца.
далей гiсторыя пра VB, майкрасофтаўскiя й шэрыданаўскiя чэкбоксы )

Current Music: Pere Ubu - St. Arkansas
Tags:

(2 comments | Leave a comment)

April 26th, 2002
02:03 pm
[User Picture]

[Link]

За што я не люблю Perl
За тое, што ён не вiдавочны )

Current Music: Clan of Xymox - Clan of Xymox
Tags:

(14 comments | Leave a comment)

Powered by LJ.Rossia.org