From a discussion at Not a kernel guy
The cafe trash bins are in groups of three pieces: for plastic, aluminum cans and the rest of the garbage. There are big icons on them so that no one would throw plastic can to the usual garbage bin. It would be nice but cleaners change bins places from time to time, which causes customer pain and frustration. Each person that has already raised arm to throw, hangs on for ten seconds, trying to understand what happened.
I laughed at the classification of the solutions offered in comments:
Static cast: You should have three bins of different shapes and make a stand with according slots then put them in a different order will be problematic.
Dynamic cast: You should stick the same icons opposite each bin then the cleaner would recognize these stickers and would think about the right order…
Duck typing: You should replace all bins of exactly the same without the icons, but put them on trays with icons (indicating the type of garbage) - ie indication of the type is external to the container =).
Showing posts with label fun. Show all posts
Showing posts with label fun. Show all posts
2007-12-11
2007-11-26
In Gates we trust
Sometimes it seems that authors that compile lists of esoteric programming languages underestimate bat files possibilities.
rem The current day of a month
for /f "tokens=2,*" %%i in ('date /T') do (
set dt=%%i
)
set dt=%dt:~0,2%
tags:
fun
2007-10-26
Under pressure.
Recently I very often come across posts shouting about the degradation of the programmer profession.
Let me join to these lamentations of Jaroslav's daughter.
Here is a part of a file with payment documents:
Can you see the error?
Here is more evident sample:
Here even the total sum does not match the sum of the parts.
But we always glad to divide millionth of kopeks Ж)
Gosh...
Let me join to these lamentations of Jaroslav's daughter.
Here is a part of a file with payment documents:
<payment id="14525" date="2007-10-24 00:00:00"
agent="4" rkc="1" operator="1"
total="8251" operduty="7407.32"
agentduty="539.171" sysduty="304.509"
bankduty="0"/>
Can you see the error?
Here is more evident sample:
<payment id="14795" date="2007-10-24 00:00:00"
agent="145" rkc="1" operator="1"
total="358010" operduty="325789.10000001"
agentduty="28640.799999998" sysduty="3580.0999999998"
bankduty="0"/>
Here even the total sum does not match the sum of the parts.
But we always glad to divide millionth of kopeks Ж)
Gosh...
tags:
fun
2007-10-22
Find your mind
I've met it here
Задача: Let it be A(x, y) = K(x2 + y2). Express A(r, φ).
Phisicist answer: A(r, φ) = Kr2.
Mathematician answer: A(r, φ) = K(r2 + φ2).
By the way, may be the problems described in the article Problem Solving and the Use of Math in Physics Courses are not the problems at all?
Very often complicated stuff come home to me in the three stages. The skill of using does not come simultaneously with the understanding of what the matter is.
Another issue is that for many University exams passing was enough to pass the first stage.
Задача: Let it be A(x, y) = K(x2 + y2). Express A(r, φ).
Phisicist answer: A(r, φ) = Kr2.
Mathematician answer: A(r, φ) = K(r2 + φ2).
By the way, may be the problems described in the article Problem Solving and the Use of Math in Physics Courses are not the problems at all?
Very often complicated stuff come home to me in the three stages. The skill of using does not come simultaneously with the understanding of what the matter is.
Another issue is that for many University exams passing was enough to pass the first stage.
tags:
fun
2007-02-16
What a wonderful world ....
It's hard to believe but it's true: If in the decimal representation of a fraction 1/p, where p is prime number and the length of a period is even then after adding the first half of the period with the last one we'll get only nines(!)
For example:
For example:
1/7 = 0.(142875) 142 + 875 = 999
1/13 = 0.(076923) 076 + 923 = 999
tags:
fun
2007-02-05
Linux: Fun stuff
# man factor
NAME
factor - factor numbers
DESCRIPTION
Print factors of each NUMBER; read standard input with no arguments.
NAME
factor - factor numbers
DESCRIPTION
Print factors of each NUMBER; read standard input with no arguments.
2006-12-12
Mess
I've just forgotten parentheses in a constructor declaration... and got
--------------------Configuration: credits - Win32 Debug--------------------
Compiling...
DocumentState.cpp
D:\MyProjects\Credits\Classes\DocumentState.cpp(24) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1794)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
Error executing cl.exe.
creditsD.exe - 1 error(s), 0 warning(s)
2006-10-31
2006-10-23
Links: Pythagorean Triple
Have you known that a right-angled rectangle with integer-valued sides always has an even perimeter? And that the multiplication of all sides is always multiply of 60?
A remarkable article Pythagorean Triple
A remarkable article Pythagorean Triple
2006-08-22
The eternal truth
const BOOL ShowAllControls=TRUE;
if(somecondition() || ShowAllControls) {
}
else {
}
crosspost at code_wtf
2006-06-29
Quote: about the documentation
Took it here
So far there's a couple of dozen HOWTOs, but a poor selection of WHENTOs and only some abstract WHYTOs
So far there's a couple of dozen HOWTOs, but a poor selection of WHENTOs and only some abstract WHYTOs
tags:
fun
2006-03-04
The programming: 99 bottles
Oh, amazing site - www.99-bottles-of-beer.net It collects a great many programs in different languages printing plain and simple song:
What languages there are not here: ANT, J, K, CLIPS, Erang, Ocaml, 1C, naturally there are C/C++, Java, Perl.
Some exoteric languages made me smile - Ook! (This is for those who read Pratchett),
Shakespeare Programming Language (at least a brief acquaintance with works of the author with the same name is also recommended), Multithreaded Brainf * ck, procmail.
But as the most beautiful solution I unexpectedly chose a program in Refal.
With the printing the beginning of the song all languages cope pretty enough. The simple end spoils everything:
In some languages code is short, simple and clear but either incorrectly declines «1 bottles», or gladly reports in the end «0 bottles of beer on the wall». After fixing it becomes huge and confusing.
ANT by using the extensions package ant-contrib demonstrates the all ugliness of XML for recording consecutive actions.
But 1C code looks rather good due to the presence of operator ? in the language. If there is no petty operator + it would be not so bad illustration of imperative approach for solving this problem.
Excel VBA wonderfully demonstrates what terror can come out of it if do not separate logic from visual appearance.
Common Lisp code made me smile — the only program, which actually does what was requested — printing the song. In the language standard there is 'format' function (highly advanced analogue of C printf) its abilities are pretty enough for this song :).
Program in Scheme generates the required string in compile time. There there is a terrifying realization and quite good one.
C++ solution with using templates amazes by its laconism and demonstrates a simple rule-based approach in compile time.
Rule-based forward chaining language CLIPS fits successfully. It's a little bit verbose, but then easy extended.
For some reason neither JESS nor Drools solutions are present. Aren't they unpopular?
Java Exception oriented programming is the joke of the month! throw new BottleExeption(1), and redefine printStackTrace() method %)
Refal is great! Pattern matching is a wonderful tool for the decomposition.
I expected to see something similar in OCalm, but in the beginning they build recursive variant type isomorphic to the song verses and after that the substitution is going on. I have not understood yet either it is an awfully overhead, or a remarkable approach, using effectively the advantages of compile time and run time.
At the same site there is a lot of programs written in different Assembler dialects, Basic and SQL, but they are not so interesting for me.
99 bottles of beer on the wall, 99 bottle of beer!
Take one down, and pass it around. 98 bottles of beer on the wall.
98 bottles of beer on the wall, 99 bottle of beer!
Take one down, and pass it around. 97 bottles of beer on the wall.
...
What languages there are not here: ANT, J, K, CLIPS, Erang, Ocaml, 1C, naturally there are C/C++, Java, Perl.
Some exoteric languages made me smile - Ook! (This is for those who read Pratchett),
Shakespeare Programming Language (at least a brief acquaintance with works of the author with the same name is also recommended), Multithreaded Brainf * ck, procmail.
But as the most beautiful solution I unexpectedly chose a program in Refal.
With the printing the beginning of the song all languages cope pretty enough. The simple end spoils everything:
...
2 bottles of beer on the wall, 2 bottle of beer!
Take one down, and pass it around. 1 bottle of beer on the wall.
1 bottle of beer on the wall, 1 bottle of beer!
Take one down, and pass it around. No more bottles of beer on the wall.
No more bottles bottles of beer on the wall, No more bottles bottles of beer!
Go to store and buy some more. 99 of beer on the wall.
In some languages code is short, simple and clear but either incorrectly declines «1 bottles», or gladly reports in the end «0 bottles of beer on the wall». After fixing it becomes huge and confusing.
ANT by using the extensions package ant-contrib demonstrates the all ugliness of XML for recording consecutive actions.
But 1C code looks rather good due to the presence of operator ? in the language. If there is no petty operator + it would be not so bad illustration of imperative approach for solving this problem.
Excel VBA wonderfully demonstrates what terror can come out of it if do not separate logic from visual appearance.
Common Lisp code made me smile — the only program, which actually does what was requested — printing the song. In the language standard there is 'format' function (highly advanced analogue of C printf) its abilities are pretty enough for this song :).
Program in Scheme generates the required string in compile time. There there is a terrifying realization and quite good one.
C++ solution with using templates amazes by its laconism and demonstrates a simple rule-based approach in compile time.
Rule-based forward chaining language CLIPS fits successfully. It's a little bit verbose, but then easy extended.
For some reason neither JESS nor Drools solutions are present. Aren't they unpopular?
Java Exception oriented programming is the joke of the month! throw new BottleExeption(1), and redefine printStackTrace() method %)
Refal is great! Pattern matching is a wonderful tool for the decomposition.
I expected to see something similar in OCalm, but in the beginning they build recursive variant type isomorphic to the song verses and after that the substitution is going on. I have not understood yet either it is an awfully overhead, or a remarkable approach, using effectively the advantages of compile time and run time.
At the same site there is a lot of programs written in different Assembler dialects, Basic and SQL, but they are not so interesting for me.
Subscribe to:
Posts (Atom)