1. Куча / Говнокод #7473

    +102

    1. 1
    org.quartz.jobStore.dontSetAutoCommitFalse=true

    config boolshit

    3.14159265, 06 Августа 2011

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

    +120

    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
    VAR
    m0:array[0..61,0..41]of byte;
    ma:array[1..60,1..40]of byte;
    I,J:byte;
    BEGIN
    randomize;
    for I:=0to 61do
    for J:=0to 41do
    if (I=0) or
       (I=61)or
       (J=0) or
       (J=61)
               then m0[I,J]:=0
               else m0[I,J]:=random(2);
    for I:=1to 60do
    for J:=1to 40do
    if m0[I,J]=1then ma[I,J]:=9
                else ma[I,J]:=m0[ I-1 , J-1  ] +
                                    m0[ I-1 , J     ] +
                                    m0[ I+1 , J+1 ]+
                                    m0[ I   , J+1  ]+
                                    m0[ I   , J-1   ]+
                                    m0[ I-1 , J+1 ]+
                                    m0[ I+1 , J-1 ]+
                                    m0[ I+1 , J    ];
    ... ... ... ... ... ... ... ... ... ... 
    ... ... ... ... ... ... ... ... ... ... 
    END.

    Начало игры САПЁР. Край массива заполняем нулями,
    середину - 0 или 1. В меньшем массиве складываем соседние
    клетки (выходит от 0 до 8), если мина - 9.

    dos, 06 Августа 2011

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

    +158

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    $max = 150;
    
    $dlja_poiska = explode(' ', $_GET['name']);
    $num = count($dlja_poiska);
    
    if ( $num > $max ) $num = $max;
    $qPart = '';
    
    foreach( $dlja_poiska as $param )
       $qPart .= ' AND (system_menu_paragraph.name RLIKE \''.addslashes().'\') ';
    
    // далее запрос к база без mysql_real_escape_string()

    http://forum.codeby.net/topic42345.html -- чел с завышенной самооценкой...
    Код писал я исходя из найденой дырки на сайте
    Вот url на скрипт из которого вы можете догадаться что код его действительно примерно такой...
    http://alexanderc.org/uploads/scripts/expl.php

    AlexanderC, 06 Августа 2011

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

    +159

    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
    #настройка	
    $file = file_get_contents('data/other/addsite.xml');
    $count = 80;	
    
    function getDatabase($name,$file){
    $DATABASE = file_get_contents('database/'.$file.'.dat');
    $DATABASE = explode('|',substr($DATABASE,0,-1));
    foreach($DATABASE as $datavalue){
    $datavalue = explode('==',$datavalue);
    $names = $datavalue[0];
    $value = $datavalue[1];
    $arr["$names"] = $value;
    }
    
    return $arr["$name"];
    }
    
    #обработка
    preg_match_all("/<name>(.+?)<\/name>/",$file,$matches);
    preg_match_all("/comment id\=\"(.+?)\"/",$file,$matchesid);
    
    if(!isset($matches[1]))die('ничего не найдено =(');
    if(!isset($matchesid[1]))die('ничего не найдено =(');
    
    $matchesid = array_reverse($matchesid[1]);
    $matches = array_reverse($matches[1]);
    $urls=array();
    
    foreach($matches as $url){
    	if(!$count)break;
    	$count--;
    
    if(!strpos(' '.$url,'http://')){
    $url = 'http://'.$url;
    }
    
            $parts = parse_url($url);
            if(substr($parts['host'],0,4)=='www.'){
            $purl = substr($parts['host'],4);
            } else {
            $purl = $parts['host'];
            }
    	if(isset($purl)){$urls[] = $purl;}
    	}
    
    $text = '';
    $count2=0;
    
    $ids=array();
    
    $countf=80;
    foreach($matchesid as $id){
    	if(!$countf)break;
    	$countf--;
    	$ids[] = $id;
    }
    
    foreach($urls as $href){
        $count2++;
    
    $idd = $ids["$count2"-1];
    $statuss = getDatabase('uweb'.$idd,'checker');
    
    $statusx = "<img src=\"/data/files/".$statuss.".png\" align=\"absmiddle\" />";
    
    
    	$text.="<span id=\"check$idd\">$statusx</span> <a href='http://$href/' target='_blank' rel='nofollow'>http://$href/</a>".($count2%20==0?'</td><td valign="top" width="25%" align="left">':'<br/>');
    	}
    # вывод
    echo "<table width='100%'><tr><td valign='top' width='25%' align='left'>".$text."</td></tr></table>";

    Студия "раскрутки" сайтов uweb.su

    substr, 06 Августа 2011

    Комментарии (5)
  5. Objective C / Говнокод #7469

    −115

    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
    - (UIImage*)thumbnailImage:(NSString*)fileName:(BOOL)includeInCache
    {
    	NSString *extension=@"png";
    	
    	if(hasRetinaDisplay)
    	{
    		NSString *newFileName=[fileName stringByAppendingString:@"@2x"];
    		newFileName=[newFileName stringByAppendingFormat:@".%@", extension];
    		
    		BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], newFileName]];
    		
    		if(fileExists)
    			fileName=[fileName stringByAppendingString:@"@2x"];
    	}
    	
    	fileName=[fileName stringByAppendingFormat:@".%@", extension]; 
    	
    	UIImage *thumbnail = nil;
    	
    	if(includeInCache)
    		thumbnail=[thumbnailCache objectForKey:fileName];
    	
    	if (thumbnail == nil)
    	{
    		NSString *thumbnailFile = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], fileName];
    		
    		BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:thumbnailFile];
    		
    		if(fileExists)
    		{
    			thumbnail = [UIImage imageWithContentsOfFile:thumbnailFile];
    			
    			if(includeInCache)
    				[thumbnailCache setObject:thumbnail forKey:fileName];
    		}
    	}
    						  
    	return thumbnail;
    }

    велосипедище

    diduz, 06 Августа 2011

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

    −99

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    T, b= 0, []
    While t!=10:
      If t!=6:
        Print ''Чётные числа''
        A = int(raw_input('>> '))
        B.append(a)
      If t!=500:
        Print 'не чётные'
        А = int(raw_input('>> '))
        B.append(a)
    
    #якобы условия для того чтоб ввод был как бы зеброй, четные, не чётные#

    KATAJIU3ATOP, 06 Августа 2011

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

    +147

    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
    public class Person {
    	
    	private final int id;
    	private final String name;
    	private final int age;
    	
    	public Person(int i, String s, int a)
    	{
    		id = i;
    		name = s;
    		age = a;
    	}
    	
    	public int getId()
    	{
    		return id;
    	}
    	
    	public String getName()
    	{
    		return name;
    	}
    	
    	public int getAge()
    	{
    		return age;
    	}
    }

    Примерно такой код был найден мною совсем недавно, сразу же скажу это не точный код, это то, как выглядел тот класс.

    redenemy, 05 Августа 2011

    Комментарии (16)
  8. Perl / Говнокод #7465

    −179

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    #count pages
    	my $counter; my $pagescount = 0; my $pagesstr;
    	for (my $i = 0; $i <= $count; $i++)
    	{
    		if ($counter == POSTS_PER_PAGE)
    		{
    		    my $a,$b; if ($pagescount == $pagenum) { $a = "["; $b = "]"; } else { $a = ""; $b = ""; }
    			$pagesstr = $pagesstr."$a<a href=\"wakaba.pl?task=mpanel&admin=$admin&page=$pagescount\">".($pagescount +1)."</a>$b" if ($pagescount == 0);
    			$pagesstr = $pagesstr.", $a<a href=\"wakaba.pl?task=mpanel&admin=$admin&page=$pagescount\">".($pagescount +1)."</a>$b" if ($pagescount != 0);
    			$pagescount++; $counter = 0;
    		} else { $counter++; }
    	}

    Вот такой веселый код пишут программисты дватиреча и на этом этот самый имиджборд и работает.

    7ion, 05 Августа 2011

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

    +128

    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
    $w=isset($_POST['w'])?(int)$_POST['w']:time();
        $p=$w-(24*3600)*7;
        $n=$w+(24*3600)*7;
    	mysql_query("set @start=date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d'),
    		@end=date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')");
        
    	$ste=mysql_fetch_assoc(mysql_query('select @start as s,@end as e'));
    	 if($_SESSION['userinfo']['login']=='Stormsfb') echo "date_format(date_sub(from_unixtime($w), interval weekday(from_unixtime($w)) day), '%m%d') <br>date_format(date_add(from_unixtime($w), interval 6-weekday(from_unixtime($w)) day), '%m%d')<br>".
    							"select *,unix_timestamp(d) as u,
    							date_format(d,'%e %b') as dm,
    							date_format(d,'%m%d') as md,
    							date_format(d,'%d.%m.%y') as mdf from users where 
                        date_format(d, '%m%d') between 
                        ".($_POST['month']!='false'?
    					date('m',$w).'01 and '.date('mt',$w):
    					($ste['s']>$ste['e']?' @start and 1231
    					or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'weekday(d)':'date_format(d,"%m%d")');
    	$q=mysql_query("select *,unix_timestamp(d) as u,
    							date_format(d,'%e %b') as dm,
    							date_format(d,'%m%d') as md,
    							date_format(d,'%d.%m') as mdf from users where 
                        date_format(d, '%m%d') between 
                        ".($_POST['month']!='false'?
    					date('m',$w).'01 and '.date('mt',$w):
    					($ste['s']>$ste['e']?' @start and 1231
    					or date_format(d, "%m%d") between '.date('m',$n).'01 and @end ':' @start and @end '))." order by ".($_POST['month']=='false'?'md':'date_format(d,"%m%d")'),_LINK_) or die(mysql_error(_LINK_)); // || $ste['s']>$ste['e']
    					/*
    					это пиздец
    					"select *,unix_timestamp(d) as u,
    							date_format(d,'%e %b') as dm,
    							date_format(d,'%m%d') as md,
    							date_format(d,'%d.%m') as mdf from users where 
                        date_format(d, '%m%d') between 
                        ".($_POST['month']!='false'?
    					date('m',$w).'01 and '.date('mt',$w):
    					($ste['s']>$ste['e']?' @start and 1231
    					union select *,unix_timestamp(d) as u,
    							date_format(d,"%e %b") as dm,
    							date_format(d,"%m%d") as md,
    							date_format(d,"%d.%m") as mdf from users where 
                        date_format(d, "%m%d") 
    					between '.date('m',$n).'01 and @end ':' @start and @end '))." order by date_format(d, '%m%d')"
    					*/

    после нас хоть трава не расти!

    GoodTalkBot, 05 Августа 2011

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

    +167

    1. 1
    $('.menu-left li:last').parent().parent().attr('class', $('#menu-menu_building li:last').parent().parent().attr('class')+' last');

    К классу последнего li главного ul в выпадающем списке добавляется 'last'.

    EugeneC, 05 Августа 2011

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