- 1
- 2
- 3
- 4
- 5
switch ($_SERVER['QUERY_STRING'])
{
case "comments":
$content = $_POST['addcomment'] ? $cmt->process_addcomment() : $this->main_comments($_GET['id']);
break;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+159.3
switch ($_SERVER['QUERY_STRING'])
{
case "comments":
$content = $_POST['addcomment'] ? $cmt->process_addcomment() : $this->main_comments($_GET['id']);
break;
Нашел в очередной cms.
+108.7
Function GetFmtTime:String;
var
tmpD : string;
crdate: TDateTime;
begin
crdate := Now;
tmpD := IntToStr(YearOf(crdate))+'-';
If MonthOf(crdate)<10 Then tmpD := tmpD + '0';
tmpD := tmpD + IntToStr(MonthOf(crdate))+'-';
If DayOf(crdate)<10 Then tmpD := tmpD + '0';
tmpD := tmpD + IntToStr(DayOf(crdate))+'(';
If HourOf(crdate)<10 Then tmpD := tmpD + '0';
tmpD := tmpD + IntToStr(HourOf(crdate)) + '-';
If MinuteOf(crdate)<10 Then tmpD := tmpD + '0';
tmpD := tmpD + IntToStr(MinuteOf(crdate)) + '-';
If SecondOf(crdate)<10 Then tmpD := tmpD + '0';
tmpD := tmpD + IntToStr(SecondOf(crdate)) + ')';
Result := tmpD;
end;
А почему бы не использовать обычную FormatDateTime?!
До моего прихода на фирму все пользовались выше приведенным кодом! (и много еще чем!)
+71.6
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Display;
public class BIOS extends MIDlet{
Kernel kern;
boolean in=false;
public void pauseApp(){
kern.c.println("ACPI : Macine paused");
}
public void destroyApp(boolean b){
kern.c.println("ACPI : Macine poweroffing");
exitApp(true);
}
public void startApp(){
if(!in) kern=new Kernel(this);
else kern.c.println("ACPI : Machine resumed");
in=true;
}
public void exitApp(boolean physical){
Display.getDisplay(this).setCurrent(kern.c);
kern.c.println("Changing runlevel to 0... [Ok]");
kern.c.println("Sending to processes the TERM signal");
kern.c.println("Sending to processes the KILL signal");
kern.c.println("Stopping FS: fsdriver");
kern.fs=null;
kern.c.println("Sending the system clocktime...");
try{
Thread.currentThread().sleep(5000L);kern.c.println("Destroyed.");
Thread.currentThread().sleep(500L);System.gc();}catch(Exception e){}
in=false;
if(physical) notifyDestroyed();
}
}
Очередной кусок говнокода :)
+73.3
package xx.xxxxxxxx.xxx.xxx.gui.constants;
/**
* constants.
*/
public class Constants
{
public static final int HORIZONTAL_SIZE = 500;
public static final int VERTICAL_SIZE = 340;
public static final int ABS_MAX_LENGTH_NUMBER = 28;
public static final int ZERO = 0;
public static final int ONE = 1;
public static final int TWO = 2;
public static final int THREE = 3;
public static final int FOUR = 4;
public static final int FIVE = 5;
}
ZERO=0, ONE=1, TWO=2, ...
Ваш К.О.
+143.8
News news = new News();
+162.4
$(document).ready(function(){
$("#dialog-a, #dialog-b, #dialog-c, #dialog-d, #dialog-e, #dialog-f, #dialog-g, #dialog-h, #dialog-i, #dialog-j, #dialog-k, #dialog-l, #dialog-m, #dialog-n, #dialog-o, #dialog-p, #dialog-q, #dialog-r, #dialog-s, #dialog-t, #dialog-u, #dialog-v, #dialog-w, #dialog-x, #dialog-y, #dialog-z").dialog(
{
autoOpen: false,
buttons: { 'OK': function() { $(this).dialog("close"); } },
modal: true,
width: 200
});
$("#button-a-dialog").click(function (event) {
$("#dialog-a").dialog('open');
event.preventDefault();
});
$("#button-b-dialog").click(function (event) {
$("#dialog-b").dialog('open');
event.preventDefault();
});
$("#button-c-dialog").click(function (event) {
$("#dialog-c").dialog('open');
event.preventDefault();
});
$("#button-d-dialog").click(function (event) {
$("#dialog-d").dialog('open');
event.preventDefault();
});
$("#button-e-dialog").click(function (event) {
$("#dialog-e").dialog('open');
event.preventDefault();
});
$("#button-f-dialog").click(function (event) {
$("#dialog-f").dialog('open');
event.preventDefault();
});
$("#button-g-dialog").click(function (event) {
$("#dialog-g").dialog('open');
event.preventDefault();
});
$("#button-h-dialog").click(function (event) {
$("#dialog-h").dialog('open');
event.preventDefault();
});
$("#button-i-dialog").click(function (event) {
$("#dialog-i").dialog('open');
event.preventDefault();
});
$("#button-j-dialog").click(function (event) {
$("#dialog-j").dialog('open');
event.preventDefault();
});
$("#button-k-dialog").click(function (event) {
$("#dialog-k").dialog('open');
event.preventDefault();
});
$("#button-l-dialog").click(function (event) {
$("#dialog-l").dialog('open');
event.preventDefault();
});
$("#button-m-dialog").click(function (event) {
$("#dialog-m").dialog('open');
event.preventDefault();
});
$("#button-n-dialog").click(function (event) {
$("#dialog-n").dialog('open');
event.preventDefault();
});
$("#button-o-dialog").click(function (event) {
$("#dialog-o").dialog('open');
event.preventDefault();
});
$("#button-p-dialog").click(function (event) {
$("#dialog-p").dialog('open');
event.preventDefault();
});
$("#button-q-dialog").click(function (event) {
$("#dialog-q").dialog('open');
event.preventDefault();
});
$("#button-r-dialog").click(function (event) {
$("#dialog-r").dialog('open');
event.preventDefault();
});
$("#button-s-dialog").click(function (event) {
$("#dialog-s").dialog('open');
event.preventDefault();
});
$("#button-t-dialog").click(function (event) {
$("#dialog-t").dialog('open');
event.preventDefault();
});
$("#button-u-dialog").click(function (event) {
$("#dialog-u").dialog('open');
event.preventDefault();
});
$("#button-v-dialog").click(function (event) {
$("#dialog-v").dialog('open');
+86.8
...
String tmp = null;
String age = null;
...
tmp = hdrInfo.getAge();
if( tmp != null )
{
age = tmp.substring( 0, tmp.length( ) - 1 );
if( !age.equals( "0" ) ) {
age = age;
} else {
age="";
}
} else {
age="";
}
Индусско-выверенный код.
+124.6
<item>
<title>Mixed Up and Maxi-ed Out at Peter Som</title>
<link>http://www.fashionwiredaily.com/first_word/fashion/article.weml?id=3056</link>
<description>Good news for gym-goers this fall: you can forget about the lunges, the squats and the leg presses,</description>
<pubDate>Sat, 13 Feb 2010 18:25:00 EST</pubDate>
<enclosure url="http://www.fashionwiredaily.com/common_images/feed_images/498955.jpg" length="20713" type="image/jpg" />
</item>
<item>
<title>Mixed Up and Maxi-ed Out at Peter Som</title>
<link>http://www.fashionwiredaily.com/first_word/fashion/article.weml?id=3056</link>
<description>Good news for gym-goers this fall: you can forget about the lunges, the squats and the leg presses,</description>
<pubDate>Sat, 13 Feb 2010 18:25:00 EST</pubDate>
<enclosure url="http://www.fashionwiredaily.com/common_images/feed_images/498953.jpg" length="21716" type="image/jpg" />
</item>
<item>
<title>Mixed Up and Maxi-ed Out at Peter Som</title>
<link>http://www.fashionwiredaily.com/first_word/fashion/article.weml?id=3056</link>
<description>Good news for gym-goers this fall: you can forget about the lunges, the squats and the leg presses,</description>
<pubDate>Sat, 13 Feb 2010 18:25:00 EST</pubDate>
<enclosure url="http://www.fashionwiredaily.com/common_images/feed_images/498951.jpg" length="22238" type="image/jpg" />
</item>
Опять же, обнаружилось на сателитном сайте нашей конторы. Обратите внимание, что все данные в rss повторяются по 3 раза за исключением картинок. Понятно, что rss генерится, но это ж каким... недалеким надо быть, чтобы так сгенерить...
[url]http://www.fashionwiredaily.com/first_word/feed.xml[/url]
−118.3
from app/controllers/test_controller.rb:13:in `index'
from (irb):4
from ♥:0>>
Сразу предупреждаю: не говнокод (и даже не код), можно минусовать.
День Святого Валентина, Interactive Ruby выдал такое, типа с праздником :)
PS: незнаю где здесь руби.
+144.8
$div = ($account->typeID == 1) ? true : false;
if ($div == true) {
// blablabla
}
И ведь не индус, а всё туда же.