1. SQL / Говнокод #16052

    −114

    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
    select 
    
    row_number() over (order by count(*) desc) r, 
    
    case when t719.f7171 is null and t719.f7201 is null then 'За поданням
    голови ОВК, капітана судна, керівн. полярної станції України' 
    
                when t719.f7171 is not null  then t717.name1 
    
                when t719.f7201 is not null  then t720.f7202||'
    '||t720.f7203||' '||t720.f7204
    
           end t021f02, 
    
            count(*) count1
    
    from  t719,
    
          t066,
    
          t714,
    
          v1_t717 t717,
    
          t720
    
    where t719.t001f01=PT001F01 and
    
          t719.t001f01=t066.t001f01 and
    
          t719.f7331=t066.f7331 and
    
          t719.f7141=t066.f7141 and
    
          t719.f7191=t066.f7191 and
    
          t066.T066F02 is not null and
    
          t066.T066F03 is null and
    
          t719.t001f01=t714.t001f01 and
    
          t719.f7331=t714.f7331 and
    
          t719.f7141=t714.f7141 and
    
          t714.f71480 is null and
    
          t719.f7171=t717.f7171(+) and
    
          t719.t001f01=t717.t001f01(+) and
    
          t719.f7201=t720.f7201(+) and
    
          t719.t001f01=t720.t001f01(+)
    
    group by case when t719.f7171 is null and t719.f7201 is null then 'За
    поданням голови ОВК, капітана судна, керівн. полярної станції України' 
    
                  when t719.f7171 is not null  then t717.name1 
    
                  when t719.f7201 is not null  then t720.f7202||'
    '||t720.f7203||' '||t720.f7204
    
             end
    
    order by count(*) desc, 1;

    Оттуда же.

    Ну и как такое можно сапортить?

    DBdev, 24 Мая 2014

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

    +129

    1. 1
    mixin(iota(3).map!(i => format("v[%1$d]+=rhs.v[%1$d];", i)).join());

    LispGovno, 23 Мая 2014

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

    −123

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    ИначеЕсли  Отправитель = "h*@**k.ua" Тогда
      НовыйДокумент.Услуга   = Справочники.Услуги.НайтиПоКоду("0000000029");
     ИначеЕсли  Отправитель = "*******@**k.ua" Тогда
      НовыйДокумент.Услуга   = Справочники.Услуги.НайтиПоКоду("0000000029");
      НовыйДокумент.Ответственный = Справочники.Сотрудники.НайтиПоКоду("0000000063");
     КонецЕсли;

    alexinzaz, 23 Мая 2014

    Комментарии (4)
  4. Lua / Говнокод #16047

    −85

    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
    c1 = true
    c2 = true
    c3 = true
    c4 = true
    c5 = true
    c6 = true
    c7 = true
    c8 = true
    c9 = true
    c10 = true
    c11 = true
    c12 = true
    c13 = true
    next = true
    
    function goForward()
      c1 = c2
      c2 = c3
      c3 = c4
      c4 = c5
      c5 = c6
      c6 = c7
      c7 = c8
      c8 = c9
      c9 = c10
      c10 = c11
      c11 = c12
      c12 = c13
      c13 = next
    end

    Немножко Lua-кода от геймдизайнера.

    kostoprav, 23 Мая 2014

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

    +144

    1. 1
    2. 2
    3. 3
    "Если не заходит на Веб мани,есть выход."
    звучит, как тонкий афоризм :)
    Вот только автор его не философ, а какое-то школоло.

    http://zismo.biz/forum/13-481526-1

    brutushafens, 23 Мая 2014

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

    +68

    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
    class CircuitBreaker
    {
        boolean broken = false;
        CircuitBreaker() {}
        private void breakCircuit()
        {
            this.broken = true;
        }
        private boolean isBroken()
        {
            return this.broken;
        }
    }
    
    private boolean writeAssetsToDisk()
    {
        CircuitBreaker breaker = new CircuitBreaker();
        writeBase64EncodedAssetToDisk(breaker, "...", getPath(...));
        writeBase64EncodedAssetToDisk(breaker, "...", getPath(...));
        writeBase64EncodedAssetToDisk(breaker, "...", getPath(...));
        writeBase64EncodedAssetToDisk(breaker, "...", getPath(...));
        return !breaker.isBroken();
    }
    
    private void writeBase64EncodedAssetToDisk(CircuitBreaker breaker, String base64String, String filename)
    {
        if (breaker.isBroken()) {
            return;
        }
        ...
        try
        {
            ...
        }
        catch (IOException e)
        {
            breaker.breakCircuit(); return;
        }
        ...
    }

    Используй исключения, Люк. Фрагмент из Amazon Mobile Ads SDK.

    chaoswithin, 23 Мая 2014

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

    +126

    1. 1
    2. 2
    3. 3
    [ 1, 2, 3, 4 ].map!("a + a")
    //...
    "{ " ~ [1, 2, 3, 4].map!(to!string).join(", ") ~ " }"

    LispGovno, 23 Мая 2014

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

    +126

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    /**
         * Set each member to false.
         */
        void pauseAll()
        {
            foreach( member; __traits(allMembers, ObjectStateFlags) )
                static if( __traits(compiles, __traits(getMember, ObjectStateFlags, member) = false) )
                    __traits(getMember, ObjectStateFlags, member) = false;
        }

    LispGovno, 23 Мая 2014

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

    +134

    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
    static U32 Round_up_to_next_2_power( U32 value )
    {
      if ( value > 16 )
        if ( value > 64 )
          if ( value > 128 )
            if ( value > 256 )
              if ( value > 512 )
                return( 1024 );
              else
                return( 512 );
            else
              return( 256 );
          else
            return( 128 );
        else
          if ( value > 32 )
            return( 64 );
          else
            return( 32 );
      else
        if ( value > 4 )
          if ( value > 8 )
            return( 16 );
          else
            return( 8 );
        else
          if ( value > 2 )
            return( 4 );
      return( value );
    }

    Simple function to round up to the next power of 2.

    Wicked, 23 Мая 2014

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

    +118

    1. 1
    ... *sizeof(uint32_t)

    Правильно. А то вдруг кто его переопределит.

    3.14159265, 22 Мая 2014

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