A Polymath Programmer survey, because I can’t read minds

The stars have informed me that (closes eyes and places fingers of right hand on forehead), unbeknownst to my inattentive mind, Polymath Programmer had gained quite a few new readers over the past few months. … Alright, fine, the stars had nothing to do with it. I was looking through some of my web stats and analytics information.

So if you’re a new reader, welcome! As a short introduction, you will find articles on math, programming and other (hopefully intellectual) points of interests here. A few articles you might be interested in:

If you’re a long time reader, I’m *sniff* very thankful for your support. *single tear* You’ve been an invisible strength to me during those lonely hours of coding, research and writing.

Now for the main crux. I’m conducting a survey. Even though I can solve programming errors by simply being near them, I can’t read minds. I’m still working on that…

All I ask is your name and email address, and to answer 3 questions. That’s it. All 5 parts are optional, so you don’t have to fill it if you don’t want to (it’ll be nice if you do though).

[UPDATE: Your name and email address is used only for the survey. They are kept confidential, and are not shared with nor sold to anyone. I just want to thank you personally for helping with the survey, that’s all. The survey is intended to let me know more about you, so I can write articles better suited to your interests. Polymathy may encompass many subjects, but it’s easier to start somewhere.]

And here’s the survey link:

[SURVEY CLOSED]

I’m using the service from Survey Monkey. I also notice that their web pages are .aspx. Yay ASP.NET! Ok, that was random…

Parsing date formats with dd/MM/yyyy or MM/dd/yyyy?

I was angry and frustrated. The developer tested his code, and it failed. When he sent it to me for help, I tested it, and it worked. Isn’t it supposed to be the other way around? Someone writes the code and it works for them, but when it’s reviewed by you, it fails?

That developer couldn’t get the date selection right. I wrote a web control library which includes a date selection widget. When I designed it, to simplify things, I hardcoded the date parsing to be dd/MM/yyyy format (I’ll explain my choice later on).

What happened was, the developer either got the yellow screen of death (if you’re working in ASP.NET, you know what I’m talking about), or the day and month were swapped.

Finally, I asked him if his computer settings had MM/dd/yyyy as the default short date format. And if it was, to change it to dd/MM/yyyy. It was, and he changed it, and the code worked.

The default date setting on computers running on Windows is MM/dd/yyyy format. I change it to dd/MM/yyyy format because Singapore uses that format. And my users’ main business involves a big company residing in United Kingdom, which also uses the dd/MM/yyyy format.

Here’s how you change the settings. Go to Control Panel, and click on “Regional and Language Options” or something named similarly. You’ll get something like:

Regional and Language Options

Click on the “Customize” button to get:

Customize Regional Options

In the “Short date format” dropdownlist, enter “dd/MM/yyyy”. You may not find it under the dropdownlist options. This is what some people don’t know: You can type “dd/MM/yyyy” in the dropdownlist. Click “Apply” button, then “OK” button, and you’re set.

Here’s some code to test your changes:

System.Globalization.CultureInfo c = new System.Globalization.CultureInfo("en-GB", true);
DateTime dt1 = DateTime.ParseExact("05/08/2009", "dd/MM/yyyy", null);
DateTime dt2 = DateTime.Parse("05/08/2009");
DateTime dt3 = DateTime.ParseExact("05/08/2009", "dd/MM/yyyy", c);
DateTime dt4 = DateTime.Parse("05/08/2009", c);
Console.WriteLine(dt1.ToString("D").PadLeft(30) + " | " + dt1.ToString(c));
Console.WriteLine(dt2.ToString("D").PadLeft(30) + " | " + dt2.ToString("dd/MM/yyyy"));
Console.WriteLine(dt3.ToString("D").PadLeft(30) + " | " + dt3.ToString("MM/dd/yyyy"));
Console.WriteLine(dt4.ToString("D").PadLeft(30) + " | " + dt4.ToString());

Did you get the values you expected?

Here’s the comparison output from the American MM/dd/yyyy and British dd/MM/yyyy format:
Regional settings test output

Note that the code remained the same. Only the regional settings were changed.

