- 1
- 2
- 3
int a;
if(a=5)
doSomthing();
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144.6
int a;
if(a=5)
doSomthing();
Боян, но первая ошибка всех новичков. Долго искал ошибку...
+154
<?php
$dPh = fopen("photos.cfg", "r");
while (($aCrow = fgetcsv($dPh, 0, "|", "}")) !== FALSE){
$sNof = explode(".", $aCrow[0]);
echo "<a href='photo/_html/show.php?ph=$sNof[0]'>\n";
echo "\t<img src='photo/_thumbs/$aCrow[0]' alt='$aCrow[1]'>\n";
echo "</a>\n";
}
?>
Скрипт, который создаёт превьюшки со ссылками для фотогаллереи.
photos.cfg - содержит строки вида: Имя_файла.jpg|Описание, которое видит пользователь.
show.php - отдельная тема.
+69.9
public void ejbPassivate() throws EJBException, RemoteException {
return;
}
Истинный китайский девелопер никогда не доверяет компилятору! Ато если ж в функции тело пустое, мало ли, вдруг она никогда не возвратиться. Какой выход? Написать об ентом явно.
+155
public function throwExceptions($flag = null)
{
if ($flag !== null) {
$this->_throwExceptions = (bool) $flag;
return $this;
}
return $this->_throwExceptions;
}
Зенд
+143.5
hideVoting = (disabled || getVisitor().isAnonymous()) ? true : false;
+13
class A
{
public:
A& operator=(const A &a)
{
this->A::A(a);
return *this;
};
// ...
};
Правильный оператор присваивания!
+154
Html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<head>
<title>I LOVE ZEND FRAMEWORK!</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="/zend/public/design/css/style.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/zend/public/design/css/style.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/zend/public/design/css/teststyle.css" media="screen" rel="stylesheet" type="text/css" /></head>
<body>
PHP:
<?php echo $this->doctype(Zend_View_Helper_Doctype::XHTML1_TRANSITIONAL); ?>
<html>
<head>
<?php echo $this->headTitle('I LOVE ZEND FRAMEWORK!'); ?>
<?php echo $this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8'); ?>
<?php echo $this->headLink()->appendStylesheet($this->baseUrl . 'design/css/style.css'); ?>
<?php echo $this->headLink()->appendStylesheet($this->baseUrl . 'design/css/teststyle.css'); ?>
</head>
+144.1
$query = "SELECT `parent_id` FROM `items` WHERE `id`='".$_GET['id']."'";
$result = mysql_query($query);
$result = mysql_fetch_assoc($result);
$parent_id = $result[0]['parent_id']
$query = "SELECT `id` FROM `catalog` WHERE `id`='".$parent_id."'";
$result = mysql_query($query);
$result = mysql_fetch_assoc($result);
$catalog_id = $result[0]['id']
Кто-нибудь мне объяснит нахрена здесь второй цикл?
−316.8
If CLng(Text1.Text)<400 and CLng(Text1.Text)>400 then
Text3.Text="17"
End if
и почему условие не проходит?
−107.4
w := ord(CHar(Pbyte(Pointer(Integer(IN_BUFFER)+ inpos))^));
s := ord(Char(Pbyte(Pointer(Integer(IN_BUFFER)+ inpos + 1))^));
PByte(Pointer(Integer(out_buf)+ outpos))^ := w and 255; {?????? ?? ?????? ??????}
PByte(Pointer(Integer(out_buf)+ outpos + 1))^ := w shr 8;
PByte(Pointer(Integer(out_buf)+ outpos))^ := PByte(Pointer(Integer(out_buf)+ outpos))^ or ((W and 15) shl 4);
доступ к указателям как к массивам