- 1
- 2
- 3
public SaveOpenTemplate getThis() {
return this;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+121.3
public SaveOpenTemplate getThis() {
return this;
}
Они это сделали!
+223
include '%fasm%\win32ax.inc'
entry start
section '.rsrc' resource data readable
....
section '.idata' import data readable writeable
....
start:
Semiono, ты крут!
+156.5
if($_SERVER['SERVER_ADDR'] == '127.0.0.1')
$PATH_DELIM=";"; //разделитель путей. в Windows - ; , в Unix - :
else
$PATH_DELIM=":";
..................................
$adress = str_replace("//","/",$host.$request);
$adress = str_replace("//","/",$adress);
$adress = str_replace("//","/",$adress);
Часть системы управления сайтом фирмы it construct
+151.3
function Cross(value) {
if (value == 0) document.pole0.src = x.src;
if (value == 1) document.pole1.src = x.src;
if (value == 2) document.pole2.src = x.src;
if (value == 3) document.pole3.src = x.src;
if (value == 4) document.pole4.src = x.src;
if (value == 5) document.pole5.src = x.src;
if (value == 6) document.pole6.src = x.src;
if (value == 7) document.pole7.src = x.src;
if (value == 8) document.pole8.src = x.src;
}
function Zero(value) {
if (value == 0) document.pole0.src = o.src;
if (value == 1) document.pole1.src = o.src;
if (value == 2) document.pole2.src = o.src;
if (value == 3) document.pole3.src = o.src;
if (value == 4) document.pole4.src = o.src;
if (value == 5) document.pole5.src = o.src;
if (value == 6) document.pole6.src = o.src;
if (value == 7) document.pole7.src = o.src;
if (value == 8) document.pole8.src = o.src;
}
function CheckVictory() {
if (cell[0] == cell[1] && cell[1] == cell[2] && cell[2] > 0) return true;
if (cell[3] == cell[4] && cell[4] == cell[5] && cell[5] > 0) return true;
if (cell[6] == cell[7] && cell[7] == cell[8] && cell[8] > 0) return true;
if (cell[6] == cell[3] && cell[3] == cell[0] && cell[0] > 0) return true;
if (cell[7] == cell[4] && cell[4] == cell[1] && cell[1] > 0) return true;
if (cell[8] == cell[5] && cell[5] == cell[2] && cell[2] > 0) return true;
if (cell[6] == cell[4] && cell[4] == cell[2] && cell[2] > 0) return true;
if (cell[0] == cell[4] && cell[4] == cell[8] && cell[8] > 0) return true;
}
function CompTurn() {
for (i=0; i<9; i++) if (cell[i] == 0) PutHere = i;
for (i=0; i<3; i++) {
if (cell[0] == cell[1] && cell[2] == 0 && cell[0] == i) PutHere = 2;
if (cell[0] == cell[2] && cell[1] == 0 && cell[0] == i) PutHere = 1;
if (cell[1] == cell[2] && cell[0] == 0 && cell[2] == i) PutHere = 0;
if (cell[3] == cell[4] && cell[5] == 0 && cell[3] == i) PutHere = 5;
if (cell[3] == cell[5] && cell[4] == 0 && cell[3] == i) PutHere = 4;
if (cell[4] == cell[5] && cell[3] == 0 && cell[5] == i) PutHere = 3;
if (cell[6] == cell[7] && cell[8] == 0 && cell[6] == i) PutHere = 8;
if (cell[6] == cell[8] && cell[7] == 0 && cell[6] == i) PutHere = 7;
if (cell[7] == cell[8] && cell[6] == 0 && cell[8] == i) PutHere = 6;
if (cell[6] == cell[3] && cell[0] == 0 && cell[6] == i) PutHere = 0;
if (cell[6] == cell[0] && cell[3] == 0 && cell[6] == i) PutHere = 3;
if (cell[3] == cell[0] && cell[6] == 0 && cell[3] == i) PutHere = 6;
if (cell[7] == cell[4] && cell[1] == 0 && cell[7] == i) PutHere = 1;
if (cell[7] == cell[1] && cell[4] == 0 && cell[7] == i) PutHere = 4;
if (cell[4] == cell[1] && cell[7] == 0 && cell[4] == i) PutHere = 7;
if (cell[8] == cell[5] && cell[2] == 0 && cell[8] == i) PutHere = 2;
if (cell[8] == cell[2] && cell[5] == 0 && cell[8] == i) PutHere = 5;
if (cell[5] == cell[2] && cell[8] == 0 && cell[5] == i) PutHere = 8;
if (cell[6] == cell[4] && cell[2] == 0 && cell[6] == i) PutHere = 2;
if (cell[6] == cell[2] && cell[4] == 0 && cell[6] == i) PutHere = 4;
if (cell[4] == cell[2] && cell[6] == 0 && cell[4] == i) PutHere = 6;
if (cell[0] == cell[4] && cell[8] == 0 && cell[0] == i) PutHere = 8;
if (cell[0] == cell[8] && cell[4] == 0 && cell[0] == i) PutHere = 4;
if (cell[4] == cell[8] && cell[0] == 0 && cell[4] == i) PutHere = 0;
}
Zero(PutHere);
cell[PutHere] = 2;
if (CheckVictory() == true) {
alert("Выиграл JavaScript =).");
GameOver();
}
}
function GameOver() {
for (i=0; i<9; i++) cell[i] = 0;
document.pole0.src = e.src;
document.pole1.src = e.src;
document.pole2.src = e.src;
document.pole3.src = e.src;
document.pole4.src = e.src;
document.pole5.src = e.src;
document.pole6.src = e.src;
document.pole7.src = e.src;
document.pole8.src = e.src;
}
Найдено тут: http://top.asf.ru/Sgames/xo/. В остальном без комментариев, код говорит сам за себя.
+141.5
class cDBEngineWrapper
{
private $dbprefix;
public function __construct($prefix)
{
$this->dbprefix = $prefix;
}
public function __call($func, $args)
{
return call_user_func_array("{$dbprefix}_{$func}", $args);
}
}
Вот такая вот оберточка для быстрой смены БД...
+135.9
<HTML>
<HEAD>
<title>
</HEAD>
<BODY>
<?php
include("connect.php");
/* вводим переменную которая соединяется с бд */
$db = @mysql_connect ($host, $user, $psw);
/* выбираем бд с использованием предыдущей */
/*переменной для соединения с бд*/
$sdb = @mysql_select_db("zforum", $db);
/* для наглядности показываем месагу результата выполнения скрипта */
if(empty($sdb)) {
echo "mysql_error()";
};
echo($info);
if($query_string=='go_reg') {$ins_new_usr="insert into users usrnick=$_POST[nick], usrpsw=$_POST[pass], usrmail=$_POST[email], usrabout=$_POST[about]";
if(isset($_POST['nick']) && isset($_POST['pass']) && isset($_POST['pass2']) && isset($_POST['email']) && $_POST['pass2']=$_POST['pass']) {
mysql_query($ins_new_usr);
$info="Account created"; } else {
$info="Input data error please correct";
}} else { $info="Please input this form";
}
?>
<form action="reg.php?go_reg" method=post target="_self">
<Table border="5">
<tr><th COLSPAN=2>Registration form</th></tr>
<tr><td>Nickname</td><td><input type="text" size=26 name="nick" maxlegth="16" size="16" value=""></td></tr>
<tr><td>Password</td><td><input type="password" name="pass" size=26 maxlength=24 size="16" value=""></td></tr>
<tr><td>Password again</td><td><input type="password" name="pass2" size=26 maxlength="24" size="16" value=""></td></tr>
<tr><td>E-mail</td><td><input type="text" name="email" maxlength="50" size=26 value=""></td></tr>
<tr><td>About</td><td><textarea name="about" maxlength="100" wrap="virtual" rows=4></textarea></tr>
<tr><th colspan=2><input type="submit" value="enter"></th></tr>
</table>
</body>
+145
/**
* 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
*/
+54.9
for( i = 0; i < 2; i++) {
if ((Result = AvCrpSignFile(iSession, szSrcFile, szDstFile, 0)) == AVCRPR_SUCCESS) break;
}
чтобы наверняка
+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');
А какие ты знаешь цвета?
+165
<?
function q($q){
return mysql_query($q);
}
function fa($q){
return mysql_fetch_array($q);
}
function nr($q){
return mysql_num_rows($q);
}
function gr($t,$f,$w,$wf,$def){
$r = ($a = mysql_fetch_array(mysql_query("SELECT $f FROM $t WHERE $wf = '$w' LIMIT 1"))) ? $a[$f] : $def ;
return $r;
}
?>
лень творит чудеса