- 1
- 2
- 3
if (empty($author) or empty ($text)) {
exit ("<p>Оппа, нежданчик!<br> <input name='back' type='button' value='Вернуться назад' onclick='javascript:self.back();'>");
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+160
if (empty($author) or empty ($text)) {
exit ("<p>Оппа, нежданчик!<br> <input name='back' type='button' value='Вернуться назад' onclick='javascript:self.back();'>");
}
...внезапно! (sic!)
Источник: комментарии на ruseller.com
+82
//i dont know full description of this errors. i just copied it from official specification :)
String[] eType = new String[] {
"Pending communication transaction in progress (0x20)",
"Specified mailbox queue is empty (0x40)",
"Request failed (i.e. specified file not found) (0xBD)",
"Unknown command opcode (0xBE)",
"Insane packet (0xBF)",
"Data contains out-of-range values (0xC0)",
"Communication bus error (0xDD)",
"No free memory in communication buffer (0xDE)",
"Specified channel/connection is not valid (0xDF)",
"Specified channel/connection not configured or busy (0xE0)",
"No active program (0xEC)",
"Illegal size specified (0xED)",
"Illegal mailbox queue ID specified (0xEE)",
"Attempted to access invalid field of a structure (0xEF)",
"Bad input or output specified (0xF0)"
};
перевод: Я не знаю, что все эти ошибки означают. Я просто скопировал это из оффициальной документации.
всясуть жаба-кодеров.
+167
bool dicLoaded_ = false;
....
dicLoaded_ = dicLoaded_?false:true;
Еще один перл из кандидатских заданий. Любителям тернарных операторов посвящается.
−84
Macro BL(X):For I=0 To 3:X:Next:EndMacro:Dim G(14,28):Dim G2(14,28):Dim C(1)
Macro IT:X+PX(PC,I,Rt),Y+PY(PC,I,Rt):EndMacro:Dim PX(6,3,3):Dim PY(6,3,3)
Macro F(X,Y):For X=0 To Y:EndMacro:Macro N:Next:EndMacro:Macro Q:EndIf:EndMacro
F(I,28):G(1,I)=1:G(13,I)=1:G(I%13,27)=1:N:F(Pe,6):eC=0:F(Eg,1):F(PL,3)
If Val("$"+Mid("33F06336747172",2*Pe+1+Eg,1))&(1<<PL):F(Ag,3):Y=1-PL:A=1.57*Ag;
C=Cos(A):S=Sin(A):PX(Pe,eC,Ag)=C*Eg-S*Y:PY(Pe,eC,Ag)=S*Eg+C*Y:N:eC+1:Q:N:N:N
Macro K0:AddKeyboardShortcut:EndMacro:OpenWindow(0,0,0,208,432,"",$CF0001)
K0(0,37,10):K0(0,40,32):K0(0,39,12):K0(0,38,16):X=7:Y=2:D=1000:C(0)=$FFFFFF
C(1)=$1:Ok=1:Repeat:Delay(1):Et=WindowEvent():StartDrawing(WindowOutput(0))
F(A,28):F(B,14):Box(B*16-16,(A-1)*16,16,16,C(G(B,A)|G2(B,A))):N:N:StopDrawing()
If Ok:BL(G2(IT)=0):MN=0:If Et=13101:MN=EventMenu():If MN=32:CH!1:Q:Q
EL=ElapsedMilliseconds():If EL>T Or CH:T=EL+D:Y+1:Q:CA=0:F(I,3):If G(IT):CA=1:Q
N:If CA:Y-1:CH=0:MN=0:BL(G(IT)=1):X=7:Y=2:SC+1:If D>100:D-10:Q:DY=0
For Y3=26 To 0 Step -1:CM=1:For X3=1 To 12:If G(X3,Y3)=0:CM=0:Q
G(X3,Y3+DY)=G(X3,Y3):N:If CM:DY+1:Q:If Y3-DY<=0:Break:Q:N:SC+(DY*(DY+1))
SetWindowTitle(0,Str(SC)):PC=Random(6):Rt=Random(3):Ok=1:F(I,3):If G(IT):Ok=0:Q
N:Else:BL(G2(IT)=1):Q:BL(G2(IT)=0):NS=0:If MN&8:NS=MN-11:Q:If NS:X+NS:Q:C0=0
F(I,3):If G(IT):C0=1:Q:N:If C0:X-NS:Q:If MN&16:Rt+1:Rt&3:Q:C3=0:F(I,3):If G(IT)
C3=1:Q:N:If C3:Rt-1:Rt&3:Q:BL(G2(IT)=1):Q:Until Et=16
Тетрис на PureBasic
+159
echo "<tr><td></td><td><small><font color=red>$sum0</font>/<font color=blue>$sum00</font></small></td>
<td> </td><td align=center><strong><!--$duse,--> $sum1</strong></td><td align=right><strong>".str_replace(".",",",c_mon($sum2))."</strong></td><td align=right><strong>".str_replace(".",",",c_mon($sum3))."</strong></td>\n
<td align=right><strong>".str_replace (".", ",", $sum4)."</strong></td>
<td align=right><strong>".str_replace (".", ",", sprintf("%01.2f",$straf/1024/1024))."</strong></td>
<td align=right><strong>".str_replace(".",",",c_mon($sum_pl))."</strong></td>
<td align=right nowrap><strong id=red>".str_replace(".",",",c_mon($sum_mn))."</strong></td>
<td> </td>
<td align=right><strong>".str_replace (".", ",", $sum5)."</strong></td>
<td> </td></tr>";
Точки и запятые в числах
+164
foreach($listuserson as $uinfo => $pinfo) {
$class_check = TRUE;
list($oid, $oname) = explode(".", $uinfo, 2);
$sql2 = new db;
$sql2->db_Select("user", "user_id", "user_admin > 0 ");
$row_2 = $sql2->db_Fetch();
$online_location = $pinfo;
$online_location_page = substr(strrchr($online_location, "/"), 1);
if (!strstr($online_location, "forum_") || !strstr($online_location, "content.php") || !strstr($online_location, "comment.php")) {
$online_location_page = str_replace(".php", "", substr(strrchr($online_location, "/"), 1));
}
if ($online_location_page == "log" || $online_location_page == "error") {
$online_location = "news.php";
$online_location_page = NEWS;
}
if ($online_location_page == "request") {
$online_location = "download.php";
}
if ($online_location_page == "article") {
$online_location_page = ARTICLEPAGE;
}
if ($online_location_page == "chat") {
$online_location_page = CHAT;
}
//if($online_location_page == "comment"){$online_location_page = COMMENT;}
if ($online_location_page == "content") {
$online_location_page = CONTENT;
}
if ($online_location_page == "download") {
$online_location_page = DOWNLOAD;
}
if ($online_location_page == "email") {
$online_location_page = EMAIL;
}
if ($online_location_page == "forum") {
$online_location_page = FORUM;
}
if ($online_location_page == "links") {
$online_location_page = LINKS;
}
if ($online_location_page == "news") {
$online_location_page = NEWS;
}
if ($online_location_page == "oldpolls") {
$online_location_page = OLDPOLLS;
}
if ($online_location_page == "print") {
$online_location_page = PRINTPAGE;
}
if ($online_location_page == "login") {
$online_location_page = LOGIN;
}
if ($online_location_page == "search") {
$online_location_page = SEARCH;
}
if ($online_location_page == "stats") {
$online_location_page = STATS;
}
if ($online_location_page == "submitnews") {
$online_location_page = SUBMITNEWS;
}
if ($online_location_page == "upload") {
$online_location_page = UPLOAD;
}
if ($online_location_page == "user") {
$online_location_page = USERPAGE;
}
if ($online_location_page == "usersettings") {
$online_location_page = USERSETTINGS;
}
if ($online_location_page == "new") {
$online_location_page = LISTNEW;
}
if ($online_location_page == "online") {
$online_location_page = ONLINE;
}
if ($online_location_page == "userposts") {
$online_location_page = USERPOSTS;
}
if ($online_location_page == "subcontent") {
$online_location_page = SUBCONTENT;
}
if ($online_location_page == "top") {
$online_location_page = TOP;
}
//commonly used plugin pages
if ($online_location_page == "bugtracker") {
$online_location_page = BUGTRACKER;
}
if ($online_location_page == "event") {
$online_location_page = EVENT;
}
if ($online_location_page == "calendar") {
$online_location_page = CALENDAR;
}
if ($online_location_page == "faq") {
$online_location_page = FAQ;
}
if ($online_location_page == "pm") {
$online_location_page = PM;
Шарился по винту, наткнулся на архив с CMS e107, машинально зашёл в него и открыл первый попавшийся файл...
ROBUST
@
SCALABLE
+135
void init(void)
{
int i,j;
setup();
if (!fork())
_exit(execve("/bin/update",NULL,NULL));
(void) open("/dev/tty0",O_RDWR,0);
(void) dup(0);
(void) dup(0);
printf("%d buffers = %d bytes buffer space\n\r",NR_BUFFERS,
NR_BUFFERS*BLOCK_SIZE);
printf(" Ok.\n\r");
if ((i=fork())<0)
printf("Fork failed in init\r\n");
else if (!i) {
close(0);close(1);close(2);
setsid();
(void) open("/dev/tty0",O_RDWR,0);
(void) dup(0);
(void) dup(0);
_exit(execve("/bin/sh",argv,envp));
}
j=wait(&i);
printf("child %d died with code %04x\n",j,i);
sync();
_exit(0); /* NOTE! _exit, not exit() */
}
Говно, вошедшее в историю.
+132
oSqlStr[0, 12] = " '<DIV onclick=\"fShowWindow(''../ReglamSchemesDoc.aspx?code='+Cast(s1.n_pp AS VarChar(50))+''')\" align=\"center\"><img border=\"0\" src=\"../Image/sxemaRed.gif\"></DIV>'+CASE WHEN s1.s_reglament>'' THEN '<DIV onclick=\"fShowFile('''+Replace(Replace(s1.s_reglament,' ',''),';',''')\" align=\"center\"><img border=\"0\" src=\"../Image/sxema.gif\"></DIV><DIV onclick=\"fShowFile(''')+''')\" align=\"center\"><img border=\"0\" src=\"../Image/sxema.gif\"></DIV>' ELSE '' END ";
Однострочная каша из трёх языков
Взято отсюда...
http://www.aspnetmania.com/Forums/ForumMessage/336926.html
+113
public static bool DefaultSuppressVersionCheck = true; //default is false
Как пишут программисты США.
+163
$metka=0;
$reason = $form->getValue("reason");
if ($activedate < $datenow)
{
$metka++;
}
if (trim($reason) == "")
{
$metka++;
}
if ($conflict>0)
{
$metka++;
}
if ($metka == 0)
{
for ($i=0;$i<count($srid);$i++)
{
$this->changeRates($srid[$i],$rate[$i],$datenow,$activedate,$reason);
}
pageAlert::nextPageAlert("Ставки по тарифам успешно сохранены!", PAGE_ALERT_SUCCESS);
}
Вот как кодят программисты, не слышавшие про исключения и return false при ошибках