Interview Question #1

Today I came accross an awesome interview question for programmers.


Given this psuedo C like code;

if "operation"

What “condition” would cause it to output “HelloWorld”?

C Solution

if (0 == printf("Hello"))

C# Solution

if ((new string[] { "Hello" }).All<string>(delegate(string n) { Console.Write(n); return false; }))

JAVA Solution

Graciously from Jack Dunham (the Java man);

if (new Object() 
  {@Override public boolean equals(Object foo) { System.out.print("hello ");return false;}}
  .equals("hello ")) {
System.out.print("hello ");
} else {

Drush – Out of Memory

So this weekend I tried to push some new changes to my staging website.  The site,, is running Drupal so you basically need to run Drush to do any form of updates.  Anyways, I logged onto the server and tried to do a drush update, and I recieved this error:

Fatal error: Out of memory (allocated 22806528) (tried to allocate 30720 bytes) in /home/musici12/ on line 105
Drush command could not be completed.

After digging around the net I found many references to PHP memory limits.  Where most people have fixed this error by simply setting the PHP.ini for Drush to use, or simply added ini_set to the drush.php file.  Here are some links;

None of these worked for me.  I always hit the 22806528 limit no matter what.  This is roughly 20M, which is really small.

The Solution

My problem was the Fork Bomb protection ( that some hosting providers setup.  The basic defense is to restrict your Bash (or whatever) shell to a very limited set of resources so that its difficult to bring down the server.  In my case the memory limits.

After requesting that my hosting provider disable the fork bomb on my VPS, I’m back to being able to update my site.

I hope this helps someone, I wasted a few midnight hours trying to figure this out.