- 1
- 2
- 3
- 4
- 5
- 6
<?
if($page!='/volga' && $page!='/volga/index.php'){
// Тут всякий код
} if($page=='/volga' or $page=='/volga/index.php'){?>
// И тут тоже
<?}?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+161
<?
if($page!='/volga' && $page!='/volga/index.php'){
// Тут всякий код
} if($page=='/volga' or $page=='/volga/index.php'){?>
// И тут тоже
<?}?>
+66
Integer obj = (Integer)dump.get("size");
if(obj == null) {
return;
}
int size = obj;
for(int i=0; i<size; i++) {
Самое странное, что автор явно знает, что такое автобоксинг, но всё равно использовал его коряво.
+77
public abstract class Data {
// The tone of Commander Riker's voice makes me suspect that
// he is not serious about finding Ambassador T'Pel charming.
// My experience suggests that in fact he may mean the exact
// opposite of what he says. Irony is a form of expression
// I have not yet been able to master.
+84
Query q;
//для хэширования
q =
session.createQuery("select idElType from " + LinkToAtributeValue.class.getName()
+ " where idEl=" + idObject.toString());
Vector<Integer> vec = new Vector<Integer>(q.list());
int t;
for(int i = 0; i < vec.size() - 1; i++) {
t = vec.get(i);
for(int j = i + 1; j < vec.size(); j++) {
if(t == vec.get(j)) {
vec.remove(j);
}
}
}
"DISTINCT для трусов"
или
"Хорошего кода должно быть много"
−85
def captions_and_translations_to_srt(captions_and_translations):
output = StringIO.StringIO()
for i in range(len(captions_and_translations)):
translation_to_srt(captions_and_translations[i][1],
captions_and_translations[i][0],
i, output)
srt = output.getvalue()
output.close()
return srt
def translation_to_srt(translation, video_caption, index, output):
subtitle_to_srt_impl(video_caption.caption_text if translation is None \
else translation.translation_text,
video_caption, index, output)
def subtitle_to_srt_impl(text, video_caption, index, output):
output.write(str(index + 1))
output.write("\n")
write_srt_time_line(video_caption, output)
output.write(text)
output.write("\n\n")
def write_srt_time_line(video_caption, output):
write_srt_time(video_caption.start_time, output)
output.write(" --> ")
write_srt_time(video_caption.end_time, output)
output.write("\n")
def write_srt_time(seconds, output):
seconds_int = int(seconds)
write_padded_num((seconds_int / 3600) % 60, 2, output)
output.write(":")
write_padded_num((seconds_int / 60) % 60, 2, output)
output.write(":")
write_padded_num(seconds_int % 60, 2, output)
output.write(",")
write_padded_num(int(seconds * 1000) % 1000, 3, output)
def write_padded_num(num, numchars, output):
strnum = str(num)
numzeros = numchars - len(strnum)
for i in range(numzeros):
output.write("0")
output.write(strnum)
Генератор SRT субтитров.
+79
public void restore(HashMap<String, Object> dump) {
if(dump != null) {
if(isInitialized()) {
if(isInitialized()) {
clear();
"Проинициализировано? Точно-точно?"
+172
days = (days < 10) ? days : days;
hours = (hours < 10) ? hours : hours;
minutes = (minutes < 10) ? minutes : minutes;
seconds = (seconds < 10) ? seconds : seconds;
Загадочная русская душа. Лежало в коде таймера обратного отсчета.
−99
case klass
when "Subject"
case attr.to_sym
when :screening_num then :screening_num
when :subject_num then :subject_num
end
end
это чО на всякий пожарный чтоли ?
обратите внимание что klass это объект ActiveRecord а проверяется как стринг
писал русский паренёк Дима ) а вы говорите индусы )
+173
$lib = $app['memcache.wrapper'] === false ? false : $app['memcache.wrapper'];
я туплю????? или кто-то получает за количество символов ????
+137
<table border="0" cellpadding="0" cellspacing="0" width="1000">
<tr>
<td width="1000" height="160" background="images/up.gif" align="center" valign="middle">
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<ul>
<p align="center">
<form action="http://www.google.com/cse" id="cse-search-box" target="_blank">
<div>
<ul>
<ul>
<ul>
<ul>
<ul>
<p><input type="hidden" name="cx" value="partner-pub-6721689618919481:ttrzumsg220" />
<input type="hidden" name="ie" value="windows-1252" />
<input type="text" name="q" size="25" />
<input type="submit" name="sa" value="Search" />
</p>
</ul>
</ul>
</ul>
</ul>
</ul>
</div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en">
</script>
</p>
<p align="center">
</p>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</ul>
</td> </tr>
</table>
из хтмла http://www.izarc.org/
слегка охренел когда случайно это увидел. параграф (пустой) в середине по центру выравненый улыбнул: т.е. в зачатке кто-то там понимает что есть такая фича как выравнивание. но вот пользоватся ею еще не научился.