1. PHP / Говнокод #17403

    +159

    1. 1
    2. 2
    3. 3
    if((!$_SERVER["REQUEST_URI"]) || ($_SERVER["REQUEST_URI"] == "/") && !$_SESSION['user']) {$smarty->display(dirname(__FILE__).'/system/template/index.html'); exit;}
    if ($_SESSION['user']['login'] && (!$_SERVER["REQUEST_URI"]) || ($_SERVER["REQUEST_URI"] == "/")) {require './system/modules/info/main.php';$smarty->assign('c',$_SESSION['user']); $smarty->display(dirname(__FILE__).'/system/template/home/index.html');}
    if((!$_SERVER["REQUEST_URI"]) || ($_SERVER["REQUEST_URI"] == "/") && !$_SESSION['user']) {$smarty->display(dirname(__FILE__).'/system/template/home/guest.html');}

    Вот как строится новая соцсеть

    yanislavb, 04 Января 2015

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

    +107

    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
    var a : int64;
     
    begin
      assign(input, 'input.txt'); reset(input);
      assign(output, 'output.txt'); rewrite(output);
      read(a);
      if a=25 then write ('2.7182818284590452353602875');
      if a=24 then write ('2.718281828459045235360288');
      if a=23 then write ('2.71828182845904523536029');
      if a=22 then write ('2.7182818284590452353603');
      if a=21 then write ('2.718281828459045235360');
      if a=20 then write ('2.71828182845904523536');
      if a=19 then write ('2.7182818284590452354');
      if a=18 then write ('2.718281828459045235');
      if a=17 then write ('2.71828182845904524');
      if a=16 then write ('2.7182818284590452');
      if a=15 then write ('2.718281828459045');
      if a=14 then write ('2.71828182845905');
      if a=13 then write ('2.7182818284590');
      if a=12 then write ('2.718281828459');
      if a=11 then write ('2.71828182846');
      if a=10 then write ('2.7182818285');
      if a=9 then write ('2.718281828');
      if a=8 then write ('2.71828183');
      if a=7 then write ('2.7182818');
      if a=6 then write ('2.718282');
      if a=5 then write ('2.71828');
      if a=4 then write ('2.7183');
      if a=3 then write ('2.718');
      if a=2 then write ('2.72');
      if a=1 then write ('2.7');
      if a=0 then write ('3') 
    end.

    Вывод числа e с заданной точностью

    AndreyZ, 04 Января 2015

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

    +158

    1. 1
    if((!$_SERVER["REQUEST_URI"]) || ($_SERVER["REQUEST_URI"] == "/") && !$_SESSION['user']) {echo "index";}

    yanislavb, 04 Января 2015

    Комментарии (0)
  4. Java / Говнокод #17400

    +71

    1. 1
    newMatrix.setElement(newMatrix.getElement(i, j) + getElement(i, k) * matrix.getElement(k, j), i, j);

    Профессиональный говнокод.

    jangolare, 04 Января 2015

    Комментарии (9)
  5. bash / Говнокод #17399

    −105

    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
    #!/bin/bash
    
    trap "logkeys -k && echo $'\n'Exit! && exit 0" SIGINT SIGTERM
    
    while true
    	do 
    		sleep 0.2
    		layout=$(xset -q | grep LED | awk {' print $10 '} | cut -c5)
    		if [[ $layout == 0 ]] && [[ $layoutmode == 0 ]]
    		then
    			echo layout US, US keymap already started
    			continue
    		elif [[ $layout == 1 ]] && [[ $layoutmode == 1 ]]
    		then
    			echo layout RU, RU keymap already started
    			continue
    		elif [[ $layout == 0 ]] && [[ $layoutmode == 1 ]]
    		then
    			echo layout 0,layoutmode 1,Kill and Start us,layoutmode=0
    			exec logkeys -k&
    			exec logkeys -s --no-func-keys -o /var/log/key.log&
    			layoutmode=0
    		elif [[ $layout == 1 ]] && [[ $layoutmode == 0 ]]
    		then 
    			echo layout 1,layoutmode 0,Kill and Start ru,layoutmode=1
    			exec logkeys -k&
    			exec logkeys -m /etc/logkeys/ru.map -s --no-func-keys -o /var/log/key.log&
    			layoutmode=1
    		else
    			if [[ $layout == 1 ]]
    			then
    				echo layout 1,logkeys Kill and Start
    				exec logkeys -k&
    				exec logkeys -m /etc/logkeys/ru.map -s --no-func-keys -o /var/log/key.log&
    				layoutmode=1
    			else
    				echo layout 0,logkeys Kill and Start
    				exec logkeys -k&
    				exec logkeys -s --no-func-keys -o /var/log/key.log&
    				layoutmode=0
    			fi
    		fi
    	done

    Скрипт переключающий раскладку для keylogs ...

    pl7ofit, 04 Января 2015

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

    +136

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    int num10 = Convert.ToInt16(this.label13.Text);
        int num11 = Convert.ToInt16(this.label11.Text);
        int num12 = Convert.ToInt16(this.LH2.Text);
        int num13 = Convert.ToInt16(this.dmserver.Text);
        int num14 = Convert.ToInt16(this.vipserver.Text);
        int num15 = Convert.ToInt16(this.NAMALSK_FREE_server.Text);
        int num16 = Convert.ToInt16(this.Igromafia_serevr.Text);
        int num18 = Convert.ToInt16(this.LH3_total_on_off.Text);
        int num17 = ((((((num10 + num11) + num13) + num14) + num15) + num12) + num16) + num18;
        this.servers.Text = Convert.ToString(num17);

    Часть метода статистики одного из лаунчеров для пиратского клиента игры.

    kingmonstr, 03 Января 2015

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

    +158

    1. 1
    Function.prototype.apply.call(window.alert, window, ['alert'])

    А я чё? Я ничё...

    AjiTae, 01 Января 2015

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

    +135

    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
    /*
         * Lack of time prevents me from writing this segment properly.
         * May Krishna have mercy on my soul.
         */
        static const uint32_t pal            = 720 * 576 * 2;
        static const uint32_t ntsc_composite = 720 * 507 * 2;
        static const uint32_t ntsc_sdi       = 720 * 480 * 2;
        uint16_t new_width = width, new_height = height;
    
        if (height == 0) {
            new_width = 1920;
            new_height = 1080;
        }
    
        if (format == PAL) {
            rv = pal;
            memset(out_payload, 0x3F, rv);
        }
        else if (format == NTSC) {
            if (source == SDI_VIDEO) {
                rv = ntsc_sdi;
                memset(out_payload, 0x3F, rv);
            }
            else {
                rv = ntsc_composite;
                memset(out_payload, 0x3F, rv);
            }
        }
        else {
            rv = new_width * new_height * 2;
            memset(out_payload, 0x3F, rv);
        }

    Вот что переизбыток мочи делает.

    codemonkey, 31 Декабря 2014

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

    +137

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    void main()
    {
      printf("HAPPY NEW YEAR!");
      printf("Forever alone! Vodka!");
      Sleep(INFINITE);
    }

    LispGovno, 31 Декабря 2014

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

    +154

    1. 1
    <input type="submit" name="sub" value="регистрация" class="buttom2_activ" onmouseover="this.className='buttom2_activ'" onmouseout="this.className='buttom2'">

    CSS :hover, лол

    heyzea1, 31 Декабря 2014

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