- 1
- 2
- 3
- 4
if rtrim(@parent_ID) = null
select '' as Parent_ID, '' as Parent_Name where 1 = 2
else
select isnull(@parent_ID, '') as Parent_ID, isnull(@parent_name, '') as Parent_Name
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−854
if rtrim(@parent_ID) = null
select '' as Parent_ID, '' as Parent_Name where 1 = 2
else
select isnull(@parent_ID, '') as Parent_ID, isnull(@parent_name, '') as Parent_Name
+72
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.
+147
urldecode($_POST['name'])
Нашел у себя в коде.
+147
ОТЦЕНИТЕ КОД!!!!1
+146
private ExportDataToCSV() { } //don't use this one!
No comments)))
+155
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);
}
});
−86
{% 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 %}
Вот такую веселую хрень встретил в джанговских темплейтах =)
+147
Рефакторинг всего сайта.
В 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 сек.. Но зло берет.
+147
sticky: <?php if(isset($gritter->sticky)) echo ($gritter->sticky?'true':'false'); else echo ('false');?>,
часть json'а
+142
/* 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
А смысл?