So what I found out was that, as long as you explicitly state the date format (or use a culture setting with your desired date format), it works whether you’re parsing in the date string, or printing out the date.

Despite changing the settings, I still had a date format issue which I asked on StackOverflow. It was some time ago, but I didn’t get a satisfactory answer. Then again, it was my colleague’s problem and he’s fine with the weird behaviour… The problem could be because he didn’t explicitly set the output format, which displayed the wrong date on the screen, even though the regional settings are correct on the web server.

Are corporate programmers also polymath programmers?

I’ve been writing for more than 2 years now, and I realised that I never told you much about my professional job. Let’s start with a brief summary of how I started…

Beginning of professional career

I started working a few months after I graduated in 2002. I had a science degree in applied mathematics and computational science, but that didn’t stop me from applying for the software engineer, software developer, application programmer, systems analyst and other confusing variants of the job title. I like programming.

Once, I worked in a startup company, writing software to deal with patents. One of the requirements was “must know regular expressions”, used for searching through the patent text, so I put my mind to learning it. I got the job. The funny thing was, the CEO handed that part of the coding to an intern. Oh wait, a PhD intern. Maybe I wasn’t qualified to touch regex…

Somewhere in that career history of mine was a software development house. The team I was in, was assigned to develop an enterprise product for a Japanese company. It’s an internal website, and handled work flow processes, task assignment and other enterprisey functions.

Half the time, I was helping to complete some sections of a business class. A third of the time, I was doing the testing, because I seem to be the only (expendable) one with more than coding skills. Because I had experience talking with users, coming up with specifications, database design, setting test environments and oh yeah, coding.

They even offered me a role in translation, after they heard I knew Japanese. Correction I told them, I knew a little teensy bit of Japanese. They had an overflow of programmers I guess… (it was a team of 10 programmers. Or was it 12?).

In the present

Currently I’m working in a telecommunications company in Singapore. Actually, I started my first job in the same company too. After the first few years, I joined the startup. Then left and joined the software house. Then left, and rejoined my current company, but in a different team (still in the billing support department though).

The interesting thing is that I’m dealing mostly with satellite data, not mobile phone data (one of the core business of telecommunications companies). And my users are like a complete company, albeit on a small scale.

They have their own departments on customer service, marketing, sales, and to a certain extent, their own IT team. And that IT team is composed of 3 people. And I’m one of them. I have a supervisor and a colleague who handles the backend programs (mostly C and C++ on Unix).

Me? I’m the frontend guy, and the everything-else guy.

Because of the unique service (compared with the rest of the company) dealing with satellite data, my team is involved with everything from the call records of the customers, to the configuration of their price plans, to billing the customers, to settling profit with the satellite providers. The satellite business is quite interesting, and I’ll tell you more in a future article.

The other team mates focus on collection of the raw file containing the call records, processing them, calculations of the bills and other backend stuff. I handle all the stuff that users will see and interact with, like Windows applications and web applications. And I manage the Windows servers the web applications are running on. And there’s the updating of the SSL certificates for the web applications. Once I was at the data centre during a power maintenance, because someone needed to be there to flip the on-off switch of the servers and check on the equipment.

My work is seen by a lot of people, which includes the customers, the sales staff, the marketing staff, the product managers, the administrative staff and the customer service officers. This means I get a lot of queries.

If a number doesn’t tally with the total, someone sends me an email.
If the font size is too small, someone sends me an email.
If the Excel download fails, someone calls me.
If the data cannot be found, someone calls me.
If they can’t open an FDF file, they call me.
If the offshore Chinese colleague have questions on business logic or web design or code design, he/she calls/emails me.

If [something happens], someone [calls/emails] me.

In short, I get interrupted a lot. Nice private offices? Not a chance.

And I still have to write code so the projects actually ship before deadlines.

There was once where I had 1 month to come up with a new website for the customers to view their call records (brand new .NET web application, new user interface, completely new database schema). That was a December (the sales people had to move fast to get that contract before the start of the next year, which meant I had to work fast). And another colleague from another team was reassigned, and his work was handed to me (basically I was covering for 2 teams). And I received calls and queries from the users of both teams.

