- 1
- 2
- 3
- 4
- 5
- 6
exec @res = dbo.p_bis_prepaid_diagnostic @tar_addr, @req_dubug_info output
if (@res = 0)
set @res = 1
else
set @res = 0
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−122
exec @res = dbo.p_bis_prepaid_diagnostic @tar_addr, @req_dubug_info output
if (@res = 0)
set @res = 1
else
set @res = 0
+121
#include "uni.h"
int getopt_long(int argc, char *const argv[],const char *optstring,const struct option *longopts, int *longindex);
int getopt__long_only(int argc, char *const argv[],const char *optstring,const struct option *longopts, int *longindex);
int chown(const char *path, uid_t owner, gid_t group);
uid_t getuid(void);
int mkdir(const char *pathname, mode_t mode);
gid_t getgid(void);
char *dirname;
mode_t perm;
uid_t owner;
gid_t group;
int main(int argc,char **argv){
owner=getuid();
group=getgid();
perm=0600;
char *pEnd;
char *dirname=(char*)malloc(16);
if(dirname==NULL){fprintf(stderr, "out of memory!\n");return -1;}
memset( dirname,'\0',16);
strcat(dirname,argv[argc-1]);
struct option longopts[] = {
{ "mode", required_argument, NULL, 'm' },
{ "parents", NULL, NULL, 'p'},
{ "verbose", required_argument, NULL, 'v'},
{ "context", required_argument, NULL, 'c'},
{ "help", NULL, NULL, 'h'},
{ "version", NULL, NULL, 'r'},
{ 0, 0, 0, 0 }
};
char c;
while((c=getopt_long(argc,argv,"m:p:v:c:r:h",longopts,NULL)) != -1) {
switch (c) {
case 'm':
perm=strtol(optarg,&pEnd,8);
printf("%s\n",pEnd);
break;
case 'p':
if(rmdir(dirname)<0){
fprintf(stderr, "don't manage to delete folder!\n");return -1;
}
break;
case 'v':
if(mkdir(dirname,perm)<0){
fprintf(stderr, "mkdir: cannot create directory `%s`: file exists\n",dirname);return -1;
} else {
printf("mkdir: created directory `%s`\n",dirname);
return 0;
}
break;
case 'c':
break;
case 'h':
printf("Usage: mkdir [OPTION]... DIRECTORY...\n");
printf("Create the DIRECTORY(ies), if they do not already exist.\n");
printf("\n");
printf("Mandatory arguments to long options are mandatory for short options too.\n");
printf(" -m, --mode=MODE set file mode (as in chmod), not a=rwx - umask\n");
printf(" -p, --parents no error if existing, make parent directories as needed\n");
printf(" -v, --verbose print a message for each created directory\n");
printf(" -Z, --context=CTX set the SELinux security context of each created\n");
printf(" directory to CTX\n");
printf(" --help display this help and exit\n");
printf(" --version output version information and exit\n");
printf("\tAuthor AliceGoth\n");
return 0;
break;
case 'r':
printf("\tMy own mkdir\n");
printf("\tVersion 1.0\n");
printf("\tAuthor AliceGoth\n");
printf("\tEmail [email protected]\n");
break;
case 1:
Мой mkdir
+126
#include "uni.h"
#include "xreadlink.h"
int process(char *dir);
char *cd;
char *scd;
struct stat st1;
ino_t cino;
dev_t cdev;
int main(){
cd = (char *)malloc(160+1);
if(cd==NULL){
perror("Not enough memory");
return -1;
}
scd = (char *)malloc(1600+1);
if(scd==NULL){
perror("Not enough memory");
return -1;
}
memset(cd,'\0',1601);
memset(scd,'\0',1601);
strcat(scd,".");
if(lstat(scd,&st1)==-1){
perror("stat");
exit(EXIT_FAILURE);
};
cino = st1.st_ino;
cdev = st1.st_rdev;
//printf("inode %lu cdev %llu\n",cino,cdev);
process(scd);
return 0;
};
int process(char *dir){
DIR *dp;
struct dirent *ent;
ino_t lino;
dev_t ldev;
ino_t lino2;
dev_t ldev2;
int cnt=0;
char *mydir=(char*)malloc(1600);
char *mydir2=(char*)malloc(1600);
char **fpwd=(char**)malloc(160);
for(int i=0;i<=160;i++){
*(fpwd+i)=(char*)malloc(1600);
if(*(fpwd+i)==NULL){perror("Not sufficient memory");
return -1;
}
}
if(mydir==NULL)return -1;
if(*fpwd==NULL)return -1;
strcpy(mydir,dir);
strcpy(mydir2,dir);
struct stat lstt;
struct stat lstt2;
struct stat stt;
while(lino!=lino2 || ldev!=ldev2){
if(lstat(mydir,&lstt)==-1){
perror("not sufficient memory");
return -1;
}
strcat(mydir2,"/..");
if(lstat(mydir2,&lstt2)==-1){
perror("not sufficient memory");
return -1;
}
//printf("yes\n");
lino=lstt.st_ino;
ldev=lstt.st_rdev;
lino2=lstt2.st_ino;
ldev2=lstt2.st_rdev;
if ((dp = opendir(mydir2)) == NULL) {
fprintf(stderr, "%s: cannot open for reading: %s\n", dir, strerror(errno));
return 1;
}
if(lstat(mydir2,&stt)==-1){
perror("not sufficient memory");
return -1;
}
//if(chdir("/")<0){perror("chdir");return -1;};
while ((ent = readdir(dp)) != NULL){
if(ent->d_ino==lino && strcmp(ent->d_name,".")!=0 && strcmp(ent->d_name,"..")!=0 && stt.st_rdev==ldev){
//printf("%8ld %s\n", ent->d_ino, ent->d_name);
strcat(fpwd[cnt++],ent->d_name);
}
}
if (closedir(dp) != 0) {
fprintf(stderr, "%s: closedir: %s\n", dir, strerror(errno));
return 1;
}
//printf("mydir %s inode %lu cdev %llu inode %lu cdev %llu\n",mydir,lino,ldev,lino2,ldev2);
strcat(mydir,"/..");
strcpy(mydir2,mydir);
}
Поиск текущего каталога в дереве каталогов.
+133
if ((textBox1.Text == textBox2.Text) | (textBox1.Text == textBox3.Text) | (textBox1.Text == textBox4.Text) | (textBox1.Text == textBox7.Text) |
(textBox2.Text == textBox1.Text) | (textBox2.Text == textBox3.Text) | (textBox2.Text == textBox5.Text) | (textBox2.Text == textBox8.Text) |
(textBox3.Text == textBox1.Text) | (textBox3.Text == textBox2.Text) | (textBox3.Text == textBox6.Text) | (textBox3.Text == textBox9.Text) |
(textBox4.Text == textBox5.Text) | (textBox4.Text == textBox6.Text) | (textBox4.Text == textBox1.Text) | (textBox4.Text == textBox7.Text) |
(textBox5.Text == textBox4.Text) | (textBox5.Text == textBox6.Text) | (textBox5.Text == textBox2.Text) | (textBox5.Text == textBox8.Text) |
(textBox6.Text == textBox4.Text) | (textBox6.Text == textBox5.Text) | (textBox6.Text == textBox3.Text) | (textBox6.Text == textBox9.Text) |
(textBox7.Text == textBox8.Text) | (textBox7.Text == textBox9.Text) | (textBox7.Text == textBox1.Text) | (textBox7.Text == textBox4.Text) |
(textBox8.Text == textBox7.Text) | (textBox8.Text == textBox9.Text) | (textBox8.Text == textBox2.Text) | (textBox8.Text == textBox5.Text) |
(textBox9.Text == textBox7.Text) | (textBox9.Text == textBox8.Text) | (textBox9.Text == textBox3.Text) | (textBox9.Text == textBox6.Text)) ;
else
}
label1.Visible = true;
label2.Visible = true;
}
Это эпик.
+61
function myrnd(){
$rnd1=rand(48,57);
$rnd2=rand(65,90);
$rnd3=rand(97,122);
$rnd4=rand(1,3);
$rnd5="rnd".$rnd4;
return $$rnd5;
}
function createReffererLink(){
$refferer="";
for($i=0;$i<12;$i++){
$refferer.=chr($this->myrnd());
}
return $refferer;
}
Нашел в своей старой партнерской программе. Угадайте, что делает этот код? ( генерирует реферальную ссылку )
+141
<?php
$sub = $_POST['sub'];
if ($sub == "Поменять"){
$player1 = $_POST['player1'];
$player2 = $_POST['player2'];
// количество дней
$days = "";
$fl = "sys/days.cou";
$fp = fopen($fl,"r");
while(!feof($fp)){
$days .= fgets($fp,2);
}
fclose($fp);
// РАБОТА С ИМЕНАМИ
// считываю имя первого pl1 - саша
$name1 = "";
$fl = "db/player".$player1.".nm";
$fp = fopen($fl,"r");
while(!feof($fp)){
$name1 .= fgets($fp,2);
}
fclose($fp);
// новый файл pl2_ саша
$fl = "db/player".$player2.".nm_";
$fp = fopen($fl,"w+");
$fw = fwrite($fp,$name1);
fclose($fp);
// считываю имя второго pl2 маша
$name2 = "";
$fl = "db/player".$player2.".nm";
$fp = fopen($fl,"r");
while(!feof($fp)){
$name2 .= fgets($fp,2);
}
fclose($fp);
// новый файл pl1 маша
$fl = "db/player".$player1.".nm";
$fp = fopen($fl,"w+");
$fw = fwrite($fp,$name2);
fclose($fp);
// новый файл pl2 саша
$fl = "db/player".$player2.".nm";
$fp = fopen($fl,"w+");
$fw = fwrite($fp,$name1);
fclose($fp);
// удаляю pl2_ саша
unlink("db/player".$player2.".nm_");
// появляются файлы pl1 маша и pl2 саша
// ТЕПЕРЬ РАБОТА С РЕЗУЛЬТАТАМИ
for ($i=1; $i<=$days; $i++){
// считываю если есть резы pl1
$fl = "db/p".$player1."d".$i.".mon";
if (file_exists($fl)){
$rez = "";
$fp = fopen($fl,"r");
while(!feof($fp)){
$rez .= fgets($fp,2);
}
fclose($fp);
$fl = "db/p".$player2."d".$i.".mon_";
$fp = fopen($fl, "w+");
$fw = fwrite($fp, $rez);
fclose($fp);
}
// считываю, если есть резы pl2
$fl = "db/p".$player2."d".$i.".mon";
if (file_exists($fl)){
$rez = "";
$fp = fopen($fl,"r");
while(!feof($fp)){
$rez .= fgets($fp,2);
}
fclose($fp);
Вот, выдавил из себя говнокод, который меняет местами игроков в таблице. Имена записаны в файлы player1.nm, player2.nm и т.д.
Результаты определенных дней записаны по такой структуре:
1) Есть дата 1.07.2012, она записана в файл day2.day (вообщем, в файл с номером по порядку: day1.day, day2.day и т.д.)
2) Если игрок player1.nm играл в день 2, на который установлена дата 1.07.2012, то к нему создается файл p1d2.mon, в который записывается его результат.
3) Потом просто считываются каждый из файлов p[PLAYER]d[DAY].mon и создается таблица.
Вот сам сайт: http://pokerstat.16mb.com/
+52
define(ADS_ACTIVE_TIME, '+1 month');
$active = date('d.m.Y H:i:s', strtotime(ADS_ACTIVE_TIME, strtotime(date('d.m.Y H:i:s'))));
Коммерческий проект. Про time() мы не слышали, похоже...
+26
input >> heap;
while( heap[0] == '0' ) heap.erase( 0, 1 );
heaps.push_back( heap );
input >> heap;
while( heap[0] == '0' ) heap.erase( 0, 1 );
heaps.push_back( heap );
input >> heap;
while( heap[0] == '0' ) heap.erase( 0, 1 );
heaps.push_back( heap );
+21
template <typename T>
void sort( T array[], size_t length ) {
size_t left_index = 0;
size_t right_index = length - 1;
while ( left_index < right_index ) {
size_t min_index = min( array, left_index, right_index );
swap( array, min_index, left_index );
size_t max_index = max( array, left_index, right_index );
swap( array, max_index, right_index );
left_index++;
right_index--;
}
}
−125
if ($f_ISSUE_DATE !~ /^\d\d.\d\d.\d\d\d\d/ && $f_ISSUE_DATE){
$e_ISSUE_DATE = 'Дата выдачи паспорта вводится в формате "ДД.ММ.ГГГГ"';
$errorCounter ++;
}
if ($f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(ул\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(бул\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(наб\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(пер\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(пл\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(пр\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(просп\.)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*(шоссе)\s*(.*)$/ &&
$f_ADDRESS_OF_SVC_SHOP !~ /^(\w+)\s+(.+?),\s*()\s*(.*)$/) {
$e_ADDRESS_OF_SVC_SHOP = 'Неправильный формат фактического адреса';
$errorCounter ++;
}
Ебаный стыд!!!
скопипасчено из попавшегося куска "исподников", идет прям подряд.
Уж даже и не знаю - что больший пиздец - первая часть или вторая.
PS. Для тех кто вел себя хорого - конфетка!
ВЕСЬ, БЛЯДЬ, проект постоен без единого гвозьдя!!! НИ ОДИН объект не пострадал!!!