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

    −108

    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
    function t()
    {
         setTimeout('document.getElementById("qwezxc").innerHTML+="H"',1000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="e"',2000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="l"',3000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="l"',4000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="o"',5000)
         setTimeout('document.getElementById("qwezxc").innerHTML+=","',6000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="W"',7000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="o"',8000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="r"',9000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="l"',10000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="d"',11000)
    }

    yasosiska, 26 Июня 2011

    Комментарии (6)
  2. SQL / Говнокод #7066

    −108

    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
    function t()
    {
         setTimeout('document.getElementById("qwezxc").innerHTML+="H"',1000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="e"',2000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="l"',3000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="l"',4000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="o"',5000)
         setTimeout('document.getElementById("qwezxc").innerHTML+=","',6000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="W"',7000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="o"',8000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="r"',9000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="l"',10000)
         setTimeout('document.getElementById("qwezxc").innerHTML+="d"',11000)
    }

    yasosiska, 26 Июня 2011

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

    +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
    <?php   ////////////////////////////////
    	//Данная вставка будет обрабатывает переменные переданные post запросом;
    	//Передается с файла MenuProduction.php.
    	//и в соответсвтвии с переданной post переменной будет выставлять get переменную
    	//Page, для корректного перехода на нужную нам страницу_02.12.2009
    	/////////////////////////
    ?>
    
    <table align="center" id="Table_01" width="100%" border="0" cellpadding="0" cellspacing="0">
    	<tr>
    		<td colspan="5" width="961" height="12">
    		<div id="Layer1">
      <!--<table align="center" cellspacing="0">
    		<tr><td>  <?php include('FunctionCellOn.php'); 
          //Поясню, что делаем подключением данного php файла:
            //   В нем описана всего одна функция, которая сверяет переданный Get параметр
              // с номером страницы(см. далее).
              // Если значения равны, значит пользователь нажал на ячейку меню, следовательно,
               //необходимо обозначить, что она нажата. Поэтому далее во всех ячейках меню делаем
               //так: проверка, если совпадение есть, значит выводим заголовок ячейки меню
               //как обычный текст, иначе обозначаем его как ссылку. 
               //Минус данного подхода - получилась мешанина php-кода c html
               //Расшифровка страниц:
               //$_GET['Page'] =
                //1 - Главная
                //2 - Интерактивная карта
                //3 - Производство
                //4 - О компании
                //5 - Контакты
                
                //далее пошли не пункты меню
                //6 - Заявка на звонок
           ?>     
           		<?php   
    		 //На главную страницу будут дополнительные условия, т.к. надо
           	         //чтобы по умолчанию грузилась главная страница, то следовательно
           	         //по умолчанию надо и отобразить ячейку меню 'главная', как 'нажато 
    		 //Для этого помимо стандартной проверке на нажатие, надо еще
    		 //проверить вот что: если ни одни параметр методом Get не передан, то
    		 //соответственно грузится просто index.php, где по умолчанию
    		 //в область вывода загружаем файли соответствующий пункты меню 'главная'
    		 //Следовательно ссылку 'главная' делаем не активной    
            	 if ((CellOnCheck($_GET['Page'],1) == true) || 
    		 !isset($_GET["Page"]) && !isset($_GET["id_news"]) &&
    	         !isset($_GET["archives"]) && !isset($_GET["page"])) {
             	 echo "<Span class = \"MenuCellOn\">Главная</Span>"; 
    		 }
    		 else echo "<a href=\"http://amalker.su\">Главная</a>";
    	
          		 ?>
          </td>
    	  <td>
    	  <?php 
            	 if (CellOnCheck($_GET['Page'],4) == true) {
            	  echo "  |  <Span class = \"MenuCellOn\">О компании </Span>"; 
    		 }
    		 else echo "  |  <a href=\"index.php?Page=4\">О компании </a>";
           		?>
                   </td>
    	   <td>  |  <a href="map/map_client.php" target="_blank">Карта конструкций<img src="new.png" width="6" height="12" border="0"></a> 
          
             	      </td>
    	  <td><?php 
            	 if (CellOnCheck($_GET['Page'],3) == true) {
             	 echo "  |  <Span class = \"MenuCellOn\">Производство  </Span>"; 
    		 }
    		 else echo "  |  <a href=\"index.php?Page=3\">Производство  </a>";
           	 	?>
            	      </td>
    	   <td>
            	<?php 
            	 if (CellOnCheck($_GET['Page'],5) == true) {
             	 echo "  |  <Span class = \"MenuCellOn\">Контактная информация</Span>"; 
    	 	 }
    		 else echo "  |  <a href=\"index.php?Page=5\">Контактная информация</a>";
           		?></td>
        </tr>
    </table>--></div>

    Ужас и только.

    nethak, 26 Июня 2011

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

    +160

    1. 1
    2. 2
    3. 3
    uWeb_b = function(text,cl,onclick,width){return '<div style="width:'+width+'px" class='+cl+' onclick='+onclick+' id="uWeb_Button">'+text+'</div>';}
    uWeb_b2 = function(text,cl,onclick,width){return '<div style="width:'+width+'px" class='+cl+' onclick='+onclick+' id="uWeb_Button2">'+text+'</div>';}
    uWeb_b3 = function(text,cl,onclick,width){return '<div style="width:'+width+'px" class='+cl+' onclick='+onclick+' id="uWeb_Button3">'+text+'</div>';}

    stuffort, 26 Июня 2011

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

    −129

    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
    #!/bin/bash
    EMAIL="Your email"
    PASSWORD="your password"
    USERAGENT="Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20110529 Firefox/4.0"
    
    curl -A "$USERAGENT" -c /tmp/vklogin.cookie -d "pass=$PASSWORD&email=$EMAIL" http://login.vk.com/?act=login -L | iconv -f cp1251 > /tmp/vklogin
    
    perl -e  "while(<STDIN>) {\$a=\$_; if(\$a =~ /^\s*<input[^>]*?name='([^']*)'[^>]*?value='([^']*)'\s*\/>/i) {print \"\$1=\$2&\";}}" < /tmp/vklogin > /tmp/vklogin.postdata
    POSTDATA="$(cat /tmp/vklogin.postdata)"
    
    curl -A "$USERAGENT" -d "$POSTDATA" -b /tmp/vklogin.cookie -c /tmp/vklogin.cookie http://vkontakte.ru/login.php -L -v 2>&1 | iconv -f cp1251 &> /dev/null
    
    echo 1 > /tmp/vklogin.mailid
    echo 1 > /tmp/vklogin.mailoutid
    
    while [ `cat /tmp/vklogin.mailid | wc -l` -gt 0 ]; do
        curl -A "$USERAGENT" -d "$POSTDATA" -b /tmp/vklogin.cookie -c /tmp/vklogin.cookie http://vk.com/mail -L | iconv -f cp1251 > /tmp/vklogin.mail
        cat /tmp/vklogin.mail |  perl -e "while(<STDIN>) {if (\$_ =~ /.*mail.deleteMsg\((\d*)/) {print \"\$1\n\";} }" > /tmp/vklogin.mailid
        for i in $(cat /tmp/vklogin.mailid); do
            curl -A "$USERAGENT" -d "act=a_delete&al=1&from=inbox&hash=1309098903_0eefa6ea250675f38e&id=$i"  -b /tmp/vklogin.cookie -c /tmp/vklogin.cookie http://vk.com/al_mail.php -L | iconv -f cp1251 
        done
    done
    
    while [ `cat /tmp/vklogin.mailoutid | wc -l` -gt 0 ]; do
        curl -A "$USERAGENT" -d "$POSTDATA" -b /tmp/vklogin.cookie -c /tmp/vklogin.cookie http://vk.com/mail?section=outbox -L | iconv -f cp1251 > /tmp/vklogin.mailout
        cat /tmp/vklogin.mailout |  perl -e "while(<STDIN>) {if (\$_ =~ /.*mail.deleteMsg\((\d*)/) {print \"\$1\n\";} }" > /tmp/vklogin.mailoutid
        for i in $(cat /tmp/vklogin.mailoutid); do
            curl -A "$USERAGENT" -d "act=a_delete&al=1&from=outbox&hash=1309103621_59302e5e1b1a924a70&id=$i"  -b /tmp/vklogin.cookie -c /tmp/vklogin.cookie http://vk.com/al_mail.php -L | iconv -f cp1251 
        done
    done
    rm /tmp/vklogin*

    Удаляет все сообщения на vk.com

    Наверное hash надо будет заменить.

    Tanger, 26 Июня 2011

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

    +146

    1. 1
    2. 2
    3. 3
    body, html {
    font-family: "Calibri","Arial","Verdana","Serif";
    }

    Взято с CSS известного сайта!

    Для чего кавычки? Если название шрифта состоит из одного слова - они не нужны.
    А теперь угадайте с какого сайта этот код?

    guest__, 26 Июня 2011

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

    +126

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    public static IEnumerable<TItem> GetNextItemFrom<TItem>(IEnumerable<TItem> Collection)
            {
                foreach (var Item in Collection)
                    yield return Item;
            }

    Говногость, 26 Июня 2011

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

    +148

    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
    95. 95
    96. 96
    97. 97
    98. 98
    99. 99
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import javax.swing.JFrame;
    public class Main extends JFrame{
        static int a=100;
        BufferedImage offscreen = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
    	static double p1[][]={{-a},{0},{a}};
    	static double p2[][]={{0},{-a},{a}};
    	static double p3[][]={{a},{-a},{a}};
    	static double p4[][]={{a},{a},{a}};
    	static double p5[][]={{-a},{a},{a}};	
    	static double p6[][]={{-a},{0},{-a}};
    	static double p7[][]={{0},{-a},{-a}};
    	static double p8[][]={{a},{-a},{-a}};
    	static double p9[][]={{a},{a},{-a}};
    	static double p10[][]={{-a},{a},{-a}};
    	static double mas[][][]=new double[10][][];
    	
    	public static void main(String[] args) {
    		Main mf=new Main();
    		mf.setVisible(true);
    		mf.setSize(800,800);
    		mf.setDefaultCloseOperation(EXIT_ON_CLOSE);
    		
    		Matrix P1=new Matrix(p1);
    		Matrix P2=new Matrix(p2);
    		Matrix P3=new Matrix(p3);
    		Matrix P4=new Matrix(p4);
    		Matrix P5=new Matrix(p5);
    		Matrix P6=new Matrix(p6);
    		Matrix P7=new Matrix(p7);
    		Matrix P8=new Matrix(p8);
    		Matrix P9=new Matrix(p9);
    		Matrix P10=new Matrix(p10);
    		
    		double a=0;
    		while(true){
    			Matrix ox=new OX(a);
    			Matrix oy=new OY(a);
    			Matrix oz=new OZ(a);
    			Matrix m=ox.multiplication(oy.multiplication(oz));
    			mas[0]=m.multiplication(P1).getData();
    			mas[1]=m.multiplication(P2).getData();	
    			mas[2]=m.multiplication(P3).getData();	
    			mas[3]=m.multiplication(P4).getData();
    			mas[4]=m.multiplication(P5).getData();
    			mas[5]=m.multiplication(P6).getData();	
    			mas[6]=m.multiplication(P7).getData();	
    			mas[7]=m.multiplication(P8).getData();
    			mas[8]=m.multiplication(P9).getData();	
    			mas[9]=m.multiplication(P10).getData();
    			a+=0.06;
    			//a=0;
    			mf.repaint();
    			try {
    				Thread.sleep(100);
    			} catch (InterruptedException e) {
    				// TODO Auto-generated catch block
    				e.printStackTrace();
    			}
    		}
    	}
       
    	public void paint(Graphics g){
    		super.paint(g);
    		this.display(mas);
    	}
    	
    	public void display(double m[][][]){
    		Graphics g= this.getGraphics();
    		g.setColor(Color.BLACK);
    		for(int i=0;i<m.length;i++){
    			m[i][0][0]+=300;
    			m[i][1][0]+=300;
    		}
    		g.drawLine((int)m[0][0][0],(int)m[0][1][0],(int)m[1][0][0],(int)m[1][1][0]);
    		g.drawLine((int)m[1][0][0],(int)m[1][1][0],(int)m[2][0][0],(int)m[2][1][0]);
    		g.drawLine((int)m[2][0][0],(int)m[2][1][0],(int)m[3][0][0],(int)m[3][1][0]);
    		g.drawLine((int)m[3][0][0],(int)m[3][1][0],(int)m[4][0][0],(int)m[4][1][0]);
    		g.drawLine((int)m[4][0][0],(int)m[4][1][0],(int)m[0][0][0],(int)m[0][1][0]);
    		g.drawLine((int)m[5][0][0],(int)m[5][1][0],(int)m[6][0][0],(int)m[6][1][0]);
    		g.drawLine((int)m[6][0][0],(int)m[6][1][0],(int)m[7][0][0],(int)m[7][1][0]);
    		g.drawLine((int)m[7][0][0],(int)m[7][1][0],(int)m[8][0][0],(int)m[8][1][0]);
    		g.drawLine((int)m[8][0][0],(int)m[8][1][0],(int)m[9][0][0],(int)m[9][1][0]);
    		g.drawLine((int)m[9][0][0],(int)m[9][1][0],(int)m[5][0][0],(int)m[5][1][0]);
    		g.drawLine((int)m[0][0][0],(int)m[0][1][0],(int)m[5][0][0],(int)m[5][1][0]);
    		g.drawLine((int)m[1][0][0],(int)m[1][1][0],(int)m[6][0][0],(int)m[6][1][0]);
    		g.drawLine((int)m[2][0][0],(int)m[2][1][0],(int)m[7][0][0],(int)m[7][1][0]);
    		g.drawLine((int)m[3][0][0],(int)m[3][1][0],(int)m[8][0][0],(int)m[8][1][0]);
    		g.drawLine((int)m[4][0][0],(int)m[4][1][0],(int)m[9][0][0],(int)m[9][1][0]);
    		Graphics g2 =  offscreen.getGraphics();
            g2.setColor(Color.WHITE);
            g2.fillRect(0, 0, getWidth(), getHeight());
            g2.setColor(Color.BLUE);
            g2.fillRect(0, 0, 100, 100);
            g.drawImage(offscreen, 0, 0, null);
    	}
    }

    Говнолаба по предмету "компьютерная графика".
    Задача: нарисовать куб с усеченным углом, повернутый на произвольный угол вокруг трех осей (OX, OY, OZ).
    Вот как эту задачу решает мой однокурсник.
    Вместо того, чтобы использовать одну матрицу поворота, он создает 10 матриц для каждой из 10 точек...
    Впрочем, код лучше расскажет...

    just_nameless, 26 Июня 2011

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

    +179

    1. 1
    2. 2
    public:
      void* getThis(void){return this;};;;;

    Говногость, 26 Июня 2011

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

    +137

    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
    rem ID generator
    :idgen
    set nsmb=36
    set idstr=
    for /l %%i in (1,1,8) do call :rsadd
    echo ID=%idstr%
    exit /b
    
    rem Random symbol adding [0-9a-z]
    :rsadd
    set r=%random%
    set /a c=r-r/nsmb*nsmb
    if %c% lss 10 set idstr=%idstr%%c%
    if %c% == 10 set idstr=%idstr%a
    if %c% == 11 set idstr=%idstr%b
    if %c% == 12 set idstr=%idstr%c
    if %c% == 13 set idstr=%idstr%d
    if %c% == 14 set idstr=%idstr%e
    if %c% == 15 set idstr=%idstr%f
    if %c% == 16 set idstr=%idstr%g
    if %c% == 17 set idstr=%idstr%h
    if %c% == 18 set idstr=%idstr%i
    if %c% == 19 set idstr=%idstr%j
    if %c% == 20 set idstr=%idstr%k
    if %c% == 21 set idstr=%idstr%l
    if %c% == 22 set idstr=%idstr%m
    if %c% == 23 set idstr=%idstr%n
    if %c% == 24 set idstr=%idstr%o
    if %c% == 25 set idstr=%idstr%p
    if %c% == 26 set idstr=%idstr%q
    if %c% == 27 set idstr=%idstr%r
    if %c% == 28 set idstr=%idstr%s
    if %c% == 29 set idstr=%idstr%t
    if %c% == 30 set idstr=%idstr%u
    if %c% == 31 set idstr=%idstr%v
    if %c% == 32 set idstr=%idstr%w
    if %c% == 33 set idstr=%idstr%x
    if %c% == 34 set idstr=%idstr%y
    if %c% == 35 set idstr=%idstr%z
    exit /b

    Windows shell

    Собственноручно написанное. Нашел, разбирая старые скрипты.

    vp2729, 25 Июня 2011

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