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

    +2

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    select * from
    (
    select case when (case when datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365 = 0 then 'Y y.,' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) as varchar(20)) + ',' end + case when (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) as varchar(20)) end) = 'Y y.,M m.' then '' else (case when datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365 = 0 then 'Y y.,' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) as varchar(20)) + ',' end + case when (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/30 - (datediff(day,date,(select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date))/365) * 12) as varchar(20)) end) end as 'Возраст', date as date1, (select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date) as date2 from Battles as P1 where (select top (1) date from Battles as P2 where P2.date > P1.date order by P2.date) is not null) as t
    union
    (select case when (case when datediff(day,date,CONVERT (date, GETDATE()))/365 = 0 then 'Y y.,' else cast((datediff(day,date,CONVERT (date, GETDATE()))/365) as varchar(20)) + ',' end + case when (datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) as varchar(20)) end) = 'Y y.,M m.' then '' else (case when datediff(day,date,CONVERT (date, GETDATE()))/365 = 0 then 'Y y.,' else cast((datediff(day,date,CONVERT (date, GETDATE()))/365) as varchar(20)) + ',' end + case when (datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) = 0 then 'M m.' else cast((datediff(day,date,CONVERT (date, GETDATE()))/30 - (datediff(day,date,CONVERT (date, GETDATE()))/365) * 12) as varchar(20)) end) end, date, CONVERT (date, GETDATE()) from Battles as T1 where (select top (1) date from Battles as T2 where T2.date > T1.date order by T2.date) is null
    );

    BDcorabli@nomer5

    akimachan, 12 Сентября 2018

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

    +3

    1. 1
    https://ssr.vuejs.org/ru/

    Это победа! Столько лет героически переносить сайты на клиент (SPA! Мы разгрузим сервер! Сервер будет отдавать только JSON!) что бы в один момент пенести всё на сервер обратно из-за ёбанных сеошников.

    хуита, 12 Сентября 2018

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    Раз уж пошли багрепорты и их начали исправлять,
    
    https://www.govnokod.ru/24743
    
    Mixed Content: The page at 'https://www.govnokod.ru/24743' was loaded over HTTPS, but requested an insecure script 'http://platform.twitter.com/widgets.js'. This request has been blocked; the content must be served over HTTPS.
    24743:127 Mixed Content: The page at 'https://www.govnokod.ru/24743' was loaded over HTTPS, but requested an insecure resource 'http://www.facebook.com/plugins/like.php?app_id=262270407124304&href=https://www.govnokod.ru/24743&send=false&layout=button_count&width=130&show_faces=true&action=like&colorscheme=light&font=arial&height=20'. This request has been blocked; the content must be served over HTTPS.

    SwiftGovno, 12 Сентября 2018

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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    http://govnokod.ru/javascript/
    
    Forbidden
    
    You don't have permission to access /javascript/ on this server.
    Apache/2.4.18 (Ubuntu) Server at govnokod.ru Port 80

    dm_fomenok, 11 Сентября 2018

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

    +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
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    onStart =: verb define
      wd 'pc game15; pn 15; bin hv; bin h'
      i =. 0
      for_text. ":@>:0,~?~15 do.
        name =. 'a', ":i
        wd 'cc ', name , ' button; cn ', text
        if. 3 = 4|i do.
          wd 'bin z; bin h'
        end.
        wd 'set ', name, ' wh 80 80'
        ". 'game15_', name, '_button =: buttonclicked@]&', (":i)
        i =. >:i
      end.
      wd 'set a15 text'
      wd 'cc count static; cn 0'
      count =: 0
      wd 'bin z'
      wd 'cc restart button; cn restart'
      wd 'pshow'
      empty =: 15
      0$0
    )
    
    buttonclicked =: verb define
      if. 1 = (+/)(**)(-/@:<.@:%&4 , -/@:|~&4) empty, y do.
        wd 'set a', (":empty), ' text ', wd 'get a', (":y), ' text'
        wd 'set a', (":y), ' text'
        empty =: y
        count =: >:count
        wd 'set count text ', ":count
      end.
    )
    
    game15_restart_button =: verb define
      wd 'pclose'
      wd 'activity base'
    )
    
    wd 'activity base'

    Я осилил гуй в J! Урряяяя!

    MasterJoda, 11 Сентября 2018

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

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    private Integer getIntegerValue(int length) throws PivotReadExeption {
            getValue(length);
            return this.stringBuffer.toString().trim().isEmpty()?0:Integer.valueOf(this.stringBuffer.toString());
        }
    
        private BigDecimal getDoubleValue(int length) throws PivotReadExeption {
            getValue(length);
            if(this.stringBuffer.toString().trim().isEmpty()) return null;
            return new BigDecimal(this.stringBuffer.toString().trim());
        }

    Сотрудник выдал. Это говнокод или нет?

    gaal, 11 Сентября 2018

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

    +1

    1. 1
    2. 2
    3. 3
    <?php
    echo implode ("<br>", file("govnokod.php"));
    ?>

    Угадайте как называется это!

    Arduino, 10 Сентября 2018

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

    +2

    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
    if (!(fs_info->workers && fs_info->delalloc_workers &&
      fs_info->submit_workers && fs_info->flush_workers &&
      fs_info->endio_workers && fs_info->endio_meta_workers &&
      fs_info->endio_meta_write_workers &&
      fs_info->endio_write_workers && fs_info->endio_raid56_workers &&
      fs_info->endio_freespace_worker && fs_info->rmw_workers &&
      fs_info->caching_workers && fs_info->readahead_workers &&
      fs_info->fixup_workers && fs_info->delayed_workers &&  // <===
      fs_info->fixup_workers && fs_info->extent_workers &&   // <===
      fs_info->qgroup_rescan_workers)) {
        err = -ENOMEM;
        goto fail_sb_buffer;
    }

    https://bugzilla.kernel.org/show_bug.cgi?id=82021

    Глаз-алмаз!

    wvxvw, 10 Сентября 2018

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

    +1

    1. 1
    Где можно посмотреть исходники "PHP" как можно раньшей релизной версии?

    LinuxGovno, 10 Сентября 2018

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

    +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
    for(int b = 0; b < len; b++){
                resultByte[b] = (byte)(buf[b] & 0xFF);
                crc32 ^= (buf[b] << 24);
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
                if(crc32 < 0) {crc32 = (crc32 << 1) ^ POLYNOMIAL;} else {crc32 = crc32 << 1;}
            }
            resultByte[len+3] = (byte)(crc32 & 0xFF);
            resultByte[len+2] = (byte)((crc32 >>> 8)  & 0xFF);
            resultByte[len+1] = (byte)((crc32 >>> 16) & 0xFF);
            resultByte[len]   = (byte)((crc32 >>> 24) & 0xFF);

    MininN, 10 Сентября 2018

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