1. JavaScript / Говнокод #18374

    +144

    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
    var me = this;            
    if (me.profile.carveoutSettings) {
        me.profile.carveoutSettings.truncationMethod = fields.truncationMethod;
        me.profile.carveoutSettings.truncationMode = fields.truncationMode;
        me.profile.carveoutSettings.applyTruncation = fields.applyTruncation;
        me.profile.carveoutSettings.truncationValue = fields.truncationValue;
        me.profile.carveoutSettings.applyExclusion = fields.applyExclusion;
        me.profile.carveoutSettings.serviceTypes = me.getSelected(me.getServiceTypeSelector().getStore(), 'ServiceSubCategoryID');
        me.profile.carveoutSettings.placeOfServices = me.getSelected(me.getPlaceOfServiceSelector().getStore(), 'code');
        me.profile.carveoutSettings.chronicConditions = me.getSelected(me.getChronicConditionSelector().getStore(), 'column');
    } else {
        this.profile.carveoutSettings = {
            truncationMethod: fields.truncationMethod,
            truncationMode: fields.truncationMode,
            applyTruncation: fields.applyTruncation,
            truncationValue: fields.truncationValue,
            applyExclusion: fields.applyExclusion,
            serviceTypes: me.getSelected(me.getServiceTypeSelector().getStore(), 'ServiceSubCategoryID'),
            placeOfServices: me.getSelected(me.getPlaceOfServiceSelector().getStore(), 'code'),
            chronicConditions: me.getSelected(me.getChronicConditionSelector().getStore(), 'column')
        }
    }

    Суслика видишь? а он есть ...

    expert, 20 Июня 2015

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

    −54

    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
    * g o a t s e x * g o a t s e x * g o a t s e x *
    g                                               g  
    o /     \             \            /    \       o
    a|       |             \          |      |      a
    t|       `.             |         |       :     t
    s`        |             |        \|       |     s
    e \       | /       /  \\\   --__ \\       :    e
    x  \      \/   _--~~          ~--__| \     |    x  
    *   \      \_-~                    ~-_\    |    *
    g    \_     \        _.--------.______\|   |    g
    o      \     \______// _ ___ _ (_(__>  \   |    o
    a       \   .  C ___)  ______ (_(____>  |  /    a
    t       /\ |   C ____)/      \ (_____>  |_/     t
    s      / /\|   C_____)       |  (___>   /  \    s
    e     |   (   _C_____)\______/  // _/ /     \   e
    x     |    \  |__   \\_________// (__/       |  x
    *    | \    \____)   `----   --'             |  *
    g    |  \_          ___\       /_          _/ | g
    o   |              /    |     |  \            | o
    a   |             |    /       \  \           | a
    t   |          / /    |         |  \           |t
    s   |         / /      \__/\___/    |          |s
    e  |           /        |    |       |         |e
    x  |          |         |    |       |         |x
    * g o a t s e x * g o a t s e x * g o a t s e x *

    https://searchcode.com/?q=goatse
    https://code.openhub.net/search?s=goatse

    3_14dar, 20 Июня 2015

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

    +142

    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
    template<class T> 
    void KillGorynich()
    {
    	T counter = 1;
    
    	while (true)
    	{
    		T newCount = counter + counter;
    
    		if (newCount > counter)
    		{
    			std::cout << "Отрубил Илья Муромец змею горынчу " << counter << " голов, а на их месте " << newCount << " выросло\n";
    			counter = newCount;
    		}
    		else
    		{
    			std::cout << "Отрубил Илья Муромец змею горынчу " << counter << " голов, и умер змей горыныч\n";
    			char * bits = "";
    
    			switch (sizeof(T) * 8)
    			{
    			case 8:
    				printf("Потому что восьмибитный был\n");
    				break;
    			case 16:
    				printf("Потому что шестнадцатибитный был\n");
    				break;
    			case 32:
    				printf("Потому что тридцатидвухбитный был\n");
    				break;
    			case 64:
    				printf("Потому что шестидесятичетырехбитный был\n");
    				break;
    			}
    
    			break;
    		}
    	}
    }
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	setlocale(LC_ALL, "russian");	
     	//KillGorynich<unsigned short>();
     	KillGorynich<unsigned int>();
     	//KillGorynich<unsigned long long>(); 
     	//KillGorynich<long double>();
    	
    	while (!_kbhit());
    	return 0;
    }

    Шаблонизм головного мозга.

    CrazyRussian, 19 Июня 2015

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

    +141

    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
    private function StrToFloat($str){
    		$str = trim($str);
    		$i=0;$k=1;
    		for($j=0;$j<=strlen($str);$j++){
    			if($str[$j]>='0' && $str[$j]<='9') {
    				$i = $i + $str[$j]*$k;
    				if($k>1) $k=$k*10;
    				else $k = $k*0.1;
    		    } else { 
    				if($str[$j]=='.' && $str[$j]==',')  $k = 0.1;
    				else if($str[$j]<=' ') {}   
    			}
    		}
    		return $i;
    	}

    heyzea1, 19 Июня 2015

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

    +145

    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
    .panel-top ul.panel li:nth-child(1){
        order: 1;
      }
      .panel-top ul.panel li:nth-child(2){
        order: 4;
      }
      .panel-top ul.panel li:nth-child(3){
        order: 2;
      }
      .panel-top ul.panel li:nth-child(4){
        order: 5;
      }
      .panel-top ul.panel li:nth-child(5){
        order: 3;
      }
      .panel-top ul.panel li:nth-child(6){
        order: 6;
      }

    CSS Responsive

    stail, 19 Июня 2015

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

    +142

    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
    private DelegateCommand loginCommand;
    
        public string Username { get; set; }
        public string Password { get; set; }
    
    
        public ICommand LoginCommand
        {
            get
            {
                if (loginCommand == null)
                {
                    loginCommand = new DelegateCommand(
                        Login, CanLogin );
                }
                return loginCommand;
            }
        }
    
        private bool CanLogin()
        {
            return !string.IsNullOrEmpty(Username);
        }
    
        private void Login()
        {
            bool result = securityService.IsValidLogin(Username, Password);
    
            if (result) { }
            else { }
        }

    Паблик стринг, чтоб тебя

    Aero, 19 Июня 2015

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

    −105

    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
    Г = 0;
    Пока Г = 0 Цикл
    	ПОПЫТКА
    		Док.РазрешитьОтгрузку = Перечисление.Булево.Да;
    		Док.Записать();
    	ИСКЛЮЧЕНИЕ
    		Сообщить("" + Г + " : Документ " + Док.НомерДок + " заблокирован. Пробую еще раз ...");
    		Если Г > 20 Тогда
    			Сообщить("Неудачка...");
    			Прервать;
    		КонецЕсли;
    	КОНЕЦПОПЫТКИ;
    	Г = Г + 1;
    КонецЦикла;

    dsfix, 19 Июня 2015

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

    +67

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    public List<LDAPUserState> getAllLDAPUsersFromAD() {
    		try {
    			ldc.getAllLDAPUsers();
    		} catch (NamingException e) {
    			LOG.error(e.getMessage(), e);
    		}
    	return null;
    }

    InCh, 19 Июня 2015

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

    +142

    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
    private boolean get(CharArrayExt szNum, CountryAreaContainer container)  {
            char cCur = 0;
            if(!szNum.isEmpty()) {
                cCur = szNum.charAt(0);
            }
    
            Country lpSettingsCountry = isRemoveNPrefixAfterCC();
    
            if ((cCur != 0) && lpSettingsCountry != null) {
                int iLen = lpSettingsCountry.getNationalPrefix().length();
    
                if ((iLen > 0) && szNum.startsWith(lpSettingsCountry.getNationalPrefix())) {
                    szNum.cut(iLen);
                    cCur = szNum.charAt(0);
                    container.areaOffset = iLen;
                }
            }
    
            if ((cCur != 0) && isNodeExist(cCur)) {
                if(getNode(cCur).get(szNum.cut(1), container)) {
                    return true;
                }
            }
    
            int iCount = items.size();
    
            if (iCount == 1) { //Normally
                NodeItemBase lpItem = items.get(0);
                if (lpItem.isArea()) {
                    container.area = (Area) lpItem;
                }
                container.country = lpItem.getCountry();
                return true;
            } else {
                if (iCount > 1) {
                    for (int i = 0; i < iCount; i++) {
                        NodeItemBase lpItem = items.get(i);
    
                        if (lpItem.isCountry()) {
                            Country lpCountry = (Country) lpItem;
    
                            if (lpCountry.getAreas().size() == 0) {
                                container.country = lpCountry;
                                return true;
                            }
                        }
                    }
                }
            }
    
            return false;
     }

    Кто писал этот код - знайте, Я Вас НЕНАВИЖУ!!!

    zaebalsya, 18 Июня 2015

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

    +144

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    var s = 0;
    $('#slider .slider_item').each(function(){
    	s++;
    });
    if (s > 1) {
    // ...

    Пример с прода для определения числа элементов в карусели

    loudless, 18 Июня 2015

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