And the new website was out in the world on time. *whew*

Do programmers who work in a corporate environment go through similar experiences? Do they handle many non-programming related work? Are corporate programmers also polymath programmers?

I’m stumped, since I probably have this naive notion of programmers just programming (to a large extent). My friend once asked me what I do at work. I didn’t know how to answer, so I rattled off a few tasks mentioned above, and he’s surprised I do so many different tasks. Particularly when I sometimes have email correspondence directly with customers, which I try to avoid for business reasons. The sales and customer service teams are supposed to be the frontline, not me.

Helping corporate programmers on time management

This brings me to a personal project. I’m creating a product about time management for corporate programmers, working title “Time management for corporate programmers – Handling interruptions, removing distractions and getting the Flow”. Or some such.

All the writings and articles on this site will continue to be free. I’m writing an ebook to help fellow corporate programmers (maybe even programmers in general) with what I know. And this endeavor might just be able to support this site. The articles are fun to write, and I love the brilliant comments by you (even the ones that tell me I’m wrong. Those are awesome).

Actually “time management” is too specific. I’ll be writing on discipline, control and health. There will be some quick tips on data migrations and doing your miscellaneous tasks with free tools (because you know, companies are always cutting the budget). My notes actually look like a jumbled mess, but maybe that’s the nature of polymaths… or just me.

So do you have any questions about time management in a corporate setting? Or even time management in general? What are the typical tasks you do? How can I help you do your job, the tasks you really want to do (it’s coding and shipping software, right?), better?

*whispers* Psst, it’s ok if you’re a student/coder. I was a student/coder once. Just ask.

Let me know in a comment, or if you’re shy, use my contact form to email me privately. You can also talk with me on Twitter (@orcasquall).

I’m really excited about this project.

The monkey and negative number of coconuts

Coconut trees

There’s this math puzzle that I recently heard from my friend. Here it goes:

The puzzle

In the not so distant past, there was this small island. And there’s this monkey… what? Yes, it’s alone. Ok, fine, he’s alone. Yes, poor thing.

So, on this island, there were many many many coconut trees. And each of them bore enough fruits to collectively and breath-of-a-hair-barely escaping the sinking of the entire island. These palms were fertile, I tell ya.

And there were them these pirates, ya know. Arrr! And they were five in all. Ok, you can stop arrr-ing now. Huh? What were these pirates doing on the island? Uh, they got stranded? How do I know? (*whispering to myself* the filthy swashbuckling buccaneers…)

Anyway, they saw them these coconuts just hanging there, and they thought they were in coconut heaven. They proceeded to gather all the coconuts they could get their hands on. Hmm? They might have some food on them. Uh, maybe they had cravings for coconut?

The monkey saw what they were doing, and went to help them. Finally, at sundown, they… what? It took maybe a day… Yes, that means the pirates arrr-ived in the morning. Alright, let me continue the story, will ya?

So at sundown, they were exhausted, and decided to divide the coconuts the next morning. And they went to bed. Or sand. Or whatever they used as makeshift beds.

During the night, one of the pirates woke up, fearing the others would betray him. And so he started dividing the pile of coconuts into 5. While he’s busy counting and dividing, the monkey came to the pile, took a coconut, opened it up and started eating. The fearful pirate, afraid of startling the monkey and making more noise, just let the monkey be. It turned out well, for he divided the pile evenly into 5. And then hid his share of the coconuts. And he went to sleep.

And another pirate, fearing the same thing, woke up just after the first pirate went to sleep. And he divided the rest of the coconuts into 5. And the monkey also took a coconut and ate it, bemused at the stealth tactics employed by the counting pirate. This second pirate was satisfied that he counted correctly and that he divided the pile evenly into 5, so he let the monkey go. Besides, he was busy hiding the coconuts and trying to be quiet.

A third pirate did the same thing, dividing the remaining pile of coconuts into 5. And the monkey did the same thing, eating a coconut while the pirate was having trouble because he didn’t have enough fingers on his left hand to help him.

