- 1
- 2
- 3
- 4
- 5
cursor.execute(bla)
count = cursor.fetchone()
if count[0] > 0 or True:
cursor.execute(bla)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−178
cursor.execute(bla)
count = cursor.fetchone()
if count[0] > 0 or True:
cursor.execute(bla)
+172
$var=trim($var);
$var=str_replace("\t", ' ',$var);
$var=str_replace("\r", ' ',$var);
$var=str_replace("\n", ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
$var=str_replace(' ', ' ',$var);
Надежно, чо.
+163
fadeOutAnimate($("#bigsun"), 500);
fadeInAnimate($("#littlesun"), 500, function(){
fadeInAnimate($("#point1"), 300, function(){
fadeInAnimate($("#point2"), 300, function(){
fadeInAnimate($("#point3"), 300, function(){
fadeInAnimate($("#point4"), 300, function(){
fadeInAnimate($("#point5"), 300, function(){
fadeInAnimate($("#point6"), 300, function(){
fadeInAnimate($("#point7"), 300, function(){
fadeInAnimate($("#point8"), 300, function(){
fadeInAnimate($("#arrows"), 600, function(){
fadeInAnimate($("#direction1"), 300, function(){
fadeInAnimate($("#direction2"), 300, function(){
fadeInAnimate($("#direction3"), 300, function(){
fadeInAnimate($("#direction4"), 300, function(){
fadeInAnimate($("#direction5"), 300, function(){
fadeInAnimate($("#direction6"), 300, function(){
fadeInAnimate($("#direction7"), 300, function(){
fadeInAnimate($("#direction8"), 300, function(){
});
});
});
});
});
});
});
});
});
});
});
});
});
});
});
});
Анимация.
+87
procedure makeWord(var str : string; var word : string);
var j, p,tp : integer;
begin
j:= 1;
p := pos(' ', str);
if (p = 0) then p:= length(str);
word := copy(str, 0, p);
delete(str, 0, p);
while (str[j] = ' ') or (str[j] = ''#9'') do begin
Inc(j);
end;
if (j > 0) then begin
delete(str,0,j-1);
end;
end;
var i,p,n : integer;
str, word : string;
begin
str := 'I want to tell you!';
readln(n);
for i:= 1 to n do begin
makeWord(str,word);
writeln(word);
end;
readln;
end.
Программа выводит первые n слов строки
+154
private function incrementKey ( $key ) {
// цепочка знаков в системе счисления
$sys = array_merge( range(0, 9), range('a', 'z') );
$newKey = '';
while( true ) {
// получаем последний символ
$sym = substr($key, -1);
$key = substr($key, 0, -1);
if ( $sym ) {
//"инкрементируем" его
$cur = array_search( $sym, $sys );
if ( isset( $sys[++$cur] ) ) {
// всё, конец.
$newKey = $key . $sys[$cur] . $newKey;
break;
} else $newKey = $sys[0] . $newKey;
} else {
$newKey = $sys[0] . $newKey;
break;
}
}
return $newKey;
}
Свежатинка
+24
function on_record(status)
{
// Ext.MessageBox.prompt('Name', 'Please enter your name:', 1);
var label = form2label();
if(label['answers'][10]==1&&label['start']=='1970-01-01 03:00:00'&&label['order_num']!='1'){
label['start'] = get_starttime_mysql();
}
else if(label['answers'][10]==2&&label['start']=='1970-01-01 03:00:00'){
label['start'] = get_finishtime_mysql();
}
label['status'] = status;
save_label(label);
}
превед.
+157
//*****************************************************************************
//************** ВНИМАНИЕ! ДАЛЬШЕ ИДЕТ СТРАШНЫЙ СТАРЫЙ КОД! *****************
//**************** ОДЕНЬТЕ СКАФАНДР ПРИ ВХОДЕ В ЭТУ ЗОНУ! *******************
//*****************************************************************************
http://habrahabr.ru/js/1329490138/system.js
+159
// Конструктор
public function __construct($tablename,
$detal = "*",
$where,
$order = "",
$pnumber = 10,
$page_link = 3,
$parameters = "")
{
if (empty($detal)) $this->detal = '*'; else $this->detal = $detal;
parent::__construct($tablename,
$where,
$order,
$pnumber,
$page_link,
$parameters);
}
ооп
+159
<?php if (!($main_controller->params['id_type'] == 3
&& in_array($id_seo, array(70,76,92,78,121,163,165,278,164)))
&& $main_controller->params['id_cat']!=12 && $main_controller->params['id_cat']!=11
&& $main_controller->params['id_type'] != 6
&& !($id_type==5 && $id_elt==6
&& isset($main_controller->params['id_prep']))
&& $id_seo!=140 && !($main_controller->params['id_type'] == 1
&& ($id_elt==76 || ($id_elt>=82 && $id_elt<=90) || in_array($id_seo, array(241,244,245,268,286,287,288,289,237,285,283,284,324))
|| in_array($id_elt, array(12,100,101,14,18,19,20,13,93,24,25,26,27,28,29,30,31,32,33,34,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,60,61,62,63,64,104,91))))) { ?>
...
else if($main_controller->params['id_type'] == 1 && ($id_elt==76 || ($id_elt>=82 && $id_elt<=90)
|| in_array($id_elt, array(12,100,101,14,18,19,20,13,93,24,25,26,27,28,29,30,31,32,33,34,43,44,45,46,47,48,49,50,51,52,53,54,55,57,58,59,60,61,62,63,64,104,91))))
такие вот лаконичнинькие условия (было в одну строку - переносы сам сделал для читабельности))))
−100
# ищем позиции в гугле
def search(request, keyword, p = nil)
proxy = nil
# инициализация прокси
if p # обьект с прокси-серверами
proxy = "http://#{p.proxy}/" # случайный прокси
proxy_working = false
while not proxy_working
begin
timeout(5) { open(request, :proxy => proxy) }
rescue Timeout::Error
$log.put "bad broxy #{proxy}"
proxy = "http://#{p.proxy}/"
next
rescue Errno::ECONNREFUSED
$log.put "bad broxy #{proxy}"
proxy = "http://#{p.proxy}/"
next
rescue OpenURI::HTTPError
$log.put "bad broxy #{proxy}"
proxy = "http://#{p.proxy}/"
next
else
$log.put "working #{proxy}"
proxy_working = true
end
end
end
# код