- 1
Хочу, чтобы 3.14159265, 1024--, vistefan, kegdan, bormand вернулись в новогоднюю ночь.
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+1
Хочу, чтобы 3.14159265, 1024--, vistefan, kegdan, bormand вернулись в новогоднюю ночь.
+1
Число 1 = 1;
Число номер 2 = 2;
Сумма = Число 1 + Число номер 2;
print Сумма; print;
function Открытие двери в поезде() {
print "Дверь открыта"; print;
}
Открытие двери в поезде();
https://habr.com/ru/sandbox/133385/
+1
size_t nChLen = it_ch_end - it_ch;
до меня дошло не сразу.
+1
https://pastebin.com/8c6KxabR
Бон аппетит, блядь.
+1
<?php
$fin = fopen($argv[1], 'r');
if($fin === false) die();
$fout = fopen('dump.csv', 'w');
if($fout === false) die();
while(!feof($fin)) {
$rawline = fgets($fin);
if(!preg_match('#\[+(.*)\]+,?#', $rawline, $matches)) continue;
$fields = str_getcsv($matches[1]);
$parts = explode(')', $fields[0]);
if(count($parts) < 2) continue;
list($host, $path) = $parts;
$domains = explode(',', $host);
$dirs = explode('/', $path);
if($domains[0] === 'ru' && $domains[1] === 'mail') {
$email = $dirs[2] . '@' . $dirs[1] . '.ru';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
} else if($domains[0] === 'ru' && $domains[1] === 'rambler' && $dirs[1] = 'users') {
if(strpos($dirs[2], '@') === false) {
$email = $dirs[2] . '@rambler.ru';
} else {
$email = $dirs[2];
}
$hash = md5($email);
fputcsv($fout, array($hash, $email));
} else if($domains[0] === 'ru' && $domains[1] === 'ya') {
$email = $domains[2] . '@yandex.ru';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $domains[2] . '@yandex.by';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $domains[2] . '@yandex.ua';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $domains[2] . '@yandex.kz';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $domains[2] . '@yandex.com';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $domains[2] . '@ya.ru';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
} else if($domains[0] === 'ru' && $domains[1] === 'yandex' && $dirs[1] = 'users') {
$email = $dirs[2] . '@yandex.ru';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $dirs[2] . '@yandex.by';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $dirs[2] . '@yandex.ua';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $dirs[2] . '@yandex.kz';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $dirs[2] . '@yandex.com';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
$email = $dirs[2] . '@ya.ru';
$hash = md5($email);
fputcsv($fout, array($hash, $email));
}
}
fclose($fout);
fclose($fin);
Генератор радужных таблиц для е-мейлов.
Особенность программы в том, что «JSON» парсится как «CSV» в целях экономии оперативки.
+1
public class Main {
public static void main(String[] args) {
ThreeD[] f = {new ThreeD(5, 9, 7), new FourD(1,3,8,5)};
Coords<ThreeD> c = new Coords<>(f);
showXYZ(c);
FiveD[] x = new FiveD[] {new FiveD(11,22,3,4, 123)};
Coords<FiveD> b = new Coords<>(x);
showAll(b);
FiveD[] z = new FiveD[] {new FiveD(1,2,1,6,5)};
Coords<FiveD> zz = new Coords<>(z);
}
private static void showXY(Coords<? super FourD> c) {
for(int i = 0; i < c.coords.length; i++) {
System.out.println(c.coords[i].x +" "+ c.coords[i].y+" ");
}
}
private static void showXYZ(Coords<? extends ThreeD> c) {
for(int i = 0; i < c.coords.length; i++) {
System.out.println(c.coords[i].x +" "+ c.coords[i].y+" "+c.coords[i].z+" ");
}
}
private static void showAll(Coords<? extends FiveD> c) {
for(int i = 0; i < c.coords.length; i++) {
System.out.println(c.coords[i].x +" "+ c.coords[i].y+" "+c.coords[i].z+" "+c.coords[i].t+" "+c.coords[i].m);
}
}
}
class Coords<T extends TwoD> {
T[] coords;
Coords(T[] o) {
coords = o;
}
}
class TwoD {
int x,y;
TwoD(int a, int b) {
x = a;
y = b;
}
}
class ThreeD extends TwoD {
int z;
ThreeD(int a, int b, int c) {
super(a, b);
z = c;
}
}
class FourD extends ThreeD {
int t;
FourD(int a, int b, int c, int d) {
super(a, b, c);
t = d;
}
}
class FiveD extends FourD {
int m;
FiveD(int a, int b, int c, int d, int e) {
super(a, b, c, d);
m = e;
}
}
говнецо или нет
+1
//Создадим типизированные колонки в ТЗ
Запрос = Новый Запрос("ВЫБРАТЬ
| CRM_ЗначенияРеквизитовТрафика.РеквизитТрафика КАК РеквизитТрафика,
| CRM_ЗначенияРеквизитовТрафика.ЗначениеРеквизита КАК ЗначениеРеквизита,
| CRM_ЗначенияРеквизитовТрафика.ИдентификаторТрафика
|ИЗ
| РегистрСведений.CRM_ЗначенияРеквизитовТрафика КАК CRM_ЗначенияРеквизитовТрафика
|ГДЕ
| CRM_ЗначенияРеквизитовТрафика.ИдентификаторТрафика ЕСТЬ NULL");
РеквизитыТрафика = Запрос.Выполнить().Выгрузить();
//Удалим "лишние записи" на всякий случай
РеквизитыТрафика.Очистить();
//Заполним реквизиты трафика
//Логин клиента из онлайнконсультанта
НовоеСвойство = РеквизитыТрафика.Добавить();
НовоеСвойство.ИдентификаторТрафика = Идентификатор;
НовоеСвойство.РеквизитТрафика = ПланыВидовХарактеристик.CRM_РеквизитыТрафика.ОнлайнКонсультантЛогинКлиента;
НовоеСвойство.ЗначениеРеквизита = Описание.ЛогинКлиента;
//Запись в регистр
НЗ = РегистрыСведений.CRM_ЗначенияРеквизитовТрафика.СоздатьНаборЗаписей();
НЗ.Отбор.ИдентификаторТрафика.Установить(Идентификатор);
НЗ.Прочитать();
НЗ.Загрузить(РеквизитыТрафика);
Нз.Записать();
Зачем столько раз читать регистр не понятно. Для чего вообще нужна типизированная таблица если используется прочитать? Одни вопросы.
+1
/**
* The expanded S-box and inverse S-box tables. These will be computed
* on the client so that we don't have to send them down the wire.
*
* There are two tables, _tables[0] is for encryption and
* _tables[1] is for decryption.
*
* The first 4 sub-tables are the expanded S-box with MixColumns. The
* last (_tables[01][4]) is the S-box itself.
*
* @private
*/
_tables: [[[],[],[],[],[]],[[],[],[],[],[]]],
+1
There was once a programmer who was attached to the court of the
warlord Wu. The warlord asked the programmer: "Which is easier to design:
an accounting package or an operating system?"
"An operating system," replied the programmer.
The warlord uttered an exclamation of disbelief. "Surely an
accounting package is trivial next to the complexity of an operating
system," he said.
"Not so," said the programmer, "when designing an accounting package,
the programmer operates as a mediator between people having different ideas:
how it must operate, how its reports must appear, and how it must conform to
tax laws. By contrast, an operating system is not limited by outward
appearances. When designing an operating system, the programmer seeks the
simplest harmony between machine and ideas. This is why an operating system
is easier to design."
The warlord of Wu nodded and smiled. "That is all good and well,"
he said, "but which is easier to debug?"
The programmer made no reply.
-- Geoffrey James, "The Tao of Programming"
друзья, а как думаете вы?
что проще делать, а что дебажить?
+1
#include <stdbool.h>
bool impl(bool a, bool b) // ->
{
return (!a || b);
}
bool always_true(bool a, bool b)
{
return (impl(a,b) == impl(b,a)) == (a == b); // ( (a -> b) = (b -> a) ) = (a = b) tautology
}
/*
GCC не хочет мне тавтологию оптимизировать!
https://godbolt.org/z/kgFMpR
always_true:
movl %esi, %eax
xorl %edi, %eax
cmpb %dil, %sil
sete %dl
xorl %edx, %eax
ret
Но Clang может
https://godbolt.org/z/YcOat-
always_true: # @always_true
movb $1, %al
retq
*/
ГОВНО!