- 1
- 2
- 3
- 4
- 5
- 6
- 7
for (i=0; i<550; i++)
{
for (j<0; j<400; j++)
{
.....
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−102
for (i=0; i<550; i++)
{
for (j<0; j<400; j++)
{
.....
}
}
Думал почему же цикл выполняеться только 550 раз, долгое время немог понять почему XD
+165
$month[1] = “Январ”;
$month[2] = “Феврал”;
$month[3] = “Март”;
$month[4] = “Апрел”;
$month[5] = “Ма”;
$month[6] = “Июн”;
$month[7] = “Июл”;
$month[8] = “Август”;
$month[9] = “Сентябр”;
$month[10] = “Октябр”;
$month[11] = “Декабр”;
$month[12] = “Январ”;
$day[0] = “Воскресенье”;
$day[1] = “Понедельник”;
$day[2] = “Вторник”;
$day[3] = “Среда”;
$day[4] = “Четверг”;
$day[5] = “Пятница”;
$day[6] = “Суббота”;
$dnum = date(”w”);
$mnum = date(”n”);
$daym = date(”d”);
$year = date(”Y”);
$textday = $day[$dnum];
$monthm = $month[$mnum];
if ($mnum==3||$mnum==8) {
$k=”а”;
}
else {
$k=”я”;
}
echo “Сегодня: $textday, $daym $monthm$k $year г.”;
Отсюда: http://flashripper.net/2007/10/24/delaem-vyvod-daty-na-php.html
+159
HMODULE nt=LoadLibrary("Ntdll.dll");
PROCESS_BASIC_INFORMATION pbi={0};
ZWQUERYINFORMATIONPROCESS _ZwQueryInformationProcess;
_ZwQueryInformationProcess = (ZWQUERYINFORMATIONPROCESS)GetProcAddress(nt, "ZwQueryInformationProcess");
DWORD rlg;
SetLastError(0);
_ZwQueryInformationProcess(divine,0,&pbi,sizeof(pbi),&rlg);
printf("%d",GetLastError());
источник: http://www.wasm.ru/forum/viewtopic.php?pid=426270#p426270
+170
$замены = array(
'{' => 'начало',
'}' => 'конец',
'for' => 'циклдля',
'echo' => 'вывод',
'print' => 'печать',
'while' => 'пока',
'foreach' => 'циклмассив',
'$' => 'пер ',
'=' => ':=',
//'==' => '=',
'!=' => '<>',
'function' => 'функ',
'true' => 'правда',
'false' => 'ложь',
'if' => 'если',
'else' => 'иначе',
'as' => 'как',
'array' => 'массив',
'_GET' => 'ГЕТ',
'_POST' => 'ПОСТ',
'return' => 'вернуть',
);
isset($_GET['debug']) ? print(ВПоХаПэ(file_get_contents($_GET['f']))) : Компилить(file_get_contents($_GET['f']));
function Компилить($сорсец) {
eval(ВПоХаПэ($сорсец));
}
function ВПоХаПэ($сорсец) {
global $замены;
return str_replace(array_values($замены), array_keys($замены), $сорсец);
}
function ИзПоХаПэ($сорсец) {
global $замены;
return str_replace(array_keys($замены), array_values($замены), $сорсец);
}
Транслятор псевдоязыка в PHP
+160
var begin_h = html.indexOf("<h1 class=\"header\">");
var end_h = html.indexOf("</h1>");
var data = "";
if (begin_h != -1 && end_h != -1) {
data = html.substr(begin_h, end_h + 5); //5 - это длина тега </h1>, чтобы его тоже захватило
}
Прелесть, найденная на гугл-ответах. Человек пишет расширение для Firefox.
+160
function antispam()
{
var num1=Math.floor(Math.random()*11)+1;
var num2=Math.floor(Math.random()*11)+1;
var sum = num1+num2;
var userP = prompt("To check that you are not spammer, solve this simple equation - "+num1+"+"+num2+"=?","");
if (userP != null)
{
if (userP != sum)
{
document.write("<!--");
alert("Wrong answer!");
}
else
{
document.write('<form id="logform" action="proceed.php" onsubmit="javascript:return validate("logform","email");" method="post"><p>Your name: <input type="text" name="name" /></p><p>Your password: <input type="password" name="password" /></p><p>Your e-mail: <input type="text" name="email" id="email" /></p><p><input type="submit" value="Register!" /></p></form>');
}
}
}
Вот в таком режиме работает уже месяца два. Если не ГК, прошу, посоветуйте как можно это лучше сделать (или прикрутить капчу и не парится? :)). На JS я практически не пишу, я пишу в основном под .NET.
+132
if (argc == 3)
snprintf(outfile, sizeof(outfile) - 1, "scan.log", argv[1], argv[2]);
else if (argc >= 4)
{
snprintf(outfile, sizeof(outfile) - 1, "scan.log", argv[1], argv[3], argv[2]);
// ...
}
Какой-то иксплойт, файл pscan2.c
+135
//глубоко в коде
char output[1024];
//еще глубже
struct sockaddr_in outputa;
//...
if(sendto(s, output, 512, 0, (struct sockaddr *) &output, rsize) == SOCKET_ERROR) {
printf("Socket error: %i.\n", WSAGetLastError());
}
Долго-же я думал, почему оно вываливается с ошибкой 10047.
+78
static List sort(List unsorted, Comparator comparator) {
List sorted = new ArrayList(unsorted);
Collections.sort(unsorted, comparator);
return sorted;
}
+118
foreach (var aiett in _selectApplItemEntranceTrial)
{
lbl2:
ReceptionReason_EducationLayout rrel_temp = null;
EntranceTrialItem_RecResEducLayout eti_rrel = null;
bool flag = false;
foreach (var rrel in _recReasonEducLay)
foreach (var ap in aiett.ListAppItem)
foreach (var rr in rrel.ListRecReas_EducLayout)
if (ap.ApplItem.Id_ReceptionReason_EducationLayout == rr.Id)
{
rrel_temp = rr;
eti_rrel = rrel;
flag = true;
goto lbl;
}
lbl: ;
if (flag)
{
_recReasonEducLay.FirstOrDefault(x => x == eti_rrel).ListRecReas_EducLayout.Remove(rrel_temp);
if (_recReasonEducLay.FirstOrDefault(x => x == eti_rrel).ListRecReas_EducLayout.Count == 0)
_recReasonEducLay.Remove(eti_rrel);
goto lbl2;
}
}
Мой личный говнокод! Работающий правильно))))