42

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?

KeyboardWielder
  • 5,956
  • 25
  • 55
  • Nice - I like that it's a story, this time, instead of a song. Will be interested to see the answer. – Khale_Kitha Mar 31 '16 at 20:38
  • Haha, like your questions :-) – ABcDexter Mar 31 '16 at 20:39
  • I am guessing the story is in UK english? – Arcane Apr 01 '16 at 04:52
  • As a programmer, I have no idea where to begin, but the product of the two numbers converted to hex, and then split up in three seperate hex values and converted to ascii, translates to "muf". But getting the factorial from that doesn't make any sense – nine9 Apr 01 '16 at 08:10
  • @nine9 Maybe the factorial is intended to indicate an explanation point? Not sure what "muf!" would mean, though. – DylanSp Apr 01 '16 at 13:49
  • @nine9 why "muf"? The binary equivalent is 01110101 01100110 and it's just "uf" – Alessandro Apr 01 '16 at 15:23
  • @AlessandroNiciforo: You seem to be using a 16-bit data type / format specifier / calculator... – KeyboardWielder Apr 02 '16 at 08:28
  • Is it of any significance that the first letters of the first six lines spell out "Taiwan"? (I suppose not, since it doesn't seem to relate to the answer you said was correct, but still.) – vvye Apr 04 '16 at 12:05
  • @vvye: I don't see that (perhaps your font / window size is word-wrapping lines differently). But that would be a freaky coincidence - not intended at all. – KeyboardWielder Apr 04 '16 at 13:25

3 Answers3

28

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!

KeyboardWielder
  • 5,956
  • 25
  • 55
Scott M
  • 1,630
  • 14
  • 19
2

Only a partial answer, but I think this is a play on the meaning of the word

socket

because

UK mains sockets have blue (neutral), green (earth) and red (live) wiring (b, g and r being the variables in the if block). In computer programs a socket is an endpoint for a network connection but I think that's misdirection here.

Other notes:

The if block

would always be executed because the condition is true.

factorial()

probably indicates an exclamation mark

queue()

might mean to reverse the order of the characters since a queue is a FIFO (first in first out) so "!fum" rather than "muf!" ?

Vicky
  • 2,095
  • 10
  • 12
  • 275903 is the HEX code for dark green(http://www.colorhexa.com/275903), which could tie into your 2nd spoiler – SlashmanX Apr 01 '16 at 14:56
  • The r, g and b could fit with any computer-related concept, not necessarily with your interpretation of 'socket'. – fffred Apr 01 '16 at 15:05
0

Answer:

it is your day at work!

Explanation:

charge();

this can be your breakfast / cup of coffee at home, to charge you for the day or the fee you pay to enter the highway

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

26 * 275903 translates to "uf" in Ascii, its factorial is "uf!" and this is what you say while you're in queue to get to the office by car (you must be driving on a busy route)

While these 2 points make perfectly sense to me, the next ones are a bit stretched....

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

You're a programmer and you pull the project? ... and it's written in English

if (true)

Every day

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

You take the source code, you review and muddle it, update it and you (don't) push it

Alessandro
  • 841
  • 6
  • 14