- 1
- 2
$_type = 'event';
if ( isset($cfgWeight->$_type) ) $this->weight = $cfgWeight->$_type;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+21.7
$_type = 'event';
if ( isset($cfgWeight->$_type) ) $this->weight = $cfgWeight->$_type;
Внимание, вопрос!
Нахрена здесь $_type?
−41
flag = bool(int(flag) - 1);
−53.2
private void setTims( String project )
{
int endIndex = project.indexOf( "-" );
boolean isNumber = false;
if ( endIndex != -1 )
{
try
{
Integer.parseInt( project.substring( 0, endIndex ) );
isNumber = true;
}
catch ( NumberFormatException e )
{
//ignore
}
}
if ( isNumber )
{
runtimeContext.put( RuntimeContext.TIMS_NUMBER, project.substring( 0, endIndex ) );
}
else
{
runtimeContext.put( RuntimeContext.TIMS_NUMBER, project );
}
}
+25.9
$temp = $this->template($this->modulePath."/right_frame");
eval("\$blockData = \"$temp\";");
return $blockData;
Реализация механизма подключения шаблонов в PHP %)
−37.2
isRegKeyRequired = distKey == null ? false : distKey.equals("yes") ? true : false;
Уматный ХавнАкоД коллеги из Индии. Ну просто няйсь. Смотрится куда зло*буче чем желаемый вариант (isRegKeyRequired = "yes".equals(distKey));
+29.3
for ($i=0; $i < $this->acl_count; $i++)
{
$acl =& $this->acl[$i];
if (strcasecmp( $aco_section_value, $acl[0] ) == 0) {
if (strcasecmp( $aco_value, $acl[1] ) == 0) {
if (strcasecmp( $aro_section_value, $acl[2] ) == 0) {
if (strcasecmp( $aro_value, $acl[3] ) == 0) {
if ($axo_section_value && $acl[4]) {
if (strcasecmp( $axo_section_value, $acl[4] ) == 0) {
if (strcasecmp( $axo_value, $acl[5] ) == 0) {
$acl_result = @$acl[6] ? $acl[6] : 1;
break;
}
}
} else {
$acl_result = @$acl[6] ? $acl[6] : 1;
break;
}
}
}
}
}
}
из ядра Joomla
+28.9
$revutxt = ($result_good['description']!='') ? $result_good['description'] : '';
вот где безопасность! вот где проверка верных значений переменных!)
+42.9
extract($GLOBALS);
Анекдот в одну строчку
+6.1
do {
XLoop:
XNextEvent(dpy,&event);
switch(event.type) {
case ResizeRequest:
if (event.xresizerequest.window!=win_main)
goto XLoop;
resize_main:
xswa.event_mask&= ~ResizeRedirectMask;
XChangeWindowAttributes(dpy,win_main,CWEventMask, &xswa);
XSync(dpy,0); /* very important, otherwise we loop endlessly ! */
XResizeWindow(dpy, win_main,event.xresizerequest.width,event.xresizerequest.height);
XSync(dpy,0); /* very important, otherwise we loop endlessly ! */
xswa.event_mask|= ResizeRedirectMask;
XChangeWindowAttributes(dpy,win_main,CWEventMask, &xswa);
resize=1;
XSync(dpy,0); /* another one, just in case... */
goto redisplay;
case Expose:
if (event.xexpose.count|moving_button1|vmoving_button)
goto XLoop;
.....// и дальше такой же хрени типа нарисовать и goto XLoop; :)
Однако под X11 пишут и так:
+16.6
$temp69 = new dbQuery($sql69, $conn->connId) or die(mysql_error());
$i=""; while($i<=5) { $res69=$temp69->getArray(); $i++; }
$sql69="select * from dj_config";
$temp69= new dbQuery($sql69, $conn->connId) or die(mysql_error());
$i="";
while($i<=5){
$res69=$temp69->getArray();
$i++;
}
оригинал: http://blog.sjinks.org.ua/humour/76-programmers-russian-indian-chinese-canadian/