- 1
Понтовый язык. Не полный по Тьюрингу...
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−110
Понтовый язык. Не полный по Тьюрингу...
−105
def show
@updates = UpdateList.new
update_id = params[:update_id]
if 'twitter' == @provider_key
provider_api = ProviderApi::Twitter.new(current_user)
if update_id.present?
begin
benchmark(" Twitter API: status") do
@api_response = provider_api.status(update_id)
end
@update = update = SocialUpdate.from_twitter_response(@api_response, true)
while update && (in_reply_to = update.in_reply_to_update_id)
benchmark(" Twitter API: status") do
@previous_status = provider_api.status(in_reply_to)
end
if error = @previous_status['error']
@updates << SocialUpdate.from_twitter_error(error)
break
else
update = SocialUpdate.from_twitter_response(@previous_status, true)
@updates << update
end
end
rescue => e
logger.info("Error in fetching status #{in_reply_to || update_id}: #{e}")
end
end
end
@update.flag_for_user(current_user) if @update
@updates.flag_for_user(current_user)
end
+146
if ((chlen = wcwidth(CharOf(CHDEREF(ch)))) <= 0) {
хорошо назвали переменную н курсес 5.9 tty_update.c
+128
string a = 'a'+""+'b';
string b = ""+'a'+'b';
string c = 'a'+'b'+"";
никогда не воспроизводи говнокод по памяти
+145
string a = 'a'+""+'b';
string b = ""+'a'+'b';
может и боян
+161
if($total>1) {
Error_Reporting(E_ALL & ~E_NOTICE);
echo "<tr><td colspan='4'><div align='center'> <br />";
echo $pervpage.$page5left.$page4left.$page3left.$page2left.$page1left.'<b>'.$p.'</b>'.$page1right.$page2right.$page3right.$page4right.$page5right.$nextpage;
echo "</div></tr></td>";
}
И это все к конце скрипта
+82
/**
* метод возвращает int-овое смещение тайм-зоны
*/
public long getIntOffset() {
if (timeZone == null) {
return 0;
}
return timeZone.getOffset(System.currentTimeMillis());
Calendar now = Calendar.getInstance();
int millisPerDay =
now.get(Calendar.HOUR) * ONE_HOUR +
now.get(Calendar.MINUTE) * ONE_MINUTE +
now.get(Calendar.SECOND) * ONE_SECOND;
int offset = timeZone.getOffset(
now.get(Calendar.ERA),
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH),
now.get(Calendar.DAY_OF_WEEK),
millisPerDay
);
int diff = now.get(Calendar.ZONE_OFFSET);
boolean isNegative = (offset < 0);
long intOffset = Math.abs(offset) - Math.abs(diff);
//todo здесь наверное как-то по-лучше можно выделить часы
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
String time = sdf.format(new Date(intOffset));
Date d;
try {
d = sdf.parse(time);
} catch (ParseException e) {
d=null;
}
if (d!=null)
return (isNegative?-1:1) * d.getHours()*3600000;
else
return 0;
}
Этот "шедевр" был написан не индусами, а суровыми программистами Новосиба ;) Это чудо долго работало, вплоть до обновления tzdata на 2011. Придется удалить, а жаль...
+112
ТАЩИТЕ ЛЕСТНИЦУ!
+143
void crash()
{
(( void(*)() )0)();
}
Crash ;]
+146
<?php
error_reporting(E_ALL);
require_once '../app/config.php';
require_once systemConfig::$pathToSystem . '/index.php';
require_once '../app/application.php';
$application = new application();
$application->run();
?>
http://code.google.com/p/govnokod/source/browse/trunk/govnoquoter/www/index.php
Шел 2011-й год...