- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
private int style;
public int Style
{
get
{
return style;
}
{
Style = value;
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+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
Нашёл у нас в проекте. Видимо, это юмор такой.
+146
(
define
(
lazy-reader
reader
)
(
lambda
(
port
)
(
make-lazy-list1
(
lambda
(
)
(
let
(
(
it
(
reader
port
)
)
)
(
if
(
eof-object?
it
)
'
(
)
it
)
)
)
)
)
)
Идиотское форматирование в Scheme
+95
void Mouse(int button, int state, int x, int y)
{
if ((button==GLUT_LEFT_BUTTON) && (state==GLUT_DOWN))
{
y=WIN_HEIGHT-1-y;
if (y<233)
{
if ((field[x/26][y/26]).busy)
{
begin_trace_x=x/26;
begin_trace_y=y/26;
}
else
if ((begin_trace_x!=-1)&&(begin_trace_y!=-1))
{
end_trace_x=x/26;
end_trace_y=y/26;
if (!checkField())
game_over=true;
else
if (findTrace())
{
moveBall();
if (!countScore())
{
throwBalls();
countScore();
}
}
}
}
glutPostRedisplay();
}
}
Вот. Игрушку Lines писал когда-то.