- 1
<div onmouseover="this.style.cursor = 'pointer';" onmouseout="this.style.cursor = 'default';">
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+121
<div onmouseover="this.style.cursor = 'pointer';" onmouseout="this.style.cursor = 'default';">
+163
require_once(HTML2PS_DIR.'utils_array.php');
require_once(HTML2PS_DIR.'utils_graphic.php');
require_once(HTML2PS_DIR.'utils_url.php');
require_once(HTML2PS_DIR.'utils_text.php');
require_once(HTML2PS_DIR.'utils_units.php');
require_once(HTML2PS_DIR.'utils_number.php');
require_once(HTML2PS_DIR.'value.color.php');
require_once(HTML2PS_DIR.'config.parse.php');
require_once(HTML2PS_DIR.'flow_context.class.inc.php');
require_once(HTML2PS_DIR.'flow_viewport.class.inc.php');
require_once(HTML2PS_DIR.'output._interface.class.php');
require_once(HTML2PS_DIR.'output._generic.class.php');
require_once(HTML2PS_DIR.'output._generic.pdf.class.php');
require_once(HTML2PS_DIR.'output._generic.ps.class.php');
require_once(HTML2PS_DIR.'output.pdflib.old.class.php');
require_once(HTML2PS_DIR.'output.pdflib.1.6.class.php');
require_once(HTML2PS_DIR.'output.fpdf.class.php');
require_once(HTML2PS_DIR.'output.fastps.class.php');
require_once(HTML2PS_DIR.'output.fastps.l2.class.php');
require_once(HTML2PS_DIR.'output.png.class.php');
// require_once(HTML2PS_DIR.'output.pcl.class.php');
require_once(HTML2PS_DIR.'stubs.common.inc.php');
require_once(HTML2PS_DIR.'media.layout.inc.php');
require_once(HTML2PS_DIR.'box.php');
require_once(HTML2PS_DIR.'box.generic.php');
require_once(HTML2PS_DIR.'box.generic.formatted.php');
require_once(HTML2PS_DIR.'box.container.php');
require_once(HTML2PS_DIR.'box.generic.inline.php');
require_once(HTML2PS_DIR.'box.inline.php');
require_once(HTML2PS_DIR.'box.inline.control.php');
require_once(HTML2PS_DIR.'font.class.php');
require_once(HTML2PS_DIR.'font_factory.class.php');
require_once(HTML2PS_DIR.'box.br.php');
require_once(HTML2PS_DIR.'box.block.php');
require_once(HTML2PS_DIR.'box.page.php');
require_once(HTML2PS_DIR.'box.page.margin.class.php');
require_once(HTML2PS_DIR.'box.body.php');
require_once(HTML2PS_DIR.'box.block.inline.php');
require_once(HTML2PS_DIR.'box.button.php');
require_once(HTML2PS_DIR.'box.button.submit.php');
require_once(HTML2PS_DIR.'box.button.reset.php');
require_once(HTML2PS_DIR.'box.checkbutton.php');
require_once(HTML2PS_DIR.'box.form.php');
require_once(HTML2PS_DIR.'box.frame.php');
require_once(HTML2PS_DIR.'box.iframe.php');
require_once(HTML2PS_DIR.'box.input.text.php');
require_once(HTML2PS_DIR.'box.input.textarea.php');
require_once(HTML2PS_DIR.'box.input.password.php');
require_once(HTML2PS_DIR.'box.legend.php');
require_once(HTML2PS_DIR.'box.list-item.php');
require_once(HTML2PS_DIR.'box.null.php');
require_once(HTML2PS_DIR.'box.radiobutton.php');
require_once(HTML2PS_DIR.'box.select.php');
require_once(HTML2PS_DIR.'box.table.php');
require_once(HTML2PS_DIR.'box.table.cell.php');
require_once(HTML2PS_DIR.'box.table.cell.fake.php');
require_once(HTML2PS_DIR.'box.table.row.php');
require_once(HTML2PS_DIR.'box.table.section.php');
require_once(HTML2PS_DIR.'box.text.php');
require_once(HTML2PS_DIR.'box.text.string.php');
require_once(HTML2PS_DIR.'box.field.pageno.php');
require_once(HTML2PS_DIR.'box.field.pages.php');
........
и так до 284й строки включительно...
в самописном модуле к Drupal нашел сий шедевр
+165
function month($n){
switch ($n) {
case 1: $m = "сiчнi" ; break;
case 2: $m = "лютому" ; break;
case 3: $m = "березнi"; break;
case 4: $m = "квiтнi" ; break;
case 5: $m = "травнi" ; break;
case 6: $m = "червнi" ; break;
case 7: $m = "липнi" ; break;
case 8: $m = "серпнi" ; break;
case 9: $m = "вереснi"; break;
case 10: $m = "жовтнi" ; break;
case 11: $m = "листопадi"; break;
case 12: $m = "груднi" ; break;
}
return $m;
}
function month2($n)
{
switch ($n)
{
case 1: $m = "сiчень" ; break;
case 2: $m = "лютий" ; break;
case 3: $m = "березень"; break;
case 4: $m = "квiтень" ; break;
case 5: $m = "травень" ; break;
case 6: $m = "червень" ; break;
case 7: $m = "липень" ; break;
case 8: $m = "серпень" ; break;
case 9: $m = "вересень"; break;
case 10: $m = "жовтень" ; break;
case 11: $m = "листопад"; break;
case 12: $m = "грудень" ; break;
}
return $m;
}
/*... всяко разно ...*/
if($month==1)$month="сiчнi";
if($month==2)$month="лютому";
if($month==3)$month="березнi";
if($month==4)$month="квiтнi";
if($month==5)$month="травнi";
if($month==6)$month="червнi";
if($month==7)$month="липнi";
if($month==8)$month="серпнi";
if($month==9)$month="вереснi";
if($month==10)$month="жовтнi";
if($month==11)$month="листопадi";
if($month==12)$month="груднi";
// дебажный комментарий тут был
if($month1==1)$month1="сiчнi";
if($month1==2)$month1="лютому";
if($month1==3)$month1="березнi";
if($month1==4)$month1="квiтнi";
if($month1==5)$month1="травнi";
if($month1==6)$month1="червнi";
if($month1==7)$month1="липнi";
if($month1==8)$month1="серпнi";
if($month1==9)$month1="вереснi";
if($month1==10)$month1="жовтнi";
if($month1==11)$month1="листопадi";
if($month1==12)$month1="груднi";
/*...еще немного...*/
if($month==1)$month1="сiчнi";
if($month==2)$month1="лютому";
if($month==3)$month1="березнi";
if($month==4)$month1="квiтнi";
if($month==5)$month1="травнi";
if($month==6)$month1="червнi";
if($month==7)$month1="липнi";
if($month==8)$month1="серпнi";
if($month==9)$month1="вереснi";
if($month==10)$month1="жовтнi";
if($month==11)$month1="листопадi";
if($month==12)$month1="груднi";
+73.6
package psorter;
import java.util.Vector;
public class CArray extends Vector {
String type="";
/**
* constructor of /array/
* @param i set capacity increment
*/
public CArray(int i) {
this.capacityIncrement=i;
}
/**
* add object to end of vector with check of type
* if type same as @ first added - add this object
* safer than add
* @param o object to add
*/
public void append(Object o) {
if ( this.type.equals("") )
this.type=o.getClass().toString();
if ( o.getClass().toString().equals(this.type) ){
this.add(o);
} else {
if ( this.type.contains("Float") && o.getClass().toString().contains("Integer") )
this.add( Float.valueOf(o.toString()) );
if ( this.type.contains("Double") && o.getClass().toString().contains("Integer") )
this.add( Double.valueOf(o.toString()) );
if ( this.type.contains("Double") && o.getClass().toString().contains("Float") )
this.add( Double.valueOf(o.toString()) );
if ( this.type.contains("String") && o.getClass().toString().contains("Char") )
this.add( o.toString() );
}
}
public byte compare(int i, int j) throws Exception {
if (type.contains("Integer")) {
if ((Integer) (this.get(i)) > (Integer) (this.get(j)))
return 1;
if ((Integer) (this.get(i)) < (Integer) (this.get(j)))
return -1;
return 0;
}
if (type.contains("Float")) {
if ((Float) (this.get(i)) > (Float) (this.get(j)))
return 1;
if ((Float) (this.get(i)) < (Float) (this.get(j)))
return -1;
return 0;
}
if (type.contains("Double")) {
if ((Double) (this.get(i)) > (Double) (this.get(j)))
return 1;
if ((Double) (this.get(i)) < (Double) (this.get(j)))
return -1;
return 0;
}
if (type.contains("Char")) {
if ((Character) (this.get(i)) > (Character) (this.get(j)))
return 1;
if ((Character) (this.get(i)) < (Character) (this.get(j)))
return -1;
return 0;
}
if (type.contains("String")) {
if ( this.get(i).toString().compareTo(this.get(j).toString())>0 )
return 1;
if ( this.get(i).toString().compareTo(this.get(j).toString())<0 )
return -1;
return 0;
}
return 0;
}
}
сел писать 3 лабы естественно в последнюю ночь. начал в 11. эта была около 3х. самому потом стыдно было нести такое
+159.8
function AbstractControl_getProperty (propertyName) {
var targetElement = this.getTargetPath(propertyName);
var result = null;
if (this.isTargetAttribute(propertyName)) {
eval("result = targetElement." + this.getAttributeName(propertyName));
} else {
var getter = this.getGetterName(propertyName);
var expression = "result = targetElement." + getter + "();";
eval(expression);
}
return result;
}
Вот так наши "суровые челябинские" программисты, не имеющие представления об интроспективности javascript-а, повсюду злоупотребляют eval-ом, усложняя отладку и понимание кода.
По хорошему, вместо первого eval-а должно бы быть:
result = targetElement[this.getAttributeName(propertyName)];
а вместо второго:
result = targetElement[this.getGetterName(propertyName)]();
+157.8
function dayTimestamp($t=null) {
if (!$t) $t = time();
$t = explode('-',date('Y-m-d',$t));
$t = mktime(0,0,0,$t[1],$t[2],$t[0]);
return $t;
}
+82.6
if IntToStr(n) = '2' then
чудо-программисты, еклмн
+77.6
public void run()
{
try
{
startExport();
}
catch (Throwable _t)
{
sendEvent(""+_t.getMessage(), true);
logger.log(Level.SEVERE, charset, _t);
}
finally
{
System.gc();
}
}
А ещё этот человек дёргает в одном сервисе gc каждые 4 секунды. Любые попытки ударить по рукам нарываются на отлуп: "так работает же!". Это не студент! Это реальный production код!
+149.2
$is_use_newstyle = ($newstyle == 1) ? 1 : 0;
+170.9
<?php
$mounths["January"]="01";
$mounths["February"]="02";
$mounths["March"]="03";
$mounths["April"]="04";
$mounths["May"]="05";
$mounths["June"]="06";
$mounths["July"]="07";
$mounths["August"]="08";
$mounths["September"]="09";
$mounths["October"]=10;
$mounths["November"]=11;
$mounths["December"]=12;
$m=date("F");
$d=date("d");
$Y=date("Y");
$datetime=date("Y")."-".$mounths[$m]."-".date("d")." ".date("H").":".date("i").":".date("s");
$date=date("Y")."-".$mounths[$m]."-".date("d");
?>
Ээээ, чо? Нарыл в проекте. Отпаиваюсь чаем.