And a fourth pirate did the same thing. And the fifth too.

At each quiet division of coconuts, the pile was divided evenly. And the monkey ate a coconut at each division. So, how many… Yes, the monkey ate a total of 5 coconuts. You’re so clever. So, how many coconuts were there in the original pile?

The solution (sort of…)

I am going to work backwards.

Let y be the number of coconuts left over.
Let x be the original number of coconuts.
Note that x and y must be integers.

At 5th pirate division:
He hid his pile, so we add his pile back.
What’s left would be 4 parts for the rest, so we get 5y/4 to get all the pirates’ share.
Oh yeah, we need to get the monkey to regurgitate his coconut.
Ok, maybe not…

So before the 5th pirate divided, we had
5y/4 + 1
= (5y + 4)/4

At 4th pirate division:
It’s 4 parts for the other pirates, so we do the 5/4 multiple again to get
5( (5y + 4)/4 )/4
And we add 1 from the monkey to get
5( (5y + 4)/4 )/4 + 1
= (25y + 20)/16 + 1
= (25y + 36)/16

Note the recursive nature.

At 3rd pirate division:
5( (25y + 36)/16 )/4 + 1
= (125y + 180)/64 + 1
= (125y + 244)/64

At 2nd pirate division:
5( (125y + 244)/64 )/4 + 1
= (625y + 1220)/256 + 1
= (625y + 1476)/256

At 1st pirate division:
5( (625y + 1476)/256 )/4 + 1
= (3125y + 7380)/1024 + 1
= (3125y + 8404)/1024

And so we have
(3125y + 8404)/1024 = x
=> 1024x = 3125y + 8404

Now, my first thoughts had something to do with the Chinese Remainder Theorem or the GCD or something. And I searched for the solution, because I have no idea how to start. And I came upon Diophantine equations.

And I have absolutely no idea how to solve the equation.

Now my friend did tell me that 3121 was a solution for the number of original coconuts, which would mean 1020 coconuts were left over. And something about modular arithmetic.

What is more interesting, is that he told me -4 is also a solution. I plugged it into the equation, and lo and behold! There were -4 coconuts left over.

Wait, what? So there were -4 coconuts originally, and after all the sneaking and counting of the pirates, and the monkey eating it’s, ok, his, (presumably) non-existent -1 coconut, we have -4 coconuts left over?

The only reason why that solution was confounding us, ok, me, no wait, you, arrr, whatever, is that an assumption was flawed. We can’t have negative numbers of coconuts. Not in this reality dimension anyway. Arrr.

But it’s interesting. -4 is a stable solution, in chaos theory parlance. I mean parrrlance. Arrr.

Final thoughts: Why would each pirate fear that the others would betray him, but was honest enough to divide the coconuts evenly? And how would the first pirate divide 3121 coconuts into 5 while keeping quiet (that’s a lot of coconuts)? And keeping his head straight? And keeping the monkey quiet?

This is why, sometimes, just because you can solve a math problem, doesn’t mean you should. Because it might not make sense in the first place.

P.S. This was inspired by my friend who told me about the puzzle, and the International Talk Like A Pirate Day. Arrr.

[image by akurtz]

Dramatising the Three Beacons of Twilight

In my ongoing quest to expand my repertoire of skills as a polymath, I have embarked on acting. Specifically, role playing. It takes a bucketload of courage to speak, for I am used to conveying words through my fingers to the screen, not from my mouth to my audience’s ears.

It’s even harder role playing a fictional character.

So I’ve resolved to include some roleplaying, some acting, some short speeches, that kind of stuff into my regular D&D gaming sessions. I want to see D&D as more than just dice rolls and statistics. The experience will also help, you know, in case I get invited on television or do videos *cough cough*.

There is this power that’s really awesome. It’s called “Three Beacons of Twilight”, a level 15 Invoker power. The flavour text reads, “In the darkest days of the war against the primordials, the gods used…” oh who cares about the flavour text? It does a fair amount of damage, and creates a zone that allows me to teleport people willy-nilly.

