- 1
- 2
- 3
wb.getApplication().run(macro, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+78
wb.getApplication().run(macro, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null);
Использование библиотеки для взаимодействия с мелкософтовскими COM-объектами
+165
function register()
{
if (!empty($_POST)) {
$msg = '';
if ($_POST['user_name']) {
if ($_POST['user_password_new']) {
if ($_POST['user_password_new'] === $_POST['user_password_repeat']) {
if (strlen($_POST['user_password_new']) > 5) {
if (strlen($_POST['user_name']) < 65 && strlen($_POST['user_name']) > 1) {
if (preg_match('/^[a-z\d]{2,64}$/i', $_POST['user_name'])) {
$user = read_user($_POST['user_name']);
if (!isset($user['user_name'])) {
if ($_POST['user_email']) {
if (strlen($_POST['user_email']) < 65) {
if (filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {
create_user();
$_SESSION['msg'] = 'You are now registered so please login';
header('Location: ' . $_SERVER['PHP_SELF']);
exit();
} else $msg = 'You must provide a valid email address';
} else $msg = 'Email must be less than 64 characters';
} else $msg = 'Email cannot be empty';
} else $msg = 'Username already exists';
} else $msg = 'Username must be only a-z, A-Z, 0-9';
} else $msg = 'Username must be between 2 and 64 characters';
} else $msg = 'Password must be at least 6 characters';
} else $msg = 'Passwords do not match';
} else $msg = 'Empty Password';
} else $msg = 'Empty Username';
$_SESSION['msg'] = $msg;
}
return register_form();
}
Из рассылки PHPWeekly: "A Clean and Secure Open Source PHP Login Script"
https://github.com/panique/php-login/blob/master/0-one-file/index.php#L98
Что-то уж очень сильно "Clean".
−136
sub parse_http_date($)
{
my ($date)=@_;
my %months=(Jan=>0,Feb=>1,Mar=>2,Apr=>3,May=>4,Jun=>5,Jul=>6,Aug=>7,Sep=>8,Oct=>9,Nov=>10,Dec=>11);
if($date=~/^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$/)
{ return eval { timegm($6,$5,$4,$1,$months{$2},$3-1900) } }
return undef;
}
Вакаба.
+142
enum {size = 10, timeout = 50};
0
Бесконечный оффтоп имени Борманда #19
#1: https://govnokod.ru/25864 https://govnokod.xyz/_25864
#2: https://govnokod.ru/25921 https://govnokod.xyz/_25921
#3: https://govnokod.ru/26544 https://govnokod.xyz/_26544
#4: https://govnokod.ru/26838 https://govnokod.xyz/_26838
#5: https://govnokod.ru/27625 https://govnokod.xyz/_27625
#6: https://govnokod.ru/27736 https://govnokod.xyz/_27736
#7: https://govnokod.ru/27739 https://govnokod.xyz/_27739
#8: https://govnokod.ru/27745 https://govnokod.xyz/_27745
#9: https://govnokod.ru/28307 https://govnokod.xyz/_28307
#10: https://govnokod.ru/28631 https://govnokod.xyz/_28631
#11: (vanished) https://govnokod.xyz/_28742
#12: (vanished) https://govnokod.xyz/_28752
#13: (vanished) https://govnokod.xyz/_28754
#14: https://govnokod.ru/28759 https://govnokod.xyz/_28759
#15: https://govnokod.ru/28765 https://govnokod.xyz/_28765
#16: (vanished) https://govnokod.xyz/_28818
#17: (vanished) https://govnokod.xyz/_28819
#18: https://govnokod.ru/28822 https://govnokod.xyz/_28822
0
table inet filter {
set open_ports {
type inet_proto . inet_service
counter
elements = { tcp . 123 counter packets 0 bytes 0,
udp . 123 counter packets 0 bytes 0,
tcp . 456 counter packets 0 bytes 0,
tcp . 567 counter packets 0 bytes 0 }
}
chain input {
type filter hook input priority filter; policy drop;
iifname "eth*" ct state established,related accept
iifname "eth*" ct state invalid drop
iifname "eth*" ct state new meta l4proto . th dport @open_ports accept
}
}
«nftables» — охуенны.
−4
<p>8. Создать гостевую книгу, где любой человек может оставить комментарий в текстовом поле и
добавить его. Все добавленные комментарии выводятся над текстовым полем. Реализовать
проверку на наличие в тексте запрещенных слов, матов. При наличии таких слов - выводить
сообщение "Некорректный комментарий". Реализовать удаление из комментария всех тегов,
кроме тега <b>.
</p>
<?php
if (!is_file('otzyvy.txt')) {
echo "Поки що немає відгуків, Ваш буде першим! <br />";
$file = fopen('otzyvy.txt', 'a+');//щоб не генерувало помилку, створюємо файл
}
elseif (isset($_POST['textar']) && $_POST['textar']) {
$file = fopen('otzyvy.txt', 'a+');//дублюємо строку так як тут інша умова
$text = strip_tags($_POST['textar'], '<b>');
$pozition = strpos($text, 'хуй');
$pozition_1 = strpos($text, 'пизд');
if ($pozition || $pozition === 0 || $pozition_1 || $pozition_1 === 0){
die ("Некорректный комментарий");
}
$new_otzyvy = fwrite($file, $text.PHP_EOL);
$arr = file('otzyvy.txt');//перетворюємо файл у масив щоб потім було зручніше виводити його елементи
foreach ($arr as $key => $item) {
$key_1 = $key + 1;//це для візуалбної нумерації відгуків
echo "Відгук {$key_1}: {$item} <br /><br />";
}
}
else {
echo 'Щоб відправити відгук, потрібно заповнити поле форми!!!';
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Задача 8</title>
</head>
<body>
<form action="" method="post">
<textarea name="textar" placeholder="Введіть свій коментарій"></textarea>
<br />
<input type="submit" value="Відправити">
</form>
<br />
<br />
</body>
</html>
+147
QT project:
t=x1; x1=x2; x2=t;
t=y1; x1=y2; y2=t;
И еще 90 говнопятнышек!
Налетай: http://www.viva64.com/ru/a/0077/
+146
public function loadClass($class) {
return class_exists($class)||interface_exists($class)||($this->load($this->findClass($class))&&(class_exists($class)||interface_exists($class)));
}
прямиком из IDE. "Оптимизация" из разряда "лучшее - враг хорошего".
Не знаю, сочтет ли публика говнокодом, но, на мой взгляд, лучше оное записать не в одну строчку.
+2
type int = 1;
function makeRangeIterator(start = 0, end = 10000, step = 1) {
print("makeRangeIterator.");
let nextIndex = start;
let iterationCount = 0;
const rangeIterator = {
next() {
let result: [value: int, done: boolean];
if (nextIndex < end) {
result = [nextIndex, false];
nextIndex += step;
iterationCount++;
return result;
} else {
result = [iterationCount, true];
}
return result;
},
};
return rangeIterator;
}
function main() {
let it = makeRangeIterator(1, 10, 2);
let result = it.next();
while (!result.done) {
print(result.value); // 1 3 5 7 9
result = it.next();
}
print("done.");
}
Ну вот и все... позвольте мне представить самый сложный кусок когда либо компилированный моей программой. но ввиду того что "трамплины" хрен знает как работают то придется этот код "забанить" до лучших времен. Но он рабочий