It's Thanksgiving in the United States tomorrow.
Please describe your favorite method of cooking turkey in the form of runnable code using your favorite language. For example in Java with java.utils.concurrency.
It's Thanksgiving in the United States tomorrow.
Please describe your favorite method of cooking turkey in the form of runnable code using your favorite language. For example in Java with java.utils.concurrency.
In C:
while (fork());
Place turkey on your favorite multi-core CPU array, execute above code.
As a bonus, you can use the leftover forks later to eat the turkey.
Of course, in Python you wouldn't actually cook anything, just do:
import turkey
I don't really get involved in the cooking process (my wife would balk at that). So, I would handle it afterwards like this:
Assembly language:
mov si,turkey ; point fork at turkey
mov cx,capacity ; stomach capacity
next: lodsb ; load single byte
int 29h ; consume it
loop next ; repeat until done (CX=0)
jmp couch ; watch football
#!/bin/bash
NUSERS=`ls /home|wc -l`
wget http://market/turkey
dd if=/dev/salt bs=2 count=1 >> turkey
dd if=/dev/pepper bs=1 count=1 >> turkey
dd if=/dev/rosemary bs=20 count=1 >> turkey
mv turkey /var/oven
/etc/init.d/oven start
sleep 60m
/etc/init.d/oven stop
mv /var/oven/turkey .
split -d -b $(( `cat turkey | wc -c` / (NUSERS-1) )) turkey meat
Complainings about me in dinning table,
In delphi: "Don't only use your hands to eat!" ( Got it? Mouse only? )
In C#: (This is to someone creative to make a joke about visual studio)
In java: "Why it is taking you so long.."
PHP
$parts = explode($turkey, "bones");
for($parts as $part)
eat($part);
OMG, i'm not good at this..
In the perversely overengineered Turkey framework, released for Thanksgiving 2008:
void CookTurkey() extends CookFood implements CookLargeAmountsOfFood,
FamilyGathering throws FamilyMemberDrunkException, BurntTurkeyException,
ArgumentOverHowToCookTurkeyException, HouseOnFireFromTurkeyException {
TurkeyOven oven = TurkeyOvenFactory.createTurkeyOven(Temperature.Hot);
try {
iEdibleBird turkey = EdibleBirdFactory.createEdibleBird(Bird.Turkey);
} catch(TurkeyDroppedOnFloorException) {
CurseWord profanity = new CurseWord("#&@$@$#");
profanity.say();
}
Cook cook = Cook.getSingletonInstance(); // Our cook is one-of-a-kind.
TurkeyResult result = CookFood(turkey, oven, cook);
if(TurkeyResult.getResult() == CookingResult.Burnt) {
throw new BurntTurkeyException();
}
FamilyMembers.getSingletonInstance().eatLargeFeast(turkey);
}
Here's an algorithm developed by a few grad students a while back:
if(broke) { // Can this branch be optimized out?
goto seminar;
}
seminar:
free(turkey);
I'd give an answer, but my internationalization skills aren't up to par
Chef's like Perl because nobody else can read their recipes. :P
<?php
$bird = new Turkey();
$oven = new Oven();
if( $bird->isFrozen() )
$bird->thaw();
$oven->preHeat(Turkey::COOKING_TEMP);
$bird->season( array(Kitchen::ROSEMARY, Kitchen::SALT, Kitchen::PEPPER) );
$bird->stuff( new StoveTop() );
$oven->cook($bird);
I tried to cook a turkey in Lisp, but I only ever got back a brand new turkey, fully cooked. The original was still in the oven. Then, since nobody was looking, the garbageman came and took it away.
In delphi:
try
turkey.Prepare();
turkey.Cook();
turkey.Serve();
except
on e: EDInerIsRuined do
pizzaLine.Order();
end;
Naturally, in PHP you wouldn't actually try to solve the "cook the turkey" problem.
You would instead try to hide that it, in fact, is raw and eat it anyways. Actually, whether your mouth is filled with turkey or something entirely else doesn't really matter, as you will chew on it and swallow happily nevertheless.
If your stomach would fail at some point, you would try to remember what you did earlier by doing what you did before, but at some points in the process, would stop, and look at what you have at hands. Once you have taken the peek, try to figure out how the salmon ended up in your fork, and start the process all over again.
Don't get me wrong; PHP is my current language of choice.
Well, it depends if Jon Skeet is the programmer or not.
He only needs to look at the turkey and it cooks.
The rest of us, not so much.
Simple one in C#
public class Cook<T>
{
public Cook(T what_to_cook)
{
what_to_cook.Prepare();
what_to_cook.DoCooking();
if(what_to_cook.ServingReady())
what_to_cook.ServeAll();
else
what_to_cook.PrepareServing();
}
}
public class MakeItHappen
{
Turkey t = new Turkey();
Cook<Turkey> ct = new Cook<Turkey>(t);
}
public class Turkey : ITurkey
{
public void Prepare(){...}
public void DoCooking(){...}
public void ServingReady(){...}
public void SaveAll(){...}
public void PrepareServing(){...}
}
public interface ITurkey
{
void Prepare();
void DoCooking();
void ServingReady();
void ServeAll();
void PrepareServing();
}
I fear for the programming industry if these unoptimized solutions are anything to go by.
Here's a (fairly) language-agnostic approach, just rewrite for your particular language:
this.Visit(Mom);
In these asynchrony times (recent C# news, case in point), I'll rewrite the above code to be asynchronous:
var ft = this.Call(Mom, c => c.Order(Turkey));
var t = await ft;
I wouldn't waste time writing custom code, I'd buy an off the shelf turkey system.
I don't have one for Turkey, but I do have one for Canadian Goose:
oven.setTemperature(200);
sleep(15 * 60);
oven.add(goose);
oven.add(brick);
while (!brick.isTender()) {
sleep(300);
}
oven.remove(brick);
oven.remove(goose);
goose.dispose();