- 1
- 2
float alpha = float(m_startAlpha) + 255.0f * (getElapsed() / (m_duration * (1.0f - float(m_startAlpha) / 255.0f)));
m_target->setAlpha(static_cast<uint8_t>(alpha));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+160
float alpha = float(m_startAlpha) + 255.0f * (getElapsed() / (m_duration * (1.0f - float(m_startAlpha) / 255.0f)));
m_target->setAlpha(static_cast<uint8_t>(alpha));
Выдержка из обновления объекта-действия, производящего линейный фейд-аут объекта...
Общение с чужим говнокодом не проходит бесследно... что же я курил, перед тем как ЭТО соорудить?
+160
public function get_settings($id,$name,$total,$limit)
{
$config = array();
$config['total_rows'] = $total;
$config['per_page'] = $limit;
$config['first_link'] = '«Первая';
$config['last_link'] = 'Последняя»';
$config['next_link'] = '»';
$config['prev_link'] = '«';
switch($id)
{
// Если навигация для категорий
case 'category':
$config['base_url'] = base_url().'/index/category/'.$name;
$config['uri_segment'] = 4;
//количество "цифровых" ссылок по бокам от текущей
$config['num_links'] = 5;
return $config;
break;
}
}
+140
printf("0x%02X", (int)( (((block[i << 1] >> ((15 - (j >> 4)) << 2)) & 15) << 4 ) | ((block[(i << 1) | 1] >> ((15 - (j & 15)) << 2)) & 15)));
Жертва жестокой оптимизации. При всем этом код исправно делал свое дело... пока не пришла пора в нем что-то изменить =)
+166
<?php
if (!isset($_REQUEST['page'])&&!isset($_REQUEST['story']))
{
header('Location: index.php');
exit;
}
$page = $_REQUEST['page'];
$story = intval($_REQUEST['story']);
include_once('db_fns.php');
include_once('header.php');
$handle = db_connect();
if($story)
{
$query = "select * from stories
where id = '$story' and
published is not null";
}
else
{
$query = "select * from stories
where page = '$page' and
published is not null
order by published desc";
}
$result = $handle->query($query);
while ($story = $result->fetch_assoc())
{
// headline
echo "<h2>{$story['headline']}</h2>";
//picture
if ($story['picture'])
{
echo '<div style="float:right; margin:0px 0px 6px 6px;">';
echo '<img src="resize_image.php?image=';
echo urlencode($story[picture]);
echo '&max_width=200&max_height=120" align = right/></div>';
}
// byline
$w = get_writer_record($story['writer']);
echo '<br /><p class="byline">';
echo $w[full_name].', ';
echo date('M d, H:i', $story['modified']);
echo '</p>';
// main text
echo $story['story_text'];
}
include_once('footer.php');
?>
Там еще много такого говнеца
http://www.ibm.com/developerworks/ru/library/l-php_mysql_10/index.html?S_TACT=105AGX99&S_CMP=GR01
На ЛОРе обсуждают http://www.linux.org.ru/news/doc/6002642
−107
try
{
compressedData.uncompress();
}
catch (e:Error)
{
throw e;
}
+146
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td id="menu"><a id="1" href="javascript:void(0);">Link 1</a></td>
<td id="menu"><a id="2" href="javascript:void(0);">Link 2</a></td>
<td id="menu"><a id="3" href="javascript:void(0);">Link 3</a></td>
</tr>
</table>
ну вкладки html тут нет
+165
<? session_start();
if (isset($_session['username'])) $s=$_session['username'];
else $s="Beda!!!!"
echo $s;
?>
+165
/*
CONNECT
*/
function connect( $server, $user, $pass )
{
return mysql_connect( $server, $user, $pass );
mysql_query("SET NAMES 'utf8'");
}
/*
PCONNECT
*/
function pconnect( $server, $user, $pass )
{
return mysql_pconnect( $server, $user, $pass );
mysql_query("SET NAMES 'utf8'");
}
/*
SELECT DB
*/
function select_db($database,$link_id)
{
return mysql_select_db($database,$link_id);
mysql_query("SET NAMES 'utf8'");
}
+92
procedure TForm1.Button1Click(Sender: TObject);
var
outfi:string;
begin
if OpenDialog1.Execute then
begin
outfi:=sysutils.ExtractFilePath((OpenDialog1.FileName))+'/program.asm';
windows.CreateFile(PChar(outfi),0,0,0,0,0,0);
AssignFile(outPutFile,outfi);
Rewrite(outPutFile);
Append(outPutFile);
AssignFile(inPutFile,OpenDialog1.FileName);
Reset(inPutFile);
init();
writeLn(outPutFile,prologMemo.Lines.GetText());
doprogram();
writeLn(outPutFile,epilogMemo.Lines.GetText());
CloseFile(outPutFile);
CloseFile(inPutFile);
ShellExecute( 0, 'open', PChar(outfi), nil, nil, SW_SHOWNORMAL);
end;
end;
+158
function sqlemptydate($test) {
return (!$test || ($test == '0000-00-00') || ($test == '0000-00-00 00:00:00'));
}