1. Список говнокодов пользователя guest

    Всего: 1419

  2. C# / Говнокод #805

    +147

    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
    if (chk.Checked)
                {
                    foreach (BV.Star.BLL.PersonGroups.PersonGroup trainee in trainees)
                    {
                        if (trainee.TraineeID.ToString() == gvwTrainees.DataKeys[gvwTrainees.PageIndex == 0 ? gvr.DataItemIndex : (gvr.DataItemIndex % gvwTrainees.PageSize)].Value.ToString())
                          goto Next;
                    }
    
                    InsertTraineeIntoGroup(Int32.Parse(ddlGroups.SelectedValue),
                        Int32.Parse(gvwTrainees.DataKeys[gvwTrainees.PageIndex == 0 ? gvr.DataItemIndex : (gvr.DataItemIndex % gvwTrainees.PageSize)].Value.ToString()),
                      false, DateTime.MaxValue,
                      "");
                Next: ;
    
                }

    И снова на сцене - goto!

    guest, 02 Апреля 2009

    Комментарии (0)
  3. C# / Говнокод #804

    +143.1

    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
    if (((HttpContext.Current.Profile as ProfileCommon).Role == "3") || ((HttpContext.Current.Profile as ProfileCommon).Role == "4"))
            {
                if (e.Item.Value == " Add New Trainee ")
                    e.Item.Enabled = false;
                if (e.Item.Value == " Add New Group ")
                    e.Item.Enabled = false;
                if (e.Item.Value == " Audit Log ")
                    e.Item.Enabled = false;
                if (e.Item.Value == " Manage Holidays ")
                    e.Item.Enabled = false;
            }
    
            if ( (( HttpContext.Current.Profile as ProfileCommon).Role != "0") && (( HttpContext.Current.Profile as ProfileCommon).Role != "") )
            {
                if (e.Item.Value == " Manage Users ")
                    e.Item.Enabled = false;
                if (e.Item.Value == " Manage Courses ")
                    e.Item.Enabled = false;
                if (e.Item.Value == " Audit Log ")
                    e.Item.Enabled = false;
            }
            if (((HttpContext.Current.Profile as ProfileCommon).Role == "") ||
                ((HttpContext.Current.Profile as ProfileCommon).Role == "0") ||
                ((HttpContext.Current.Profile as ProfileCommon).Role == "1") ||
                ((HttpContext.Current.Profile as ProfileCommon).Role == "2"))
            {
                if (e.Item.Value == " Holidays ")
                    e.Item.Enabled = false;
    
            }

    Новое место работы. Новые порции говнокода.
    Это классика - no comments...

    guest, 02 Апреля 2009

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

    +157.6

    1. 1
    $result = preg_replace("/(\d\d,\d\d)\d\d/", "$1", $result);

    Не хотелось, а пришлось - это в большом потоке не очень хорошо структурированных данных так округляются числа, с четырёх до двух знаков после запятой.

    guest, 02 Апреля 2009

    Комментарии (0)
  5. Си / Говнокод #802

    +135.8

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    Xgetc(fp); /* the extension code */
    	for ( i = Xgetc(fp); i > 0; i-- ) Xgetc(fp);
    	while ( ( i = Xgetc(fp) ) > 0 ) {
    	  for ( i = i ; i > 0; i-- ) Xgetc(fp);
    	}

    Кусок из whirlgif - whirlgif.c

    * This program reads in a sequence of single-image Gif format files and
    * outputs a single multi-image Gif file, suitable for use as an animation.

    Поубивал бы!

    guest, 01 Апреля 2009

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

    +151.4

    1. 1
    http://suchen.mobile.de/fahrzeuge/showDetails.html?lang=ru&id=74773331&pageNumber=3&scopeId=C&sortOption.sortBy=searchNetGrossPrice&sortOption.sortOrder=ASCENDING&makeModelVariant1.makeId=17700&makeModelVariant1.modelId=13&makeModelVariant1.searchInFreetext=false&makeModelVariant2.searchInFreetext=false&makeModelVariant3.searchInFreetext=false&vehicleCategory=Car&segment=Car&minFirstRegistrationDate=1995-01-01&siteId=GERMANY&damageUnrepaired=ALSO_DAMAGE_UNREPAIRED&export=ALSO_EXPORT&customerIdsAsString=&tabNumber=2

    небольшой такой запросик...

    guest, 01 Апреля 2009

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

    +142

    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
    [root@v6704 debug]# make
    [  1%] Generating moc_wordplugin.cxx
    Scanning dependencies of target gluxi_plugin_word
    [  1%] Building CXX object src/plugins/word/CMakeFiles/gluxi_plugin_word.dir/wordplugin.o
    /home/gluxi/src/plugins/word/wordplugin.cpp: In member function ‘virtual bool WordPlugin::parseMessage(gloox::Stanza*)’:
    /home/gluxi/src/plugins/word/wordplugin.cpp:104: error: ‘class gloox::Stanza’ has no member named ‘addAttribute’
    /home/gluxi/src/plugins/word/wordplugin.cpp:105: error: ‘class gloox::Stanza’ has no member named ‘finalize’
    /home/gluxi/src/plugins/word/wordplugin.cpp:106: error: ‘class gloox::Stanza’ has no member named ‘xml’
    /home/gluxi/src/plugins/word/wordplugin.cpp:136: error: ‘class gloox::Stanza’ has no member named ‘addAttribute’
    /home/gluxi/src/plugins/word/wordplugin.cpp:137: error: ‘class gloox::Stanza’ has no member named ‘finalize’
    make[2]: *** [src/plugins/word/CMakeFiles/gluxi_plugin_word.dir/wordplugin.o] Error 1
    make[1]: *** [src/plugins/word/CMakeFiles/gluxi_plugin_word.dir/all] Error 2
    make: *** [all] Error 2

    продолжаем говнокодить

    guest, 01 Апреля 2009

    Комментарии (0)
  8. Куча / Говнокод #799

    +139

    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
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    debug]# cmake .. 
    -- Check for working C compiler: /usr/bin/gcc
    -- Check for working C compiler: /usr/bin/gcc -- works
    -- Check size of void*
    -- Check size of void* - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Looking for Q_WS_X11
    -- Looking for Q_WS_X11 - found
    -- Looking for Q_WS_WIN
    -- Looking for Q_WS_WIN - not found.
    -- Looking for Q_WS_QWS
    -- Looking for Q_WS_QWS - not found.
    -- Looking for Q_WS_MAC
    -- Looking for Q_WS_MAC - not found.
    -- Found Qt-Version 4.3.4
    -- Looking for _POSIX_TIMERS
    -- Looking for _POSIX_TIMERS - found
    -- Found OpenSSL: /usr/lib/libssl.so
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Finding plugins in /home/gluxi/src/plugins
    -- -> Found plugin: word
    -- -> Found plugin: net
    -- -> Found plugin: webstatus
    -- -> Found plugin: muc
    -- -> Found plugin: config
    -- -> Found plugin: core
    -- -> Found plugin: misc
    -- -> Found plugin: user
    -- -> Found plugin: alias
    -- -> Found plugin: admin
    -- PluginLoader generated
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/gluxi/debug

    не понятно

    guest, 01 Апреля 2009

    Комментарии (0)
  9. Си / Говнокод #798

    +142

    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
    34. 34
    35. 35
    36. 36
    case MOTO_ACCY_IOCTL_SET_CHARGER_LOAD_LINE:
                /* Copy the load line setting from user space */
                retval = copy_from_user ((void *)&data, (void *)arg, sizeof(data));
    
                /* If the copy failed, return an error */
                if (retval != 0)
                {
                    retval = -EFAULT;
                }
    
                /* Else, configure the hardware for the requested load line setting */
                else
                {
                    /* Acquire the lock to prevent changes to connected_accessories */
                    spin_lock (&connected_lock);
    
                    /* Verify that the 3G fast charger is connected */
                    if (ACCY_BITMASK_ISSET(connected_accessories, MOTO_ACCY_TYPE_CHARGER_FAST_3G))
                    {
                        /* This charger is the only charger that supports an adjustable load line */
    
                        /* TBD */
                    }
    
                    /* Else, the appropriate charger type is not connected */
                    else
                    {
                        /* Return error: No such device */
                        retval = -ENODEV;
                    }
    
                    /* Release the lock for connected_accessories */
                    spin_unlock (&connected_lock);
                }
    
                break;

    guest, 01 Апреля 2009

    Комментарии (3)
  10. Си / Говнокод #797

    +145.4

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    индокод:
    #ifdef PRINT_DEBUG_INFO
    #define DBG_PRINT if(1) printf
    #else
    #define DBG_PRINT if(0) printf
    #endif

    Индокод - макрос для вкл-выкл дебажной печати.

    guest, 31 Марта 2009

    Комментарии (11)
  11. JavaScript / Говнокод #796

    +130

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    function showMenu() {
        var isShowMenu = false;
     
        isShowMenu = true;
     
        isShowMenu = true;
        if (isShowMenu) { ... }
    }

    сгенерированный код такой сгенерированный..

    guest, 31 Марта 2009

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