1. C# / Говнокод #12008

    +175

    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
    public static IEnumerable<float> Single(float from, float to, float step)
            {
                if (step <= 0.0f) step = (step == 0.0f) ? 1.0f : -step;
     
                if (from <= to)
                {
                    for (float f = from; f <= to; f += step) yield return f;
                }
                else
                {
                    for (float f = from; f >= to; f -= step) yield return f;
                }
            }
     
    public static IEnumerable<double> Double(double from, double to, double step)
            {
                if (step <= 0.0) step = (step == 0.0) ? 1.0 : -step;
     
                if (from <= to)
                {
                    for (double d = from; d <= to; d += step) yield return d;
                }
                else
                {
                    for (double d = from; d >= to; d -= step) yield return d;
                }
            }

    Такие методы накопированы для всех типов данных, которые известны поциенту.
    Но особо интересны эти джва метода

    Unlike some other programmimg languages (notably F#), C# doesn't have any built-in support for dealing with ranges of numbers. The .NET Framework does have the Enumerable.Range() method.
    - It can only deal with Int32's.
    - You can't specify a 'step' from one element of the range to the next. In effect, the step is always one. In this article, I'd therefore like to present a static Range class to deal with these deficiencies.

    http://www.c-sharpcorner.com/uploadfile/b942f9/dealing-with-ranges-of-numbers-in-C-Sharp

    3.14159265, 26 Октября 2012

    Комментарии (4)
  2. Куча / Говнокод #12007

    +104

    1. 1
    http://zapret-info.gov.ru/

    Ананимус ты не знаешь где посмотреть детское порно специально для тебя каталог со свежим проном.

    Vasiliy, 26 Октября 2012

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

    +141

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <script type="text/javascript">
        //<!--
        var SITE_PATH = ''; var SITE_LANG = '';
        //-->
        </script>
        <script type="text/javascript" src="/media/b724280b51052a3df70e38caed7434ff.js?files=jquery.js,govnokod.save.js,govnokod.js&amp;v=4"></script>

    Херня на вашем сайте)) Можно просто сделать в один код...

    111111, 26 Октября 2012

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

    +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
    public string WorkerSexWord
            {
                get
                {
                  if(WorkerSex == true)
                  {
                      return "м";
                  }
                  if(WorkerSex == false)
                  {
                      return "ж";
                  }
                    return "";
                }
            }

    "м" или "ж" выбор с булевого поля

    bercerker, 25 Октября 2012

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

    +142

    1. 1
    http://habrahabr.ru/post/155131/

    dos_, 25 Октября 2012

    Комментарии (19)
  6. Куча / Говнокод #12003

    +95

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    println    (13.0 to 14.0 by 0.1);
    println    (1.3 to  1.4 by 0.01);
    println    (7.0 to 8.2 by 0.3);
    
    //Output:
    NumericRange(13.0, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0)
    NumericRange(1.3, 1.31, 1.32, 1.33, 1.34, 1.35, 1.36, 1.37, 1.38, 1.39)
    java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
    	at java.math.BigDecimal.divide(BigDecimal.java:1616)

    Скала - говно. Вернее даже говнище. И это достойно отдельного поста.
    Консолька для запуска тут:
    http://www.simplyscala.com/

    3.14159265, 25 Октября 2012

    Комментарии (14)
  7. JavaScript / Говнокод #12002

    +160

    1. 1
    new Array(100).map(function(x) { return Math.random() * 1000; });

    Угадайте результат.

    wvxvw, 25 Октября 2012

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

    +129

    1. 1
    <input type="hidden" style="width:0px; height:0px;border:0px" name="eventtype" value="3" />

    shmaltorhbooks, 25 Октября 2012

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

    +130

    1. 1
    void RetreiveAddressInfo(ref string shipToName, ref string streetAddress, ref string streetAddress2, ref string city, ref string state, ref string zip);

    abatishchev, 25 Октября 2012

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

    +140

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    говорят, что на PL/1 это работает:
    
    if if = then then
        then = else;
    else else = if;

    dim1r, 25 Октября 2012

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