- 1
- 2
- 3
- 4
- 5
- 6
# -*- coding: cp1251 -*-
beer = u"бутылок пива стоят на столе. Одна упала."
botle = 100
for i in range(1, 100):
print (botle-i), beer
print u"Нету больше пива на столе :-("
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−98
# -*- coding: cp1251 -*-
beer = u"бутылок пива стоят на столе. Одна упала."
botle = 100
for i in range(1, 100):
print (botle-i), beer
print u"Нету больше пива на столе :-("
Пива не будет :-(
+140
<!-- Скрипт иерархичесского аккардиона -->
Не говнокод, но говноречь - 3 ошибки в 2 словах.
"Девелоперы" научились подключать jQuery, а вот русский язык пока что не осилили.
Эти грамотеи работают на "Первом канале", см. http://www.1tv.ru/videoarchiver/.
+159
int** ppi = new int*;
+149
<?php
@require_once('something-that-doesnot-exists.php');
echo 'My etogo uzhe ne prochitaem((';
?>
Баг ПХП. 4 часа искал методом научного echo. Ошибки не выдает, завершает выполнение как будто вызвали exit() or die(). Растолкуйте в чем суть?
Но всё-таки виновати разработчики CodeIgniter. Они нарушили принцип KISS (keep it simple). Я например, никогда не использую @ (даже незнаю к чему этот отросток).
+164
// set admin mode
switch (true) {
case $nc_core->inside_admin:
$nc_core->admin_mode = true;
break;
case !$passed_thru_404 && isset($posting): // add (edit) action
$nc_core->admin_mode = $admin_mode;
break;
case !$passed_thru_404: //front-office
$nc_core->admin_mode = true;
break;
case $passed_thru_404:
$nc_core->admin_mode = false;
break;
default:
$nc_core->admin_mode = false;
}
/netcat/require/index.php
Что они там курят, что у них настолько извилины выпрямляются?!
+101
if IntToStr(n) = '2' then begin
/// Еще куча говнокода
end;
Устроился я тут работать в одну компанию... Начинаю серию публикаций... Название компании пока не буду озвучивать - еще уволят нах...
Начнём с чего-нибудь простенького :)
+160.4
<?php
$form = new Validator;
$form
->newString(Request::get('nickname'));
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\Length(4, 16),
new FW\Rules\RegExp('/^[a-z]+$/i')
);
->newString(Request::get('password'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\MinLength(3),
new App\Rules\PasswordStrength(40)
);
->newString(Request::get('confirm'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\Equals(Request::get('password'))
)
->newString(Request::get('email'))
->addRules(
new FW\Rules\NotEmpty(),
new FW\Rules\ValidEmail(Request::get('email'))
);
if ($form->isValid()) {
reg_user(Request::get('nickname'), Request::get('password'), Request::get('email'));
} else {
print_r($form->getErrors());
}
Народ ёбнулся на ООП
0
if (this.$arg0 == 'inc') this.$ret = this.$math = args[0] + 1;
if (this.$arg0 == 'dec') this.$ret = this.$math = args[0] - 1;
if (this.$arg0 == 'div') this.$ret = this.$math = args[0] / args[1];
if (this.$arg0 == 'ceil') this.$ret = this.$math = Math.ceil(args[0]);
if (this.$arg0 == 'floor') this.$ret = this.$math = Math.floor(args[0]);
if (this.$arg0 == 'sqrt') this.$ret = this.$math = Math.sqrt(args[0]);
if (this.$arg0 == 'exp') this.$ret = this.$math = Math.exp(args[0]);
if (this.$arg0 == 'log') this.$ret = this.$math = Math.log(args[0]);
if (this.$arg0 == 'sin') this.$ret = this.$math = Math.sign(args[0]);
if (this.$arg0 == 'log10') this.$ret = this.$math = Math.log10(args[0]);
if (this.$arg0 == 'cos') this.$ret = this.$math = Math.cos(args[0]);
if (this.$arg0 == 'tan') this.$ret = this.$math = Math.tan(args[0]);
if (this.$arg0 == 'acos') this.$ret = this.$math = Math.acos(args[0]);
if (this.$arg0 == 'atan') this.$ret = this.$math = Math.atan(args[0]);
if (this.$arg0 == 'round') this.$ret = this.$math = Math.round(args[0]);
if (this.$arg0 == 'atan2') this.$ret = this.$math = Math.atan2(args[0]);
Исходный код интерпретатора компилятора (!) Языка Программирования «AsmX».
https://github.com/langprogramming-AsmX/AsmX/blob/main/compiler.js#L215
+1
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
void swap(uint8_t *x, uint8_t *y)
{
uint8_t tmp;
tmp = *x;
*x = *y;
*y = tmp;
}
// эту хуйню тоже можно нагенерировать
uint64_t cmp_bits(uint8_t a[restrict 9])
{
return
((uint64_t)(a[0] < a[1]) << 0) |
((uint64_t)(a[0] < a[2]) << 1) |
((uint64_t)(a[0] < a[3]) << 2) |
((uint64_t)(a[0] < a[4]) << 3) |
((uint64_t)(a[0] < a[5]) << 4) |
((uint64_t)(a[0] < a[6]) << 5) |
((uint64_t)(a[0] < a[7]) << 6) |
((uint64_t)(a[0] < a[8]) << 7) |
((uint64_t)(a[1] < a[2]) << 8) |
((uint64_t)(a[1] < a[3]) << 9) |
((uint64_t)(a[1] < a[4]) << 10) |
((uint64_t)(a[1] < a[5]) << 11) |
((uint64_t)(a[1] < a[6]) << 12) |
((uint64_t)(a[1] < a[7]) << 13) |
((uint64_t)(a[1] < a[8]) << 14) |
((uint64_t)(a[2] < a[3]) << 15) |
((uint64_t)(a[2] < a[4]) << 16) |
((uint64_t)(a[2] < a[5]) << 17) |
((uint64_t)(a[2] < a[6]) << 18) |
((uint64_t)(a[2] < a[7]) << 19) |
((uint64_t)(a[2] < a[8]) << 20) |
((uint64_t)(a[3] < a[4]) << 21) |
((uint64_t)(a[3] < a[5]) << 22) |
((uint64_t)(a[3] < a[6]) << 23) |
((uint64_t)(a[3] < a[7]) << 24) |
((uint64_t)(a[3] < a[8]) << 25) |
((uint64_t)(a[4] < a[5]) << 26) |
((uint64_t)(a[4] < a[6]) << 27) |
((uint64_t)(a[4] < a[7]) << 28) |
((uint64_t)(a[4] < a[8]) << 29) |
((uint64_t)(a[5] < a[6]) << 30) |
((uint64_t)(a[5] < a[7]) << 31) |
((uint64_t)(a[5] < a[8]) << 32) |
((uint64_t)(a[6] < a[7]) << 33) |
((uint64_t)(a[6] < a[8]) << 34) |
((uint64_t)(a[7] < a[8]) << 35);
}
void printshit(uint8_t a[restrict 9])
{
size_t i = 0;
while(*a != 4)
{
a++;
i++;
}
printf("arr[%" PRIu64 "] = %zu\n", cmp_bits(a), i);
}
void permute(char *a, size_t l, size_t r)
{
size_t i;
if (l == r)
printshit(a);
else
{
for (i = l; i <= r; i++)
{
swap((a+l), (a+i));
permute(a, l+1, r);
swap((a+l), (a+i));
}
}
}
int main()
{
uint8_t a[] = {0,1,2,3,4,5,6,7,8};
size_t n = 9;
permute(a, 0, n-1);
return 0;
}
https://govnokod.ru/24496#comment782476
Построение таблицы поиска для быстрого нахождения медианы. Там эту хуйню конечно можно улучшить, например запаковывать число от 0 до 8 в хуйни по 4 бита
+1
import std.stdio;
template GenMix()
{
const char[] GenMix =
"template GenMix2()" ~
"{" ~
" const char[] GenMix2 = \"writeln(\\\"Hello, Wandbox!\\\");\";" ~
"};";
}
template MixMix(string Name)
{
const char[] MixMix = "mixin(" ~ Name ~ "!());";
}
mixin(GenMix!());
void main()
{
mixin(GenMix2!());
mixin(MixMix!("GenMix2"));
}
https://wandbox.org/permlink/1HpjfgrgVLyBSrXG
ГОМОИКОННОСТЬ в D