1. C++ / Говнокод #8537

    +161

    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
    // CFileFind ff;
    // ...
    bool IsNext = ff.FindNextFile();
    bool IsCurr = true;
    while (IsCurr)
    {
        if(!ff.IsDirectory() && !ff.IsDots()) 
        {	
    	pTplList->InsertString(-1, ff.GetFileName());
        }
        if(IsNext)
            IsNext = ff.FindNextFile();
        else
            IsCurr = false;
    };

    IsNext и IsCurr - лишние переменные, которые запутывают код

    hayhay, 16 Ноября 2011

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

    +161

    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
    #if DEBUG == 2
    	#define INFO(message) (util::debug::print(TYPE_INFO, (message), __func__, __LINE__))
    	#define WARNING(message) (util::debug::print(TYPE_WARNING, (message), __func__, __LINE__))
    	#define ERROR(message) (util::debug::print(TYPE_ERROR, (message), __func__, __LINE__))
    #elif DEBUG == 1
    	#define INFO(message) (util::debug::print(TYPE_INFO, (message), __func__))
    	#define WARNING(message) (util::debug::print(TYPE_WARNING, (message), __func__))
    	#define ERROR(message) (util::debug::print(TYPE_ERROR, (message), __func__))
    #elif DEBUG == 0
    	#define INFO(message) (util::debug::print(TYPE_INFO, (message)))
    	#define WARNING(message) (util::debug::print(TYPE_WARNING, (message)))
    	#define ERROR(message) (util::debug::print(TYPE_ERROR, (message)))
    #else
    	/* Default defines, uses if logging is disable */
    	#define INFO()
    	#define WARNING()
    	#define ERROR()
    #endif

    rootick, 16 Ноября 2011

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

    +152

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    vObject o;
        o["kind"]=="prop";
        o["type"]=="";
        o["desc"]=="";
        o["name"]==""; //not sure about this
        n->setData(0,TIDATA,o); //data is EMPTY? WTF?

    ... :D

    petersvp, 15 Ноября 2011

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

    +1000

    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
    int *element_iskomoi_posledovatelnosti;
     int tempNum = 1;
    element_iskomoi_posledovatelnosti = new int [maxim];
       
        int k=index_pervogo_elementa_posledovatelnosti;
        element_iskomoi_posledovatelnosti[0]=arr[k];
        printf(" element_iskomoi_posledovatelnosti[%i]=%i\n ",1, element_iskomoi_posledovatelnosti[0]);
     
        for (int j=index_pervogo_elementa_posledovatelnosti; j< n ; j++ )
        if (arr[k]<arr[j]) 
        {
           element_iskomoi_posledovatelnosti[tempNum]=arr[j];
           printf(" element_iskomoi_posledovatelnosti[%i]=%i\n ",tempNum+1, element_iskomoi_posledovatelnosti[tempNum++]);
           k=j;
         }
    }

    Crazy_penguin, 13 Ноября 2011

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

    +1003

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    /c/Qt/4.7.4/src/plugins/bearer/symbian/symbianengine.cpp:1336..1344
    
    // Waits for 2..6 seconds.
    void SymbianEngine::updateConfigurationsAfterRandomTime()
    {
        int iTimeToWait = qMax(1000, (qAbs(qrand()) % 68) * 100);
    #ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
        qDebug("QNCM waiting random time: %d ms", iTimeToWait);
    #endif
        QTimer::singleShot(iTimeToWait, this, SLOT(delayedConfigurationUpdate()));
    }

    68 будет в самый раз, да.

    overloop, 11 Ноября 2011

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

    +989

    1. 1
    char* mData=new char[MAX_STRING_LENGTH+1];

    Кто сможет перечислить все ошибки в этом говнокоде?

    Говногость, 11 Ноября 2011

    Комментарии (37)
  7. C++ / Говнокод #8477

    +1001

    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
    Matrix Matrix::inverse ()
    {
    	Matrix Temp;
    
    
    	Matrix A;
    
    	Matrix AL(4,4);
    
    	int c1,c2;
    
    
    
    	for (int i = 0; i < 5; i++)
    	for (int j = 0; j < 5; j++)
    	{
    		c1 = 0;
    
    		for (int k = 0; k < 5; k++)
    		{
    			if (k == i) continue;
    			c2 = 0;
    			for (int l = 0; l < 5; l++)
    			{
    				if (l == j) continue;
    				AL[c1][c2] = array[k][l];
    				c2++;
    			}
    			c1++;
    		}
    
    		A[i][j] = pow(-1,static_cast<double>(i + j + 2))*AL.determinant();
    	}
    	
    	for (int i = 0; i < 5; i++)
    	for (int j = 0; j < 5; j++)
    	{
    		Temp[i][j] = 1/determinant()*A[i][j];
    	}
    
    
    	return Temp;
    }

    цените, алгоритм обратной матрицы

    bartimeus33nt10, 11 Ноября 2011

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

    +168

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    QTime time;
    
    QString name =  (time.currentTime()).toString();
    
    for (int i = 2; i <= 5; i = i+3)
    {
    	name.remove(i,1);
    	name.insert(i,".");
    }

    вот так вот, ребятишки.

    bartimeus33nt10, 10 Ноября 2011

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

    +148

    1. 1
    http://dobrochan.ru/src/png/1009/тролфейс5.png

    i͞f̩̙͚̺̖͖͑͒̎͢ ̛̤̣͇͉̔ͅ(͟(͓̣rͪ̄͑̂̇͆ͣ͢e͙͓͍͒̀s̬̪̫̼̬̗̾̈͡ ͓̥̔ͪ=̺̭̄ͪ̂͟ ̞̥̳̤͉̂͊͗sͩͮ̏́̚eͦ̓ͯt̬̲̞̬̭̿̇̎̑́̚s̑ͬ͌͌ͨo̧̖͙ ͚̮͍̻͋ͧ̇c͓̝͈͙͉̞͒ͩ͋ͮ̚͞k̟̩͍̗̺͎̈̽͂̽̇ͦͦ͢ͅo͈̫͍ ̠̭̓ͣ̆ͩ̚p̴̻̰͇͇̀̃t̡́ͦ͊̎ͩ̊(̥̞̞̫̎̽̾̾ͫ.͈͎̤͉̲̙ ̠ͥ͒̐̃ͣ̑̀.̔.ͬͨͪ̽.̲̭̲͙̇)̧̫͙͇̜̜̩̘ͭ̈́̆̽̉ ̮̯̜͉̼̜̲ͬ͑̽̃ͭ̐=̳̥̗̰̘͚͝=̧̳̙ ̬̰̔ͨͨͧͯ-͘1̮̻̦̘͉̗͑)ͫ̒)͉̲̤̝ͣ̐ͩ̆͑

    AnimeGovno-_-, 08 Ноября 2011

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

    +147

    1. 1
    http://www.viva64.com/media/images/content/a/ReactOS_ru/image1.png

    Ḅ̩̝͓̆ͦͮ̅ͧ̏́ͅȌ̘̫ͯO̮̐̋ͪ̽̇ͯ̅L̸̜̯̩͗ ͔͕̦̗ͧͭ̕F̴̘͔̝̱̫̾ͫÄ̧̭̯͉̩̜̮͇́̍ͤS̮̦̰̺̗͈͆̄̄̓̚T̎̄͏̥̩͍̠̬͖ͅC̝̽̽̋ͅA̼̖̘̿ͧ̓͡L̝̝͚͚̬̓͌L̞͌
    ̿͊͆͏̫I̪̿ͮͦ͊ͮ̓̈͡n͖̱̾ͦ́͌tẸ͕̬̱̰̗̘̊͐̎ͨ̆̓ņͦ͐̽̄ͭ̆g̝͆G̬̝̲͙̼̞r̶͔̩̗̯̘̯͑ͤ͛͐̈a̫̥͇̠̗̪̔ͧ̾̾̎͜d̙̯̖͈̬ͤͤͭ͟i̢͇̥̰͔̙̺̿͛e̤̠͛̋ͭn̳͕̺͖ͨ̽̃ͬ͊̾t͖̰͓͎̼ͦ̓̑͂̚̚͜F̡̞̘̯̜i̪͕̪̲̝̬̫̋ͫ̔͌̒ͯ̿l̟͉̆l͔͔͙̗̖̄̒ͪ͑ͬ̍̍T̥͕̙̀r̮̜͓̽̉̎ͧ̈ͦͅȉ̢̹̲̝̤̫̳ͮ̆a̢̺̤͔̤ͬͮͪ̽̐̈̈n̫̄͝g̢͈̗̖ͦ̔̓ͯͫ͑̋l̡̟̬͚͍̐ͥ͐ͪ͗̽̏e͌ͫ̉͆ͪ̆͏(̳̺̪̯̎͑̓.̵̊̊ͪ͛̾ͩ̚.̔ͩ͝.̻̫̟̙ͣ̍͒͞)͍̻̠̯ͬ͛̄̕
    ̧̥̬̩̖̤ͯͪ̂̚{̲̻̪
    ͉ͬ͋͒̎͟ ̽͛ͤ̇͟ ͍̭̻̬̹̲̇̀̍ͫ̒͂͝.̲̬̳̦̀̄͐̔́̓.̬͓̭̊̏̅ͩ͊.͙͕̠̰͓̘
    ̸̤͉̬͓̲̠ͮ́ͯ̃͑ͥ ̲̥̝̞̝͓̂͐ ̑͋̾̿Ṣ̸͔̗̖̳̱͍̊̈͑̃W͔̳̰̫̿A͉̬͙͎͂̔̇ͫͨ̾́P͂ͯ(̂̓v̟̲̦̪̖̻̎͂́2͇̤̔,̧̺͎̞̞̈́̍v̘̟͕͚̘̞ͧ̒͊ͦ̚ͅ3̤̩̙̬̘̯̼,̣̰͕͑̂͌͆̉̍͢tͩ̏ͮ͋͌̆ͯ)̜̳̖̈́̎̏̏̎ͦ;̫̻̪̞̼̟̆͐̐ͨ̀̾̉
    ͛ ̹̮͓͎̑͆̌͂́ ̙̟̦̤.ͤ̎ͧ̀ͅ.̥̼̠̮͉̰̀.̧̥͙̻̲
    ̖̬̫̣̙̅̽̋̔ͤ̏̇}̵̬̞̻̜̮̟ͣ̄ͧͦ̊

    AnimeGovno-_-, 08 Ноября 2011

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