1. Лучший говнокод

    В номинации:
    За время:
  2. Java / Говнокод #7441

    +72

    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
    30. 30
    31. 31
    32. 32
    package com.uva.concurrent;
    
    import com.uva.log.Log;
    import com.uva.log.Message;
    
    public class ThreadExecutor implements Executor {
    	private final String name;
    
    	public ThreadExecutor(String name) {
    		this.name = name;
    	}
    
    	public void execute(Runnable target) {
    		new Thread(target, name).start();
    	}
    	
    	/** Execute given runnable in separate thread. All exceptions will be caught.
    	 * @param runnable - runnable to execute. */
    	public void executeSilent(final Runnable runnable) {
    		new Thread() {	
    			public void run() {
    				try {
    					runnable.run();
    				} 
    				catch (RuntimeException e) {
    					Log.exception(name, Message.CRITICAL_ERROR, e);
    					throw e;
    				}
    			}
    		}.start();
    	}
    }

    Junior пишет весьма ThreadPoolExecutor для BlackBerry.

    enikey, 04 Августа 2011

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

    +147

    1. 1
    urldecode($_POST['name'])

    Нашел у себя в коде.

    stuffort, 29 Июля 2011

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

    +147

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

    odnoklassniki, 28 Июля 2011

    Комментарии (8)
  5. C# / Говнокод #7339

    +146

    1. 1
    private ExportDataToCSV() { } //don't use this one!

    No comments)))

    kudriavaya_juli, 25 Июля 2011

    Комментарии (8)
  6. JavaScript / Говнокод #7329

    +155

    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
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    jQuery.each(elems, function(i, elem) {
                    if (typeof elem === "number") {
                        elem += "";
                    }
                    if (!elem) {
                        return;
                    }
                    if (typeof elem === "string" && !rhtml.test(elem)) {
                        elem = context.createTextNode(elem);
                    } else if (typeof elem === "string") {
                        elem = elem.replace(rxhtmlTag, fcloseTag);
                        var tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(),
                            wrap = wrapMap[tag] || wrapMap._default,
                            depth = wrap[0],
                            div = context.createElement("div");
                        div.innerHTML = wrap[1] + elem + wrap[2];
                        while (depth--) {
                            div = div.lastChild;
                        }
                        if (!jQuery.support.tbody) {
                            var hasBody = rtbody.test(elem),
                                tbody = tag === "table" && !hasBody ? div.firstChild && div.firstChild.childNodes : wrap[1] === "<table>" && !hasBody ? div.childNodes : [];
                            for (var j = tbody.length - 1; j >= 0; --j) {
                                if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) {
                                    tbody[j].parentNode.removeChild(tbody[j]);
                                }
                            }
                        }
                        if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(elem)) {
                            div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]), div.firstChild);
                        }
                        elem = jQuery.makeArray(div.childNodes);
                    }
                    if (elem.nodeType) {
                        ret.push(elem);
                    } else {
                        ret = jQuery.merge(ret, elem);
                    }
                });

    mark, 24 Июля 2011

    Комментарии (8)
  7. Python / Говнокод #7323

    −86

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    {% if field.help_text %}
    <tr>
    <td></td>
    <td colspan="2" style="padding-top: 0px; padding-bottom: 10px;">{{ field.help_text|safe }}</td>
    <td>
    <img id="captcha_img" src="<?php echo $absolute_page_path; ?>captcha/captcha.php?ref=register"/>
    </td>
    {% endif %}

    Вот такую веселую хрень встретил в джанговских темплейтах =)

    de_orion, 23 Июля 2011

    Комментарии (8)
  8. Куча / Говнокод #7321

    +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
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    Рефакторинг всего сайта. 
    
    В html:
    <a class="gal" href="ссылка">
    	<p><img width="96" height="63" alt="" src="image.jpg"></p>
    	<p>Название</p>
        </a>
    
    В админке уже сделал ресайс изображений! 
    
    И вдруг оказывается  в CSS:
    .gal img {
      border: 1px solid #F4EDDC;
      display: block;
      height: 100px;
      margin: 0 auto;
      width: 160px;
    }

    Изменить дело 5 сек.. Но зло берет.

    De-Luxis, 23 Июля 2011

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

    +147

    1. 1
    sticky: <?php if(isset($gritter->sticky)) echo ($gritter->sticky?'true':'false'); else echo ('false');?>,

    часть json'а

    Lure Of Chaos, 22 Июля 2011

    Комментарии (8)
  10. Си / Говнокод #7300

    +142

    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    /* Standard streams.  */
    extern struct _IO_FILE *stdin;		/* Standard input stream.  */
    extern struct _IO_FILE *stdout;		/* Standard output stream.  */
    extern struct _IO_FILE *stderr;		/* Standard error output stream.  */
    /* C89/C99 say they're macros.  Make them happy.  */
    #define stdin stdin
    #define stdout stdout
    #define stderr stderr

    А смысл?

    intelfx, 21 Июля 2011

    Комментарии (8)
  11. JavaScript / Говнокод #7263

    +153

    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
    function preview(e,id,b){
    		e.stopPropagation();
    		var post;
    		if(b!=board||!$('#post_'+id).attr('id')){
    		$.getJSON('/getpost/'+b+'/'+id,function(data,status){
    			if(data){
    				post=$.tmpl(postmpl, {post:data,lng:'',info:''});
    			}else{
    				post=$('<div id="post_'+id+'" class="reply poststyle"> 404 </div>');
    			}
    			post.css({display:'block', width: '450px', position: 'absolute', top: e.pageY, left: e.pageX})
    				.mouseleave(function(evt){
    					if(!/cloned_/i.test(evt.relatedTarget.id)||evt.relatedTarget.id>p.attr('id')){
    						post.remove();
    					}
    			})
    			.attr('id','cloned_'+id).appendTo($(doc.body))
    		});
    		}else{
    			post=$('#post_'+id).clone();
    			post.css({display:'block', width: '450px', position: 'absolute', top: e.pageY, left: e.pageX})
    				.mouseleave(function(evt){
    					if(!/cloned_/i.test(evt.relatedTarget.id)||evt.relatedTarget.id>p.attr('id')){
    						post.remove();
    					}
    			})
    			.attr('id','cloned_'+id).appendTo($(doc.body))
    		}
    	}

    хуита, 16 Июля 2011

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