- 1
https://oldoctober.com/
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
https://oldoctober.com/
Сайт какого-то очкастого задрота с козьим голосом, где он учит хомячков ковыряться в жопе.
В одном из видосов он показывает, как залуживать выводы на таблетке аспирина.
На 20-минуте вдруг всплывает хинт: 'dont breath the aspirine vapor - it may be dangerous for your health'
Ебал я такие уроки, и учителя с ними.
0
<?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>',
);
?>
Звездочки для оценки товара интернет-магазина)
0
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(); };
−4
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;
}
+2
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 переменные, которые через ссылку или указатель пробрасывать можно, ну чисто чтоб поржать
−1
<?php
$i = -1;
while ($i == $i)
{
$i = $i + (1);
echo($i + "," + " ");
}
?>
KEK
0
// 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.
Итак, тут у нас стековая машина из хачкеля, которая вродекак отвечает за динамическую загрузку какого-то говна.
+1
Прыщи
0
// 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 ax² + bxy + cy² + dx + ey + f = 0 where the unknowns x and y are integer numbers.
0
Хостинг