- 1
- 2
- 3
- 4
- 5
- 6
- 7
function test(p) {
return p +' World';
}
var str = 'Hello ';
console.log(str + test());
// Hello undefined World
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−3
function test(p) {
return p +' World';
}
var str = 'Hello ';
console.log(str + test());
// Hello undefined World
−1
#include <cstdio>
int main(void)
{
static char data[] = "sosu hui\n";
__asm
{
mov eax, 0
ploop:
mov bl, [data + eax]
push eax
push bx
call putchar
pop bx
pop eax
inc eax
cmp bl, 0
jnz ploop
}
return 0;
}
0
function main4() {
let i = 0;
try {
try {
throw 1.0;
}
catch (e: number) {
i++;
print("asd1");
throw 2.0;
}
finally {
print("finally");
}
}
catch (e2: number) {
i++;
print("asd3");
}
assert(i == 2);
}
function main() {
main4();
print("done.");
}
Ну вот и все.. шах и мат С/C++ девелоперы... последняя хитровые...аная инструкция finally сделана. (надо еще для линуха сделать .. а то они разные)
+1
def main():
pipe(int(input('Введите неотрицательное целое число: ')),
lambda n: (n, reduce(lambda x, y: x * y, range(1, n + 1))),
lambda tup: print(f'Факториал числа {tup[0]} равняется {tup[1]}'))
Из https://habr.com/ru/post/555370/ (Функциональное ядро на Python).
+3
The reboot() call reboots the system, or enables/disables the reboot keystroke (abbreviated CAD, since the de‐
fault is Ctrl-Alt-Delete; it can be changed using loadkeys(1)).
This system call fails (with the error EINVAL) unless magic equals LINUX_REBOOT_MAGIC1 (that is, 0xfee1dead)
and magic2 equals LINUX_REBOOT_MAGIC2 (that is, 672274793). However, since 2.1.17 also LINUX_REBOOT_MAGIC2A
(that is, 85072278) and since 2.1.97 also LINUX_REBOOT_MAGIC2B (that is, 369367448) and since 2.5.71 also
LINUX_REBOOT_MAGIC2C (that is, 537993216) are permitted as values for magic2. (The hexadecimal values of
these constants are meaningful.)
man 2 reboot
−2
#Ide для япа
code = input('Ваш код: ')
if code = "print('text')
print('text')
0
$snippet = preg_split('/'. $qs .'/i', $replace);
$c = 1;
foreach( $snippet as $snip ) {
$length = strlen( $snip ) * .3;
$xlength = strlen( explode( $qs, $snip )[0] );
if( $c % 2 !== 0 ) {
$highlight_1 = substr( $snip, $xlength * .3, $xlength );
}
else {
$highlight_2 = substr( $snip, 0, $length );
}
$c++;
}
$output .= '<dfn class="revolver__search-snippet">... '. preg_replace("#[^а-яА-ЯA-Za-z:;._,? -]+#u", '', $highlight_1) . '<mark>'. $qs .'</mark>'. preg_replace("#[^а-яА-ЯA-Za-z:.;_,? -]+#u", '', $highlight_2) .' ...</dfn></li>';
Pick — самая маленькая поисковая система на PHP и MySQL
Здесь пришлось повозиться. Простой подход совсем не подразумевал, что PHP начнет обрабатывать UTF-8 корректно, но я смог добиться работы с русским и английским языками.
https://habr.com/post/526652
+3
int main()
{
+ ! - ! -- -- ! + ! - - - ++ ~ - ! -- -- -- ~ ~ ~ ++ ++ ++ - ~ ++ - * - - -
* ++ * * ++ * -- -- -- -- - * -- + * ++ ++ ++ ++ ++ * ++ * -- -- * -- - *
BRAINFUCK;
return 0;
}
https://ideone.com/EtK1J4
Ответ на https://govnokod.ru/26910. Теперь с реальной конпеляцией в нативный код.
−1
private function changePlans(Coupon $coupon): Coupon
{
$coupon->paypal_plan_yearly_rub_id = $this->getPaypalId($coupon->billingPlanYearlyRub, $coupon);
$coupon->paypal_plan_yearly_usd_id = $this->getPaypalId($coupon->billingPlanYearlyUsd, $coupon);
$coupon->paypal_plan_monthly_rub_id = $this->getPaypalId($coupon->billingPlanMonthlyRub, $coupon);
$coupon->paypal_plan_monthly_usd_id = $this->getPaypalId($coupon->billingPlanMonthlyUsd, $coupon);
return $coupon;
}
Вот это забавно $this->getPaypalId($coupon->billingPlanMonthlyUsd, $coupon); (getPaypalId приватный)
0
apibrėžti WSGIHandler(aplin, pradžia_atsakymas):
globalinis prašymas
globalinis atsakymas
prašymas.įpareigoti(aplin)
atsakymas.įpareigoti()
bandyti:
prižiūrėtojas, argi = rungtynės_url(prašymas.kelias, prašymas.metodas)
jei not prižiūrėtojas:
kelti HTTPKlaida(404, "Nerastas")
produkcija = prižiūrėtojas(**argi)
išskyrus BreakButelio kaip antsparnis:
produkcija = antsparnis.produkcija
išskyrus Exception kaip išimtis:
atsakymas.statusas = getattr(išimtis, 'http_statusas', 500)
klaidaprižiūrėtojas = KLAIDA_HANDLER.get(atsakymas.statusas, klaida_nutylėjimą)
bandyti:
produkcija = klaidaprižiūrėtojas(išimtis)
išskyrus:
produkcija = "Išimtis per klaidos prižiūrėtojas! Prašymas sustabdyti."
jei atsakymas.statusas == 500:
prašymas._aplin['wsgi.errors'].write("Error (500) on '%s': %s\n" % (prašymas.kelias, išimtis))
db.uždaryti()
jei turiatrib(produkcija, 'read'):
failąišvesties = produkcija
jei 'wsgi.file_wrapper' iš aplin:
produkcija = aplin['wsgi.file_wrapper'](failąišvesties)
kitas:
produkcija = iter(lambda: failąišvesties.read(8192), '')
kijei isinstance(produkcija, stg):
produkcija = [produkcija.encode()]
dėl c iš atsakymas.SLAPUKAI.values():
atsakymas.antraštė.papildyti('Set-Cookie', c.OutputString())
statusas = '%d %s' % (atsakymas.statusas, HTTP_KODAI[atsakymas.statusas])
pradžia_atsakymas(statusas, sąrašas(atsakymas.antraštė.daiktai()))
sugrįžti produkcija
Отсюда:
https://github.com/Setonas/setonas