1. PHP / Говнокод #7376

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    if (file_exists("C:\autoexec.bat"))
      mysql_query('CREATE TABLE eto_windows');
    
    ...гдето в другом файле
    if(mysql_query('DROP TABLE eto_windows')) {
      echo "это виндоус ;(";
      mysql_query('CREATE TABLE eto_windows');
    }
    ...
    
    // не забываем чистить шлак! а то будут утечки!
    mysql_query('DROP TABLE eto_windows')

    вот такие вот дела...

    qfox, 29 Июля 2011

    Комментарии (15)
  2. JavaScript / Говнокод #7375

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    function ismaxlength255(obj){
        if (obj.getAttribute && obj.value.length>255)
                obj.value=obj.value.substring(0,255)
    }
    
    
    
    <textarea name="comment" cols="50" rows="3" onkeypress="return ismaxlength255(this);"></textarea>

    Нашел с исходниках крупной латвийской соц.сети

    jQuery, 28 Июля 2011

    Комментарии (32)
  3. C++ / Говнокод #7374

    +147

    1. 1
    ОТЦЕНИТЕ КОД!!!!1

    odnoklassniki, 28 Июля 2011

    Комментарии (8)
  4. Java / Говнокод #7373

    +147

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    /*
    org.springframework.aop.framework
    Class AbstractSingletonProxyFactoryBean
    
    Convenient proxy factory bean superclass for proxy factory beans that create only singletons. 
    */
    
    public abstract class AbstractSingletonProxyFactoryBean
    extends ProxyConfig
    implements FactoryBean, BeanClassLoaderAware, InitializingBean

    http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html
    Convenient proxy factory bean superclass for proxy factory beans that create only singletons. And we need to go deeper...

    zheka, 28 Июля 2011

    Комментарии (11)
  5. Python / Говнокод #7372

    −97

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    if cells[x-1,y-1] == 1: pos+=1
    else:
      if cells[x-1,y-1] == -1: neg+=1
    if cells[x-1,y] == 1: pos+=1
    else:
      if cells[x-1,y] == -1: neg+=1
    if cells[x-1,y+1] == 1: pos+=1
    else:
      if cells[x-1,y+1] == -1: neg+=1
    
    if cells[x,y-1] == 1: pos+=1
    else:
      if cells[x,y-1] == -1: neg+=1
    if cells[x,y] == 1: pos+=1
    else:
      if cells[x,y] == -1: neg+=1
    if cells[x,y+1] == 1: pos+=1
    else:
      if cells[x,y+1] == -1: neg+=1
    
    if cells[x+1,y-1] == 1: pos+=1
    else:
      if cells[x+1,y-1] == -1: neg+=1
    if cells[x+1,y] == 1: pos+=1
    else:
      if cells[x+1,y] == -1: neg+=1
    if cells[x+1,y+1] == 1: pos+=1
    else:
      if cells[x+1,y+1] == -1: neg+=1

    Иначе никак =D.

    Fai, 28 Июля 2011

    Комментарии (5)
  6. Java / Говнокод #7371

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    try {
    			final SecurityClientInternalLocal scil =
    				(SecurityClientInternalLocal) EJBLocator.getEJBLocal(
    						SecurityClientInternalLocal.class);
    			final String result = scil.getPath2ChipherTables(login);
    			return result;
    		} catch (Exception ex) {			
    			throw ex;
    		}

    Промышленная обработка исключений такая промышленная...

    roman-kashitsyn, 28 Июля 2011

    Комментарии (7)
  7. PHP / Говнокод #7370

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    // Базовые проверки на тип переменных
    if ((isset($this->params['month']) && (string)$this->params['month']!==(string)(int)$this->params['month'])
    	|| (isset($this->params['season']) && (string)$this->params['season']!==(string)(int)$this->params['season'])
    	|| (isset($this->params['year']) && (string)$this->params['year'] !== (string)(int)$this->params['year']) // проверки на вхождение в диапзон дат
    	|| (isset($this->params['year']) && !in_array($this->params['year'], $this->data['years']))
    	|| (isset($this->params['season']) && !isset($this->data['seasons'][(string)(int)$this->params['season']]))
    	|| (isset($this->params['month']) && !isset($this->data['monthes'][(string)(int)$this->params['month']])) || false
    	|| (isset($this->params['month']) && isset($this->params['season']) && !in_array((string)(int)$this->params['month'], $this->data['seasons_monthes'][(string)(int)$this->params['season']])))

    sectronov, 28 Июля 2011

    Комментарии (4)
  8. PHP / Говнокод #7369

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    While ($componentPage != "ticket_edit") 
    $componentPage = "ticket_edit";
    if ($componentPage == "ticket_edit") 
    $componentPage = "ticket_edit";

    нет, я всё понимаю, но зачем такое насилие и контрольный в голову?

    alazutov, 28 Июля 2011

    Комментарии (3)
  9. PHP / Говнокод #7368

    +147

    1. 1
    2. 2
    3. 3
    4. 4
    if (!$case['item_type'])
            unset($case['item_type']);
    else
            unset($case['content_id']);

    sectronov, 28 Июля 2011

    Комментарии (5)
  10. PHP / Говнокод #7367

    +146

    1. 1
    2. 2
    3. 3
    4. 4
    // поменяем местами get и post
    $_REQUEST=$_GET;
    $_POST=$_GET;
    $_GET=$_REQUEST;

    хорошее начало. Уже после комментария я стал бояться.
    Нет, ну блять,
    1. нахуя пытаться менять местами _GET и _POST
    2. через _REQUEST (что, переменных что ли мало?)
    3. Попутно перетирая нахуй его и чем-то провинившийся _POST со всеми остановками по дороге.

    PS каким-то образом кары избежал _GET. Порадуемся хоть за его.

    alazutov, 28 Июля 2011

    Комментарии (26)