Fighting the elder blue dragon
My invoker’s the nearest to the top. The little hand-thingy represents the origin square of my Three Beacons of Twilight. Just in case you’re wondering, that’s the bad-ass elder blue dragon we’re fighting. We’ve got props too. The silver ring means it’s cursed by the warlock. The gold ring means it’s marked by the paladin. And the red ring? Means it’s half way dead (thank goodness!).

I sort of imagined the three beacons as stars in the sky. So during this last encounter for the day, I decided it was an appropriate move, and I launched fully into my dramatic pose and dramatic voice.

I call upon the Three Beacons of Twilight, named Waffles, Tea, and Fudgecake. I invoke their power word pronounced “WUHTUHF”, which is an acronym formed from their initials. Or WTF for short. WTF!!

My DM nearly fell off his chair laughing. I got a few smiles from my comrades-at-arms too. Success!

Then I rolled my d20 to determine if I hit.

And I rolled a 1.

My DM laughed even harder.

After the dramatic performance I put up, I failed to hit abysmally. Like I said before, I can’t roll to save my own life

Carcerian Stones – Wands of chrome

We’re continuing the D&D adventure story. Previously, our adventurers defeated some giant ants, was nearly skewered by a javelin trap, and successfully retrieved an ancient tome. We have Ryan the human DM, Dan playing Toth the goliath warden, James playing Heoriss the eladrin invoker, Ian playing Iofae the eladrin sorcerer, and Klenn playing Phileas the half-elf bard. And now…

*****

Dan: “offer a drop of sacrifice”…
Ian: Does it mean blood?
James: Alright, use mine. All of you were injured badly. I barely got nicked.

Heoriss borrowed Phileas’ dagger and made a small cut on his palm. He returned the dagger and…

James: What do I do? Put my hand on the wall?

placed his bloody hand on the wall.

Ryan: Ok everyone, roll Perception for me.

“Something glowed in your hand.” said Iofae.
“What?” Heoriss held up his hands. And saw the crystal-clear compass now tinged with red.
“Does it hurt?”
“No.”

“Guys, something’s happening…” Phileas called out.

The wall started to slide to the left, revealing a long dark passageway, a torch burning warmly at the end. A faint outline of a black canine stood under the torch, and then loped to the left and disappeared.

“The shadow wolf!” cried Toth, and he gave chase.
“Wait!” Phileas called.

The rest of the party ran after Toth and the wall shut behind them. Iofae held out his still glowing sunrod and lit the passageway. It was narrow, barely able to fit 2 people standing shoulder to shoulder. And the air was musty.

Heoriss banged on the wall behind them, trying to find a way to open it. Phileas chased after Toth, reaching him just at the torch at the end of the passage. The walls were cold to the touch of Iofae’s hands as he examined the stone patterns under the light of the sunrod.

“Hey, there’s some writing here!” Phileas pointed to under the torch.

“If you want to go home, just strike a wand of chrome” it said. And on the right wall, there was an opening, with a stack of silvery sticks.

Dan: That sounds lame.
Ryan: I know. But do you want to go home or not? *grin*

“Let’s see what this does” said Phileas. And he struck a wand of chrome against the wall. And then he vanished.
“Where did he go?” Heoriss looked around.

They heard some noises from the other side of the wall that trapped them.

“I’m outside!” they heard the muffled cry of Phileas. So all of them went to get a wand and teleport out to join their bard friend.

Klenn: So that’s how it works.
Ian: So do we want to continue? Or do we return the tome first?
James: Maybe we should return the tome, and get some rest. That passage doesn’t look very friendly to me.
Dan: Sounds good to me. Hey can we sell these wands?
Ryan: Oh, they’re gone. Once used, they disappear back into that wall crevice.
Dan: Darn…

The party returned to Havenswerd and gave the ancient tome to Arofell. The happy wizard ran his fingers over the old pages as he flipped gently.

“Uh, Mr Arofell?” Phileas asked.
“Hmm, yes?”
“About this dagger…” Phileas took out the murder weapon.
“Oh, I suppose I owe you some answers. Let me take a look at that.” He turned the dagger around, and stared at the strange rune on the hilt. “That’s the symbol of an artistic group called ‘Songs of Grace’. They’re quite popular in Havenswerd.”

