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

    +147

    1. 1
    $APPLICATION->SetTitle('Хуй на рыло, чтоб душа не ныла');

    код скриптов админ-панели, взято с продакшена

    elw00d, 08 Июня 2011

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

    −88

    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
    try:
            dday = time.strftime("%d", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            dmonth = time.strftime("%m", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            dhour = time.strftime("%H", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            dmin = time.strftime("%M", time.localtime(os.path.getmtime(path + d))).lstrip('0')
            screenpath = os.listdir(spath)
            for screen in screenpath:
                sday = time.strftime("%d", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                smonth = time.strftime("%m", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                shour = time.strftime("%H", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                smin = time.strftime("%M", time.localtime(os.path.getmtime(spath + screen))).lstrip('0')
                if dday == sday:
                    if dmonth == smonth:
                        if dhour == shour:
                            if dmin == smin:
                                scr = spath + screen
                                if scr:
                                    return str(scr)
                                else:
                                    return None
        except:
            return "None"

    Проверка даты создания двух файлов

    pztrn, 08 Июня 2011

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

    +129

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    \begin{equation*}
    \begin{split}
      \Delta B_m^{(\text{Т})} &= \left(\left(\frac{\upmu_0N}{2L}\left(\frac{\frac{1}{2}L - z}{\sqrt{R^2 + (\frac{1}{2}L - z)^2}} + \frac{\frac{1}{2}L + z}{\sqrt{R^2 + (\frac{1}{2}L + z)^2}}\right)\Delta I\right)^2 + \right.\\
      &+ \left(\frac{\upmu_0NI_mD}{8L}\left(\frac{\frac{1}{2}L - z}{\sqrt{(\frac{D^2}{4} + (\frac{1}{2}L - z)^2)^3}} + \frac{\frac{1}{2}L + z}{\sqrt{(\frac{D^2}{4} + (\frac{1}{2}L + z)^2)^3}}\right)\Delta D\right)^2 + \\
      &+ \left(\frac{\upmu_0NI_m}{4L^2}\left(\frac{L(\frac{1}{2}L - z)^2}{\sqrt{(R^2 + (\frac{1}{2}L - z)^2)^3}} + \frac{L(\frac{1}{2}L + z)^2}{\sqrt{(R^2 + (\frac{1}{2}L + z)^2)^3}} - \right.\right. \\
      &- \left.\left.\frac{2z}{\sqrt{R^2 + (\frac{1}{2}L - z)^2}} + \frac{2z}{\sqrt{R^2 + (\frac{1}{2}L + z)^2}}\right)\Delta L\right)^2 + \\
      &+ \left(\frac{\upmu_0NI_m}{2L}\left(\frac{(\frac{1}{2}L - z)^2}{\sqrt{(R^2 + (\frac{1}{2}L - z)^2)^3}} - \frac{(\frac{1}{2}L + z)^2}{\sqrt{(R^2 + (\frac{1}{2}L + z)^2)^3}} - \right.\right. \\
      &- \left.\left.\left.\frac{1}{\sqrt{R^2 + (\frac{1}{2}L - z)^2}} + \frac{1}{\sqrt{R^2 + (\frac{1}{2}L + z)^2}}\right)\Delta z\right)^2 \right)^{\frac{1}{2}}
    \end{split}
    \end{equation*}

    LaTeX

    mityada, 07 Июня 2011

    Комментарии (13)
  4. Си / Говнокод #6884

    +130

    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
    MACROFIRE-MACRO 5.0.0
    
    [Info]
    Name = 
    Hotkey = 
    Repeat = 1
    
    [Macro]
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 83
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 50
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Down
    Delay = 50
    ButtonsPress = Right
    Delay = 83
    ButtonsRelease = Down
    ButtonsPress = Square
    Delay = 116
    ButtonsRelease = Right
    ButtonsRelease = Square
    Delay = 266
    ButtonsPress = RTrigger
    Delay = 83
    ButtonsRelease = RTrigger
    Delay = 50
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 83
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 49
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 50
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 100
    ButtonsChange = Down
    Delay = 83
    ButtonsPress = Right
    Delay = 66
    ButtonsRelease = Down
    Delay = 100
    ButtonsPress = Triangle
    ButtonsRelease = Right
    Delay = 83
    ButtonsRelease = Triangle
    Delay = 917
    ButtonsPress = Down
    Delay = 200
    ButtonsPress = Circle
    Delay = 83
    ButtonsRelease = Circle
    Delay = 66
    ButtonsPress = Circle
    Delay = 66
    ButtonsRelease = Circle
    Delay = 83
    ButtonsPress = Circle
    Delay = 133
    ButtonsRelease = Circle
    Delay = 50
    ButtonsRelease = Down
    Delay = 83
    ButtonsPress = Left
    ButtonsPress = Up
    Delay = 166
    ButtonsChange = Left + Circle
    ButtonsRelease = Left
    Delay = 116
    ButtonsRelease = Circle

    Lambda-11 Challenge 6

    minlexx, 07 Июня 2011

    Комментарии (24)
  5. SQL / Говнокод #6883

    −121

    1. 1
    2. 2
    3. 3
    4. 4
    update RPout
    set ReserveCalculated = round((Base * ElementNorm) /100.0 + 1e-9, 2) * 
    sign(convert(money, floor(Base * ElementNorm) / 100.0)) * sign( 1 + 
    sign(convert(money, floor(Base * ElementNorm) / 100.0)))

    Отрицательные значения изменить на ноль плюс феерическая работа с типами данных.

    Blackened, 07 Июня 2011

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

    +73

    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
    elem = request.getParameter("max_price");
        if ((elem != null) && (elem.trim().length() != 0)) {
          filter.setMax_price_id(elem);
          switch (Integer.parseInt(elem))
          {
          case 1:
            filter.setMax_price("price <= 10000");
            break;
          case 2:
            filter.setMax_price("price > 10000 and price <= 20000");
            break;
          case 3:
            filter.setMax_price("price > 20000 and price <= 30000");
            break;
          case 4:
            filter.setMax_price("price > 30000 and price <= 40000");
            break;
          case 5:
            filter.setMax_price("price > 50000");
          }
        }

    получение диапазона цен

    kakon, 07 Июня 2011

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

    +160

    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
    function message($mess,$font,$border,$backgr){
    $bsize = '2';
    if ($font == "" || $border == "" || $backgr == "" ){
    $font   = '#ffffff';
    $border = 'none';
    $backgr = 'none';
    $backgr = 'none';
    $bsize = '0';
    }
    //exit();
    echo $top_pan.'<br>
    <div align="center">
    <div align="center"
    style="width: 60%; border-width: '.$bsize.'; border-style: solid;color: '.$font.'; border-color: '.$border.'; background-color: '.$backgr.';">'
    .$mess.'</div></div>'.$bottom_pan;
    
    }

    Оттуда же.
    А вообще там все можно выкладывать.

    7ion, 07 Июня 2011

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

    +161

    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
    <?php
    /*
    =====================================================
     Esay Engne Site CMS
    -----------------------------------------------------
     http://ees-co.com
    -----------------------------------------------------
     Copyright © 2010 - 2011  EES
    =====================================================
     Назначение: просмотр offline сайта
    =====================================================
    */
    
    require_once("engine/class/security_mod.php");
    $status_a = "000";
    require_once("index.php");
    
    ?>

    Esay Enigme MKS
    offline.php из корня системы.
    Долго думал.

    7ion, 07 Июня 2011

    Комментарии (10)
  9. Python / Говнокод #6879

    −167

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    def word(long):
       s=''
       for j in range(0,long):
          lit =  struct.unpack('c',plik.read(1))[0]
          if ord(lit)!=0:
             s+=lit
             if len(s)>300:
                break
       return s

    WGH, 06 Июня 2011

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

    +161

    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
    <? 
    	//------------------------------------------//
    	// Рисуем кнопку с цифирками xD 			//
    	//------------------------------------------//
    	
    	// Берём конфиг и библиотеки
    	$db_db		=	"hoster1129_mc";  		// Имя  базы  данных  
        $db_user	=	"hoster1129_mc";  		// Пользователь  сервера  баз  данных  
        $db_pass	=	"SH3vOp4m";  		// Пароль  
        $db_server	=	"localhost";  		// Имя  сервера 
    	
    	$red		=	"80"; 		// RGB(Red)
    	$green		=	"80"; 		// RGB(Green)
    	$blue		=	"80"; 		// RGB(Blue)
    	
    	//$count		= 	"123";	
    	
    	// Проверим соединение с базой
    	$link = @mysql_connect($db_server, $db_user, $db_pass);  
    	if(!$link)
    	{	
    	die('Невозможно подключится к MySQL базе');	
    	}
    	
    	//Убираем кол-во
    	$count = "0";
    	//Берем кол-во серверов с базы
    	$link = mysql_connect($db_server, $db_user, $db_pass);  
    	if(!$link)  die("MySQL Error");  
    	mysql_select_db($db_db)  or  die("MySQL Error");  
    	$query = "SELECT  *  FROM  ats_stats";  
    	$result = mysql_query($query,  $link)  or  die(mysql_error()); 
    	//Цикль
    	while($info = mysql_fetch_array($result))  
    	{
    		if($_GET['username'] == $info['username'])
    		{
    		$count = $info['num_ratings'];
    		break;
    		}
    	}
    	//Рисуем))
    	header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    	header("Cache-Control: no-store, no-cache, must-revalidate");
    	header("Cache-Control: post-check=0, pre-check=0", false);
    	header("Pragma: no-cache");
    	header("Content-type: image/png");
    
    	//Устанавливаем переменные
    	$whatthefuck = mb_strlen($count);
    	$image = ImageCreateFromPNG('vote.png');
    	$color = ImageColorAllocate($image,$red,$green,$blue);
    	
    	//Проверяем кол-во символов
    	if($whatthefuck == 1)
    	{
    	ImageString($image,3,62,15,$count,$color);
    	}
    	elseif($whatthefuck == 2)
    	{
    	ImageString($image,3,58,15,$count,$color);
    	}
    	elseif($whatthefuck == 3)
    	{
    	ImageString($image,3,55,15,$count,$color);
    	}
    	elseif($whatthefuck == 4)
    	{
    	ImageString($image,3,51,15,$count,$color);
    	}
    	elseif($whatthefuck == 5)
    	{
    	ImageString($image,3,48,15,$count,$color);
    	}	
    	else
    	{
    	ImageString($image,3,50,15,"WTF?!",$color);
    	}
    
    	//Выводим картинку
    	ImagePNG($image);
    ?>

    Скрипт должен выводить число голосов по имени.

    Enelar, 06 Июня 2011

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