Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
var person1 = new SherlockHolmes();
var person2 = new DrWatson();
person1.MoveToBalloon().Sleep();
person2.MoveToBalloon().Sleep();
var address = new Field(«Где-то»);
if (address == AddressTypes.Unknown)
{
var person3 = new CowMan();
var question = «Скажите, сэр, где мы находимся?»;
person1.Ask(person3, question);
while (person3.IsThinking())
{
Application.DoEvents();
}
person3.Answer(«На воздушном шаре.»);
person1.SpeakTo(person3, «Спасибо, сэр!»);
person1.SpeakTo(person2, «Интересная местность, Ватсон! Программист пасет коров!»);
person2.Ask(person1, «Но, Холмс, с чего вы взяли, что он программист?»);
person1.Answer(person2, «Это элементарно! Во-первых, он долго думал над ответом. Во-вторых, его ответ был абсолютно точен. И самое главное - абсолютно бесполезен!»);
}
else
{
Console.WriteLine(«Not a joke...»);
}
* This source code was highlighted with Source Code Highlighter.
class Petrosyan:
def __init__(self):
print u"I will DDos you with jokes, MSUG!"
mass_kill = Petrosyan()
import shop.Food;
class Salad extends Food {
public Salad() {
addComponent(new Tomato());
addComponent(new Cucumber());
addComponent(new Salad());
}
}
public static void main() {
try {
Food food = new Salad();
food.eat();
} catch(OutOfMemoryError e) {
System.out.println("Forget it, let's get some beer");
}
}
* This source code was highlighted with Source Code Highlighter.
bool IsRussian(Person personToTest)
{
SteelBall ball1 = new SteelBall();
SteelBall ball2 = new SteelBall();
if (personToTest.Break(ball1) && personToTest.Loose(ball2))
return true;
else
return false;
}
* This source code was highlighted with Source Code Highlighter. void tellOldChineseWisdom() {
if (nothingToTell) {
tellOldChineseWisdom();
}
}
* This source code was highlighted with Source Code Highlighter.Авторы лучших #codejoke и #itfairytale получат лицензированную Windows 7 Ultimate!
Стихи. Читать вслух.
<?php
print ("4 8 0 15\n");
print ("108 40 23\n");
print ("16 815\n");
print ("316 2 03\n");
?>
* This source code was highlighted with Source Code Highlighter.class Benny
{
private $_push_amount = 0;
private $_touch_amount = 0;
public function push_me()
{
$this->_push_amount +=1;
}
public function touch_me()
{
$this->_touch_amount +=1;
}
public function satisfaction()
{
echo 'WAU';
$this->_smoke();
$this->_snoring();
}
private function _smoke()
{
echo 'пых пыз пых';
}
private function _snoring()
{
echo 'ghrr...';
}
public function isReady()
{
// TODO remove hardcode :-)
if ($this->_push_amount == 'много' AND $this->_touch_amount == 'много')
{
return true;
}
return false;
}
}
$benny = new Benny();
while (!$benny->isReady())
{
$benny->push_me();
$benny->touch_me();
}
$benny->satisfaction();
* This source code was highlighted with Source Code Highlighter.Copy Source | Copy HTML
enum Direction {
Left,
Right,
Straight
};
Direction chooseDirection() {
String msg = "Налево пойдёшь - п@#ды получишь, \
направо пойдёшь - п@#ды получишь, \
прямо пойдёшь - п@#ды получишь";
return Dialog::question(msg, Button("Налево", Left), Button("Направо", Right), Button("Прямо", Straight));
}
int TIMEOUT = 5000;
bool timedOut;
Direction dir = WaitForThreaded(chooseDirection(), TIMEOUT, &timedOut);
if (timedOut) {
MessageBox("Решай скорее, а то прямо здесь п@#ды получишь!");
doPunishment();
}
SELECT name FROM european_proletarians
UNION
SELECT name FROM asian_proletarians
UNION
SELECT name FROM african_proletarians
UNION
SELECT name FROM american_proletarians
UNION
SELECT name FROM australian_proletarians
* This source code was highlighted with Source Code Highlighter.bool question(bool to_be)
{
return to_be || !to_be; // wtf? no choice!
}
* This source code was highlighted with Source Code Highlighter.Copy Source | Copy HTML
enum Answer {
Yes,
No,
DontKnow
};
Answer isMouseTrap(unsigned int cheesePrice) {
if (cheesePrice == 0)
return Yes;
else
return DontKnow;
}
if (!mountain.go(Moses.position()))
{
Moses.go(mountain.position());
}
* This source code was highlighted with Source Code Highlighter.Copy Source | Copy HTML
class Morozov {
protected:
virtual Info getSomeInfo() { return m_info; }
private:
Info m_info;
};
class Pavlik : public Morozov {
public:
virtual Info getSomeInfo() { return Morozov::getSomeInfo(); }
};
- class DeadCat{};
-
- class Cat: public DeadCat{};
-
- class Zoofil
- {
- public:
- void Action(Cat* sexualcat){throw sexualcat;}
- };
-
- class Sadist
- {
- public:
- void Action(Cat* cat){throw cat;}
- };
-
- class Nekrofil
- {
- public:
- void Action(DeadCat* cat){}
- };
-
- class Extremal: public Cat
- {
- public:
- void SayMau(){throw Cat();}
- };
-
-
- class Kamera
- {
- public:
- Extremal extreamal;
- Zoofil zoofil;
- Sadist sadist;
- Nekrofil nekrofil;
-
- Kamera()
- {
- try
- {
- extreamal.SayMau();
- }
- catch(Cat sexualcat)
- {
- try
- {
- zoofil.Action(&sexualcat);
- }
- catch(Cat* cat)
- {
- try
- {
- sadist.Action(cat);
- }
- catch(DeadCat* deadcat)
- {
- nekrofil.Action(deadcat);
- }
- }
-
-
- }
-
- }
-
- };
-
- void main()
- {
- new Kamera();
- }
* This source code was highlighted with Source Code Highlighter.
if( $("#me").data("chydnoe_mgnovenie") ) {
$("#me").before('<div id="you"></div>');
$("#you").hide('fast');
$("#you").append('<div id="genius" class="beautiful" style="clear:both"></div>');
}
* This source code was highlighted with Source Code Highlighter.<?php
include 'Priest.php';
include 'Dog.php';
include 'Meat.php';
$pop = new Priest();
$dog = new Dog();
$piece_of_meat = new Meat();
story();
function story() {
$pop.has($dog);
$pop.love($dog);
if ($dog.eat($piece_of_meat)) {
$pop.kill($dog);
$pop.bury($dog);
return $pop.write(story());
};
return true;
};
?>
* This source code was highlighted with Source Code Highlighter.bool question()
{
return to_be() || !to_be();
}
* This source code was highlighted with Source Code Highlighter.for ( ; !hedgehog.HasFarted; )
hedgehog.Say("I'm not going to fart");
throw new ItWasNotMeException(hedgehog);
Шуточный конкурс с дельными призами