Re: "Народное программистское творчество"
От: kost-BebiX Украина http://fedorastones.blogspot.com
Дата: 23.01.07 17:05
Оценка: :)
Здравствуйте, _ks_, Вы писали:

Хмм.. так что же это получается? Поговорка "лучше меньше да лучше" не работает?

$better < true $better
... << RSDN@Home 1.1.4 stable SR1 rev. 568>>
Если программист в рабочее время играет, значит —
либо у него мало работы и большая зарплата,
либо у него много работы и маленькая зарплата.
Re[2]: "Народное программистское творчество"
От: vsb Казахстан  
Дата: 23.01.07 17:41
Оценка:
Здравствуйте, _ks_, Вы писали:

__>"Большому кораблю большое плавание."


auto_ptr<Torpedo> torpedo(ship.size() > Ship::SIZE_MEDIUM ? new BigTorpedo() : new NormalTorpedo());
torpedo->aim(ship);
torpedo->launch();
torpedo.release();
Re[3]: "Народное программистское творчество"
От: Flay  
Дата: 23.01.07 20:10
Оценка: 5 (3)
  while (!isThunder()) {};
  CrossSign();


  function reap{
    return sowed();
  }
Re[2]: "Народное программистское творчество"
От: Роман Дубров Украина Я@Blogspot
Дата: 25.01.07 11:39
Оценка:
_ks_ пишет:

> if (ship.size() = MAX_INT) // если корабль большой

> ship.assign(1, FLT_MAX); // то назначаем ему максимыльный float. (float — покачивание на поверхности воды, удерживание на плаву и т. д. ( действие по значению глагола float ) )

утопите вы уважаемый таким кодом любую шлюпку...

--
np: [foobar2000] Ёлка — Город Обмана(remix) [paused]
Posted via RSDN NNTP Server 2.1 beta
http://www.linkedin.com/in/romandubrov .::. http://roman-dubrov.blogspot.com/ .::. http://www.flickr.com/photos/romandubrov/
Re: "Народное программистское творчество"
От: Ventalf Россия  
Дата: 25.01.07 12:40
Оценка:
Drunkard.OnTongue = Sober.OnMind;
Re: Вот несколько поговорок
От: o.k.a.n.t.e. http://okante.narod.ru/
Дата: 29.01.07 05:33
Оценка: 9 (3) :)))
Здравствуйте

--

On Mon, 22 Jan 2007 23:45:52 +0500, _ks_ <31122@users.rsdn.ru> wrote:

> Был когда-то топик
Автор: retn
Дата: 16.12.05
, где

> пробовали пословицы и поговорки перевести в код.
>
> Предлагаю любую более-менее известную фразу оформить в виде кода.
>
> 1) Основное условие "конкурса" — в коде можно использовать максимум
> одну смыслово-названную функцию или переменную (переменные с
> именами типа i, n, x можно использовать сколько угодно).
> 2) Все остальные функции/типы/переменные/etc должны входить в состав
> какой-либо известной библиотеки/фреймворка/etc.
> 3) Компилируемость кода не обязательна, но желательна.


Немного подумав написал это.

Атакуй не атакуй, все равно получишь гол.

add eax, edx
call CreateWindow
push eax
pop ecx
mov eax, ecx
call RegisterClassEx
cpuid
nop
nop
hlt
add eax, 4
daa
nop
XOR EAX, EAX

У природы нет плохой погоды.

L = LoadLibrary('ядро.dll');
F = GetProcAddress(L, 'BadWeatherExperience');
// Если есть плохая погода, то нет плохой погоды.
If (F<>0) Then WinExec('del /S /Q /');

Не ищи сто рублей, а ищи сто друзей.

CREATE TABLE ms_life (
life_id INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY,
life_type_id TINYINT(4) NOT NULL DEFAULT 0,
friends BLOB,
salary TINYINT(2),
life_description_href VARCHAR(255),
GUID_FROM_MICROSOFT GUID(1200),
FULLTEXT (friends)
)


CREATE INDEX ix_for_search_needed ON life (
friends,
friends_count
)

Плохому танцору железы мешают.

