- 1
- 2
- 3
- 4
- 5
- 6
var settings = new ResizeSettings();
settings.Width = width > 0 ? width : settings.Width;
settings.Height = height > 0 ? height : settings.Height;
ImageBuilder.Current.Build(url, cachedImagePath, settings);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+134
var settings = new ResizeSettings();
settings.Width = width > 0 ? width : settings.Width;
settings.Height = height > 0 ? height : settings.Height;
ImageBuilder.Current.Build(url, cachedImagePath, settings);
Соль в том, что settings.Width и settings.Height, инициализируется -1, а ImageBuilder.Current.Build считает, что -1 - это маркер необязательного параметра.
+139
var priorities = Repository.Get<IIncidentPriority>().Query().OrderBy(x => x.Priority)
.Select(x => new InputItem { Id = x.Id.ToString(CultureInfo.InvariantCulture), Value = x.LocalizationValue })
.ToList();
priorities.Add(new InputItem { Id = "-1", Value = Localizator.Get("X4.Incident.Undefined") });
priorities.Reverse();
тру хацкеры презирают метод Insert )
+47
if ($num_rows2>0) {
$raw2=mysql_fetch_array($sth2, MYSQL_ASSOC);
$desc=$raw2['desc'];
$sector = "$desc";//O-o-o!
}
//далее $desc нигде не используется, равно как и $raw2
//и ещё:
$sid=$raw['id'];
$sector=$raw['sector'];
$selind='';
if ($sector==$sid) { $selind='selected'; }
echo "<option value='$sid' $selind >$sector</option>";
//и так по всему коду
//А ЭТО вместо темплэйта от 30 до 150 include за один раз с огрызками HTML и PHP
<?php
require_once('includes/core.php'); // connection, config
$is_index_page = true; // add this variable to check that we are on default index page (#2907)
require_once('header.php');
require_once('menu.php');
include('homepage.php');
. . .
. . .
require_once('footer.php');
?>
Реальный кусок Хадж-кода. В комплекте более 3500 файлов перекрёстно инклюдящих друг друга. Действительно "Индусский код" оплачивается построчно..., дёшево, долго, сердито.
+81
if (uf.getPath().contains("d:/test.java/uploads/")) {
uf.setPath(uf.getPath().replace("d:/test.java/uploads/", this.uploadPath));
}
+116
object User extends User with MetaMegaProtoUser[User] {
http://exploring.liftweb.net/master/index-2.html
+158
$(window).load(function() {
if ($(window).height() < 587) {
$('#inquiry').css({'position' : 'relative','margin-top' : -511,'top' : 0});
}
$(document).ready(function() {
$(function() {
if ($.browser.msie && $.browser.version >= 7) {
$('.ask').click(function() {
$('#inquiry').css({'display' : 'block'});
$('#inquiry_pop').css({'display' : 'block'});
});
$('#close_iq').click(function() {
$('#inquiry').hide();
$('#inquiry_pop').hide();
});
$('.sub_fo').click(function() {
$('#inquiry, #inquiry_pop').hide(0);
$('#thank_you').delay(500).show(0);
$('#thank_you').delay(3000).hide(0);
});
} else {
$('.ask').click(function() {
$('#inquiry, #inquiry_pop').fadeIn(1500);
});
$('#close_iq').click(function() {
$('#inquiry, #inquiry_pop').fadeOut(1500);
});
$('.sub_fo').click(function() {
$('#inquiry, #inquiry_pop').fadeOut(1500);
$('#thank_you').delay(500).fadeIn(1500);
$('#thank_you').delay(3000).fadeOut(1500);
});
}
});
});
});
−133
return { map { $_ => $domain->$_ } qw( name ) };
Мини-говнокодик. Ради одного имени наворотили map.
+70
if (s.startsWith("job."))
{
s = s.trim().replaceFirst("job\\.", "");
String name = s.split("\\.")[0];
String paramName = s.split("\\.")[1];
// Ещё немного говнокода, не сильно интересного
}
+72
public abstract class SomeActivity extends Activity implements SomeEventListener {
@Override
protected void onResume() {
super.onResume();
application.addSomeListener(this);
}
@Override
protected void onPause() {
application.removeSomeListener(this);
super.onPause();
}
В дополнение к #11379
Вопрос пользователю нужно задать поверх любой нашей активити...
+71
protected T mutex;
public Mutex(final Class<?> clazz) {
if (this.mutex != null) {
this.mutex = null;
}
Runtime.getRuntime().addShutdownHook(this);
}
ну а вдруг?