1. Лучший говнокод

    В номинации:
    За время:
  2. PHP / Говнокод #681

    +136.9

    1. 1
    2. 2
    $Fp = join("", file("Logs.txt"));
    $Fp1 = explode("\r\n\r\n", $Fp);

    Норм сиги

    guest, 07 Марта 2009

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

    +140.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
    //cache control side box detect
    	if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories1.php') ) {
    		echo tep_cache_categories_box();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories.php') ) {
    		echo tep_cache_categories_box();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories2.php') ) {
    		echo tep_cache_categories_box1();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories3.php') ) {
    		echo tep_cache_categories_box3();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories4.php') ) {
    		echo tep_cache_categories_box4();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'categories5.php') ) {
    		echo tep_cache_categories_box5();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'coolmenu.php') ) {
    		echo tep_cache_coolmenu();
    	} else if ((USE_CACHE == 'true') && empty($SID) && ($column['cfgtitle'] == 'manufacturers.php') ) {
    		echo tep_cache_manufacturers_box();
    	} else {
    		require(DIR_FS_TEMPLATE_BOXES . '/' . $column['cfgtitle']);
    	}

    Хотите интернет-магазин? Не спрашивайте про крелоад.

    guest, 06 Марта 2009

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

    +133.8

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    iplist += "<ul id='iplist'>";
    jsonData="[";
    for(var i=0;i<selections.length;i++) {
        jsonData += Ext.util.JSON.encode(selections[i])+",";
        iplist += "<li>" + selections[i] + "; </li>";
    }
    jsonData = jsonData.substring(0,jsonData.length-1) + "]";
    iplist += "</ul>";
    win.show();
    Ext.get("list").update(iplist);
    win.hide();
    win.show();

    В ExtJS не хотел обновляться компонент окна.

    guest, 05 Марта 2009

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

    −854

    1. 1
    select * from Etbagent where id=555

    слово хуй

    guest, 04 Марта 2009

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

    +167.3

    1. 1
    2. 2
    3. 3
    GLOBAL $_SERVER; 
    GLOBAL $_COOKIE;
    .......

    Вот переделывал код одного товариша, и так и не смог понять зачем вот эти строчки он добавлял в КАЖДЫЙ файл

    guest, 04 Марта 2009

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

    +154

    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
    package com.photoholding.processimage.eugene;
    
    import java.awt.Point;
    import java.awt.Rectangle;
    
    import magick.ImageInfo;
    import magick.MagickException;
    import magick.MagickImage;
    
    public class ProcessA {
    	private MagickImage img;
    	private String text;
    	private String imageOrigin;
    	private String fout;
    	private String fmount;
    	private final String tmpImg = "tmpIM.jpg";
    	private final String tmpMnt = "tmpMounted.jpg";
        private final int width = 1607;
        private final int height = 1205;
    	
    	public ProcessA( String txt, String fin, String fout, String fmount ){
    		if( txt.length() > 52 ){
    			System.out.println( "error: text string more than 52" );
    			System.exit(0);
    		}			
    		this.text = txt;
    		this.img = getImage( fin );
    		this.imageOrigin = fin;
    		this.fmount = fmount;
    		this.fout = fout;
    	}
    
    	private MagickImage getImage( String fin2 ) {
    		MagickImage im = null;
    		try {	
    		     im = new MagickImage( new ImageInfo( fin2 ) );
    		} catch ( MagickException  e ) {
    			e.printStackTrace();
    			return null;
    		}
    		return im;
    	}
    	
    	public boolean doProcess(){
    		try {
    			scaleGenerally();
    			annotateMounted();
    			montage();
    		} catch ( Exception e ) {
    			e.printStackTrace();
    			return false;
    		}		
    		return true;
    	}
    	
        private void montage() throws Exception {
        	MagickProcessing mp = new MagickProcessing();
        	mp.montage( tmpMnt, tmpImg, fout );		
    	}
    
    	private void annotateMounted() throws Exception {
        	MagickProcessing mp = new MagickProcessing();
        	mp.annotateImage(  text, new Point( 115, 1195 - ( 598 - ( ( text.length() /  2 ) * 23  ) ) ), fmount, tmpMnt );	
    	}
    
    	protected boolean scaleGenerally() throws Exception {
    
        	int h = img.getDimension().height;
    		int w = img.getDimension().width;
    		MagickProcessing mp = new MagickProcessing();
    		if( h > w ){
    			if ( !mp.rotateANDscale( "1607x", imageOrigin, tmpImg )) return false;
    			img = getImage( tmpImg );
    			h = img.getDimension().height;
    			w = img.getDimension().width;
    			if( h < height ){
    				if( !mp.rotateANDscale( "x1205", imageOrigin, tmpImg )) return false;
    				img = getImage( tmpImg );
    				h = img.getDimension().height;
    				w = img.getDimension().width;
    			}
    			if( !mp.crop( new Rectangle( ( w - width ) / 2, 0, 1607, 1205 ), tmpImg, tmpImg )) return false;
    		} else {
    			if( !mp.scaleImage( "1607x", imageOrigin, tmpImg ) ) return false;
    			img = getImage( tmpImg );
    			h = img.getDimension().height;
    			w = img.getDimension().width;
    			if( h < height ){
    				if( !mp.scaleImage( "x1205", imageOrigin, tmpImg ) ) return false;
    				if( !mp.crop( new Rectangle( ( w - width ) / 2, 0, 1607, 1205 ), tmpImg, tmpImg ) ) return false;
    			} else if( h > height ){
    				if( !mp.crop( new Rectangle( 0, (int)( h - height ) / 2, width, height  ), tmpImg, tmpImg )) return false;
    			}
    		}
    		return true;
    	}
    }

    постановка задачи - нужен метод для вращения изображений

    guest, 04 Марта 2009

    Комментарии (2)
  8. VisualBasic / Говнокод #650

    −272.6

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    set DISK=none
    set BOOTFLAG=boot666s.tmp
    
    echo This file is used to determine current drive letter. It should be deleted. >\%BOOTFLAG%
    if not exist \%BOOTFLAG% goto readOnly
    
    echo Wait please, searching for current drive letter.
    for %%d in ( C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do if exist %%d:\%BOOTFLAG% set DISK=%%d

    Это из батника bootinst.bat LiveCD Slax6. Он должен сделать флешку бутабельной. При всем уважении... И да, добавьте CMD в список языков.

    guest, 03 Марта 2009

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

    +152

    1. 1
    if (count($auction)<1) return false; // backup

    ппц

    guest, 03 Марта 2009

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

    +140

    1. 1
    2. 2
    3. 3
    4. 4
    <?php
    define ("CONST", "govno");
    while (CONST=="GOVNO") { echo '<a href="http://govnokod.ru">Govnokod</a><br>'; flush(); }
    ?>

    гыгыгыгыгыгы

    guest, 02 Марта 2009

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

    +144.1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    ... and p.products_group_access like '%,". $customer_group_id.",%' 
    OR
      p.products_group_access like '%,". $customer_group_id."' 
    OR
      p.products_group_access like '". $customer_group_id.",%' 
    OR
      p.products_group_access = '". $customer_group_id."')";

    REGEXP уже не рулят

    guest, 26 Февраля 2009

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