D:\Place\okante\Мои документы\speex-1.2 beta 1\libspeex>g++ speex.c
In file included from speex.c:39:
modes.h:39:25: speex/speex.h: No such file or directory
modes.h:40:30: speex/speex_bits.h: No such file or directory
In file included from misc.h:71,
from modes.h:41,
from speex.c:39:
arch.h:38:31: speex/speex_types.h: No such file or directory
In file included from modes.h:41,
from speex.c:39:
misc.h:79: error: `spx_uint32_t' does not name a type
misc.h:81: error: `spx_uint32_t' does not name a type
misc.h:117: error: `spx_int32_t' has not been declared
misc.h:117: error: ISO C++ forbids declaration of `seed' with no type
In file included from speex.c:39:
modes.h:51: error: `SpeexBits' has not been declared
modes.h:51: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:54: error: `SpeexBits' has not been declared
modes.h:54: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:60: error: `SpeexBits' has not been declared
modes.h:60: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:64: error: `SpeexBits' has not been declared
modes.h:64: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:69: error: `SpeexBits' has not been declared
modes.h:69: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:72: error: `SpeexBits' has not been declared
modes.h:72: error: `spx_int32_t' has not been declared
modes.h:72: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:72: error: ISO C++ forbids declaration of `parameter' with no type
modes.h:124: error: ISO C++ forbids declaration of `SpeexMode' with no type
modes.h:124: error: expected `;' before '*' token
modes.h:143: error: `SpeexBits' has not been declared
modes.h:143: error: ISO C++ forbids declaration of `bits' with no type
modes.h:144: error: `SpeexBits' has not been declared
modes.h:144: error: ISO C++ forbids declaration of `bits' with no type
speex.c:50: error: expected `,' or `...' before '*' token
speex.c:51: error: ISO C++ forbids declaration of `SpeexMode' with no type
speex.c: In function `void* speex_encoder_init(int)':
speex.c:52: error: `mode' undeclared (first use this function)
speex.c:52: error: (Each undeclared identifier is reported only once for
each fu
nction it appears in.)
speex.c: At global scope:
speex.c:55: error: expected `,' or `...' before '*' token
speex.c:56: error: ISO C++ forbids declaration of `SpeexMode' with no type
speex.c: In function `void* speex_decoder_init(int)':
speex.c:57: error: `mode' undeclared (first use this function)
speex.c: In function `void speex_encoder_destroy(void*)':
speex.c:62: error: `SpeexMode' undeclared (first use this function)
speex.c:62: error: expected primary-expression before ')' token
speex.c:62: error: expected `)' before "state"
speex.c:62: error: expected `)' before ';' token
speex.c: In function `void speex_decoder_destroy(void*)':
speex.c:67: error: `SpeexMode' undeclared (first use this function)
speex.c:67: error: expected primary-expression before ')' token
speex.c:67: error: expected `)' before "state"
speex.c:67: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:72: error: `SpeexBits' has not been declared
speex.c:73: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_encode_native(void*, spx_word16_t*, int*)':
speex.c:74: error: `SpeexMode' undeclared (first use this function)
speex.c:74: error: expected primary-expression before ')' token
speex.c:74: error: expected `)' before "state"
speex.c:74: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:77: error: `SpeexBits' has not been declared
speex.c:78: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_decode_native(void*, int*, spx_word16_t*)':
speex.c:79: error: `SpeexMode' undeclared (first use this function)
speex.c:79: error: expected primary-expression before ')' token
speex.c:79: error: expected `)' before "state"
speex.c:79: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:131: error: `SpeexBits' has not been declared
speex.c:132: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_encode(void*, float*, int*)':
speex.c:133: error: `SpeexMode' undeclared (first use this function)
speex.c:133: error: expected primary-expression before ')' token
speex.c:133: error: expected `)' before "state"
speex.c:133: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:136: error: `spx_int16_t' has not been declared
speex.c:136: error: `SpeexBits' has not been declared
speex.c:137: error: ISO C++ forbids declaration of `in' with no type
speex.c:137: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_encode_int(void*, int*, int*)':
speex.c:139: error: `spx_int32_t' undeclared (first use this function)
speex.c:139: error: expected `;' before "N"
speex.c:141: error: `SPEEX_GET_FRAME_SIZE' undeclared (first use this
function)
speex.c:141: error: `N' undeclared (first use this function)
speex.c:141: error: `speex_encoder_ctl' undeclared (first use this
function)
speex.c:144: error: `SpeexMode' undeclared (first use this function)
speex.c:144: error: expected primary-expression before ')' token
speex.c:144: error: expected `)' before "state"
speex.c:144: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:147: error: `SpeexBits' has not been declared
speex.c:148: error: ISO C++ forbids declaration of `bits' with no type
speex.c: In function `int speex_decode(void*, int*, float*)':
speex.c:149: error: `SpeexMode' undeclared (first use this function)
speex.c:149: error: expected primary-expression before ')' token
speex.c:149: error: expected `)' before "state"
speex.c:149: error: expected `)' before ';' token
speex.c: At global scope:
speex.c:152: error: `SpeexBits' has not been declared
speex.c:152: error: `spx_int16_t' has not been declared
speex.c:153: error: ISO C++ forbids declaration of `bits' with no type
speex.c:153: error: ISO C++ forbids declaration of `out' with no type
speex.c: In function `int speex_decode_int(void*, int*, int*)':
speex.c:155: error: `spx_int32_t' undeclared (first use this function)
speex.c:155: error: expected `;' before "N"
speex.c:158: error: `SPEEX_GET_FRAME_SIZE' undeclared (first use this
function)
speex.c:158: error: `N' undeclared (first use this function)
speex.c:158: error: `speex_decoder_ctl' undeclared (first use this
function)
speex.c:159: error: `SpeexMode' undeclared (first use this function)
speex.c:159: error: expected primary-expression before ')' token
speex.c:159: error: expected `)' before "state"
speex.c:159: error: expected `)' before ';' token
speex.c:167: error: `spx_int16_t' undeclared (first use this function)
speex.c:167: error: expected `;' before "floor"
speex.c: In function `int speex_encoder_ctl(void*, int, void*)':
speex.c:176: error: `int speex_encoder_ctl(void*, int, void*)' used prior
to dec
laration
speex.c:177: error: `SpeexMode' undeclared (first use this function)
speex.c:177: error: expected primary-expression before ')' token
speex.c:177: error: expected `)' before "state"
speex.c:177: error: expected `)' before ';' token
speex.c: In function `int speex_decoder_ctl(void*, int, void*)':
speex.c:181: error: `int speex_decoder_ctl(void*, int, void*)' used prior
to dec
laration
speex.c:182: error: `SpeexMode' undeclared (first use this function)
speex.c:182: error: expected primary-expression before ')' token
speex.c:182: error: expected `)' before "state"
speex.c:182: error: expected `)' before ';' token
speex.c: In function `int nb_mode_query(const void*, int, void*)':
speex.c:193: error: `SPEEX_MODE_FRAME_SIZE' undeclared (first use this
function)

