Friday, June 23, 2017

word problem - The telltale code


The other night, while writing this Java class that could be serialized into a socket, I fell asleep and had a weird dream.


In my dream, when I ran the program, the socket and the class object suddenly came alive. I tried to walk away from them but they followed behind.


As I desperately tried to change the program, I found the following strange piece of code in it, having no apparent rhyme or reason:


charge();
queue(factorial((26 * 275903).toAscii()));


h = m_socket[0].object;
assert( h.locale == "en_GB" );

if (true)
{
b = h.extractInternalStructure();
g = hash(b);
r = b.read(g);
// m_socket[1].send(r);
}


Which story had I been dreaming?



Answer



I don't have time to flesh out every detail right now, but the story is clearly



Jack and the Beanstalk.



Some of the clues that give it away:



A charge is a fee, queue is FIFO, and the ascii gives fum!, i.e. "Fee fi fo fum!".

The variable h represents Jack, an Englishman (locale = en_GB).
Be he alive or be he dead (always true), I'll grind his bones (extract internal structure and hash it) to make my bread (b.read(g)).



Some more:



"m_" is a coding convention to denote a "member". m_socket[0] denotes the nose and the "h" is the "object" of its sense. m_socket[1] denotes the mouth, and the comment line implies that the result would be eaten.



In the back-story:



A "jack" is a type of socket and a Java "bean" is a special type of Java class/object that can be serialized (among other properties). In the story, the two follow behind, i.e. "stalk" the author. Thus: Jack and the bean stalk!




No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...