1. JavaScript / Говнокод #13068

    +149

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    <a onclick="document.getElementById('callback').style.display='block'">Заказать обратный звонок</a>
    
    =====================================================================================
    
    <img src="img/close_callback.png" onclick="document.getElementById('callback').style.display='none'">
    
    =====================================================================================
    
    <div class='main_menu'>
        <ul>
            <li style='width:185px;margin:0 5.5px 0 0' class='ie_menu'><a href='' class='active' style='width:155px' onmouseover='document.getElementById("drop_top_1").style.display="block"' onmouseout='document.getElementById("drop_top_1").style.display="none"'>каталог строительных <br/>материалов</a>
                <div class='drop_top' id='drop_top_1' onmouseover='this.style.display="block"'  onmouseout='this.style.display="none"'>

    Мамонт-стайл

    dsxack, 29 Мая 2013

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

    +24

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    int randomize(int Min, int Max)
    {
    qsrand(QTime::currentTime().msec());
    if (Min > Max)
    {
    int Temp = Min;
    Min = Max;
    Max = Temp;
    }
    return ((qrand()%(Max-Min+1))+Min);
    }

    Всё хорошо?

    Hackeridze, 29 Мая 2013

    Комментарии (18)
  3. JavaScript / Говнокод #13066

    +162

    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
    function closeLayerInSite(layerName) {
        if (layerName != "count_result") $("#count_result").fadeOut(200);
        if (layerName != "subscribe_layer") $("#subscribe_layer").fadeOut(200);
        if (layerName != "online_contact") $("#online_contact").fadeOut(200);
        if (layerName != "faq_layer") $("#faq_layer").fadeOut(200);
        if (layerName != "layerCity") $("#layerCity").fadeOut(200);
        if (layerName != "ur_service_layer") $("#ur_service_layer").fadeOut(200);
        if (layerName != "fiz_service_layer") $("#fiz_service_layer").fadeOut(200);
        if (layerName != "requestRateMain_layer") $("#requestRateMain_layer").fadeOut(200);
        if (layerName != "exchange_calc") $("#exchange_calc").fadeOut(200);
        if (layerName != "universalForm") $("#universalForm").fadeOut(200);
        if (layerName != "layerCityes") $("#layerCityes").fadeOut(200);
        if (layerName != "vacancy") $("#vacancy").fadeOut(200);
        if (layerName != "cardsAnnotation") $("#cardsAnnotation").fadeOut(200);
        $("#content").css("padding", "0 0 280px");
    }

    Реальный JS-код от самого коммерческий эффективного ТИМЛИДА!

    validol, 29 Мая 2013

    Комментарии (6)
  4. Objective C / Говнокод #13065

    −110

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    Amount_List=[[NSArray alloc] initWithObjects:@"500",@"1000",@"2000",@"5000",@"10000",@"25000",@"50000",@"100000",@"250000",@"350000",@"500000",@"1000000",nil];
    	
    
    	//ShowWonAmout
    	NSString *str1=[NSString stringWithFormat:@"%@",[currencyStyle stringFromNumber:[NSNumber numberWithInt:[[Amount_List objectAtIndex:0] intValue]]]];
    	ShowAmount1.text=[str1 substringToIndex:[str1 length]-3];
            ...	
    	NSString *str12=[NSString stringWithFormat:@"%@",[currencyStyle stringFromNumber:[NSNumber numberWithInt:[[Amount_List objectAtIndex:11] intValue]]]];
    	ShowAmount12.text=[str12 substringToIndex:[str12 length]-3];

    Коллега принес покушать плоды трудов ребят из солнечной Индии

    clockworkman, 29 Мая 2013

    Комментарии (6)
  5. Java / Говнокод #13064

    +65

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    // вот такой вот паттерн инициализации статических переменных во всех классах проекта... 
    private static Properties globalProps = null;
    
    static {
            globalProps = new Properties();
    }

    вот такой вот паттерн инициализации статических переменных во всех классах проекта...ин-лайн инициализацию автору делать почему то не хотелось...и ведь вроде не индус писал, а белый человек...

    aa_kovalev, 29 Мая 2013

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

    +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
    static uint ipToUint(byte[] ipBytes)
            {
            var bConvert = new ByteConverter();
            uint ipUint = 0;
            int shift = 24; //TODO: указывает количество бит для смещения лево
                foreach (byte b in ipBytes)
                {
                    if (ipUint == 0)
                    {
                        ipUint = (uint)bConvert.ConvertTo(b, typeof(uint)) << shift;
                        shift -= 8;
                        continue;
                    }
                    if (shift >= 8)
                        ipUint += (uint)bConvert.ConvertTo(b, typeof(uint)) << shift;
                    else
                        ipUint += (uint)bConvert.ConvertTo(b, typeof(uint));
                        shift -= 8;
                }
            return ipUint;
            }

    Функция конвертирующая массив байтов полученный из IPAddress.Parse("...").GetAddressBytes() в целочисленное представление.

    neeedle, 29 Мая 2013

    Комментарии (70)
  7. Java / Говнокод #13061

    +69

    1. 1
    2. 2
    3. 3
    void superFire(ActionEvent evt) {
        super.fireActionPerformed(evt);
    }

    пиу-пиу!!111

    myzone, 28 Мая 2013

    Комментарии (10)
  8. PHP / Говнокод #13060

    +147

    1. 1
    trim($_GET['password'])

    nc

    sleeper, 28 Мая 2013

    Комментарии (15)
  9. Java / Говнокод #13058

    +66

    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
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    48. 48
    49. 49
    50. 50
    51. 51
    52. 52
    53. 53
    54. 54
    55. 55
    56. 56
    57. 57
    58. 58
    59. 59
    60. 60
    61. 61
    62. 62
    63. 63
    64. 64
    65. 65
    66. 66
    67. 67
    68. 68
    69. 69
    70. 70
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    78. 78
    79. 79
    80. 80
    81. 81
    82. 82
    83. 83
    84. 84
    85. 85
    86. 86
    87. 87
    88. 88
    89. 89
    90. 90
    91. 91
    92. 92
    93. 93
    94. 94
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    package islands.general.playerlist;
    
    import islands.general.player.Player;
    import java.io.Externalizable;
    import java.io.IOException;
    import java.io.ObjectInput;
    import java.io.ObjectOutput;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    
    /**
     * Список игроков.
     *
     * @author Григорий
     */
    public class PlayerList implements Externalizable, Iterable<Player> {
    
        private static final long serialVersionUID = -8237639142683577971L;
        private static final Player[] emptyPlayerArray = new Player[0];
        private List<Player> list;
        private int maxIndex;
    
        public PlayerList() {
            this(emptyPlayerArray);
        }
    
        public PlayerList(Player... players) {
            list = new ArrayList<Player>();
            maxIndex = 0;
            for (int i = 0; i < players.length; i++) {
                Player player = players[i];
                add(player);
            }
        }
    
        /**
         * Добавить нового игрока в конец списка.
         *
         * @param player новый игрок
         * @return индекс нового игрока
         */
        public final int add(Player player) {
            list.add(maxIndex, player);
            return maxIndex++;
        }
    
        /**
         * Установить нового игрока по указанному индексу.
         *
         * @param index индекс для установки
         * @param player новый игрок
         */
        public void set(int index, Player player) {
            list.set(index, player);
        }
    
        /**
         * Возвратить количество игроков.
         *
         * @return количество игроков
         */
        public int getLength() {
            return maxIndex;
        }
    
        /**
         * Возвратить игрока по указанному индексу.
         *
         * @param index индекс игрока
         * @return игрок
         */
        public Player get(int index) {
            return list.get(index);
        }
    
        @Override
        public void writeExternal(ObjectOutput out) throws IOException {
            out.writeInt(maxIndex);
            for (int i = 0; i < maxIndex; i++) {
                list.get(i).writeExternal(out);
            }
        }
    
        @Override
        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
            maxIndex = in.readInt();
            for (int i = 0; i < maxIndex; i++) {
                Player player = new Player();
                player.readExternal(in);
                list.add(player);
            }
        }
    
        @Override
        public Iterator<Player> iterator() {
            return list.iterator();
        }
    }

    Dougrinch, 27 Мая 2013

    Комментарии (30)
  10. JavaScript / Говнокод #13057

    +144

    1. 1
    sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false);

    Кэп с нами.

    Daiver, 27 Мая 2013

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