[Archive c 17.03.2008] Humour [Archive to 28.04.2012] - page 155

 
< $andman > $months = array("July", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

Do you also have a zero month or do you just subtract the one?
 
 
 

A programmer's dream (Tough).

I had a wonderful dream today. I dreamed that I invented a new, totally awesome programming style. Programs written with this style turned out to be very compact and very easy to read. At least in the dream, when I rewrote an existing program in the new style, it was ten times smaller. And it was very easy to read, because with one glance I could cover a piece that previously took several pages and immediately understand what it was doing and how.

The point of the new concept was this.

The program becomes very bloated in size, because it uses long mnemonic identifiers. This must be avoided. For instance, Perl often uses such a variable as '$_' that always means something different. I figured out that it would be a damn good idea to use the '|' symbol. That's why it makes the program the most compact.

This symbol should be used everywhere - both as variables and as function arguments. If a function has several arguments, you should use caching and reduce it to several functions with a single argument. In the end I even managed to rigorously prove mathematically that any program in any language can be rewritten using a single identifier '|' for all variables. The proof was very short, in one line, and very elegant. Unfortunately, when I woke up, I couldn't reproduce it. Using a primitive preprocessor that I wrote in my sleep in five minutes, I managed to ensure that the symbol '|' was also used for the names of all classes and all functions, all class methods and all other identifiers used in the language (the language was not important, the preprocessor did not go into semantics, but simply replaced all found '|' with the usual identifiers by a tricky rule, so that it would all compile normally). Which variable, class or function we were referring to by writing '|' depended on the context. For example, the first time | is mentioned it means the first class, the second time it means the second class, and so on. Just describe the classes in the order you will use them, and it will work itself out. Similarly with functions, etc.

After thinking about it some more, I decided that the function names could be empty altogether. All functions would be nameless. If an opening parenthesis is found - the compiler or interpreter understands that we call the unnamed function, and then in parentheses will be its only argument - '|'.

So I finally woke up and ran to my computer, trying to keep such a wonderful programming paradigm in my head and write something down, because I forget dreams quickly.

I urgently opened my notebook and with trembling hands wrote down what a call to an unnamed function would look like with a single argument |

(|)

When I looked closely, I recognized something familiar in this picture. It was a shock. How cruel and insidious my subconscious mind is. It had decided to insult me. It could have just dreamt my arse off. But no, that would have been too rude and primitive! It decided to make me draw my own asshole without me knowing it until the last moment! It started from afar. And brilliantly set a trap for me, which I fell into like a last sucker. :'(

At times I can hear the gloating laughter somewhere deep inside me.

 
The summary of the girl sysadmin is super, even if it is an accordion.
 

Cable stacker

I once had an urgent need to lay four dozen twisted pair wires over a distance of a hundred metres. Most of the distance was over a three-metre high drop ceiling. When I realised that the problem could not be solved in a reasonable time, I started to ask my boss to hire a third party fitter, and he kindly agreed. I drafted the terms of reference, sent them out to various companies and waited.

One of the proposals stood out from the crowd. The guys claimed that the work would be done in just one day, and three times cheaper than any of my competitors! Just in case, I called them back and asked if they understood the task correctly. They replied that they understood perfectly, and that the speed and low cost were due to the use of a cable laying machine. I was intrigued - I used to work with cablelayers in the army, and I had absolutely no idea how I could adapt the device to laying twisted pair cable under a false ceiling.

On the appointed day only two installers arrived with ladders and tools. Watching the unloading process, I was looking forward to the miracle machine, capable of automating the process. The machine didn't arrive, but a small dachshund was the last one to be unloaded from the van. I had no sooner was I surprised by appearance of an animal, than it was explained to me that it was a mysterious cable-laying machine.

The dachshund was provided with a special suit with a handle along its back for carrying, a head strap with an LED light and a harness. The cable was attached to the harness and the dachshund was launched into a hard-to-reach spot. The untrained animal would dash at the sound of a voice or the light of a torch, dragging the wire behind him. The ceiling was sufficient to withstand the dog, but the power was enough for about fifty meters.

The speed in long and hard-to-reach areas was fantastic. The dachshund scampered up one side and back down the corridor, frightening the female staff. Even an accident involving a fallen ceiling panel had no effect on her mood: a stretched wire acted as a safety rope, and the doggy sank gently to the floor. The guys said the cable-handler was accustomed to such situations.

They laughed but they were serious about keeping the dachshund on the balance sheet of their company - I was shown the documents. The job was done in less than a day, and without any cable uncoiling and, consequently, without any scraps. However, the work of our office came to a complete standstill - the whole population came to watch the cable-laying machine at work.
 
Appearance, you say? I go to the RCC to pay my utility bills. In front of me stands.... either a late guy or an early man - it's hard to tell. He looks like something from a war chronicle: rather coarse stubble, sunburned face covered with sweat and fine grey dust, high kirzov boots, breeches and tunic of khaki colour with epaulets of Soviet army times, panama-panamas, something like an army PPS and Wehrmacht "trapeze" on his shoulders, to which a kind of bag was attached, from which an axe, a spade and a saw stick out, and outlines of a planer can be seen. Dust, sawdust and wood shavings are strewn liberally over breeches and boots. Who can look like that - a carpenter, right? He goes to the cash register, shovels some papers, and all of a sudden the cashier gives out:
- Oh! And my car broke down!
The man, as if nothing had happened:
- Alt-C.
The cashier doesn't get it:
- What?
- Alt plus Y. Control plus F5. F5 is one key. Next. Next. Default option. Enter. There you go, and you say "broken".
The cashier, looking at him with huge eyes, returns his receipts and asks:
- How do you know that?
Man, tiredly:
- I wrote it. Don't put your elbows on the keyboard again.