Monday, June 28, 2004

Maths: Where is the father?

At present the mother is 21 years older than her son.
After 6 years, the age of the mother will be 5 times the age of the son.

Question: Where is the father now?

Solution:
Today:
the son is X years old
and the mother is Y years old:
--- X+21=Y

In 6 years:
--- 5(X+6)=Y+6
-------------------------------------------------
5X+30 = X+21+6
4X = -3
X = -3/4

The son is -3/4 years old. That means -9 months.

So, the father is on top of her ....

Friday, June 25, 2004

DDHH: God is real...

"God is real; unless declared integer"

UUU: Multi-line grep with AWK

UUU - Unbelievably Useful Utilities:

I will be talking more about awk, awk vs. perl later, but this time I would like to demonstrate how easy it is to have versatile multi-grep functionality using AWK.

The goal is to print previous or next line that follows/goes before a line consisting of dashes (i.e. comments in C++/Java, text file with headings, etc.).

The text file is

test.txt
before line 1
--------
after line 1
x
y
z
before line 2
--------
after line 2
x
y
z
before line 3
--------
after line 3
x
y
z



grepAfter.awk
/^-+$/{


getline nextLine
print nextLine
}



Command line:
awk -f grepAfter.awk test.txt

Output Listing:
after line 1
after line 2
after line 3




grepBefore.awk
/^-+$/{


print prevLine
}
{
prevLine = $0
}


Command line:
awk -f grepBefore.awk test.txt

Output Listing:
before line 1
before line 2
before line 3


Thursday, June 24, 2004

DDOHH: Chinese Proverbs


Ok -- so some of these are cheesy, but sometimes cheesy is good -
Enjoy!

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*

1. Virginity like bubble, one prick, all gone.
2. Man who run in front of car get tired.
3. Man who run behind car get exhausted.
4. Man with hand in pocket feel cocky all day.
5. Foolish man give wife grand piano, wise man give wife upright
organ.
6. Man who walk through airport turnstile sideways going to Bangkok.
7. Man with one chopstick go hungry.
8. Man who scratch ass should not bite fingernails.
9. Man who eat many prunes get good run for money.
10. Baseball is wrong: man with four balls cannot walk.
11. Panties not best thing on earth! but next to best thing on earth.
12. War does not determine who is right, war determine who is left.
13. Wife who put husband in doghouse soon find him in cat house.
14. Man who fight with wife all day get no piece at night.
15. It take many nails to build crib, but one screw to fill it.
16. Man who drive like hell, bound to get there.
17. Man who stand on toilet is high on pot.
18. Man who live in glass house should change clothes in basement.
19. Man who fish in other man's well often catch crabs.
20. Man who fart in church sit in own pew.
21. Crowded elevator smell different to midget.

Wednesday, June 23, 2004

NRY: Absolute Friends by John Le Carre

Absolute Friends by John Le Carre

ISBN: 0316000698

Yet another disappointment and subtlety in book publishing industry. Foyles was selling latest Le Carre for £6.99. And only when I called them and asked for the book they said that it's "duty free" edition. Special soft-cover printed to be sold in airports only.

Tuesday, June 22, 2004

Comment: Writing Code Is Stupid

Writing Code Is Stupid
by Ian Wij

I agree with many concepts/points you declared in your article. Especially that code generation put into comparatively narrow context of 'informational systems' becomes manageable and cost-effective.

> So why hasn’t this been done already?
That's what I would like to comment on. It was. The tool called Synon/2E (later cool:2e, later Advantage:2e, now owned by CA.com) did it 20 years ago and (surprise-surprise) keeps going on: generates informational systems from business logic specifications.

The success/failure of many CASE tools I would say were a 'balance point" when a tool while evolving functionality instead of honestly generating code began to stuff 'AI' heuristics. There is a subtle difference I would say between 'raising abstraction' and 'increasing complexity'. And many CASE tools intermix these concepts.

DDHH: Daily Dose of Healthy Humor; Infinity lesson.

Click here for Interactive Lesson about Infinity

http://www.mathmojo.com/interestinglessons/interactiveinfinity/Infinity1.html

Far phenomena

www.rarsoft.com

I still am looking for reasonable explanation of programmers that trade fashion for functionality.

The Norton Commander (or Far in its new incarnation) serves my needs for the last 15 years. The copying/moving operation does indeed involve TWO panes by definition source and destination. As well as many other file management operations. Windows Explorer NEVER had such mode thus it never was efficient or convenient for file housekeeping.

And nevertheless, most people prefer Explorer?!… Lets hope this blog would help enlighten at least some of them who are not completely hopeless.

IRL: Garry Jennings, Aztec

Aztec by Gary Jennings
ISBN: 0812521463

Yet another gem that is not published anymore and can be found only in second-hand book stores. Amazing story and superb storytelling.

Monday, June 21, 2004

IRL: Stratagems. List of the Thirty-Six Strategies

Stratagems
List of the Thirty-Six Strategies

Another classical text. Hardly any comments are required.


http://balder.prohosting.com/ylesiuk/case/rdng/List.htm
(from http://www.chinastrategies.com/List.htm)

New entries to Inspirational Reading List.

Five Rings by Miyamoto Musashi.

http://balder.prohosting.com/ylesiuk/case/rdng/FiveRngs.htm

The book that triggered my desire to buy Musashi by Eiji Yoshikawa
(ISBN: 4770019572). And it IS pretty damn hard to persuade me to buy anything in its hardcopy...

2e java generator

The 2e-to-java generator project progresses. Slowly but surely.

The java arithmetics expressions generator is ready. The logical expressions generator is approaching. The nesting statements are working.

So now, its time to concentrate on persistancy layer.

At last...

I was thinking about creating blog for myself for some time.

At last one definitive factor overweighted my laziness. As a result I can track/memo myself:)