- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
var code = '\
int sum(int a, int b) {\
__asm {\
mov eax, a;\
add eax, b;\
mov a, eax;\
}\
return a;\
}';
var sum = cpp2js(code);
var ans = sum(34, 288);
alert(ans);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+4
var code = '\
int sum(int a, int b) {\
__asm {\
mov eax, a;\
add eax, b;\
mov a, eax;\
}\
return a;\
}';
var sum = cpp2js(code);
var ans = sum(34, 288);
alert(ans);
http://www.speqmath.com/tutorials/cpp2js/index.html
+4
function Head($p1) {
echo '<!DOCTYPE html><html><head><meta charset="utf-8" /><title>'.$p1.'</title><meta name="keywords" content="" /><meta name="description" content="" /><link href="/resource/style.css" rel="stylesheet"><link rel="icon" href="/resource/img/favicon.ico" type="image/x-icon"><script src="//mc.yandex.ru/metrika/watch.js" type="text/javascript"></script><script type="text/javascript">try {var yaCounter30971061 = new Ya.Metrika({id:30971061});}catch(e){}</script></head>';
}
шедевры от #Mr.shitcode (для своих адептов - mr.shift)
за такой вывод html нужно отрывать руки
+2
case ((((parametr[3, 1] - parametr[1, 1]) / parametr[4, 2] = (parametr[3, 2] - parametr[1, 2]) / parametr[4, 2]) and ((parametr[3, 2] - parametr[1, 2]) / parametr[4, 2] = (parametr[3, 3] - parametr[1, 3]) / parametr[4, 3])) xor
((parametr[4, 1] = 0) and (parametr[1, 1] = parametr[2, 1]) and (parametr[2, 1] = parametr[3, 1]) and ((parametr[3, 2] - parametr[1, 2]) / parametr[4, 2] = (parametr[3, 3] - parametr[1, 3]) / parametr[4, 3])) xor
((parametr[4, 2] = 0) and (parametr[1, 2] = parametr[2, 2]) and (parametr[2, 2] = parametr[3, 2]) and ((parametr[3, 1] - parametr[1, 1]) / parametr[4, 1] = (parametr[3, 3] - parametr[1, 3]) / parametr[4, 3])) xor
((parametr[4, 3] = 0) and (parametr[1, 3] = parametr[2, 3]) and (parametr[2, 3] = parametr[3, 3]) and ((parametr[3, 1] - parametr[1, 1]) / parametr[4, 1] = (parametr[3, 2] - parametr[1, 2]) / parametr[4, 2])) xor
((parametr[4, 3] <> 0) and (parametr[4, 1] = 0) and (parametr[4, 2] = 0) and (parametr[3, 1] = parametr[2, 1]) and (parametr[3, 2] = parametr[2, 2])) xor
((parametr[4, 2] <> 0) and (parametr[4, 1] = 0) and (parametr[4, 3] = 0) and (parametr[3, 1] = parametr[2, 1]) and (parametr[3, 3] = parametr[2, 3])) xor
((parametr[4, 1] <> 0) and (parametr[4, 2] = 0) and (parametr[4, 3] = 0) and (parametr[3, 2] = parametr[2, 2]) and (parametr[3, 3] = parametr[2, 3])) xor
((parametr[4, 1] = 0) and (parametr[4, 2] = 0) and (parametr[4, 3] = 0))) of true:
writeln('Все точки лежат на одной прямой. Такой треугольник не существует.');
Проверка треугольника в декартовой системе координат
+1
{header}
<p style="font-weight: bold; text-decoration: underline">{$orgName}</p>
<p style="font-weight: bold">Адреса: {$orgBillingAddress}, тел.: {$orgPhone}</p>
<div style="font-weight: bold; text-align: center">Зразок заповенння платіжного доручення</div>
<table border="1" cellpadding="2">
<tr>
<td width="140">ЄДРПО {$orgInn}</td><td width="140">ІДПРС {$orgKpp}</td><td rowspan="2" width="50"><br/><br/>Рахунок. №</td><td rowspan="2" width="200"><br/><br/>{$orgBankAccount}</td>
</tr>
<tr>
<td colspan="2" width="280"><span style="font-size: 8pt">Одержувач</span><br/>{$orgName}</td>
</tr>
<tr>
<td colspan="2" rowspan="2" width="280"><span style="font-size: 8pt">Банк отримувача</span><br/>{$orgBankName}</td>
<td width="50">БІК</td>
<td rowspan="2" width="200">{$orgBankId}<br/>{$orgCorrAccount}</td>
</tr>
<tr>
<td width="50">Рахунок. №</td>
</tr>
</table>
<br/>
<h1 style="text-align: center">Рахунок № {$invoice_no} від {$invoice_invoicedate}</h1>
<br/><br/>
<table border="0">
<tr>
<td width="100">Платник:</td><td width="450"><span style="font-weight: bold">{$account_accountname}</span></td>
</tr>
<tr>
<td width="100">Одержувач:</td><td width="450"><span style="font-weight: bold">{$orgName}</span></td>
</tr>
</table>
{/header}
{table_head}
<table border="1" style="font-size: 8pt" cellpadding="2">
<tr style="text-align: center; font-weight: bold">
<td width="30">№</td>
<td width="260">Назва<br/>товару</td>
<td width="65">Одиниця<br/>вимір-<br/>рювання</td>
<td width="35">Кіль-<br/>кість</td>
<td width="70">Ціна</td>
<td width="70">Сумма</td>
</tr>
{/table_head}
{table_row}
<tr>
<td width="30">{$productNumber}</td>
<td width="260">{$productName} {$productComment}</td>
<td width="65" style="text-align: center">{$productUnits}</td>
<td width="35" style="text-align: right">{$productQuantityInt}</td>
<td width="70" style="text-align: right">{$productPrice}</td>
<td width="70" style="text-align: right">{$productNetTotal}</td>
</tr>
{/table_row}
{summary}
</table>
<table border="0" style="font-size: 8pt;font-weight: bold">
<tr>
<td width="460">
<table border="0" cellpadding="2">
<tr><td width="460" style="text-align: right">Разом:</td></tr>
<tr><td width="460" style="text-align: right">Сумма ПРД:</td></tr>
<tr><td width="460" style="text-align: right">Всього до сплати:</td></tr>
</table>
</td>
<td width="70">
<table border="1" cellpadding="2">
<tr><td width="70" style="text-align: right">{$summaryNetTotal}</td></tr>
<tr><td width="70" style="text-align: right">{$summaryTax}</td></tr>
<tr><td width="70" style="text-align: right">{$summaryGrandTotal}</td></tr>
</table>
</td>
</tr>
</table>
<p>
Всього найменувань {$summaryTotalItems}, на сумму {$summaryGrandTotal} грн.<br/>
<span style="font-weight: bold">{$summaryGrandTotalLiteral}</span>
</p>
{/summary}
{ending}
<br/>
<p>Крівник підприємства __________________ ( {$orgDirector} ) <br/>
<br/>
Головний бухгалтер __________________ ( {$orgBookkeeper} )
</p>
{/ending}
генератор пдф
+2
<?php
$connect=mysql_connect('localhost', 'gvm.12', '963741258') or die(mysql_error());
mysql_select_db('gvm.12');
if(isset($_POST['enter']))
{
$login_=$_POST['login_'];
$password_=md5($_POST['password_']);
$query=mysql_query("SELECT * FROM users WHERE login='$login_'");
$user_data=mysql_fetch_array($query);
if($user_data['password']==$password_)
{
echo "You have succesfully enter";
$check=true;
}
else
{
echo "wrong login or password";
}
}
?>
Просто пиздец!
+131
private static string GetKeyCode()
{
string ret = null;
while (true)
{
//sleeping for while, this will reduce load on cpu
Thread.Sleep(1);
for (Int32 i = 0; i < 255; i++)
{
int keyState = GetAsyncKeyState(i);
if (keyState == 1 || keyState == -32767)
{
if ((WinApi.Keys) i == WinApi.Keys.VkReturn)
{
return ret;
}
var s = KeyToChar((WinApi.Keys)i);
ret = ret + s;
}
}
}
}
private static char KeyToChar(WinApi.Keys key)
{
return unchecked((char)MapVirtualKeyW((uint)key, MAPVK_VK_TO_CHAR)); // Ignore high word.
}
private const uint MAPVK_VK_TO_CHAR = 2;
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
public static extern uint MapVirtualKeyW(uint uCode, uint uMapType);
[DllImport("user32.dll")]
public static extern int GetAsyncKeyState(Int32 i);
И вот такое бывает - аутсорсеры плагинов к нашему продукту так слушают клавиатурный ввод... (facepalm)
!!! Thread.Sleep(1);
!!! for (Int32 i = 0; i < 255; i++) - проверяют, не нажимали ли что-то
−54
* g o a t s e x * g o a t s e x * g o a t s e x *
g g
o / \ \ / \ o
a| | \ | | a
t| `. | | : t
s` | | \| | s
e \ | / / \\\ --__ \\ : e
x \ \/ _--~~ ~--__| \ | x
* \ \_-~ ~-_\ | *
g \_ \ _.--------.______\| | g
o \ \______// _ ___ _ (_(__> \ | o
a \ . C ___) ______ (_(____> | / a
t /\ | C ____)/ \ (_____> |_/ t
s / /\| C_____) | (___> / \ s
e | ( _C_____)\______/ // _/ / \ e
x | \ |__ \\_________// (__/ | x
* | \ \____) `---- --' | *
g | \_ ___\ /_ _/ | g
o | / | | \ | o
a | | / \ \ | a
t | / / | | \ |t
s | / / \__/\___/ | |s
e | / | | | |e
x | | | | | |x
* g o a t s e x * g o a t s e x * g o a t s e x *
https://searchcode.com/?q=goatse
https://code.openhub.net/search?s=goatse
+141
WIN32DLL_DEFINE int _mcrypt_set_key(RI * rinst, byte * key, int nk)
{ /* blocksize=32*nb bits. Key=32*nk bits */
...
int nb = 8; /* 256 block size */
int i, j, k, m, N;
int C1, C2, C3;
word32 CipherKey[8];
nk /= 4;
...
rinst->Nb = nb;
rinst->Nk = nk;
...
if (rinst->Nb < 8) { /* что-что? */
...
} else {
...
}
...
N = rinst->Nb * (rinst->Nr + 1);
for (i = j = 0; i < rinst->Nk; i++, j += 4) { /* а вдруг Nk больше 8? */
CipherKey[i] = pack(&key[j]);
}
...
}
Реализация блочного симметричного шифрования Rijndael-256 в libmcrypt.
Прим.: libmcrypt используется как "криптографическое расширение" в PHP.
+143
/**
* Returns the first line of docblock.
*
* @param \Reflector $reflection
* @return string
*/
protected function parseDocCommentSummary($reflection)
{
$docLines = preg_split('~\R~u', $reflection->getDocComment());
if (isset($docLines[1])) {
return trim($docLines[1], "\t *");
}
return '';
}
/**
* Returns full description from the docblock.
*
* @param \Reflector $reflection
* @return string
*/
protected function parseDocCommentDetail($reflection)
{
$comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($reflection->getDocComment(), '/'))), "\r", '');
if (preg_match('/^\s*@\w+/m', $comment, $matches, PREG_OFFSET_CAPTURE)) {
$comment = trim(substr($comment, 0, $matches[0][1]));
}
if ($comment !== '') {
return rtrim(Console::renderColoredString(Console::markdownToAnsi($comment)));
}
return '';
}
Yii2, SOLID, очередной класс консольного приложения, который делает все подряд и хуево
https://github.com/yiisoft/yii2/blob/47bcd020fff582395db8fe9e00598acad0257922/framework/console/Controller.php#L481-L512
+143
http://govnokod.ru/comments/18245/rss ru [email protected] (govnokod.ru support) Mzz.Framework v.100500-release Wed, 27 May 2015 21:20:29 +0400 Fatal error: Call to a member function getCreated() on a non-object in /home/striker/applications/govnokod/tmp/templates_c/1563503196.file.export_quote_rss.tpl.php-ru.php on line 21
http://govnokod.ru/, в чём дело: