-
+53
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
public function __construct() {
$this->em = \Zend_Registry::get('em');
$this->_pid = mysql_connect(
$this->em->getConnection()->getHost(),
$this->em->getConnection()->getUsername(),
$this->em->getConnection()->getPassword());
mysql_select_db( $this->em->getConnection()->getDatabase(), $this->_pid);
}
shmaltorhbooks,
10 Сентября 2012
-
+142
- 1
- 2
- 3
- 4
- 5
- 6
/// <summary>
/// Убирает прибамбасы, такие как формат, кондишены и т.д.
/// </summary>
public virtual void ClearFutures()
{}
Да просто пиздец всему будущему при вызове метода.
grobotron,
10 Сентября 2012
-
+104
- 1
[Obsolete( "Пока не потдерживается" )]
Каких шта приставки русски язык?
grobotron,
10 Сентября 2012
-
+145
- 1
- 2
- 3
- 4
- 5
- 6
function returnFalse() {
return false;
}
function returnTrue() {
return true;
}
Из кода jQuery, по сути не совсем говнокод, так как оно потом красиво заюзано, но всё равно забавно
RedMonkey,
10 Сентября 2012
-
+29
- 1
- 2
- 3
- 4
- 5
- 6
- 7
string input;
string output;
input = "C:\\bla.txt\\"; //"Bla.txt" is the file to copy
output = "C:\\test\\"; //"Test" is the folder to copy to
system("copy input.c_str() output.c_str()")
http://cboard.cprogramming.com/cplusplus-programming/109047-help-copy-files-cplusplus.html
an0nym,
10 Сентября 2012
-
+108
- 1
- 2
- 3
- 4
if (!"12345".Contains(Model.quarter.ToString()))
{
m1 = m2 = m3 = "ошибка";
}
Немного восхитительного кода утром в понедельник.
Тип данных Model.quarter Int32. Код из шаблона Razor
CrazyMORF,
10 Сентября 2012
-
+18
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
char* GetConnectionName(){return "";}
//---
char* NetworkMgr::getErrorString(int id)
{
if(this->idValid(id))
{
return errors[id];
}
else
{
return "!!!unknown error!!!";
}
}
Из тела одного большого класса, я конечно понимаю что строки хранятся не в стеке, но всеравно.
Psionic,
10 Сентября 2012
-
+118
- 1
- 2
- 3
yoba = (flip (>>=) .) . ((filter .) . (flip . (((==) .) . flip mod)))
main = print $ yoba 3 0 [КО КО КО]
http://ideone.com/UGoYJ
result: Internal error time: 0s memory: 0 kB signal: 0
LispGovno,
09 Сентября 2012
-
+160
- 1
- 2
- 3
- 4
if(h&&c-L<0)return y^=8,G--,L;
// Toledo просрал оптимизацию на 2 байта ;)
if(h&&c<L)return y^=8,G--,L;
В общем-то этот пост не про говнокод, а про обещанную попытку привести в понятный вид шахматы,
упомянутые в http://govnokod.ru/11704.
https://github.com/bormand/nanochess
Читаем, играем, обсираемкомментируем...
bormand,
09 Сентября 2012
-
+123
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
static void Main() {
Random random = new Random();
...
int n1 = notations[random.Next(max)];
int n2 = notations[random.Next(max)]; // дублирование кода!
....
//исправлено на
int n1 = notations[random.Next(max)];
int n2 = n1;
}
vistefan,
09 Сентября 2012