- 1
- 2
info->cipher_oid = oid_to_string(p->header2->header3->header4->header5->cipher_oid);
info->hash_oid = oid_to_string(p->header2->header3->header4->header5->hash_oid);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144
info->cipher_oid = oid_to_string(p->header2->header3->header4->header5->cipher_oid);
info->hash_oid = oid_to_string(p->header2->header3->header4->header5->hash_oid);
Вчера наговнокодил.
+54
#include <iostream>
using namespace std;
struct Foo
{
int i[0];
};
int main() {
// your code goes here
Foo f1;
Foo f2[5];
cout << sizeof(f1) << endl;
cout << sizeof(f2) << endl;
return 0;
}
http://rextester.com/NAA5246
http://rextester.com/GKLFG82436
http://rextester.com/SSZ22454
http://rextester.com/ZEY11320
+68
int a, b ;
//some code
int numCount = 0;
while ((a + numCount++) < b) // посчитать кол-во чисел между a и b, включая a и b
;
это великолепно!
−113
escape_cats = [cat_id for cat_id, values in cats.iteritems() if any([values[1] == supercat or cat_id == supercat for supercat in escape_supercats])]
Избегание котов.
+131
elseif selectedObj::mouthOnMenuRect then
if dir == "left" then
inv = true
changeMouth()
elseif dir == "right" then
inv = false
changeMouth()
end
elseif selectedObj::eyesOnMenuRect then
if dir == "left" then
inv = true
changeEyes()
elseif dir == "right" then
inv = false
changeEyes()
end
elseif
Вступительная заставка к фильму "Добро пожаловать в рай", промелькнуло с десяток таких вот блоков "elseif selectedObj::чтоТоТамOnMenuRect".
В начале фильма под сеансом видеосвязи с аналоговыми помехами закольцевали фрагмент телефонного справочника на си с полотнами printf.
Где-то в середине в консольном окошке с заголовком "DATABASE_QUERY" продемонстрировали код функции groups_alloc из ядра linux, а чуть позже - groups_from_user и groups_sort из того же файла.
Между делом, хакер отличается от других тем, что у него не терминал, а SECURE_TERMINAL, сам он носит ублюдошные очки в толстой оправе, а код в терминале тот же сишный, но красного цвета вместо зеленого.
Под конец на "главный сервер" заливали виндовый батничек, над которым явно работали больше, чем над сценарием фильма. Нагуглился исходник батничка: http://www.wikihow.com/Make-a-Prank-Virus-(Windows)
+133
HTTP referer (originally a misspelling of referrer) is an HTTP header field that identifies the address of the webpage
(i.e. the URI or IRI) that linked to the resource being requested.
Originally a misspelling of referrer...
+137
#include <time.h>
int rrand(int start, int end)
{
int range=end-start+1;
int speed=1;
int base=0;
int rez=start;
if(range>200) speed=range/100;
while(range>=0)
{
srand(clock());
if(rand()%2) base=base+speed+1;
else base--;
rez=rez+base;
rez=(rez < start)? end-rez : rez;
rez=(rez > end)? (rez%end)+start : rez;
range=range-speed;
}
return rez;
}
случайные числа в определенном диапазоне...
+160
foreach (scandir(DIR.'app'.SLASH.'lib') as $filename) {
$path = DIR.'app'.SLASH.'lib'.SLASH.$filename;
if (is_file($path) && substr($filename,strlen($filename)-4,4)=='.php') {
require_once($path);
}
}
foreach (scandir(DIR.'app'.SLASH.'models') as $filename) {
$path = DIR.'app'.SLASH.'models'.SLASH.$filename;
if (is_file($path) && substr($filename,strlen($filename)-4,4)=='.php') {
require_once($path);
}
}
foreach (scandir(DIR.'app'.SLASH.'ext') as $filename) {
$path = DIR.'app'.SLASH.'ext'.SLASH.$filename;
if (is_file($path) && substr($filename,strlen($filename)-4,4)=='.php') {
require_once($path);
}
}
Начался разбор проблемы со слов заказчика - "сайт долго грузится"
+108
void Data3Fill(string _TownCheck, string _StreetCheck, string _HouseCheck, string _FlatCheck, string _BloodCheck,
string _InsuranceCheck, string _EndPolCheck, string _DateFutureCheck, string _DoctorCheck, string _DiagnosisCheck, string _ComplaintsCheck, string _VichCheck, string _CancerCheck, string _SurnameCheck, string _NameCheck, string _MidnameCheck,
string _SexCheck, string _StatusCheck, string _HighStatusCheck)
{
...
}
Одному моему другу такой подход кажется нормальным.
+130
char* obrab_stroki(char*, int);
int move(char*);
int action_register(char*);
int speed(char*);
int condition(char*);
char answer1[25];
uint8_t Output[512];
uint32_t number_for_output=16;
typedef struct { char *name; uint8_t adress; } struct_label;
typedef struct { char *name; uint8_t adress; } struct_goto_label;
//----------------------------------------------------------------------------------------
while (strcmp(qwerty[++string_count],""))
{
str=obrab_stroki(qwerty[string_count], 0);
printf("s:%s\n",str);
if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"{")) fig_skob++;
if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"}")) fig_skob--;
if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"{") && !strcmp(str,"if")) { fig_skob_if++; adres_return[fig_skob_if]=number_for_output+3; }
if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,"}") && fig_skob_if>0) { Output[adres_return[fig_skob_if]]=number_for_output; fig_skob_if--;}
if (fig_skob==0)
{
Output[number_for_output++]=0;
Output[number_for_output++]=0;
}
if (!strcmp(qwerty[string_count]+strlen(qwerty[string_count])-1,":"))
{
label[number_label].name=qwerty[string_count];
label[number_label++].adress = number_for_output;
continue;
}
//-------------------------------------------------------------------------------------------
if (!strcmp(str,"r")) if (action_register(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
if (!strcmp(str,"move")) if (move(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
if (!strcmp(str,"speed")) if (speed(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
if (!strcmp(str,"if")) if (condition(qwerty[string_count]) == 1) {printf("ERROR in string: %d", string_count); return 1;} else continue;
//-----------------------------------------------------------------------------------------
char* obrab_stroki(char* qwerty, int i)
{
int count;
char asnwer1[25];
for (count=0; (qwerty[count+i]<='z' && qwerty[count+i]>='a') || (qwerty[count+i]<='Z' && qwerty[count+i]>='A'); count++)
{
answer1[count]=qwerty[count+i];
}
answer1[count]='\0';
return answer1;
}//тут как бы нет ошибок =)
//----------------------------------------------------------------------------------------------
if (qwerty[i]=='-')
{
if (qwerty[i+1]=='1' && qwerty[i+2]=='0')
{
Output[number_for_output++]=answer|MOTOR_SPEC_SPEED_DEC;
Output[number_for_output++]=0;
return 0;
}
else
return 1;
}
Человек писал компилятор. Самые эпичные моменты