- 1
$col=array('red','blue','green','black','yellow','magenta','blue','gray','red','blue','green','black','yellow','blue','gray','red','blue','green','black','yellow','blue','gray');
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+158.8
$col=array('red','blue','green','black','yellow','magenta','blue','gray','red','blue','green','black','yellow','blue','gray','red','blue','green','black','yellow','blue','gray');
А какие ты знаешь цвета?
+154
/**
* public static final int ARRAY 2003 public static final int BIGINT -5
* public static final int BINARY -2 public static final int BIT -7 public
* static final int BLOB 2004 public static final int BOOLEAN 16 public
* static final int CHAR 1 public static final int CLOB 2005 public static
* final int DATALINK 70 public static final int DATE 91 public static final
* int DECIMAL 3 public static final int DISTINCT 2001 public static final
* int DOUBLE 8 public static final int FLOAT 6 public static final int
* INTEGER 4 public static final int JAVA_OBJECT 2000 public static final
* int LONGVARBINARY -4 public static final int LONGVARCHAR -1 public static
* final int NULL 0 public static final int NUMERIC 2 public static final
* int OTHER 1111 public static final int REAL 7 public static final int REF
* 2006 public static final int SMALLINT 5 public static final int STRUCT
* 2002 public static final int TIME 92 public static final int TIMESTAMP 93
* public static final int TINYINT -6 public static final int VARBINARY -3
* public static final int VARCHAR 12
*/
public Class getColumnClass(int column) {
...
}
+150
private int style;
public int Style
{
get
{
return style;
}
{
Style = value;
}
}
Вечный двигатель!
+148
<?php
class db {
function db_conn ($host,$user,$pass,$db) {
if((!$this->link = @mysqli_connect($host,$user,$pass)))
{
echo "<font color=\"red\">Error:</font> connect to host: $host";
exit();
}
if(!mysqli_select_db($this->link,$db))
{
echo "<font color=\"red\">Error:</font> select database $db";
exit();
}
}
function sql_query ($query) {
$this->link = mysqli_query($this->link, $query);
if (!$this->link)
{
$this->error_msg = mysqli_error ($this->link);
return $this->error_msg;
}
return $this->link;
}
function sql_fetch_assoc ($query) {
$res=$this->sql_query($query);
$array = array();
$row = mysqli_fetch_array($res);
/*{
$array[]=$cur;
}*/
mysqli_free_result($res);
return $row;
}
}
?>
+141
if((5<a).toString() == "true")
{
ля-ля
}
+139.8
unction int2hex($intega){
$Ziffer = "0123456789ABCDEF";
return $Ziffer[($intega%256)/16].$Ziffer[$intega%16];
}
function url_encode($text){
$text = urlencode($text);
if(!strpos($text,"%C3"))
for($i=129;$i<255;$i++){
$in = "%".int2hex($i);
$out = "%C3%".int2hex($i-64);
$text = str_replace($in,$out,$text);
}
return $text;
}
function tounicode ($string){
$unistring="";
for($i=0;$i<strlen($string);$i++){
$current=$string[$i];
$codcurrent=ord($current);
if($codcurrent>255):
$unicurrent=utf8_encode($current);
$unistring=$unistring.$unicurrent;
elseif($codcurrent<192):
if($codcurrent==184):
$unicurrent=chr(209).chr($codcurrent-39);
$unistring=$unistring.$unicurrent;
elseif($codcurrent==168):
$unicurrent=chr(208).chr($codcurrent-39);
$unistring=$unistring.$unicurrent;
elseif($codcurrent==147):
$unicurrent=utf8_encode("\"");
$unistring=$unistring.$unicurrent;
elseif($codcurrent==148):
$unicurrent=utf8_encode("\"");
$unistring=$unistring.$unicurrent;
elseif($codcurrent==151):
$unicurrent=utf8_encode("-");
$unistring=$unistring.$unicurrent;
else:
$unicurrent=utf8_encode($current);
$unistring=$unistring.$unicurrent;
endif;
else:
if ($codcurrent<240):
$unicurrent=chr(208).chr($codcurrent-48);
$unistring=$unistring.$unicurrent;
else:
$unicurrent=chr(209).chr($codcurrent-112);
$unistring=$unistring.$unicurrent;
endif;
endif;
}
return $unistring;
}
+150.7
function login() {
// Optional: Show a waiting message in the layer with ID ajax_response
var img_load="<img src=images/wait.gif alt=\"error\" width=\"100\" height=\"100\" /> ";
document.getElementById('login_response').innerHTML = img_load;
// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
var email = encodeURI(document.getElementById('emailLogin').value);
var psw = encodeURI(document.getElementById('pswLogin').value);
//var rem = encodeURI(document.getElementById('chkrem').value);
var rem = document.getElementById('chkrem').checked;
if(document.getElementById('chkrem').checked==true)
{
rem=1;
}
else
if(document.getElementById('chkrem').checked==false)
{
rem=0;
}
else
{
rem=0;
}
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
var act;
act='login.php?email='+email+'&psw='+psw+'&remchk='+rem+'&nocache='+nocache;
//alert(act);
http.open('get', 'login.php?email='+email+'&psw='+psw+'&remchk='+rem+'&nocache='+nocache);
http.onreadystatechange = loginReply;
http.send(null);
}
Взято с одного непонятно кем разработанного зарубежного сайта, который (судя по забагованности и унылости) всё никак не может добраться до релиза.
Код интересен двумя пассажами: строки 13-25 и 33-35
+143.5
if (isset($_COOKIE['wrboardname'])) {
$wrboardname=$_COOKIE['wrboardname'];
}
// если в куках есть wrboardname, то забиваем данные куков в переменные, иначе выводим форму для входа
if (isset($wrboardname)) {
print "<td align=right style='FONT-SIZE: 11px' width=100%><a href='tools.php?event=profile&pname=$wrboardname'>Ваш Профиль</a> <a href='tools.php?event=clearcooke'>Выход [$wrboardname]</a>";
}
Показан прекрасный метод, как нужно юзать куки))(wr-board 1.1)
+148
IAssignment assignment = serviceCall.getAssignment();
assignment.setAssWorkgroup(object);
assignment.transfer();
Кусок кода с использованием API HP ServiceDesk
+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
Нашёл у нас в проекте. Видимо, это юмор такой.