- 1
- 2
- 3
- 4
- 5
int Cparse_post::is_hex(char c)
{
if (strchr("0123456789abcdefABCDEF",c)!=NULL) return 1;
return 0;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+73.1
int Cparse_post::is_hex(char c)
{
if (strchr("0123456789abcdefABCDEF",c)!=NULL) return 1;
return 0;
}
+138.9
[DataContract]
public class MyDataContract {
string lASTNAME = "";
string nAMESUFFIX = "";
string mIDDLENAME = "";
string fIRSTNAME = "";
[DataMember]
public string LASTNAME {
get { return lASTNAME; }
set { lASTNAME = value; }
}
[DataMember]
public string FIRSTNAME {
get { return fIRSTNAME; }
set { fIRSTNAME = value; }
}
[DataMember]
public string MIDDLENAME {
get { return mIDDLENAME; }
set { mIDDLENAME = value; }
}
[DataMember]
public string NAMESUFFIX {
get { return nAMESUFFIX; }
set { nAMESUFFIX = value; }
}
}
Акуенная конвенция именования переменных
+13
class A
{
public:
A& operator=(const A &a)
{
this->A::A(a);
return *this;
};
// ...
};
Правильный оператор присваивания!
−276.9
Private Function GetDirection(ByVal sort As String)
If sort.IndexOf("DESC") > 0 Then
sort = sort.Replace("DESC", "ASC")
Else
sort = sort & " DESC "
End If
Return ""
End Function
Даже придумывать ничего не пришлось.
+125
# /* [ <!-- */ include <stdio.h> /* \
#{\
`""""true \\#{"\n#"}; \
\
if [ -n "$ZSH_VERSION" ]; then \
\
echo exec echo I\'m a zsh script.; \
\
elif [ -n "$BASH_VERSION" ]; then \
\
echo exec echo I\'m a bash script.; \
else \
echo exec echo I\'m a sh script.; \
fi`; #\
BEGIN{print"I'm a ", 0 ? "Ruby" :"Perl", " program.\n"; exit; }
#\
%q~
set dummy =0; puts [list "I'm" "a" "tcl" "script."]; exit
all: ; @echo "I'm a Makefile." \
#*/
/*: */ enum {a, b}; \
\
static int c99(void) {
#ifndef __cplusplus /* bah */
unused1: if ((enum {b, a})0) \
(void)0;
#endif
unused2: return a; \
} \
static int trigraphs(void) { \
\
return sizeof "??!" == 2; \
} \
char X; \
\
int main(void) { \
\
struct X { \
\
char a[2]; \
};\
if (sizeof(X) != 1) { \
\
printf("I'm a C++ program (trigraphs %sabled).\n", \
\
trigraphs() ? "en" : "dis");\
\
}else if (1//**/2
)unused3 : { ; \
printf("I'm a C program (C%s, trigraphs %sabled).\n", \
c99() ? "89 with // comments" : "99", \
trigraphs() ? "en" : "dis"); \
} else { \
printf("I'm a C program (C89, trigraphs %sabled).\n", \
trigraphs() ? "en" : "dis"); \
} \
return 0; \
} /*
# \
> main :: IO () -- -- \
> main = putStr "I'm a Literate Haskell program.\n"
# \
]>++++++++[<+++++++++>-]<+.>>++++[<++++++++++>-]<-.[-]>++++++++++ \
[<+++++++++++>-]<-.>>++++[<++++++++>-]<.>>++++++++++[<++++++++++> \
-]<- - -.<.>+.->>++++++++++[<+++++++++++>-]<++++.<.>>>++++++++++[ \
<++++++++++>-]<+++++.<<<<+.->>>>- - -.<+++.- - -<++.- ->>>>>+++++ \
+++++[<+++++++++++>-]<- - -.<<<<<.<+++.>>>.<<<-.- ->>>>+.<.<.<<.> \
++++++++++++++.[-]++++++++++"""`
# \
print "I'm a Python program."; """[-][--><html><head>
<!--:--><title>I'm a HTML page</title></head><body>
<!--:--><h1>I'm a <marquee><blink>horrible HTML</blink></marquee> page</h1>
<!--:--><script language="Javascript">
<!--: # \
setTimeout( // \
function () { // \
document.body.innerHTML = "<h1>I'm a javascript-generated HTML page</h1>"; // \
}, 10000); // \
//-->
</script><!--: \
</body></html><!-- } # \
say "I'm a Perl6 program", try { " ($?PUGS_VERSION)" } // "", "."; # """ # */
#define FOO ]-->~
Программа-полиморф hello world на 15 языках. Работает в C, C++, Haskell, Ruby, Python, Perl(x2), HTML, tcl, bash, zsh, make, bash и brainfuck.
+140.1
Object[] tass = UC.getUserTaskList(off);
int i=0;
for (i=0; i<tass.length; i++)
{
Xu.data.UserTask ts = (Xu.data.UserTask)tass[i];
out.println("<br />"+UC.getById(new Integer (ts.getId()).intValue()).getTaskName());
}
//Получаем массив Object[], приводим к UserTask[], создаем новую UserTask по id
// созданной из массива UserTask[], чтобы вывести на свойства. Но говнокод работает.
Как ни печально, но это написал я. Ночью башка не варит. Вы себе представляете алгоритм, рождающий UserTask?:))))
+77
6432168468453
вы все говнокоды
+142
#define FNT_LARGE FONT_QCSANS18
#define FNT_LARGE_BOLD FONT_QCSANS18
#define FNT_X_LARGE FONT_QCSANS18
#define FNT_X_LARGE_BOLD FONT_QCSANS18
#define FNT_XX_LARGE FONT_QCSANS18
#define FNT_XX_LARGE_BOLD FONT_QCSANS18
Нашёл у нас в проекте. Видимо, это юмор такой.
+60.3
function fromunicode($string,$lang){
if ($lang=="fr"):
return utf8_decode($string);
elseif($lang=="rus"):
$tempchar1=chr(208);
$string=ereg_replace( "Рђ" , "А" , $string);
$tempchar2=chr(145);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar , "Б" , $string);
$tempchar2=chr( 146);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar, "В" , $string);
$tempchar2=chr( 147);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar ,"Г" , $string);
$tempchar2=chr( 148);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar, "Д" , $string);
$string=ereg_replace( "Р•" , "Е" , $string);
$string=ereg_replace( "РЃ" ,"Ё" , $string);
$string=ereg_replace( "Р–" , "Ж" , $string);
$string=ereg_replace( "Р—" , "З" , $string);
$string=ereg_replace( "Р?" , "И" , $string);
$string=ereg_replace( "Р™" , "Й" , $string);
$string=ereg_replace( "Рљ" , "К" , $string);
$string=ereg_replace( "Р›" , "Л" , $string);
$string=ereg_replace( "Рњ" , "М" , $string);
$string=ereg_replace( "Рќ" , "Н" , $string);
$string=ereg_replace( "Рћ" , "О" , $string);
$string=ereg_replace( "Рџ" , "П" , $string);
//$string=ereg_replace( "Р" , "Р " , $string);
//$string=ereg_replace( "С" , "РЎ" , $string);
$string=ereg_replace( "Рў" , "Т" , $string);
$string=ereg_replace( "РЈ" , "У" , $string);
$string=ereg_replace( "Р¤" , "Ф" , $string);
$string=ereg_replace("РҐ" , "Х" , $string);
$string=ereg_replace( "Р¦" , "Ц" , $string);
$string=ereg_replace( "Р§" , "Ч" , $string);
$string=ereg_replace( "РЁ" , "Ш" , $string);
$string=ereg_replace( "Р©" , "Щ" , $string);
$string=ereg_replace( "Р¬" , "Ь" , $string);
$tempchar2=chr( 170);
$tempchar=$tempchar1.$tempchar2;
$string=ereg_replace( $tempchar,"Ъ" , $string);
//echo "tempmygk=$tempchar";
$tempchar2=chr( 171);
$tempchar=$tempchar1.$tempchar2;
// $string=ereg_replace( $tempchar3,$tempchar, $string);
$string=ereg_replace( $tempchar,"Ы" , $string);
//echo "tempy=$tempchar";
$string=ereg_replace("Р" , "Э" , $string);
$string=ereg_replace( "Р®" , "Ю" , $string);
$string=ereg_replace( "РЇ" , "Я" , $string);
// small
$string=ereg_replace( "Р°" ,"а" , $string);
$string=ereg_replace( "Р±" ,"б" , $string);
$string=ereg_replace( "РІ" ,"в" , $string);
$string=ereg_replace( "Рі" ,"г" , $string);
$string=ereg_replace( "Рґ" , "д" , $string);
$string=ereg_replace( "Рµ" ,"е" , $string);
$string=ereg_replace( "Рµ" ,"ё" , $string);
// $string=ereg_replace( "С'" , "ё" , $string);
$string=ereg_replace( "Р¶" , "ж" , $string);
$string=ereg_replace( "Р·" , "з" , $string);
$string=ereg_replace( "Рё" ,"и" , $string);
$string=ereg_replace( "Р№" ,"й" , $string);
$string=ereg_replace("Рє" , "к" , $string);
$string=ereg_replace( "Р»" , "л" , $string);
$string=ereg_replace( "Рј" , "м" , $string);
$string=ereg_replace( "РЅ" , "н" , $string);
$string=ereg_replace( "Рѕ" , "о" , $string);
$string=ereg_replace("Рї" , "п" , $string);
$string=ereg_replace("СЂ" , "р" , $string);
$string=ereg_replace("СЃ" , "с" , $string);
$string=ereg_replace( "С‚" , "т" , $string);
$string=ereg_replace( "Сѓ" , "у" , $string);
$string=ereg_replace( "С„" , "ф" , $string);
$string=ereg_replace( "С…" , "х" , $string);
$string=ereg_replace( "С†" , "ц" , $string);
$string=ereg_replace( "С‡" , "ч" , $string);
$string=ereg_replace( "С?" , "ш" , $string);
$string=ereg_replace( "С‰" , "щ" , $string);
$string=ereg_replace( "СЊ" ,"ь" , $string);
$string=ereg_replace( "С‹" , "ы" , $string);
$string=ereg_replace( "СЉ" , "ъ" , $string);
$string=ereg_replace( "СЌ" , "э" , $string);
$string=ereg_replace( "СЋ" , "ю" , $string);
$string=ereg_replace("СЏ" , "я" , $string);
$string=ereg_replace("Р " , "Р" , $string);
+137
DBEdit.DataField:='';
b:=0;
Bookmark:=ADOQuery.GetBookmark;
try
if FLDFND.Text<>'' then
begin
if b=0 then
begin
try
v:=ADOQuery.Fields[DBGrid.SelectedIndex].AsFloat;
b:=1;
except
end;
end;
if b=0 then
begin
try
v:=ADOQuery.Fields[DBGrid.SelectedIndex].AsString;
b:=2;
except
end;
end;
if b=0 then
begin
try
v:=ADOQuery.Fields[DBGrid.SelectedIndex].AsInteger;
b:=3;
except
end;
end;
if b=0 then
begin
try
v:=ADOQuery.Fields[DBGrid.SelectedIndex].AsDateTime;
b:=4;
except
end;
end;
Определял тип поля. Писал в пъяном бреду, ночью...