1. Pascal / Говнокод #11414

    +89

    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
    procedure TClickerAdvertising.Start(Item: TTaskItem);
      procedure StartTask(AURL: string);
      procedure SearchInYandex(Keywords, Domen: string);
        procedure SendSearchRequest;
        procedure CheckSearchRequest;
        procedure SearchLinkAndClick;
          function FindLinkInList: IHTMLElement;
        procedure CheckValidateTransition;
    
      procedure MoveAndGoBack(Domen: string; MoveCount, MoveDelay: Integer);
        function GetRandomElement: IHTMLElement;
    
      procedure FindAdvertLinkAndClick(AdvertType: TAdvertType; var AdvertLink: string);
        procedure ClickFromLinkToAdvert;
        procedure ClickFromGoogleAds;
    
      procedure SendReport(AURL: string);
        function GetIP: string;
        
    begin
    //...
    end;

    А як, Ви, ставитись до вкладених процедур?

    ADR, 14 Июля 2012

    Комментарии (36)
  2. C++ / Говнокод #11413

    +32

    1. 1
    2. 2
    3. 3
    4. 4
    typedef typename _STD tr1::conditional<
            _STD tr1::is_same<key_type, value_type>::value,
            const_iterator,
            _Tree_iterator<_Mybase> >::type iterator;

    Шаблоны на шаблонах и шаблонами погоняют.

    Fai, 14 Июля 2012

    Комментарии (45)
  3. Java / Говнокод #11412

    +74

    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
    if (scope.equals("page")) {
        beanObject = context.getAttribute(bean);
    } else {
        if (scope.equals("request")) {
            beanObject = context.getRequest().getAttribute(bean);
        } else {
            if (scope.equals("session")) {
                beanObject = context.getSession().getAttribute(bean);
            } else {
                if (scope.equals("context")) {
                    beanObject = context.getServletContext().getAttribute(bean);
                }
            }
        }
    }

    Eyeless, 14 Июля 2012

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

    +68

    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
    public function makeCategoryArray() {
            $a = array();
            for($i = 1; $i <=3 ; $i++) {
                $j = $i != 1 ? $i : '';
                $Method = "getCategoryid" . $j;
                $categoryid = $this->$Method();
                if($this->$Method()) {
                    try{
                        $category = BC::Get()->getCompanyService()->getCategoryByID($categoryid);
                        $a[] = array(
                            'name' => $category->getName(),
                            'url' => $category->makeURL()
                        );
                    } catch(Exception $e) {
                        return $a;
                    }
                }
            }
            return $a;
        }

    Эпичный вызов getCategoryid1(), getCategoryid2(), getCategoryid3() когда есть getField(fieldname)...

    max_wp, 13 Июля 2012

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

    +127

    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
    $ cat macro.c
    # define M3(x, y, z) x + y + z
    # define M2(x, y) M3(x, y)
    # define P(x, y) {x, y}
    # define M(x, y) M2(x, P(x, y))
    M(a, b)
    
    $ gcc-4.5  -E  macro.c
    # 1 "macro.c"
    # 1 "<built-in>"
    # 1 "<command-line>"
    # 1 "macro.c"
    
    a + {a + b}
    $

    Какой выхлоп по разным версиям cl?
    Отсюда: http://stackoverflow.com/questions/11469462/difference-between-gcc-and-microsoft-preprocessor

    sayidandrtfm, 13 Июля 2012

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

    −101

    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
    -(void)showRetrySuccess:(NSString*)requestUrlString
    {
    	NSString *statusMessage = @"";
    	
    	if([requestUrlString rangeOfString:kFollowFriendsRequest].location != NSNotFound)
    	{
    		statusMessage =@"Your follow friend request completed successfully.";
    	}
    	else
    		if([requestUrlString rangeOfString:kUnfollowFriendsRequest].location != NSNotFound)
    		{
    			statusMessage =@"Your unfollow friend request completed successfully.";
    		}else
    			if([requestUrlString rangeOfString:kDeleteContentService].location != NSNotFound)
    			{
    				statusMessage =@"Your delete request completed successfully.";
    			}else
    				if([requestUrlString rangeOfString:kSavePostService].location != NSNotFound)
    				{
    					statusMessage =@"Your save post request completed successfully";
    				}else
    					if([requestUrlString rangeOfString:kSaveMediaService].location != NSNotFound)
    					{
    						statusMessage =@"Your save request  completed successfully";
    					}else
    						if([requestUrlString rangeOfString:kSaveTwitterDirectMessage].location != NSNotFound)
    						{
    							statusMessage =@"Your request completed successfully.";
    						}else
    							if([requestUrlString rangeOfString:kSaveTwitterResponse].location != NSNotFound)
    							{
    								statusMessage =@"Your request completed successfully.";
    							}
    							else
    								if([requestUrlString rangeOfString:kAddCommentService].location != NSNotFound)
    								{
    									statusMessage =@"Your post comment request completed successfully.";
    								}
    	UIAlertView * alert = [[[UIAlertView alloc] initWithTitle:@"" message:statusMessage delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]autorelease];
    	[alert show];
    	
    	
    }

    GLvRzZZ, 13 Июля 2012

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

    −63

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    <?php
    
    global $KONKURS_ADMIN;
    $KONKURS_ADMIN=array('[email protected]',
                         '[email protected]',
                         '[email protected]');

    распределение привелегий в системе епта.

    brainstorm, 12 Июля 2012

    Комментарии (4)
  8. C# / Говнокод #11406

    +134

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    for (int i = 0; i < e.Row.Cells.Count; i++)
                        {
                            ....................................................
                            if ((i == 1) || (i == 4) || (i == 5) || (i == 6) || (i == 7) || (i == 8) || (i == 9) || (i == 10) || (i == 11) || (i == 12))//11 12
    .............................................

    Indian style..
    no comments

    Nataly, 12 Июля 2012

    Комментарии (8)
  9. SQL / Говнокод #11405

    −116

    1. 1
    2. 2
    DECLARE @SysDatoFull datetime
    SET @SysDatoFull = CAST(YEAR(getdate()) as varchar) + RIGHT('00'+CAST(MONTH(getdate()) as varchar), 2) + RIGHT('00'+CAST(DAY(getdate()) as varchar), 2)

    SQL, даты... nuff said
    Вспомнился http://govnokod.ru/9211. Может есть где-то специальное учебное заведение, где обучают таким техникам?

    DBdev, 12 Июля 2012

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

    +70

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    if (s.startsWith("job."))
    {
        s = s.trim().replaceFirst("job\\.", "");
        String name = s.split("\\.")[0];
        String paramName = s.split("\\.")[1];
        // Ещё немного говнокода, не сильно интересного
    }

    konsoletyper, 12 Июля 2012

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