“Wait. Are you telling me I’m framed by a bunch of musicians?”
“Perhaps your bardic performances were getting on their nerves…”
“But murder?!?”

“Ok, so can you tell us anything about the black wolf?” Toth ignored Phileas’ indignant cries.
“Oh, that. Vand told me about it. The history records only told of a foul wolf-like creature prowling some 2 decades ago. For a few years, strange stories of people mysteriously vanishing abound, and there were sightings of the beast at night, particularly during full moons. Then the beast simply disappeared.”

“About the Jorv babies?” Heoriss inquired.
“I only know the beast appeared at the same time as when a pair of twins were delivered to Jorv from the abbey.” The wizard’s eyes widened. “Are you…”

Heoriss and Iofae eyed each other. “Perhaps…”

“There was a secret tunnel in the room where we found your tome.” Phileas asked, having recovered from his anger. “Do you know anything about that?”
“No.” Arofell furrowed his eyebrows. “This tome was written in a set of 3. Perhaps the other 2 are also found in the cave. Can you venture further in, chart the dungeon, and search for the other 2 tomes?”

Dan: Alright, we’re going back in.
James: One more thing…

“Do you know what this is?” Heoriss showed the compass to Arofell.
“That allows the wielder to move freely around the battlefield. It actually relies on the wielder’s blood. The more the wielder is injured, the more times it can be used. That’s actually a lost artifact. You found it in the cave?”

A cry sounded from outside Arofell’s room. Phileas ran towards the door, opened it and looked out. He saw a flurry of wizard’s robes disappearing up the stairs.

Ian: Questin!
Klenn: He was eavesdropping!

to be continued…

*****

P.S. I created that compass as a custom magic item. I call it, the “Compass of Retributive Teleportation”. For every point of health lost by the wielder, the compass gains a point stored, up to a maximum of 100 points. The wielder can use the stored points, deducting points equal to his healing surge value, and he can teleport a number of squares equal to his speed as a minor action. Oh, and it serves as a compass. *smile*

It might take too long for me to explain those terms if you’re not a D&D player. Do some research if you’re curious. Perhaps I’ll find a way to explain them over the future story posts. And if you are a D&D player, you have my permission to use that in your game.

If you’re Chinese, don’t give your progeny full dialect names

I recently had a chat with a friend about baby names. She’s asking for opinions because, well, she’s carrying a baby girl (congratulations!) and she wanted to know what her/my friends and I thought of her choice.

The name’s not important to this story. The point is, her husband and her had decided to use only an English name and the surname (or last name if you come from those western countries). I’m using the term “English name” as opposed to “Christian name” because it’s more generic.

Now, the typical Chinese name has 2 “English” equivalents, phonetically speaking (other than a direct English name). One is the Hanyu Pinyin version. For example, my name in Hanyu Pinyin is Chen Weilie (or Wei Lie in 2 characters, but it’s sort of understood when they’re lumped together).

The other equivalent is the dialect name. My Chinese dialect group is Hokkien, which means my ancestors came from Fu Jian in China. And my dialect name is Tan Wai Lip.

Now, my preferred name is “Vincent”. Or “Vincent Tan”. “Vincent Chen” is fine too. I just think that last one sounds funny to me…

Which gives an interesting problem, because my full “English name” is Vincent Tan Wai Lip. “Tan” is my last name. It doesn’t look very “last” to me…

According to the western naming convention, I should be “Wai Lip Vincent Tan”, which means in my culture’s convention, I’m “Tan Wai Lip Vincent”. The “Wai Lip” part is not a middle name, it is my first name according to western culture, and my given name in Chinese culture.

I’m bringing this up because, many of the online transactions I’ve made requires a “first name” and “last name” field. What do I fill in for those? I usually use “Vincent” and “Tan” respectively.

This worked fine till I got to PayPal. For withdrawal purposes, they required my name, after fully resolving the “first name” and “last name” part, to be exactly the same as that in my Singapore bank account. I’ll leave you to imagine all the hassle this gave me…

