0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
<?
/////////////////////////////// GAME START TASOVKA //////////////////////////////////////////////////
if($page == "game_start")
{
if( isset($_SESSION["game"]) && !empty($_SESSION["game"]) )
{
session_unregister("game");
}
if( isset($_SESSION["total_price"]) && !empty($_SESSION["total_price"]) )
{
session_unregister("total_price");
}
if( isset($_SESSION["game_num"]) && !empty($_SESSION["game_num"]))
{
session_unregister("game_num");
}
if( isset($_SESSION["ticket_num"]) && !empty($_SESSION["ticket_num"]) )
{
session_unregister("ticket_num");
}
if( isset($_SESSION["for_fl"]) && !empty($_SESSION["for_fl"]) )
{
session_unregister("for_fl");
}
//---------------------------------------------------//
if( isset($_SESSION["order_res_query3"]) && !empty($_SESSION["order_res_query3"]) )
{
session_unregister("order_res_query3");
}
if( isset($_SESSION["order_res_query2"]) && !empty($_SESSION["order_res_query2"]) )
{
session_unregister("order_res_query2");
}
if( isset($_SESSION["order_res2"]) && !empty($_SESSION["order_res2"]) )
{
session_unregister("order_res2");
}
if( isset($_SESSION["order_res"]) && !empty($_SESSION["order_res"]) )
{
session_unregister("order_res");
}
if( isset($_SESSION["user_not_reg"]) && !empty($_SESSION["user_not_reg"]) )
{
session_unregister("user_not_reg");
}
if( isset($_SESSION["order_id"]) && !empty($_SESSION["order_id"]) )
{
session_unregister("order_id");
}
if( isset($_SESSION["user_edit_type"]) && !empty($_SESSION["user_edit_type"]) )
{
session_unregister("user_edit_type");
}
//---------------------------------------------------//
if( isset($_SESSION["order_date"]) && !empty($_SESSION["order_date"]) )
{
session_unregister("order_date");
}
if( isset($_SESSION["drawing_num"]) && !empty($_SESSION["drawing_num"]) )
{
session_unregister("drawing_num");
}
}
/////////////////////////////// GAME START TASOVKA //////////////////////////////////////////////////
?>
<?
/////////////////////////////// CHOSE TASOVKA //////////////////////////////////////////////////
if($page == "chose")
{
if( isset($_SESSION["order_res_query3"]) && !empty($_SESSION["order_res_query3"]) )
{
session_unregister("order_res_query3");
}
if( isset($_SESSION["order_res_query2"]) && !empty($_SESSION["order_res_query2"]) )
{
session_unregister("order_res_query2");
}
if( isset($_SESSION["order_res2"]) && !empty($_SESSION["order_res2"]) )
{
session_unregister("order_res2");
}
if( isset($_SESSION["order_res"]) && !empty($_SESSION["order_res"]) )
{
session_unregister("order_res");
guest ,
09.12.2008 (Updated 24.03.2018 )
0
1
foreach(explode(' ',str_replace($symbols,'',htmlspecialchars_decode(html_entity_decode(implode(' ',$keywords))))) as $i=>$val) if(mb_strlen($val)>2) echo ', '.$val;
Массив keywords собирается в строку через запятую :)
guest ,
09.12.2008 (Updated 24.03.2018 )
0
1 2
Application was halted by an exception.
Debug-mode is off.
Ошибка на govnokod.ru при добавлении комментариев
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
//разметка матрицы
while ((founded==1)&&(mat[nx][ny]<=0)) {
founded=0;
iii=y-i;
while (((i==0)&&(iii==y))||((iii<=y+i))){
ii=x-i;
while ((ii<=x+i)){
if ((mat[ii][iii]==i)&&((ii<70)&&(ii>=0))&&((iii<70)&&(iii>=0))) {
bii=ii;
biii=iii;
if ((mat[bii+1][biii]==-1)&&(bii+1<70)&&(bii+1>=0)) {
mat[bii+1][biii]=i+1;
founded=1;
}
if ((mat[bii-1][biii]==-1)&&(bii-1<70)&&(bii-1>=0)) {
mat[bii-1][biii]=i+1;
founded=1;
}
if ((mat[bii][biii+1]==-1)&&(biii+1<70)&&(biii+1>=0)) {
mat[bii][biii+1]=i+1;
founded=1;
}
if ((mat[bii][biii-1]==-1)&&(biii-1<70)&&(biii-1>=0)) {
mat[bii][biii-1]=i+1;
founded=1;
}
}
ii++;
}
iii++;
}
i++;
}
if (mat[nx][ny]>=0) {
if ((nx==40)&&(ny==57)) {
nx=nx;
}
ik=i;
ii=nx;
iii=ny;
//поиск пути
while (ik>1) {
if ((mat[ii-1][iii]==ik-1)&&(ii-1<70)&&(ii-1>=0)) {
ii--;
mat[ii][iii]=-3;
}
if ((mat[ii][iii-1]==ik-1)&&(iii-1<70)&&(iii-1>=0)) {
iii--;
mat[ii][iii]=-3;
}
if ((mat[ii+1][iii]==ik-1)&&(ii+1<70)&&(ii+1>=0)) {
ii++;
mat[ii][iii]=-3;
}
if ((mat[ii][iii+1]==ik-1)&&(iii+1<70)&&(iii+1>=0)) {
iii++;
mat[ii][iii]=-3;
}
ik--;
}
ax=ii*10+5;
ay=iii*10+5;
//out_to_file(mat,"d:\\out.txt");
i++;
ii=0;
iii=0;
while ((iii>-1)&&(iii<70)){
ii=0;
while ((ii>-1)&&(ii<70)){
if ((mat[ii][iii]>-1)||(mat[ii][iii]==-3)) {
mat[ii][iii]=-1;
}
ii++;
}
iii++;
}
nx=ax;
ny=ay;
} else ...
}
Разметка матрицы, Поиск Пути.
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5 6 7
nop
nop
nop
call somelabel
somelabel:
pop si
sub si, 3
ассемблер - источник массы говнокода, классика...
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
var newstr = null;
var lastnewstr = null;
var newclass = null;
var lastclass = null;
var newstr2 = null;
var lastnewstr2 = null;
var newclass2 = null;
var lastclass2 = null;
var newstr3 = null;
var lastnewstr3 = null;
var newclass3 = null;
var lastclass3 = null;
function check(s, i)
{
p1 = document.getElementById("id_1_"+i);
p2 = document.getElementById("id_2_"+i);
if (s!=lastnewstr)
{
newclass2 = p1.className;
newclass3 = p2.className;
newclass = s.className;
s.className="check";
p1.className="viz";
p2.className="viz";
if (lastnewstr!=null)
{
lastnewstr.className=lastclass;
lastnewstr2.className=lastclass2;
lastnewstr3.className=lastclass3;
}
}
lastnewstr = s;
lastnewstr2 = p1;
lastnewstr3 = p2;
lastclass = newclass;
lastclass2 = newclass2;
lastclass3 = newclass3;
}
Убожество которое на одной строке меняет у <tr> стиль и еще у двух элементов...
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
public void updateAmountValues(List<TransactionResultItem> transactionResultItems) {
for (TransactionResultItem transaction : transactionResultItems) {
Account account = getAccountById(transaction.getAccountId());
if ((transaction.getMainTransaction()
&& ! transaction.getTransactionTypeId().equals(4)
&& ! transaction.getTransactionTypeId().equals(5)
&& ! transaction.getTransactionTypeId().equals(6))
||
(! transaction.getMainTransaction() &&
(transaction.getTransactionTypeId().equals(5) &&
((account.getAccountTypeId().equals(AccountType.INCOME_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_INCOME_TYPE_ID)) &&
transaction.getAmount() > 0)
|| (transaction.getAccountId().equals(getSalesTaxPayableAccountId()) && transaction.getAmount() > 0)
|| ((account.getAccountTypeId().equals(AccountType.EXPENSE_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_EXPENSE_TYPE_ID)) && transaction.getAmount() < 0))
|| (transaction.getTransactionTypeId().equals(1) &&
(account.getAccountTypeId().equals(AccountType.INCOME_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_INCOME_TYPE_ID)) &&
transaction.getAmount() < 0)
|| (transaction.getTransactionTypeId().equals(2) &&
(account.getAccountTypeId().equals(AccountType.INCOME_TYPE_ID) ||
account.getAccountTypeId().equals(AccountType.OTHER_INCOME_TYPE_ID)) &&
transaction.getAmount() > 0)
)) {
Double amount = transaction.getAmount();
transaction.setAmount(-amount);
}
}
}
Потрясающий по понятности код. Вызывался несколько раз в одном и том же методе.
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5 6 7 8 9 10 11
/**
* Reply string array after tokenize the url address
*
* @param String url
* @return String[]
*/
protected String[] processURL(String url) {
StringBuffer s = new StringBuffer(url);
StringBuffer AfterRemoval = s.delete(0, 27);
...
...в тот день магическим числом для паренька из Индии было число 27... похоже он и сам не понимал почему.. возможно это как то было связано с именем хоста...
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5
SELECT FROM Staff
CASE Sex
WHEN 'M' THEN 'МужЫк!'
WHEN 'F' THEN 'Баба'
ELSE 'ЫЫЫыы?'
препод сказал что елсе не будет выполняться изза ограничений целостности базы
guest ,
08.12.2008 (Updated 24.03.2018 )
0
1 2 3 4 5 6 7 8 9 10 11 12
private function _mouseDown(e:MouseEvent):void
{
stage.addEventListener(MouseEvent.MOUSE_UP, _mouseUp);
if (e.target is PCell) {
//Клик по клетке, но возможно хотят подвигать поле :)
_startDrag(e);
}
else {
//Значит двигаем поле
_startDrag(e);
}
}
guest ,
08.12.2008 (Updated 24.03.2018 )