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

    +5

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    <ul style="display:none" class="displaynone2">
            <li>
                    <a href="/catalog?q=Колесо&how=r">Колесо</a>
            </li>
    </ul>

    Наверняка где-то в черторгах ждёт элемент с классом "displaynone:nachalo"

    tutov2013, 29 Сентября 2015

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

    +3

    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
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    76. 76
    77. 77
    #ifndef DEFINES
    #define DEFINES
    
    #define _W_CALL(a,b) a b
    
    #define _W_NARGS_OVERRIDE(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, N, ...) N
    #define _W_NARGS(...) _W_NARGS_OVERRIDE("ignored", ##__VA_ARGS__, 10, 9, 8, 7, 6 ,5, 4, 3, 2, 1, 0)
    
    
    #define _W_GETPARAM1(_1,...) _1
    #define _W_GETPARAM2(_1,_2,...) _2
    #define _W_GETPARAM3(_1,_2,_3,...) _3
    
    
    #define _W_ARG_OVERRIDE(_1, _2, _3, NAME, ...) NAME
    #define _W_ARG2(a,b) (a,b)
    #define _W_ARG3(a,b,c) (a,b,c)
    #define W_ARG(...) _W_ARG_OVERRIDE(__VA_ARGS__, _W_ARG3, _W_ARG2)(__VA_ARGS__)
    
    
    #define _W_ARGNAME2(a,b) b
    #define _W_ARGNAME3(a,b,c) b
    #define _W_ARGNAME_(...) _W_ARG_OVERRIDE(__VA_ARGS__, _W_ARGNAME3, _W_ARGNAME2)(__VA_ARGS__)
    #define _W_ARGNAME(a) _W_ARGNAME_ a
    
    #define _W_ARGPREP2(a,b) a b
    #define _W_ARGPREP3(a,b,c) a bc
    #define _W_ARGPREP_(...) _W_ARG_OVERRIDE(__VA_ARGS__, _W_ARGPREP3, _W_ARGPREP2)(__VA_ARGS__)
    #define _W_ARGPREP(a) _W_ARGPREP_ a
    
    #define _W_FUNCTPARAM1(a) _W_ARGPREP(a)
    #define _W_FUNCTPARAM2(a,b) _W_ARGPREP(a), _W_ARGPREP(b)
    #define _W_FUNCTPARAM3(a,b,c) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c)
    #define _W_FUNCTPARAM4(a,b,c,d) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d)
    #define _W_FUNCTPARAM5(a,b,c,d,e) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d) , _W_ARGPREP(e)
    #define _W_FUNCTPARAM6(a,b,c,d,e,f) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d) , _W_ARGPREP(e) , _W_ARGPREP(f)
    #define _W_FUNCTPARAM7(a,b,c,d,e,f,g) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d) , _W_ARGPREP(e) , _W_ARGPREP(f), _W_ARGPREP(g)
    #define _W_FUNCTPARAM8(a,b,c,d,e,f,g,h) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d) , _W_ARGPREP(e) , _W_ARGPREP(f), _W_ARGPREP(g), _W_ARGPREP(h)
    #define _W_FUNCTPARAM9(a,b,c,d,e,f,g,h,i) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d) , _W_ARGPREP(e) , _W_ARGPREP(f), _W_ARGPREP(g), _W_ARGPREP(h), _W_ARGPREP(i)
    #define _W_FUNCTPARAM10(a,b,c,d,e,f,g,h,i,j) _W_ARGPREP(a) , _W_ARGPREP(b) , _W_ARGPREP(c) , _W_ARGPREP(d) , _W_ARGPREP(e) , _W_ARGPREP(f), _W_ARGPREP(g), _W_ARGPREP(h), _W_ARGPREP(i), _W_ARGPREP(j)
    
    #define _W_FUNCTPARAMS_OVERRIDE(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
    #define _W_FUNCTPARAMS(...) _W_FUNCTPARAMS_OVERRIDE(__VA_ARGS__,_W_FUNCTPARAM10,_W_FUNCTPARAM9,_W_FUNCTPARAM8,_W_FUNCTPARAM7,_W_FUNCTPARAM6,_W_FUNCTPARAM5,_W_FUNCTPARAM4,_W_FUNCTPARAM3,_W_FUNCTPARAM2,_W_FUNCTPARAM1)(__VA_ARGS__)
    
    
    #define _W_FUNCTNAME1(a) _W_ARGNAME(a)
    #define _W_FUNCTNAME2(a,b) _W_ARGNAME(a), _W_ARGNAME(b)
    #define _W_FUNCTNAME3(a,b,c) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c)
    #define _W_FUNCTNAME4(a,b,c,d) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d)
    #define _W_FUNCTNAME5(a,b,c,d,e) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d) , _W_ARGNAME(e)
    #define _W_FUNCTNAME6(a,b,c,d,e,f) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d) , _W_ARGNAME(e) , _W_ARGNAME(f)
    #define _W_FUNCTNAME7(a,b,c,d,e,f,g) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d) , _W_ARGNAME(e) , _W_ARGNAME(f), _W_ARGNAME(g)
    #define _W_FUNCTNAME8(a,b,c,d,e,f,g,h) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d) , _W_ARGNAME(e) , _W_ARGNAME(f), _W_ARGNAME(g), _W_ARGNAME(h)
    #define _W_FUNCTNAME9(a,b,c,d,e,f,g,h,i) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d) , _W_ARGNAME(e) , _W_ARGNAME(f), _W_ARGNAME(g), _W_ARGNAME(h), _W_ARGNAME(i)
    #define _W_FUNCTNAME10(a,b,c,d,e,f,g,h,i,j) _W_ARGNAME(a) , _W_ARGNAME(b) , _W_ARGNAME(c) , _W_ARGNAME(d) , _W_ARGNAME(e) , _W_ARGNAME(f), _W_ARGNAME(g), _W_ARGNAME(h), _W_ARGNAME(i), _W_ARGNAME(j)
    
    
    #define _W_FUNCTNAMES_OVERRIDE(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
    #define _W_FUNCTNAMES(...) _W_FUNCTNAMES_OVERRIDE(__VA_ARGS__,_W_FUNCTNAME10,_W_FUNCTNAME9,_W_FUNCTNAME8,_W_FUNCTNAME7,_W_FUNCTNAME6,_W_FUNCTNAME5,_W_FUNCTNAME4,_W_FUNCTNAME3,_W_FUNCTNAME2,_W_FUNCTNAME1)(__VA_ARGS__)
    
    
    #define W_FUNCT(className, retType, functName, ...) \
        private: \
            retType _##functName(  _W_FUNCTPARAMS(__VA_ARGS__) ); \
            retType (className::*__##functName)( _W_FUNCTPARAMS(__VA_ARGS__)  ); \
        public: \
            retType functName( _W_FUNCTPARAMS(__VA_ARGS__) ) { return (this->*__##functName)( _W_FUNCTNAMES(__VA_ARGS__) );  }
    
    
    #define W_FUNCT_REL(className, functName, classPointer) classPointer->__##functName = & className::_##functName;
    
    
    #define _W_STRING(X) #X
    
    
    
    #endif // DEFINES

    Немножко надэфайнил.

    PavelK, 29 Сентября 2015

    Комментарии (3)
  3. JavaScript / Говнокод #18776

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    function windowSize(){
        if (jQuery(window).width() <= '995'){
            var pdiv = jQuery('#fw_c > div:nth-child(5) > div > div > div.vc_row.wpb_row.vc_inner.vc_row-fluid > div:nth-child(2)').parent('#fw_c > div:nth-child(5) > div > div > div.vc_row.wpb_row.vc_inner.vc_row-fluid > div:nth-child(2)');
            pdiv.insertAfter(pdiv.next());
        } 
    }

    Верстаем адаптивно

    http://ru.stackoverflow.com/questions/454209/

    xaja, 28 Сентября 2015

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

    +4

    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
    private void button2_Click(object sender, EventArgs e)
            {
     
            int n1 = Convert.ToInt16(textBox1.Text);
            int n2 = Convert.ToInt16(textBox4.Text);
            int n3 = Convert.ToInt16(textBox7.Text);
            int n4 = Convert.ToInt16(textBox10.Text);
            int n5 = Convert.ToInt16(textBox13.Text);
            int n6 = Convert.ToInt16(textBox16.Text);
            int n7 = Convert.ToInt16(textBox19.Text);
            int n8 = Convert.ToInt16(textBox22.Text);
     
            int b1 = Convert.ToInt16(textBox2.Text);
            int b2 = Convert.ToInt16(textBox5.Text);
            int b3 = Convert.ToInt16(textBox8.Text);
            int b4 = Convert.ToInt16(textBox11.Text);
            int b5 = Convert.ToInt16(textBox14.Text);
            int b6 = Convert.ToInt16(textBox17.Text);
            int b7 = Convert.ToInt16(textBox20.Text);
            int b8 = Convert.ToInt16(textBox23.Text);
     
            int c1 = Convert.ToInt16(textBox3.Text);
            int c2 = Convert.ToInt16(textBox6.Text);
            int c3 = Convert.ToInt16(textBox9.Text);
            int c4 = Convert.ToInt16(textBox12.Text);
            int c5 = Convert.ToInt16(textBox15.Text);
            int c6 = Convert.ToInt16(textBox18.Text);
            int c7 = Convert.ToInt16(textBox21.Text);
            int c8 = Convert.ToInt16(textBox24.Text);
     
            int ii, S2, S1, ti, ip, iip, iis, dp, ds, n;
                /*Индекс инфляции ii=S2/S1,
                *Темп инфляции ti=ii-1
                *простых процентов iip=((1+n*ip)*ii-1)/n
                 * для сложных iis=(1+is)nii(1/n)-1
                 * Реальная доходность простые% dp=(n*iip+1-ii)/ii
                 * Реальная доходность сложные% ds=(1+iis)/ii(1/n)-1
                 * сумма всей корзины S1 и S2
                 */
            S1 = n1 * b1 + n2 * b2 + n3 * b3 + n4 * b4 + n5 * b5 + n6 * b6 + n7 * b7 + n8 * b8;// сумма S1
            S2 = n1 * c1 + n2 * c2 + n3 * c3 + n4 * c4 + n5 * c5 + n6 * c6 + n7 * c7 + n8 * c8;// сумма S2
     
            ii = S2 / S1; // индекс инфляции
     
            ti = ii - 1; // темп инфляции
                
                n= n1+n2+n3+n4+n5+n6+n7+n8; // n= общее кол-во товаров и услуг
                iip = ((1 + n * ip) * ii - 1) / n;

    Diman3241, 28 Сентября 2015

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

    +4

    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
    71. 71
    72. 72
    73. 73
    74. 74
    75. 75
    StringBuilder errorMessage = new StringBuilder();
    int i = 0, j = 0;
    bool outcome = true;
    double value;
    string[] label = new string[] { label1.Text, label2.Text, label4.Text };
    
    textBox1.Text = textBox1.Text.Trim();
    textBox2.Text = textBox2.Text.Trim();
    textBox3.Text = textBox3.Text.Trim();
    
    foreach (string field in (new string[] { textBox1.Text, textBox2.Text, textBox3.Text }))
    {
    	try
    	{
    		if (field.Length == 0)
    			throw new Exception("отсутствует значение.\n");
    
    		if (j == 2)
    			value = int.Parse(field, NumberStyles.Integer);
    		else
    			value = double.Parse(field, NumberStyles.Float);
    
    		if (value <= 0)
    			throw new Exception("значение должно быть строго больше нуля.\n");
    
    		if (j == 2)
    		{
    			try
    			{
    				dateTimePicker1.Value.Date.AddMonths((int)value);
    			}
    			catch (Exception)
    			{
    				throw new Exception("превышено максимальное значение типа System.DateTime, " + DateTime.MaxValue.ToShortDateString() + ".\n" +
    									"Срок вклада не может превышать " + 
    									((DateTime.MaxValue.Year - dateTimePicker1.Value.Date.Year) * 12 +
    									DateTime.MaxValue.Month - dateTimePicker1.Value.Date.Month).ToString() + " мес. " + "от указанной даты оформления, " + dateTimePicker1.Value.Date.ToShortDateString() + ".\n");
    			}
    		}
    	}
    	catch (Exception e)
    	{
    		errorMessage.Append((++i).ToString() + ". " + label[j] + ": ");
    
    		switch (e.GetType().ToString())
    		{
    			case "System.FormatException":
    				errorMessage.AppendLine("неверный формат числа.\n");
    				break;
    
    			case "System.OverflowException":
    				{
    					if (j < 2)
    					{
    						errorMessage.AppendLine("значение не может быть обработано вещественным типом System.Double.");
    						errorMessage.AppendLine("Значение типа должно быть строго больше нуля, в промежутке (0; " + double.MaxValue.ToString() + "].\n");
    					}
    					else
    					{
    						errorMessage.AppendLine("значение не может быть обработано целочисленным типом System.Int32.");
    						errorMessage.AppendLine("Значение типа должно быть строго больше нуля, в промежутке (0; " + int.MaxValue.ToString() + "].\n");
    					}
    					break;
    				}
    
    			default:
    				errorMessage.AppendLine(e.Message);
    				break;
    		}
    
    		outcome = false;
    	}
    
    	j++;
    }

    Мастер исключений 80-го уровня.
    Хорошо, хоть не по мессаджам их разделяет.

    yamamoto, 28 Сентября 2015

    Комментарии (5)
  6. JavaScript / Говнокод #18773

    +1

    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
    71. 71
    72. 72
    73. 73
    74. 74
    function cashBonusCalculator(currentDepositValue, el) {
        var $scope = el;
    
        if (!currentDepositValue) {
            currentDepositValue = 0;
        }
        var max_bonus_01 = $scope.find('[name="progr_step_01_max"]'),
            max_bonus_02 = $scope.find('[name="progr_step_02_max"]'),
            max_bonus_03 = $scope.find('[name="progr_step_03_max"]'),
            bonus_start_01 = $scope.find('[name="progr_step_01_start"]'),
            bonus_start_02 = $scope.find('[name="progr_step_02_start"]'),
            bonus_start_03 = $scope.find('[name="progr_step_03_start"]'),
            bonus_amount_01 = $scope.find('[name="progr_step_01_amount"]'),
            bonus_amount_02 = $scope.find('[name="progr_step_02_amount"]'),
            bonus_amount_03 = $scope.find('[name="progr_step_03_amount"]');
    
            if (cash_bonuses_list[0]) {
                max_bonus_01.text('max ' + cash_bonuses_list[0].maxbonus.toMonetaryString());
                bonus_start_01.text(cash_bonuses_list[0].f.toMonetaryString());
                bonus_amount_01.text(cash_bonuses_list[0].bonus + '%');
                main_gift_conditions.text('x' + cash_bonuses_list[0].wager + ' ' + wagerType +'; ' + cash_bonuses_list[0].ttl + _('h'));
                gift_progress.addClass('cash_gift_progress_level_01');
            }
            if (cash_bonuses_list[1]) {
                max_bonus_02.text('max ' + cash_bonuses_list[1].maxbonus.toMonetaryString());
                bonus_start_02.text(cash_bonuses_list[1].f.toMonetaryString());
                bonus_amount_02.text(cash_bonuses_list[1].bonus + '%');
                main_gift_conditions.text('x' + cash_bonuses_list[1].wager + ' ' + wagerType + '; ' + cash_bonuses_list[1].ttl + _('h'));
                gift_progress.addClass('cash_gift_progress_level_02');
            }
            if (cash_bonuses_list[2]) {
                max_bonus_03.text('max ' + cash_bonuses_list[2].maxbonus.toMonetaryString());
                bonus_start_03.text(cash_bonuses_list[2].f.toMonetaryString());
                bonus_amount_03.text(cash_bonuses_list[2].bonus + '%');
                main_gift_conditions.text('x' + cash_bonuses_list[2].wager + ' ' + wagerType + '; ' + cash_bonuses_list[2].ttl + _('h'));
                gift_progress.addClass('cash_gift_progress_level_03');
            }
    
            if (window.CASHBONUSES && window.CASHBONUSES.length > 0) {
                var progressSteps = 3;
                if (cash_bonuses_list[0]) {
                    progressSteps = 1;
                }
                if (cash_bonuses_list[1]) {
                    progressSteps = 2;
                }
                if (cash_bonuses_list[2]) {
                    progressSteps = 3;
                }
    
                if (cash_bonuses_list[0] && currentDepositValue <= cash_bonuses_list[0].t && currentDepositValue >= cash_bonuses_list[0].f) {
                    $scope.find('[name="cash_gift_progressbar"]').css({
                        width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[0].f) / (((cash_bonuses_list[0].t - cash_bonuses_list[0].f) / 100)) * 0.01))) + 'px'
                    });
                    main_gift_amount.text(cash_bonuses_list[0].c + ' ' + currentBonusSumm(cash_bonuses_list[0].bonus, cash_bonuses_list[0].maxbonus, fromCashDepositValue));
                } else if (!cash_bonuses_list[1] && cash_bonuses_list[0] && currentDepositValue > cash_bonuses_list[0].t && currentDepositValue >= cash_bonuses_list[0].f){
                    $scope.find('[name="cash_gift_progressbar"]').css({
                        width: '100%'
                    });
                    main_gift_amount.text(cash_bonuses_list[0].c + ' ' + currentBonusSumm(cash_bonuses_list[0].bonus, cash_bonuses_list[0].maxbonus, fromCashDepositValue));
                } else if (cash_bonuses_list[1] && currentDepositValue <= cash_bonuses_list[1].t && currentDepositValue >= cash_bonuses_list[1].f) {
                    $scope.find('[name="cash_gift_progressbar"]').css({
                        width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[1].f) / (((cash_bonuses_list[1].t - cash_bonuses_list[1].f) / 100)) * 0.01)) + (main_progress_width / progressSteps)) + 'px'
                    });
                    main_gift_amount.text(cash_bonuses_list[1].c + ' ' + currentBonusSumm(cash_bonuses_list[1].bonus, cash_bonuses_list[1].maxbonus, fromCashDepositValue));
                } else if (!cash_bonuses_list[2] && cash_bonuses_list[1] && currentDepositValue > cash_bonuses_list[1].t && currentDepositValue >= cash_bonuses_list[1].f){
                    $scope.find('[name="cash_gift_progressbar"]').css({
                        width: '100%'
                    });
                    main_gift_amount.text(cash_bonuses_list[1].c + ' ' + currentBonusSumm(cash_bonuses_list[1].bonus, cash_bonuses_list[1].maxbonus, fromCashDepositValue));
                } else if (cash_bonuses_list[2] && currentDepositValue <= cash_bonuses_list[2].maxbonus && currentDepositValue >= cash_bonuses_list[2].f){
                    $scope.find('[name="cash_gift_progressbar"]').css({
                        width: (((main_progress_width / progressSteps) * ( (currentDepositValue - cash_bonuses_list[2].f) / (((cash_bonuses_list[2].maxbonus - cash_bonuses_list[2].f) / 100)) * 0.01)) + ((main_progress_width / progressSteps) * 2)) + 'px'
                    });

    ambt, 28 Сентября 2015

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

    −1

    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
    #include<stdio.h>
    	main(void){
    	#define   SIZE 10
    	int workers[SIZE] = {0,0,0,0,0,0,0,0,0};
           int frequency[SIZE] = {0,0,0,0,0,0,0,0,0};          		
    	int freq[SIZE]  = {0,0,0,0,0,0,0,0,0};
    	int salary = 200;	
    	int  m = 0, k = 0 ,n = 0, x = 0;
    
    for( k = 1 ; 	k <= SIZE - 1  ; ++k){
       printf("inter summary cash = ");
           scanf("\n%d", &m);
    	  workers[k] = m;
    	  freq[k ]	= (int) salary +  ( workers[k] * 0.01 ) * 9;
    		printf("number index%4d  up salary $%d\n", k  , freq[k]);
    		puts("");
    	}
    
    for(n = 1;n <= SIZE  - 1; n++){
      freq[x]	=  salary +  (workers[n] * 0.01 ) * 9   ;
        if(freq[n] >= 200 && freq[n] < 1000 ){
           ++frequency[(int)  freq[n] / 100  ]  ;
    	 }
    else if ( freq[n] > 1000 ){
    	++frequency[10];
    		 }
    	}		
    		
          for(x = 2;  x <=  SIZE ; x++ ){							
    	printf("$%4d = $%4d 	%d\n",salary, salary + 99,	frequency[x]  );						
                  salary += 100;		
    		}	
    return 0;
    	}

    Задачу по Дейтелам решал.

    tyrin, 27 Сентября 2015

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

    +2

    1. 1
    2. 2
    3. 3
    $query = "SELECT * FROM 
    		(SELECT * FROM `".$this->table_name."` ORDER BY `date` DESC $l) a
    		ORDER BY `$sort` $desc";

    С видеокурса Михаила Русакова

    REMOX, 27 Сентября 2015

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

    +1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    private function check($data) {
    	$result = $this->checkData($data);
    	if ($result === true) return true;
    	$sm = new SystemMessage();
    	return $sm->message($result);
    }
    protected function checkData($data) {
    	return false;
    }

    С видеокурса Михаила Русакова

    REMOX, 27 Сентября 2015

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

    −4

    1. 1
    2. 2
    3. 3
    4. 4
    // Привет коллеги, у меня возникла делема, куда пихать код отправки
    // на e-mail сообщения? В модель формы или в контроллере оставить?
    // фреймворк Yii, в самой Yii доке, написано, что в контроллерах надо
    // оставлять, а вы как делаете?

    Привет коллеги, у меня возникла делема, куда пихать код отправки на e-mail сообщения? В модель формы или в контроллере оставить? Фреймворк Yii, в самой Yii доке, написано, что в контроллерах надо оставлять, а вы как делаете?

    proweber1, 27 Сентября 2015

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