I’m sure Chinese aren’t the only ones with this problem.

So, back to that pregnant friend of mine. Even though she and her husband are both Chinese, they’ve decided that their daughter shall only have the “English name” and the surname part. Their daughter will still have a full Chinese name, only that she won’t have a full dialect name.

Their main reason?

Because the nurse at the hospital is prone to giving terrible sounding dialect names…

Carcerian Stones – Retrieving an ancient tome

We’re continuing the D&D adventure story. Previously, we found our adventurers doing some crime scene investigation, were out of money, and located the wizard Arofell. We have Ryan the human DM, Dan playing Toth the goliath warden, James playing Heoriss the eladrin invoker, Ian playing Iofae the eladrin sorcerer, and Klenn playing Phileas the half-elf bard. And now…

*****

“Mr Arofell?” Phileas tried again, raising his voice a bit louder this time.
“Wha?” The man woke with a start. And a shrieking wail blasted from his hands.

Everyone covered their ears.

“Oh, you’re not Questin.” The ear-piercing shrieks stopped.
“Who’s Questin?” Toth asked.
“Oh, one of my colleagues who don’t really like me, and he’s been bothering me lately.” Arofell stammered. “Anyway, who are you?”

“We’re actually looking for you. The head monk at the abbey told us about you.” Heoriss replied.
“That would be Vand. A bit stiff, but I like him.”
“Do you know anything about a pair of babies being brought to Jorv, and some planar convergence that happened at the abbey?”
“Do you know anything about a foul black wolf-like creature?” Toth added.
“Do you know anything about this gold dagger?” Phileas showed the dagger from his accused murder scene.
“Do you have any quests for us?” Iofae asked.

James: Oh right, we need experience and money badly.
Klenn: Nearly forgot about our cash situation.

“Woah, woah, woah! Hang on a second! You don’t barge into someone’s lab and start barraging him with questions! Why should I help you?”
“Well, are you in need of assistance? We could help you cross the road?” Iofae suggested.

Ryan: Huh?

“We could help you cross your lawn?” Iofae continued.

Ryan: What?!
Dan: *snickering*
James: Oh… *muffled laughter*

“We could… help you cross your door?” Iofae faltered.

Ryan: Alright, what’s going on?
Klenn: I believe those are lines from the movie “Up”. Or at least of similar sentence structure.
Ryan: Ian!
Ian: Well… do you have anything we can help with? Other than crossing stuff.

“Well, I do have one small task I need done. Some days ago, a group of adventurers returned from an underground cave a couple of miles to the north west. They were lamenting the lack of any treasure. But one thing caught my attention. A book was mentioned. It was an ancient tome, set in the centre of the inner-most room they ventured in. They didn’t take it, because they didn’t know its value. But I do!”

“I want you to help me retrieve it. If you do that, I might be willing to help you with answering those questions…”
“Do we get to keep any treasure if we find them? Not that there are any left, since the adventurers probably cleaned them out…” Heoriss asked.
“I only need the tome. You can keep everything else. Don’t lose hope. Those adventurers aren’t the brightest men I’ve seen… They might have overlooked places…”

James: Alright! Treasure!
Klenn: So we go to the underground cave?
Ian: We need his help. We need money. We need experience. That cave’s gonna give us all that. Yeah, I think our next course of action is decided.
Dan: So we just trudge towards the cave now? *narrowing his eyes at Ryan* Any more skill challenges?

Ryan: Nope. And at this point, I wanna tell you that I’m upgrading all of you to 2nd level.
Dan: Why?
Ryan: To make up for whatever disadvantages you had. Like lack of cash. Whatever storyline I had in mind is already introduced, so you should have more stuff to play with. Besides, I want to keep the story moving. I can’t throw interesting stuff at you if you keep plodding at low levels. And we’ll stop for the night. I’m tired…

The underground cave

Dan: Alright, the cave’s next.
Ian: Feels like the Cave of Wonders in Kingdom Hearts.
James: Yeah, like “I wonder why there’s no treasure in this cave.”
Ian and Klenn: *laugh*
Ryan: Ok, you’re all just outside the cave. What are you going to do?

