1. Objective C / Говнокод #10035

    −85

    1. 1
    [self.navigationItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithCustomView:[(TANavigationBar *)self.navigationController.navigationBar backButtonWith:[UIImage imageNamed:@"ActivityNavBackButtonBackground"] highlight:nil leftCapWidth:30.0f]] autorelease]];

    Однако, это печально :(
    И не индус вроде

    dove06, 25 Апреля 2012

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

    +132

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    // Asynchronously load the DXF.
    // While we're doing that, the data can change, so we should guard against it.
    new WebappResourceLoader().loadResource(ResourceType.DXF, sDxfName + ".dxf",
    	new ResourceCallback<List<String>>() {
    		@Override
    		public void onSuccess(final List<String> result) {
    			if (!sDxfName.equals(dxfToLoad)) {
    				// Too slow, dude.
    				return;
    			}

    someone, 25 Апреля 2012

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

    +97

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    If bd12tc->mes!=num_month
      st_mes=num_month
    Else
      st_mes=bd12tc->mes
    EndIf

    Clipper
    Перевожу на работе старую программку (писалась больше 12 лет назад) в Delphi, нашёл вот такое

    avstecenko, 25 Апреля 2012

    Комментарии (1)
  4. Pascal / Говнокод #10030

    +121

    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
    procedure TForm1.Timer2Timer(Sender: TObject);
    begin
    image75.Visible:=false;image76.Visible:=false;
    image1.Visible:=true;image2.Visible:=true;image3.Visible:=true;
    image4.Visible:=true;image5.Visible:=true;image6.Visible:=true;
    image7.Visible:=true;image8.Visible:=true;image9.Visible:=true;
    image10.Visible:=true;image11.Visible:=true;image12.Visible:=true;
    image13.Visible:=true;image14.Visible:=true;image15.Visible:=true;
    image16.Visible:=true;image17.Visible:=true;image18.Visible:=true;
    image19.Visible:=true;image20.Visible:=true;image21.Visible:=true;
    image22.Visible:=true;image23.Visible:=true;image24.Visible:=true;
    image25.Visible:=true;image26.Visible:=true;image27.Visible:=true;
    image28.Visible:=true;image29.Visible:=true;image30.Visible:=true;
    image31.Visible:=true;image32.Visible:=true;image33.Visible:=true;
    image34.Visible:=true;image35.Visible:=true;image36.Visible:=true;
    image37.Visible:=true;image38.Visible:=true;image39.Visible:=true;
    image40.Visible:=true;image41.Visible:=true;image42.Visible:=true;
    image43.Visible:=true;image44.Visible:=true;image45.Visible:=true;
    image46.Visible:=true;image47.Visible:=true;image48.Visible:=true;
    image49.Visible:=true;image50.Visible:=true;image51.Visible:=true;
    image52.Visible:=true;image53.Visible:=true;image54.Visible:=true;
    image55.Visible:=true;image56.Visible:=true;image57.Visible:=true;
    image58.Visible:=true;image59.Visible:=true;image60.Visible:=true;
    image61.Visible:=true;image62.Visible:=true;image63.Visible:=true;
    image64.Visible:=true;image65.Visible:=true;image66.Visible:=true;
    image67.Visible:=true;image68.Visible:=true;image69.Visible:=true;
    image70.Visible:=true;image71.Visible:=true;image72.Visible:=true;
    image73.Visible:=true;
    if image1.left<360 then begin timer2.Enabled:=false;button2.Visible:=true;
    image1.Visible:=false;image2.Visible:=false;image3.Visible:=false;
    image4.Visible:=false;image5.Visible:=false;image6.Visible:=false;
    image7.Visible:=false;image8.Visible:=false;image9.Visible:=false;
    image10.Visible:=false;image11.Visible:=false;image12.Visible:=false;
    image13.Visible:=false;image14.Visible:=false;image15.Visible:=false;
    image16.Visible:=false;image17.Visible:=false;image18.Visible:=false;
    image19.Visible:=false;image20.Visible:=false;image21.Visible:=false;
    image22.Visible:=false;image23.Visible:=false;image24.Visible:=false;
    image25.Visible:=false;image26.Visible:=false;image27.Visible:=false;
    image28.Visible:=false;image29.Visible:=false;image30.Visible:=false;
    image31.Visible:=false;image32.Visible:=false;image33.Visible:=false;
    image34.Visible:=false;image35.Visible:=false;image36.Visible:=false;
    image37.Visible:=false;image38.Visible:=false;image39.Visible:=false;
    image40.Visible:=false;image41.Visible:=false;image42.Visible:=false;
    image43.Visible:=false;image44.Visible:=false;image45.Visible:=false;
    image46.Visible:=false;image47.Visible:=false;image48.Visible:=false;
    image49.Visible:=false;image50.Visible:=false;image51.Visible:=false;
    image52.Visible:=false;image53.Visible:=false;image54.Visible:=false;
    image55.Visible:=false;image56.Visible:=false;image57.Visible:=false;
    image58.Visible:=false;image59.Visible:=false;image60.Visible:=false;
    image61.Visible:=false;image62.Visible:=false;image63.Visible:=false;
    image64.Visible:=false;image65.Visible:=false;image66.Visible:=false;
    image67.Visible:=false;image68.Visible:=false;image69.Visible:=false;
    image70.Visible:=false;image71.Visible:=false;image72.Visible:=false;
    image73.Visible:=false;end
    else begin image1.left:=image1.Left-3;image1.top:=image1.top-1;
    image2.left:=image2.Left+2;image2.top:=image2.top+2;
    image3.left:=image3.Left-1;image3.top:=image3.top-3;
    image4.left:=image4.Left-2;image4.top:=image4.top+4;
    ...

    Ещё 65 строк кода!
    Анимация взрыва на Delphi 7.

    artar94, 24 Апреля 2012

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

    +102

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    $compareCost = 0;
    $countGacha = 0;
    for($i=0; $i<10; ++$i): 
        $compareCost += $this->freeGacha->getCost();
        if( $this->player->getSocialPoint() > $compareCost )        continue;
        else break;
        $countGacha = $i+1;
    endfor;

    Korean style ;)

    nidkor, 24 Апреля 2012

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

    +96

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public void setWeather(WeatherData[] weather) {
    		weatherInfo.setWeather(weather[0]);
    		weatherInfo.setTomorrowWeather(weather[1]);
    		weatherInfo.setDayAfterTomorrowWeather(weather[2]);
    		weatherInfo.setDayAfterDayAfterTomorrowWeather(weather[3]);
    		weatherInfo.setDayAfterDayAfterDayAfterTomorrowWeather(weather[4]);
    		weatherInfo.setDayAfterDayAfterDayAfterDayAfterTomorrowWeather(weather[5]);
    	}

    Студенты такие студенты....

    b3er, 23 Апреля 2012

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

    +100

    1. 1
    2. 2
    3. 3
    if ($node->title == 'Главная страница' || $node->title == 'Home')
    {print '<img src="sites/all/themes/them/images/stock.png" />';
    }

    Говнокод по Drupal-овски.
    Найден в шаблоне page.tpl.php

    Dishvola, 23 Апреля 2012

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

    −89

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    MdlСимметричность.Командная(СтИстБи, ФлагСим, КвоРабЧис)
                If ФлагСим = True Then ' тут мы сохраним столб истинности линейной функции и количество рабочих чисел
                    ФлагСим1 = True 'покажем, что хоть одна функция симметрична
                    СохранимНужнуюФункцию(СчетСим, КвоРабЧисЖмин, КвоРабЧис, СтИстБи, СтИстБиИскомыйСим)
                End If

    Как, пример, как нельзя называть и обзывать переменные и имена функций. Взято отсюда: http://www.sql.ru/forum/actualthread.aspx?tid=934300

    Ciana, 23 Апреля 2012

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

    +96

    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
    // expressions to parse
    		$input_pars = array(
    			's:2'=>'(sort(\d+)/?)?', 				//1-2
    			'id:2'=>'((\d+)/?)?',  			 		//3-4
    			'utkonos_id-shop_id:2-2'=>'(u(\d+)(s(\d+))?/)?', 	//5-6 7-8
    			'iid:1'=>'([0-9a-zA-Z_]+)/?', 				//9
    			'page:2'=>'(pg(\d+)/)?', 				//10-11
    			'chpsize:2'=>'(chp(\d+)/)?', 				//12-13
    			'chlist:2'=>'(chlist_(grid|list)/)?', 				//14-15
    			'p_other:1'=>'(.*)',					//16
    		);
    		if(!$class)unset($input_pars['iid:1']);
    		$m = array();
    		$i=0;
    
    		if(isset($_REQUEST['p_'])&&preg_match('[^'.implode('',$input_pars).'$]',$_REQUEST['p_'],$m)) {
    			//vd($m);
    			foreach($input_pars as $key=>$line) {
    				list($par_name,$num) = explode(':', $key);
    				$par_name_arr = explode('-',$par_name);
    				$num_arr = explode('-',$num);
    				if(count($par_name_arr)>1) {
    					foreach($par_name_arr as $kluch => $par_name) {
    						$i += $num_arr[$kluch];
    						$_REQUEST[$par_name] = $m[$i];
    					}
    				}else{
    					$i += $num;
    					$_REQUEST[$par_name] = $m[$i];
    				}
    			}
    			$_REQUEST['id'] += 0;
    			if ($_REQUEST['s'] === '0') {
    				$_REQUEST['s'] = 0;
    			}
    			if ($_REQUEST['chpsize'] === '0') {
    				$_REQUEST['chpsize'] = 0;
    			}
    			vd($_REQUEST);
    		}else{
    			$_REQUEST['s'] = grv('s',-1);						/// Сортировка
    			$_REQUEST['id'] = grv('id',0);
    			$_REQUEST['shop_id'] = grv('shop_id',0);
    			$_REQUEST['page'] = grv('page',0);
    			$_REQUEST['chpsize'] = (int)grv('chpsize',-1);
    		}

    ggg, 23 Апреля 2012

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

    +103

    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
    digits n  = reverse $ map (`mod` 10) (takeWhile (/= 0) (iterate (`div` 10) n))
    
    fromDigits l = sum $ zipWith (*) (reverse l) (map (10^) [0..])
    
    isPalindromic x = digits x == (reverse $ digits x)
    
    
    f :: Integer -> [[Integer]] -> [Integer] -> Int -> [[Integer]]
    f x founded lookedup niter 
                      | niter > 50 = [notlychers, [x] ++ lychers ++ lookedup, zs]
                      | nextX `elem` notlychers = [[x] ++ notlychers ++ lookedup, lychers, zs]
                      | nextX `elem` lychers = [notlychers, [x] ++ lychers ++ lookedup, zs]
                      | isPalindromic nextX = [[x] ++ notlychers ++ lookedup, lychers, zs]
                      | otherwise = f nextX founded (x : lookedup) (niter+1)
       where nextX = x + fromDigits (reverse $ digits x)
             notlychers = founded !! 0
             lychers = founded !! 1
             zs = founded !! 2
    
    g :: [[Integer]] -> [[Integer]]
    g founded = f (x-1) [xs, ys, [x-1]] [] 0
     where x  = zs !! 0
           xs = founded !! 0
           ys = founded !! 1
           zs = founded !! 2
    
    gg n = g [[],[],[n+1]]
    
    isLycher n = null $ (gg n) !! 0

    http://projecteuler.net/problem=55
    http://projecteuler.net/thread=55


    >i even haven't understood why it works :(

    TheHamstertamer, 23 Апреля 2012

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