- 1
@$go = (string)$_HTTP_REQUEST_VARS['go'];
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+151.5
@$go = (string)$_HTTP_REQUEST_VARS['go'];
+151.5
function custom_print ($custom_category, $custom_template, $aviable, $custom_from, $custom_limit, $custom_cache, $do){
global $db, $is_logged, $member_id, $xf_inited, $cat_info, $config, $user_group, $category_id, $_TIME, $lang;
$do = $do ? $do : "main";
$aviable = explode ('|', $aviable);
if(!(in_array($do, $aviable)) AND ($aviable[0] != "global")) return "";
$custom_category = $db->safesql(str_replace(',', '|', $custom_category));
$custom_from = intval($custom_from);
$custom_limit = intval($custom_limit);
$thisdate = date ("Y-m-d H:i:s", (time()+ $config['date_adjust']*60));
if (intval($config['no_date'])) $where_date = " AND date < '".$thisdate."'"; else $where_date = "";
$tpl = new dle_template;
$tpl->dir = TEMPLATE_DIR;
//if ($custom_cache == "yes") $config['allow_cache'] = "yes"; else $config['allow_cache'] = false;
if ($is_logged AND ($user_group[$member_id['user_group']]['allow_edit'] AND !$user_group[$member_id['user_group']]['allow_all_edit'])) $config['allow_cache'] = false;
$content = dle_cache("custom", "cat_".$custom_category."template_".$custom_template."from_".$custom_from."limit_".$custom_limit, true);
if ($content) { return $content; }
else {
$allow_list = explode (',', $user_group[$member_id['user_group']]['allow_cats']);
if ($allow_list[0] != "all") {
if ($config['allow_multi_category']) {
$stop_list = "category regexp '[[:<:]](".implode ('|', $allow_list).")[[:>:]]' AND ";
} else {
$stop_list = "category IN ('".implode ("','", $allow_list)."') AND ";
}
} else $stop_list = "";
if ($user_group[$member_id['user_group']]['allow_short']) $stop_list = "";
if ($cat_info[$custom_category]['news_sort'] != "") $config['news_sort'] = $cat_info[$custom_category]['news_sort'];
if ($cat_info[$custom_category]['news_msort'] != "") $config['news_msort'] = $cat_info[$custom_category]['news_msort'];
if ($config['allow_multi_category']) {
$where_category = "category regexp '[[:<:]](".$custom_category.")[[:>:]]'";
} else {
$custom_category = str_replace ("|", "','", $custom_category);
$where_category = "category IN ('".$custom_category."')";
}
$sql_select = "SELECT " . PREFIX . "_post.id, gallery, autor, date," . PREFIX . "_post.image," . PREFIX . "_post.imgtype, short_story, full_story, " . PREFIX . "_post.xfields, title, category, alt_name, " . PREFIX . "_post.comm_num, " . PREFIX . "_post.allow_comm, allow_rate, " . PREFIX . "_post.rating, " . PREFIX . "_post.vote_num, news_read, " . PREFIX . "_post.flag, " . PREFIX . "_users.fullname FROM " . PREFIX . "_post , " . PREFIX . "_users WHERE " . PREFIX . "_post.autor=" . PREFIX . "_users.name and ".$stop_list.$where_category." AND approve = '1'".$where_date." ORDER BY ".$config['news_sort']." ".$config['news_msort']." LIMIT ".$custom_from.",".$custom_limit;
//echo $sql_select;
include (ENGINE_DIR.'/modules/show.custom.php');
if ($config['files_allow'] == "yes")
if ( strpos( $tpl->result['content'], "[attachment=" ) !== false)
{
$tpl->result['content'] = show_attach($tpl->result['content'], $attachments);
}
create_cache("custom", $tpl->result['content'], "cat_".$custom_category."template_".$custom_template."from_".$custom_from."limit_".$custom_limit, true);
}
return $tpl->result['content'];
}
Не пишите так функции, пожалейте того, кто будет ее поддерживать после вас.
+151.4
if( pc_rbyte == 0xFA && pc_buff_ready == 0 && pc_rec_pos == 0)
{
pc_rec_en = 1;
return;
}
return;
}
ISR(USART0_RX_vect)
{
cli();
rbyte = rs485_reciv();
if( COMM == 1 && rbyte != 0x42 )
xp_rec_en = 1;
if(COMM == 1 && rbyte == 0x42)
{
//xp_rec_pos++;
xp_response[xp_rec_pos] = xp_xor;
COMM = 0;
xp_rec_en = 0;
xp_buff_ready = xp_rec_pos;
xp_rec_pos = 0;
xp_rec_en = 0;
xp_xor = 0;
}
if( xp_rec_en == 1 )
{
if( rbyte != xp_xor && xp_rec_pos<16 )
{
xp_response[xp_rec_pos] = rbyte;
xp_xor = xp_xor^rbyte;
xp_rec_pos++;
}else{
xp_buff_ready = xp_rec_pos;
xp_rec_pos = 0;
xp_rec_en = 0;
xp_xor = 0;
}
}
if( rbyte == 0x60 )
{
xp_rec_en = 1;
xp_response[0] = rbyte;
xp_rec_pos++;
}
if( rbyte == 0x41 && my_window!=1)
COMM = 1;
if( (bit9&0b00000010) == 0b00000010 && (rbyte&0b00011111) == myXPaddress )
switch( (rbyte&0b01100000) )
{
case 0b01000000: ack = 0; if( pc_buff_ready == 1 ) my_window = 1; xp_rec_en = 0;break; // NormalInquary
case 0b01100000: ack = 0; my_window = 0; xp_rec_en = 1;break; // CallByte
case 0b00000000: ack = 1; my_window = 0; xp_rec_en = 0;break; // ACK!
}
rbyte = 0;
sei();
return;
}
int main(void)
{
avr_init();
sei();
//PORTD &=~(1<<transmit_en);
//pc_buff_ready = 1;
while (1)
{
//if( pc_buff_ready == 1 ) //pc_buff_ready == 1 &&
//{
if( my_window == 1 )
{
cli();
_delay_us(30);
//PORTD |= (1<<transmit_en);
PORTG |=_BV(PG4); //disable DE RS485
PORTD |=_BV(PD5); //enable RE RS485
//_delay_us(5);
for( i=0; pc_rec_pos != i; i++ )
rs485_ransmit(pc_command[i]);
while ( !( UCSR0A & (1<<UDRE0)) );
_delay_us(160);
PORTG &=~_BV(PG4); //disable DE RS485
PORTD &=~_BV(PD5); //enable RE RS485
my_window = 0;
clear_buff(0);
pc_buff_ready = 0;
pc_rec_pos = 0;
+151.4
CREATE TABLE `pm_keywords` (
`id` int(11) unsigned NOT NULL auto_increment,
`keyword` varchar(255) default NULL,
....
PRIMARY KEY (`id`),
UNIQUE KEY `uniq_keyword` (`keyword`),
) ;"
$sql = "SELECT keyword
FROM pm_keywords
WHERE active = 0
ORDER BY rand()
LIMIT ".intval($newKeywords);
$q = mysql_query($sql);
$keywords = array();
while ($r = mysql_fetch_assoc($q)) {
$keywords[] = mysql_real_escape_string($r['keyword']);
}
$newKeywordsActual = count($keywords);
$sql = "UPDATE `pm_keywords` SET
active = 1,
lastupdate = '".date('Y-m-d H:i:s')."'
WHERE keyword IN ('".implode("','", $keywords)."')
LIMIT ".$newKeywordsActual;
mysql_query($sql);
WHERE keyword IN ('".implode("','", $keywords)."')
+151.4
//фигура
class Figura
{ $type
$ploshad
function A($t)
{echo $t}
}
// круг треугольник
class CRTR extendes Figura
{ $ r
$ a
$ b
$c
function B($B)
{echo $a
echo $b
echo $d
echo $c
}
}
// прямоугольник квадрат
class PRKV extendes CRTP
{$ d
$ e
}
function C ($C)
{ echo $ d
echo $ e
}
$ l=new PRKV;
}
class Myclass
{$s
}
function Ploshad KR($s1)
{$this>s1=r*r*3.14;
}
function ploshad($s)
{$this>s=a*b }
Решение геометрической задачи...
нет слов...
+151.4
if (isset($_SESSION) && !is_array($_SESSION)){
exit("Hacking attempt");
}
просто улыбнуло
симпатичная антихакерская защита
+151.4
if(Silverlight.isInstalled("2.0"))
logWrite("Падшая женщина!");
// На сервере обработка просто убила (C#):
string blyad = "Падшая женщина!";
...
if (respString == blyad)
GetProfile(userID).isSilverlight = Convert.ToBoolean(blyad.Length.GetHashCode());
+151.4
http://suchen.mobile.de/fahrzeuge/showDetails.html?lang=ru&id=74773331&pageNumber=3&scopeId=C&sortOption.sortBy=searchNetGrossPrice&sortOption.sortOrder=ASCENDING&makeModelVariant1.makeId=17700&makeModelVariant1.modelId=13&makeModelVariant1.searchInFreetext=false&makeModelVariant2.searchInFreetext=false&makeModelVariant3.searchInFreetext=false&vehicleCategory=Car&segment=Car&minFirstRegistrationDate=1995-01-01&siteId=GERMANY&damageUnrepaired=ALSO_DAMAGE_UNREPAIRED&export=ALSO_EXPORT&customerIdsAsString=&tabNumber=2
небольшой такой запросик...
+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/. В остальном без комментариев, код говорит сам за себя.
+151.2
<body onload="blinkAfterSearch();setTimeout('loadDummyImg()', 590000);var ex; try { startUpTasks(); } catch(ex) {}" />
Недавно отрыл в недрах нашего проекта! Try catch в onload!! :D