- 1
- 2
- 3
#KPACHblu {COLOR:#FF0000 !IMPORTANT;}
#KPACHblu .CuHuu {COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;}
#KPACHblu .3EJlEHblu {COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+68
#KPACHblu {COLOR:#FF0000 !IMPORTANT;}
#KPACHblu .CuHuu {COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;COLOR:BLUE;}
#KPACHblu .3EJlEHblu {COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;COLOR:GREEN;}
+156
//было:
function query($sque){
$sque = mysql_real_escape_string($sque,$this->hdb);
$res = mysql_query($sque,$this->hdb);
if(!$res){
echo 'Invalid query: '.mysql_error().'; ';
return 0;
}
return $res;
}
//добавил:
//так как предыдущая функция иногда косячила запрос
function sensiblequery($sque,$arr){
for($i = 0; $i<count($arr); ++$i){
$arr[$i] = mysql_real_escape_string($arr[$i],$this->hdb);
$pattern = "/{var$i}/";
$sque = preg_replace($pattern, $arr[$i], $sque);
}
$res = mysql_query($sque,$this->hdb);
if(!$res){
echo 'Invalid query: '.mysql_error().'; ';
return 0;
}
return $res;
}
Такое ощущение что написал говно. Если это так подскажите как адекватней сделать...
−139
#!/bin/bash
export cpx=0
export cpy=0
cf=0
export xf=0
export yf=0
while :
do
tput reset
xp=`cat /tmp/X.txt`
yp=`cat /tmp/Y.txt`
echo "xp $xp yp $yp"
clear
if [ $cpx -eq $xp ]
then
echo "x coincided"
xf=1
elif [ $cpx -gt $xp ]
then
let cpx--
else
let cpx++
fi
if [ $cpy -eq $yp ]
then
echo "y coincided"
yf=1
elif [ $cpy -gt $yp ]
then
let cpy--
else
let cpy++
fi
tput cup 45 130
echo px $xp py $yp
tput cup 46 130
echo x $cpx y $cpy
tput cup $cpx $cpy
sleep 0.5s
if [ $xf -eq 1 ]
then
if [ $yf -eq 1 ]
then
echo "Point coincide"
exit
fi
fi
done
Move cursor in right place.
+127
'8, :.
`""`oooob."T,.
,-`".)O;8:doob.'-.
,..`'.'' -dP()d8O8Yo8:,..`,
-o8b- ,..)doOO8:':o; `Y8.`,
,..bo.,.....)OOO888o' :oO. ". `-.
, "`"d....88OOOOO8O88o :O8o;. ;;,b
,dOOOOO""""""""O88888o: :O88Oo.;:o888d
""888Ob...,-- :o88O88o:. :o'"""""""Y8OP
d8888.....,.. :o8OO888:: ::
,dd8". ,-)do8O8o:"""; :::
-"",`(;O"KdOo:: :::
.doo:::""":: :. 'o:
,.. .;ooooooo..o:""""" ::;. ::;. 'o.
,, "' ` .. .d;o:"""' ::o:;::o:: :;
d, , ..ooo::; ::oo:;::o"'.:o
,d'. :OOOOO8Oo::" '.. . ::o8Ooo:; ;o:
,8: o::oO` 88888OOo::: o8O8Oo:::;; ,;:oO88OOo; '
,YP , :;:O: *888o:::: :8888Ooo::::::::::oo888888o;. ,
dPY: :o8O (|)888O:O:; O8888888888OOOO888"" Y8o:O88o; ,
,' O: 'ob` "8888888Oo;;o8888888888888'"' `8OO:.`OOb .
' Y: ,:o: `8O88888OOoo"""""""""""' `OOob`Y8b`
:: ';o: `8O88o:oOoP `8Oo `YO.
`: Oo: `888O::oP 88O :OY
:o; 8oP :888o::P do: 8O:
,ooO:8O' ,d8888o:O' dOo ;:.
;O8odo' 88888O:o' do:: oo.:
''-'`" d:O8oK -hrr- dOOo' :o":
`8O:;7b,. `"8' Y:
`Oo; 8:.
Y8bod.
Ву-гу-гу! Поне! Не забыли ещё?
−864
SELECT COUNT(*) FROM apteka.cache_offers WHERE ORG_ID = '21963' AND `subject_id` IN (35,30052,20262,20263,20001,30488,30776,22099,22044,21982,21938,21823,
(еще триста чисел),
26313,26358,26478,23381,27430,26367,26418,23433,23404,23372,23289,23321,23285,23315,23282,23406,23287,
26356,23429,23263,23349,23399,23356,23291,23346,23351,23250,23198,23194,23319,23238,23296,23259,23167,23268,23130,23052,23119,22430,23146,22315,23069,23083,23
127,23189,23023,23014,23059,22988,23020,23007,22989,22949,22937,22939,22941,22979,22786,22842,22849,22758,22913,22919,22833,22718,22753,22779,22724,22857,2276
8,22761,22733,22823,22759,22764,22658,22681,22674,22706,22599,22698,22667,22627,22776,22654,22655,22601,22619,22598,22694,22696,22603,22541,22570,22469,22534,
22515,22676,22516,22477,22491,22677,22513,22421,22537,22451,22507,22482,22440,22353,22523,22422,22510,22397,22473,22348,22383,22424,22333,22380,22359,22508,22
486,22456,22330);
Стандартный запрос. При формировании страницы конструкция встречается многократно (>10 раз)
+105
int c = ((i-(i%(int)pow(10,p)))/(int)pow(10,p))%10;
Выделение из числа I цифры, стоящей на месте P с конца.
=>
i = 1234, p = 2, c => 2
+120
string tmpS;
//идут всякие монипуляции с этой строкой
//. . .
tmpS.Remove(0, tmpS.Length);
Реальный код из коммерческого продукта.
+164
<?php
$Options = file("OPTIONS.txt");
foreach ($Options as $opt)
{
$opt = trim($opt);
eval("$".$opt.";");
}
+165
function get_sel_values(index){
var test = eval('typeof opt_val'+index);
if ( test != 'undefined' ){
eval('var sel_values = opt_val'+index);
return sel_values;
}
else { return false; }
}
//**************************************************************
function get_sel_text(index){
var test = eval('typeof opt_text'+index);
if ( test != 'undefined' ){
eval('var sel_text = opt_text'+index);
return sel_text;
}
else { return false; }
}
//**************************************************************
function show_select(index, lev, dv){
if ( dv == 'jdc1'){ var tr = "jdc2";}
if ( dv == 'jdc2'){ var tr = "jdc3";}
if ( dv == 'jdc3'){ var tr = "jdc4";}
var curr_sel_text = get_sel_text(index);
var curr_sel_value = get_sel_values(index);
if ( curr_sel_value != false && curr_sel_text != false ){
if ( dv == 'jdc1'){
document.getElementById('jdc1').style.visibility = "visible";
document.getElementById('jdc2').style.visibility = "hidden";
document.getElementById('jdc3').style.visibility = "hidden";
document.getElementById('jdc4').style.visibility = "hidden";
document.forms["form1"].elements['cc2'].length = 0;
document.forms["form1"].elements['cc3'].length = 0;
document.forms["form1"].elements['cc4'].length = 0;
}
if ( dv == 'jdc2'){
document.getElementById('jdc1').style.visibility = "visible";
document.getElementById('jdc2').style.visibility = "visible";
document.getElementById('jdc3').style.visibility = "hidden";
document.getElementById('jdc4').style.visibility = "hidden";
document.forms["form1"].elements['cc3'].length = 0;
document.forms["form1"].elements['cc4'].length = 0;
}
if ( dv == 'jdc3'){
document.getElementById('jdc1').style.visibility = "visible";
document.getElementById('jdc2').style.visibility = "visible";
document.getElementById('jdc3').style.visibility = "visible";
document.getElementById('jdc4').style.visibility = "hidden";
document.forms["form1"].elements['cc4'].length = 0;
}
var count_values = curr_sel_value.length;
var category_list = document.forms["form1"].elements[lev];
var count_category_list = category_list.options.length;
category_list.length = 0;
for (i = 0; i < count_values; i++){
if (document.createElement){
var newCategoryListOption = document.createElement("OPTION");
newCategoryListOption.text = curr_sel_text[i];
newCategoryListOption.value = curr_sel_value[i];
(category_list.options.add) ? category_list.options.add(newCategoryListOption) : category_list.add(newCategoryListOption);
}else{
category_list.options[i] = new Option(curr_sel_text[i], curr_sel_value[i], false, false);
}
}
document.getElementById(tr).style.visibility = "visible";
}
else{
document.getElementById(tr).style.visibility = "hidden";
}
}
//-->
+146
class GridPanel extends JPanel {
protected Point myLocation;
@Override
public Point location() {
return this.myLocation;
}
}
убивал бы за такое.