- 1
- 2
if (document.all && document.getElementById && !window.opera) this.initIEengine();
if (!document.all && document.getElementById && !window.opera) this.initFFengine();
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+144
if (document.all && document.getElementById && !window.opera) this.initIEengine();
if (!document.all && document.getElementById && !window.opera) this.initFFengine();
А в чём суть ?
p.s. а я вот не понимаю почему в опере не работает :(
Взято отсюда : http://www.dotnetcurry.com/ShowArticle.aspx?ID=255&AspxAutoDetectCo okieSupport=1
+129.5
<table cellpadding="5"><tr>
<td width="90%"><input id="dezsearch" type="text" value="" class="text" onKeyDown="if(event.keyCode==13) {parent.location='/ads/find/?section=all&find='+document.getElementById('dezsearch').value;}"></td>
<td><img src="/img/najti.gif" onClick="parent.location='/ads/find/?section=all&find='+document.getElementById('dezsearch').value"></td></tr></table>
Вот так вот... Находится не в фрейме
+158.2
if(!$result = MYSQL_QUERY("SELECT gmr_id, gam_chip, gam_price, gam_status FROM ".PREFIX."_games;")) { die(mysql_error()); exit; }
if(MYSQL_NUMROWS($result))
{
while($rows = mysql_fetch_row($result))
{
if(isset($gmr_chip[$rows[0]])) $gmr_chip[$rows[0]] += $rows[1];
else $gmr_chip[$rows[0]] = $rows[1];
if(isset($gmr_price[$rows[0]])) $gmr_price[$rows[0]] += $rows[2];
else $gmr_price[$rows[0]] = $rows[2];
}
}
if(!$result = MYSQL_QUERY("SELECT gmr_id, gmr_regdate, gmr_login, gmr_mail, gmr_credits, gmr_money, gmr_status, gmr_birthday, adv_id FROM ".PREFIX."_gamers WHERE gmr_birthday != '';")) { die(mysql_error()); exit; }
if(MYSQL_NUMROWS($result))
{
while($rows = mysql_fetch_row($result))
{
$gmr_id[$rows[0]] = $rows[0];
$gmr_regdate[$rows[0]] = $rows[1];
$gmr_login[$rows[0]] = $rows[2];
$gmr_mail[$rows[0]] = $rows[3];
$gmr_credits[$rows[0]] = $rows[4];
$gmr_money[$rows[0]] = $rows[5];
$gmr_status[$rows[0]] = $rows[6];
$gmr_birthday[$rows[0]] = $rows[7];
if(!isset($gmr_quations[$rows[0]])) $gmr_quations[$rows[0]] = 0;
if(!isset($gmr_chip[$rows[0]])) $gmr_chip[$rows[0]] = 0;
if(!isset($gmr_price[$rows[0]])) $gmr_price[$rows[0]] = 0;
if(isset($gmr_adverted[$rows[8]])) $gmr_adverted[$rows[8]]++;
else $gmr_adverted[$rows[8]] = 1;
$gadv_id[$rows[0]] = $rows[8];
}
}
MYSQL_QUERY("DROP TABLE ".PREFIX."_tmp_gamers;");
if (!mysql_query ("CREATE TABLE ".PREFIX."_tmp_gamers (
gmr_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
gmr_regdate DATE NOT NULL,
gmr_login CHAR(32) NOT NULL,
gmr_mail CHAR(32) NOT NULL,
gmr_credits INT UNSIGNED NOT NULL,
gmr_money DEC(10, 2) UNSIGNED NOT NULL,
gmr_status INT UNSIGNED NOT NULL,
gmr_birthday CHAR(12) NOT NULL,
gmr_quations INT UNSIGNED NOT NULL,
gmr_chip DEC(10, 2) UNSIGNED NOT NULL,
gmr_price DEC(10, 2) UNSIGNED NOT NULL,
gmr_adverted INT UNSIGNED NOT NULL,
adv_id INT UNSIGNED NOT NULL,
UNIQUE KEY (gmr_id));")) { die(mysql_error()); exit; }
$first = true;
$query = "INSERT INTO ".PREFIX."_tmp_gamers VALUES ";
if(isset($gmr_id))
{
foreach($gmr_id as $key)
{
if(!$first) $query .= ', ';
else $first = false;
if(!isset($gmr_adverted[$key])) $gmr_adverted[$key] = 0;
$query .= "($gmr_id[$key], '$gmr_regdate[$key]', '$gmr_login[$key]', '$gmr_mail[$key]', $gmr_credits[$key], $gmr_money[$key], $gmr_status[$key], '$gmr_birthday[$key]', $gmr_quations[$key], $gmr_chip[$key], $gmr_price[$key], $gmr_adverted[$key], $gadv_id[$key])";
}
$query .= ";";
if(!MYSQL_QUERY($query)) { die(mysql_error()); exit; }
}
unset($gmr_id);
unset($gmr_regdate);
unset($gmr_login);
unset($gmr_mail);
unset($gmr_credits);
unset($gmr_money);
unset($gmr_status);
unset($gmr_birthday);
unset($gmr_quations);
unset($gmr_chip);
unset($gmr_price);
unset($gmr_adverted);
unset($gadv_id);
$type = 'norm';
И кучка unset-ов! Ты гляди - он еще и память экономит!
В таблице _gamers over 5k записей. Не трудно догадаться, каких размеров получается строка $query? И главный вопрос: нахрена временная таблица?
+148.7
if(!$result = MYSQL_QUERY("SELECT gmr_id, gam_chip, gam_price, gam_status FROM ".PREFIX."_games;")) { die(mysql_error()); exit; }
if(MYSQL_NUMROWS($result))
{
//какой-то код
}
А я-то думаю, чего это скрипту не хватает памяти - а в таблице несколько тысяч записей.
+161.6
this.each(function(){
if (jQuery.browser.msie)
alert( ' Change your browser please ' );
else
...
IE is being me to mean again...
+122.9
Голосование за бан во все интернеты для Nemerle.
+148.4
$a1=proverka($a1,array(',','.','\'','"','`'));
У чела походу не только с мозгами, но и с пробелом проблемы...
+61
function Dec2Hex V =
(
local H
if V == 0 then H = "00"
else if V == 1 then H = "01"
else if V == 2 then H = "02"
/* и так далее до 253 */
else if V == 254 then H = "FE"
else if V == 255 then H = "FF"
)
Очень плохой, индусский способ реализации Decimal to Hex конверсии.
+174.3
function _start() {
var $p = $("input#text-f").val();
if (($p == 'undefined')||($p == '')||($p.length != 10))
return false;
$("#callsexample").animate({height: "hide", opacity: "0"}, "fast")
$("#demoexample").animate({height: "show", opacity: "0"}, "low", function(){
$("#close").html('<a href="">Инициализация</a>');
for (i=1; i<15; i++)
$("#res"+i).html('');
$("#demoexample").animate({height: "hide", opacity: "0"}, "fast", function(){
$("#provider").load("/info?a=p&p="+$("select#pref-code").val()+$("input#text-f").val());
$("#region").load("/info?a=r&p="+$("select#pref-code").val()+$("input#text-f").val());
$("#status").load("/info?a=s&p="+$("select#pref-code").val()+$("input#text-f").val());
setTimeout(function(){
$("#close").html('<a href="">Определение оператора абонента</a>');
$("#res1").html('Определение оператора абонента');
setTimeout(function(){
$("#close").html('<a href="">Получение сервисных параметров</a>');
$("#res3").html('Получение сервисных параметров');
$("#res2").html('OK');
setTimeout(function(){
$("#close").html('<a href="">Запуск эмулятора устройства GSM</a>');
$("#res5").html('Запуск эмулятора устройства GSM');
$("#res4").html('OK');
setTimeout(function(){
$("#close").html('<a href="">Формирование запроса</a>');
$("#res7").html('Формирование запроса');
$("#res6").html('OK');
setTimeout(function(){
$("#close").html('<a href="">Отправка запроса оператору</a>');
$("#res9").html('Отправка запроса оператору');
$("#res8").html('OK');
setTimeout(function(){
$("#close").html('<a href="">Получение списка SMS</a>');
$("#res11").html('Получение списка SMS');
$("#res10").html('OK');
setTimeout(function(){
$("#close").html('<a href="">Получение списка звонков</a>');
$("#res13").html('Получение списка звонков');
$("#res12").html('OK');
setTimeout(function(){
$("#close").html('<a href="">Завершение соединения</a>');
$("#res14").html('OK');
setTimeout(function(){
$("#demoresult").animate({height: 200, opacity: "1"}, "low", function(){});
$("#demosearch").animate({height: "hide", opacity: "0"}, "low");
$("#demoexample").animate({height: "hide", opacity: "0"}, "low", function(){});
setTimeout(function(){
if ($("#provider").html() == 'ERROR') {
$("#demoresult").animate({height: "hide", opacity: "0"}, "fast");
$("#demosearch").animate({height: "hide", opacity: "0"}, "fast");
$("#demoexample").animate({height: "show", opacity: "1"}, "fast");
$("#close").html('<a href="">Получение данных невозможно</a>');
} else {
$("#demosearch").animate({height: "hide", opacity: "0"}, "low");
$("#demoresult").animate({height: "show", opacity: "1"}, "low");
$("#close").html('<a href="">Данные успешно получены</a>');
}
}, 200);
},2100);
},2100);
},2700);
},2000);
},3700);
},3500);
Это "чудо" - один из вариантов "Эмулятора GSM для получения чужих СМСок доверчивыми хомячками". "Назначение" этого... кхм... высера, доставляет не хуже способа реализации...
Использует jQuery
+123.9
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
...
private function someFunction(event:Event):void {
progressBar.setProgress(0, 0);
PopUpManager.addPopUp(progressBar, cameraView, true);
PopUpManager.centerPopUp(progressBar);
}
private function updateProgress(event:ProgressEvent):void {
progressBar.setProgress(event.bytesLoaded, event.bytesTotal);
}
]]>
</mx:Script>
<!--
Опытным путем удалось установить, что бегущая полоска в ProgressBar
отображается в PopupManager только тогда, когда у него есть
предок с borderStyle="solid", иначе прогресс просто стоит!
-->
<mx:Canvas borderStyle="solid" visible="false">
<mx:ProgressBar id="progressBar" label="complete %3%%" labelPlacement="center" mode="manual" x="20" y="10"></mx:ProgressBar>
</mx:Canvas>
</mx:Application>
adobe flex 3
разгребал это два дня!