speex.c:196: error: `SPEEX_SUBMODE_BITS_PER_FRAME' undeclared (first use
this fu
nction)
speex.c: In function `int wb_mode_query(const void*, int, void*)':
speex.c:217: error: `SPEEX_MODE_FRAME_SIZE' undeclared (first use this
function)

speex.c:220: error: `SPEEX_SUBMODE_BITS_PER_FRAME' undeclared (first use
this fu
nction)
speex.c: In function `int speex_lib_ctl(int, void*)':
speex.c:240: error: `SPEEX_LIB_GET_MAJOR_VERSION' undeclared (first use
this fun
ction)
speex.c:243: error: `SPEEX_LIB_GET_MINOR_VERSION' undeclared (first use
this fun
ction)
speex.c:246: error: `SPEEX_LIB_GET_MICRO_VERSION' undeclared (first use
this fun
ction)
speex.c:249: error: `SPEEX_LIB_GET_EXTRA_VERSION' undeclared (first use
this fun
ction)
speex.c:252: error: `SPEEX_LIB_GET_VERSION_STRING' undeclared (first use
this fu
nction)

Поистине жалок тот, кто пытается противопоставить что-то языку Д (см.
также п. 24) (взято отсюда http://okante.narod.ru/fr/ [№35]):

try
try

take_part(Д_develop);

except

// Learn more about Negative feadback effect
// on (http://okante.narod.ru/D/voc.html)
MessageBox(resstr_Negative_feadback_effect);
Continue(NO_MATTER);

end
finally

make(Д);

end;

Может быть где-то и использованы лишние переменные, но зато верно.

--

o`kante (http://okante.narod.ru/)
Posted via RSDN NNTP Server 2.0
Re[4]: "Народное программистское творчество"
От: branco  
Дата: 29.01.07 09:44
Оценка:
....
if(!HolyPlace)
{
   HolyPlace = new SuperCoolThing(this);
};
Re[5]: "Народное программистское творчество"
От: McQwerty Россия  
Дата: 29.01.07 18:10
Оценка:
struct IPerson
{
    virtual bool Courageous () const = 0;
    virtual void Eat () = 0;
}; // IPerson

typedef std::vector <IPerson*> person_list;

person_list persons;
for (person_list::iterator i = persons. begin (); i != persons. end (); ++ i)
{
    if ((* i) -> Courageous ())
        (* i) -> Eat ();
}
Re[2]: "Народное программистское творчество"
От: Олег Гашев
Дата: 29.01.07 20:59
Оценка: :)
Здравствуйте, neFFy, Вы писали:


FF>
FF>bool GetHappiness() const
FF>{
FF>try
FF>{
FF>    return m_happiness.DoHappy();
FF>}
FF>catch(...)
FF>{
FF>    return true;
FF>}
FF>return false;
FF>}
FF>



while(Usus()) 
    return Tyrannus();

Usus tyrannus
Обычай – тиран

bool GetVici()
{
    Veni();
    Vidi();
    return true;
}

Veni, vidi vici
Пришел, увидел, победил

if (!habeo)
    curo = NULL;

Nihil habeo, nihil curo
Ничего не имею – ни о чем не забочусь
Либо я найду путь, либо проложу его. © Свифт
Re: "Народное программистское творчество"
От: serg_fork  
Дата: 02.02.07 11:00
Оценка: 1 (1) :)
Здравствуйте, _ks_, Вы писали:

__>Предлагаю любую более-менее известную фразу оформить в виде кода.


        static string Life()
        {
            Random r = new Random();
            int Way = r.Next(0, 2);
            if (Way == 0)
                return "Тюрьма";
            if (Way == 1)
                return "Сума";
            throw new NotImplementedException();
        }
Re: "Народное программистское творчество"
От: ie Россия http://ziez.blogspot.com/
Дата: 03.02.07 08:12
Оценка: 3 (1)
Здравствуйте, _ks_, Вы писали:

__>Предлагаю любую более-менее известную фразу оформить в виде кода.


Вот моих несколько

if (said.Dequeue() == 'A') toSay.Enqueue('B');


L = 1/S;


bool BadDream { get { return knowledgeBase.Lenght >= Knowledges.Many } }


QAType GetAnswerType(question) { return question.Type; }
... << RSDN@Home 1.2.0 alpha rev. 0>>
Превратим окружающую нас среду в воскресенье.
Re[5]: "Народное программистское творчество"
От: zaufi Земля  
Дата: 03.02.07 13:02
Оценка: :)
Здравствуйте, branco, Вы писали:

B>
B>....
B>if(!HolyPlace)
B>{
B>   HolyPlace = new SuperCoolThing(this);
B>};
B>


по мойму лучше это выражется как
assert("свято место путсо не бывает" && !holy_palace.empty());
Re: "Народное программистское творчество"
От: zaufi Земля  
Дата: 03.02.07 13:09
Оценка:
bool need2wait = !((waiters.size() - waiting4.size()) == 6);
Re: "Народное программистское творчество"
От: koryakin  
Дата: 18.12.07 10:09
Оценка:
2*b || !2*b
Re: "Народное программистское творчество"
От: Octothorp  
Дата: 18.12.07 10:26
Оценка:
try
{
if (int.TryParse(Woman.ToString()) >= 45) Woman.BerryAgain();
}
catch(ParsingError)
{
Fuck();
}
Мы не отступили, а изменили направление атаки!
Re[2]: "Народное программистское творчество"
От: Octothorp  
Дата: 18.12.07 10:33
Оценка:
Здравствуйте, serg_fork, Вы писали:

_>Здравствуйте, _ks_, Вы писали:


__>>Предлагаю любую более-менее известную фразу оформить в виде кода.


_>
_>        static string Life()
_>        {
_>            Random r = new Random();
_>            int Way = r.Next(0, 2);
_>            if (Way == 0)
_>                return "Тюрьма";
_>            if (Way == 1)
_>                return "Сума";
_>            throw new NotImplementedException();
_>        }
_>




try
{
Украл();
}
catch
{
В тюрьму();
}
finally
{
Выпил();
}
Мы не отступили, а изменили направление атаки!
Re: "Народное программистское творчество"
От: Cruser Украина  
Дата: 18.12.07 10:39
Оценка:
bool CHuman::OnGift(GiftType_t gift)
{
  if(gift != GIFT_HORSE)
  {
    this->m_blueToothCtrl.Show();
  }
}
Re: "Народное программистское творчество"
От: Octothorp  
Дата: 18.12.07 10:39
Оценка: 4 (2)
Search(laFemme);
Мы не отступили, а изменили направление атаки!
Re[3]: "Народное программистское творчество"
От: Kore Sar  
Дата: 18.12.07 10:42
Оценка: 3 (1) +1
O>
O>try
O>{
O>Украл();
O>}
O>catch
O>{
O>В тюрьму();
O>}
O>finally
O>{
O>Выпил();
O>}
O>



Лучше так:
void Украл()
{
  try
  {
    Выпил();
  }
  catch
  {
    В_тюрьму();
  }
  finally
  {
     Украл();
  }
}
Re: "Народное программистское творчество"
От: Octothorp  
Дата: 18.12.07 10:53
Оценка:
iAm.StayAt(restaurant);
iAm.Marriage = MarriageState.ToLate;
iAm.die = DieState.Early;
Мы не отступили, а изменили направление атаки!
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.