1. 1C / Говнокод #25406

    0

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    СтраницыПанели = ЭтаФорма.ЭлементыФормы.ОсновнаяПанель.Страницы;
    Для Каждого Страница Bз СтраницыПанели Цикл
    	Если ПакетныйВводКонтрагентов = Истина Тогда
    		Если Страница.Имя = "стрКонтрагенты" Тогда
    			Страница.Доступность = Истина;
    		КонецЕсли;
    	КонецЕсли;
    КонецЦикла;

    kvvit74, 25 Февраля 2019

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

    +1

    1. 1
    https://oldoctober.com/

    Сайт какого-то очкастого задрота с козьим голосом, где он учит хомячков ковыряться в жопе.
    В одном из видосов он показывает, как залуживать выводы на таблетке аспирина.
    На 20-минуте вдруг всплывает хинт: 'dont breath the aspirine vapor - it may be dangerous for your health'

    Ебал я такие уроки, и учителя с ними.

    OlegYch, 24 Февраля 2019

    Комментарии (34)
  3. PHP / Говнокод #25404

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    <?php
    	$stars_code_arr = array(
    		'<span class="span_stars_2">★★★★★</span>',
    		'<span class="span_stars_1">★</span><span class="span_stars_2">★★★★</span>',
    		'<span class="span_stars_1">★★</span><span class="span_stars_2">★★★</span>',
    		'<span class="span_stars_1">★★★</span><span class="span_stars_2">★★</span>',
    		'<span class="span_stars_1">★★★★</span><span class="span_stars_2">★</span>',
    		'<span class="span_stars_1">★★★★★</span>',
    	);
    ?>

    Звездочки для оценки товара интернет-магазина)

    GenkaFF, 24 Февраля 2019

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

    0

    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
    var normalWidth = 1440 + 20;
    var maxStep = 720;
    
    var eDivSizeWidth = 1440;
    var eDivBodyEndWidth = 1400;
    var eSearchInputWidth = 920;
    var eSearchButtonLeft = 1210;
    var eCartButtonLeft = 1260;
    
    function onWindowResize()
    {
    	var step = normalWidth - innerWidth;
    	if (step < 0)
    		step = 0;
    	else if (step > maxStep)
    		step = maxStep;
    	document.getElementById('divSize').style.width = eDivSizeWidth - step;
    	document.getElementById('divBody').style.width = eDivBodyEndWidth - step;
    	document.getElementById('divEnd').style.width = eDivBodyEndWidth - step;
    	document.getElementById('mainSearch').style.width = eSearchInputWidth - step;
    	document.getElementById('searchButton').style.left = eSearchButtonLeft - step;
    	document.getElementById('cartButton').style.left = eCartButtonLeft - step;
    }
    
    window.onresize = function() { onWindowResize(); };
    window.onload = function() { onWindowResize(); };

    GenkaFF, 24 Февраля 2019

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

    −4

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    static string ArrayToString(byte[] a) => return string.Join(",", a); // гуд
    
            static byte[] StringToArray(string a) // бэд
            {
                var parts = a.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                var partsLen = parts.Length;
                var b = new byte[partsLen];
                for (var i = 0; i < partsLen; i++)
                    b[i] = Convert.ToByte(parts[i]);
                return b;
            }

    GenkaFF, 24 Февраля 2019

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

    +2

    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
    constexpr void foo(int &a, const int b)
    {
      a = b * 2;
    }
    
    constexpr void foo2(int *a, const int b)
    {
      *a = b * 2;
    }
    
    constexpr int shit = []() constexpr {int a = 0; foo(a, 666); return a;}();
    
    constexpr int shit2 = []() constexpr {int a = 0; foo2(&a, 666); return a;}();

    Итак, время обсирать крестоговно. Вот есть там такая фича - можно по ссылке и указателю хуйню через constexpr присваивать. Только вот эта тупая херня под названием лямбда, она обязательно требует инициализации некоторого говна, передаваемого куда-то там, если она объявлена как constexpr. На кой хрен мне что-то инициализировать, если это говно я в constexpr не читаю, а только присваиваю? И сделайте там какие-нибудь write-only переменные, которые через ссылку или указатель пробрасывать можно, ну чисто чтоб поржать

    j123123, 23 Февраля 2019

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

    −1

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    <?php
    	$i = -1;
    	while ($i == $i)
    	{
    		$i = $i + (1);
    		echo($i + "," + " ");
    	}
    ?>

    KEK

    GenkaFF, 23 Февраля 2019

    Комментарии (40)
  8. Си / Говнокод #25399

    0

    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
    // https://github.com/ghc/ghc/blob/e204431e5a5e2fd16da52b04bda2798f16c51344/rts/Interpreter.c#L1184
    
            case bci_PUSH8: {
                int off = BCO_NEXT;
                Sp_subB(1);
                *(StgWord8*)Sp = *(StgWord8*)(Sp_plusB(off+1));
                goto nextInsn;
            }
    
            case bci_PUSH16: {
                int off = BCO_NEXT;
                Sp_subB(2);
                *(StgWord16*)Sp = *(StgWord16*)(Sp_plusB(off+2));
                goto nextInsn;
            }
    
            case bci_PUSH32: {
                int off = BCO_NEXT;
                Sp_subB(4);
                *(StgWord32*)Sp = *(StgWord32*)(Sp_plusB(off+4));
                goto nextInsn;
            }
    
            case bci_PUSH8_W: {
                int off = BCO_NEXT;
                *(StgWord*)(Sp_minusW(1)) = *(StgWord8*)(Sp_plusB(off));
                Sp_subW(1);
                goto nextInsn;
            }
    
            case bci_PUSH16_W: {
                int off = BCO_NEXT;
                *(StgWord*)(Sp_minusW(1)) = *(StgWord16*)(Sp_plusB(off));
                Sp_subW(1);
                goto nextInsn;
            }
    
            case bci_PUSH32_W: {
                int off = BCO_NEXT;
                *(StgWord*)(Sp_minusW(1)) = *(StgWord32*)(Sp_plusB(off));
                Sp_subW(1);
                goto nextInsn;
            }

    https://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Interpreter

    > The linker lives in rts/Linker.c and is responsible for handling runtime loading of code into a Haskell process. This is something of a big blob of unpleasant code, and see DynamicGhcPrograms for information about efforts to reduce our dependence on this linker.

    Итак, тут у нас стековая машина из хачкеля, которая вродекак отвечает за динамическую загрузку какого-то говна.

    j123123, 22 Февраля 2019

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

    +1

    1. 1
    Прыщи

    syoma, 22 Февраля 2019

    Комментарии (299)
  10. Си / Говнокод #25397

    0

    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
    // https://github.com/alpertron/calculators/blob/15607feafb0ddb1c075bb326dc6ea2224a4c50bb/siqs.c#L3720
    
                switch (NumberLengthA)
                {
                case 7:
                  dRem = (double)*(piDividend + 6) * (double)rowPrimeTrialDivisionData->exp6 +
                    (double)*(piDividend + 5) * (double)rowPrimeTrialDivisionData->exp5 +
                    (double)*(piDividend + 4) * (double)rowPrimeTrialDivisionData->exp4 +
                    (double)*(piDividend + 3) * (double)rowPrimeTrialDivisionData->exp3 +
                    (double)*(piDividend + 2) * (double)rowPrimeTrialDivisionData->exp2 +
                    (double)*(piDividend + 1) * (double)rowPrimeTrialDivisionData->exp1;
                  break;
                case 6:
                  dRem = (double)*(piDividend + 5) * (double)rowPrimeTrialDivisionData->exp5 +
                    (double)*(piDividend + 4) * (double)rowPrimeTrialDivisionData->exp4 +
                    (double)*(piDividend + 3) * (double)rowPrimeTrialDivisionData->exp3 +
                    (double)*(piDividend + 2) * (double)rowPrimeTrialDivisionData->exp2 +
                    (double)*(piDividend + 1) * (double)rowPrimeTrialDivisionData->exp1;
                  break;
                case 5:
                  dRem = (double)*(piDividend + 4) * (double)rowPrimeTrialDivisionData->exp4 +
                    (double)*(piDividend + 3) * (double)rowPrimeTrialDivisionData->exp3 +
                    (double)*(piDividend + 2) * (double)rowPrimeTrialDivisionData->exp2 +
                    (double)*(piDividend + 1) * (double)rowPrimeTrialDivisionData->exp1;
                  break;
                case 4:
                  dRem = (double)*(piDividend + 3) * (double)rowPrimeTrialDivisionData->exp3 +
                    (double)*(piDividend + 2) * (double)rowPrimeTrialDivisionData->exp2 +
                    (double)*(piDividend + 1) * (double)rowPrimeTrialDivisionData->exp1;
                  break;
                default:
                  dRem = (double)*(piDividend + 2) * (double)rowPrimeTrialDivisionData->exp2 +
                    (double)*(piDividend + 1) * (double)rowPrimeTrialDivisionData->exp1;
                  break;
                }

    Generic two integer variable equation solver
    This calculator can solve equations of the form a⁢x² + b⁢x⁢y + c⁢y² + dx + ey + f = 0 where the unknowns x and y are integer numbers.

    j123123, 22 Февраля 2019

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