The party moved into the cave. It was pitch black, so Iofae struck a sunrod against the wall, and it cast enough light to let them see where they were going. There were some scuttling sounds ahead of them, and they stopped. And a pale insect emerged from view. And it’s the size of a man.

[some time later…]

James: I hate giant ants!
Dan: Ok, there’s a treasure chest beside the exit. Let’s open that.
Ian: No, wait!
Ryan: Too late.

As Toth stepped onto the granite tile in front of the treasure chest, a click sounded from the far left. The huge goliath barely dodged the javelin as he jerked himself back.

Ian: That’s why there are skeletal remains on the right of the treasure chest. They were the adventurers who weren’t careful. The javelin’s probably poisoned. But I wonder how the trap resets itself?

As the party stood around Toth, relieved that he was fine, the javelin started moving back. There was a thin wire attached to the end of the javelin, and there was a mechanical sound at its opening.

Ian: Oh a self-reeling javelin. Klenn, can I borrow your sword?

Iofae moved swiftly before the javelin was fully recoiled back into the wall, and severed the wire with quick slashes from his dagger and Phileas’ longsword.

Ryan: Impressive. The trap’s disarmed for good.
Dan: Now can we open the stupid treasure chest?

[some time later…]

After the party dealt with a few goblins, a run-in with some skeletons and a nasty mummy, they reached an open room with a dais in the centre. A wooden stand was lying on its side and a book laid close by.

James: Probably knocked over by the previous adventurers. Let me go check it out.

While Toth went looking for hidden rooms, Phileas retrieved the ancient tome and examined the book together with Iofae. Heoriss noticed something glinting at the bottom of the wooden stand, and found a curious object.

It was small and cylindrical in shape, fitting snugly into the palm of his hands. It was made of a material that’s complete transparent, maybe from some precious stone, judging from its weight. A thin gold line extended from the centre of a circular face to its circumference. There was also a similar line, silver in colour. As Heoriss examined it, the silver line rotated this way and that.

“I think it’s a compass.” stated Iofae.

James: *rolls d20 against Arcana*

“And magical!” Heoriss hissed.
“You keep that then.”

“Hey guys, there’s some writing over here!” bellowed Toth.

On the wall in front of Toth, was a short sentence written in flowing script. “To enter, offer a drop of sacrifice.” it read.

to be continued…

*****
P.S. The wizard Arofell was using what’s known as “Ghost Sound”, a wizard cantrip in D&D.

It’s not about number of urinals, it’s about the space they are in

There’s a post on the packing efficiency of urinals on XKCD. In summary, assuming that

  • first male to use a urinal picks a corner urinal
  • a male picks his urinal that’s furthest away from all other urinals in use
  • a male will keep at least 1 urinal between him and another male

then the best number of urinals in a row are of the form 2^k + 1, where k=1, 2, 3, …

Or if you’re not in the mood for math, 3, 5, 9, 17 and so on. I’m not listing more because, WHAT KIND OF ARCHITECT BUILDS 17 URINALS IN A ROW!?! But I digress…

What I want to emphasise is that the last assumption is the overriding one. The first 2 assumptions are corollaries of the third. It’s the buffer urinal that the self-conscious male is worried about.

Let’s look at the trivial case of 2 urinals. Based on the assumptions, there will only ever be 1 urinal in use at any one time. In effect, it’s no better than just putting 1 urinal. So why build 2 urinals?

Bonus thought experiment: One of the 2 urinals is probably used more often than the other. Based on reasons such as it’s the one furthest from the main toilet door, it’s the one most hidden from view, it’s the cleaner (for whatever reason).

However, if you build 2 urinals with 1 urinal’s space in between them, then both are more likely to be used at the same time when there are at least 2 males needing to release their liquid waste. Based on that specification, a 5-urinal-in-a-row setup is no better than a 3-urinal-with-1-urinal-space-in-between-them setup.

It’s not about the number of urinals in a row. It’s about the available space they were built in.

And I think I’m done talking about urinals for the rest of my life… (I counted 22 uses).