1. Java / Говнокод #7944

    +69

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    public void openPopupWindow( com.sap.tc.webdynpro.services.session.api.IWDWindow window )
      {
    	IWindowStackElement newWindow = wdContext.nodeWindowStack().createWindowStackElement();
    	newWindow.setWindow(window);
    	wdContext.nodeWindowStack().addElement(newWindow);
      }

    Вот так вот вроде называешь всё своими именами, а потом на выходе получаешь вот такую тавтологию как в 4ой строке.

    foGa, 23 Сентября 2011

    Комментарии (9)
  2. Assembler / Говнокод #7943

    +131

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    ThreadStarter stru
      this dd ?
      ...
    ends
    
    
    
    ThreadStarter::MoveToArmy near proc
      in ax, 0x40 // initial time
    
      xor cx, cx
      mov dx, ax
    __repeat:
      in ax, 0x40
      lea cx, [ax - dx]
      mov dx, ax
    
      cmp cx, 60 * 60 * 24 * 365
        jl short __repeat
    
      pop ax
      ret
    endp
    
    
    start:
     sub sp, sizeof ThreadStarter
     assume [sp]: stru ThreadStarter
    
     mov ax, sp 
     invoke Thread_Starter::MoveToArmy, ax
    
     ...

    http://www.gamedev.ru/flame/forum/?id=152390#m6

    >14 сен. 2011 17:38
    Машинный код для шестнадцати битного режима
    Все привет. С началом учебы полнейший завал, времени нет вообще. Если вы знаете ссылки на сабж (прерывания, всякие mov, cmp, jmp и т.д.) поделитесь пожалуйста.
    Очень важно, что бы он был для шестнадцати битного режима, для ДОСа, не для Вин32.

    CPPGovno, 22 Сентября 2011

    Комментарии (7)
  3. Куча / Говнокод #7942

    +132

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    if instance_number(global.obj_childwindow) exit
    global.oid=id
    no_etazh=etazh
    no_x=x/16
    no_y=y/16
    no_name=name
    no_room=myroom
    global.param_window=chw_create(view_xview[0]+view_wview[0]/2-168,view_yview[0]+view_hview[0]/2-150,336,364,"Параметры объекта: Игрок")
    with global.param_window
    {
    step="editor_controller.selected=global.oid"
    draw="draw_set_font(font);draw_text_color(x+224,y+94,'Этаж:',0,0,0,0,1);draw_text_color(txtx.x+10,txtx.y-18,'Позиция',0,0,0,0,1);draw_text_color(txtx.x-14,txtx.y+2,'X',0,0,0,0,1);draw_text_color(txty.x-14,txty.y+2,'Y',0,0,0,0,1)"
    
    ok_btn=btn_create(16,308,80,24,"ОК","chw_destroy(parent_id);global.active=1",1)
    close_btn=btn_create(242,308,80,24,"Отмена","global.param_window.text_room=string(global.oid.no_room);global.param_window.text_name.text=global.oid.no_name;global.param_window.txtx.text=string(global.oid.no_x);global.param_window.txty.text=string(global.oid.no_y);global.param_window.floors.current_selected=global.oid.no_etazh;chw_destroy(parent_id);global.active=1",1)
    
    text_name=txt_create(80,14,112,"Название")
    with text_name {step="global.oid.name=text;with editor_controller.text_name txt_set_text(other.text)";txt_set_text(global.oid.name)}
    text_room=txt_create(80,46,112,"Комната")
    with text_room {step="if string_digits(text)!=text txt_set_text(string_digits(text));if real(text)<0 || real(text)>999 txt_set_text(string(max(min(real(text),999),0)));global.oid.myroom=real(text);with editor_controller.text_room txt_set_text(other.text)";txt_set_text(string(global.oid.myroom))}
    
    floors=list_create(176,96,144,128)
    with floors {list_copy(editor_controller.list,0,editor_controller.list.itemnmb);current_selected=editor_controller.list.current_selected;step="editor_controller.list.current_selected=current_selected;global.oid.etazh=editor_controller.list.current_selected"}
    txtx=txt_create(208,248,74)
    with txtx {txt_set_text(string(global.oid.x/16));step="if (text!=string_digits(text) || real(string_digits(text))<0 || real(string_digits(text))>(room_width-208)/16) txt_set_text(string(limit(real(string_digits(text)),0,(room_width-208)/16-1)));global.oid.x=real(text)*16"}
    txty=txt_create(208,280,74)
    with txty {txt_set_text(string(global.oid.y/16));step="if (text!=string_digits(text) || real(string_digits(text))<0 || real(string_digits(text))>(room_height-16)/16) txt_set_text(string(limit(real(string_digits(text)),0,(room_height-16)/16-1)));global.oid.y=real(text)*16"}
    }
    global.active=0

    Сам не могу поверить, что я такое мог написать.
    Это код моего редактора карт, написанный 2 года назад на Game Maker.

    gammaker, 22 Сентября 2011

    Комментарии (16)
  4. PHP / Говнокод #7941

    +163

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    /// Здесь настройки подключения к БД
    $bd_host = "openserver";
    
    $bd_user     = "root"; // - логин
    $bd_password = ""; // - пароль
    $bd_base     = "test"; // - имя базы
    
    
    mysql_connect($bd_host, $bd_user, $bd_password) or die(mysql_error());
    mysql_select_db($bd_base);
    
    
    // параметры
    $conf = mysql_query("SELECT * FROM Settings where s='1' limit 1");	
    
    $cr=mysql_fetch_assoc($conf);
    
    
    $SITENAME  = $cr['sitename'];
    $SITENAME  = str_replace('+',"<br>",$SITENAME);
    
    $SITED     = $cr['domen'];
    $SITEDESC  = $cr['description'];
    $SITEKEYW  = $cr['keywords'];
    $SEC	   = $cr['seconds'];
    
    // другие конфигурации 
    $sys_testmode = "false"	//- режим тестирования (сайты не показываются) true-вкл | false-выкл

    Гордый файл config.php

    Мартин, 22 Сентября 2011

    Комментарии (9)
  5. Куча / Говнокод #7940

    +143

    1. 1
    Хватит!

    alexoy, 22 Сентября 2011

    Комментарии (2)
  6. C++ / Говнокод #7939

    +160

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    #if !defined(_CONSOLE) && !defined(BOOTSTRAP_AGENT)
     g_scheduler.Init(&g_Schedule);
    #endif
    #if (defined(UNDER_CE) || defined(MC_AGENT)) && !defined(BOOTSTRAP_AGENT) /*&& !defined(_CONSOLE) */&& !defined(MC_APM_AGENT)
     m_collector.InitializeFromPDB(/*GetPdbFile()*/);
    #endif
    #if (defined(UNDER_CE) || defined(MC_AGENT)) && !defined(BOOTSTRAP_AGENT) && !defined(_CONSOLE) && !defined(MC_APM_AGENT)
     m_Alert.InitializeFromPDB();
    #endif
    #if !defined( _CONSOLE ) && !defined(BOOTSTRAP_AGENT)
     g_ScheduleEngine.Add( this ); // install scheduler
    #endif
    #if !defined(BOOTSTRAP_AGENT) && !defined(MC_APM_AGENT) && !defined(PRINTER_AGENT)
     g_manager.LoadFromPDB();
    #endif
    
    #if (defined(UNDER_CE) && !defined(BOOTSTRAP_AGENT)) || (defined(MC_AGENT) && !defined(_CONSOLE))
     WriteMCConnectionStatus(MCA_CONN_STATUS_INITIALIZING);
    #endif
     ASSERT(pData != NULL);
     DWORD dwRetries = 0;
    
     bool bFirstDevPkgInstalled = false; // for HHI agent only
     while (pData->nTask != PDT_QUIT)
     {
    #ifdef HHI_AGENT
    ..............

    без комментариев

    Alek86, 22 Сентября 2011

    Комментарии (12)
  7. C++ / Говнокод #7938

    +165

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    int excpt[]={03, 03, 03, 00};
    //...
    typedef int tex[sizeof(excpt)/sizeof(excpt[0])];
    typedef tex& texr;
    //... 
    throw texr(excpt);

    Уж сразу массив кидали, как исключение. Зря мелочились...

    Говногость, 22 Сентября 2011

    Комментарии (17)
  8. Java / Говнокод #7937

    +72

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    if(TextUtils.isEmpty(text)
        || TextUtils.isEmpty(text)
        || TextUtils.isEmpty(text)) {
       return null;
      }

    Не уверенность в себе.

    musuk, 22 Сентября 2011

    Комментарии (9)
  9. PHP / Говнокод #7936

    +36

    1. 1
    2. 2
    3. 3
    $kd = strrpos("$fotofilenames[$i]", ".");
        $kf = substr("$fotofilenames[$i]", $kd+1, strlen("$fotofilenames[$i]")-$kd);
        $kf = strtolower($kf);

    вот так и живем.

    Специальная олимпиада по программированию для программистов PHP, VB и 1c (c)

    brainstorm, 22 Сентября 2011

    Комментарии (12)
  10. Куча / Говнокод #7935

    +124

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function Trig_d_Conditions takes nothing returns boolean
        if ( not ( true == true ) ) then
            return false
        endif
        return true
    endfunction

    Код написан на JASS. Данный язык был придуман компанией Blizzard и использован в игре WarCraft 3 (WC3).
    То что вы видите было сгенерировано стандартным редактором WC3.

    alexprey, 22 Сентября 2011

    Комментарии (16)