- 1
_videoNum = (byte) (videoNum==0?videoNum:0);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+124
_videoNum = (byte) (videoNum==0?videoNum:0);
попалось сегодня в исходниках рабочего проекта
+80
m_scrabblerProperties = Utils.loadPropertiesFile(m_args[1]);
if (null != m_scrabblerProperties)
{
System.out.println("Executing DBScrubber with properties file " + m_args[1] + " loaded from the classpath");
}
else
{
try
{
m_scrabblerProperties.load(new FileInputStream(m_args[1]));
System.out.println("Executing DBScrubber with properties file " + m_args[1] + " loaded from the file system");
}
catch (IOException e)
{
System.err.println("Failed to load " + m_args[1] + " from the classpath or the file system");
}
}
Utils.loadPropertiesFile - какая то хитрая поделуха которая ищет файл в кэше. Если он не найден в кэше, то автор видимо хотел попробовать считать файл с диска, но судя по всему оказался оказался дебилом.
+166
foreach ($_GET as $xxx => $rvar) { $$xxx = $rvar; }
может боян конешн
−362
// Если FlowerItem, то ложим продукт в подарки, иначе ложим на склад
Блядь, ну ведь не ложим, а кладем!
+163
if (isset($_GET['last_user']) && (int)$_GET['last_user']){
$last_user = 0;
}else{
$last_user = (int)$_GET['last_user'];
}
no comments.. )
+162
$tmp_arr=array();
$id1_str='';
$root_str='';
foreach($id1 as $id){
$id1_str.=$id['id'].' , ';
if(!isset($tmp_arr[$id['root']])){
$root_str.=$id['root'].' , ';
$tmp_arr[$id['root']]=true;
}
}
это типа такой способ собрать distinct root ids в строку!
не забыть потом откусить хвост ' , '
нормальные герои не ищут легких путей
+996
abstractObject=abstractObject;
Когда я это обнаружила в коде, то упала со стула.
+100
function Encrypt(jstr: String): String;
var
I: Integer;
A: Real;
begin
if Length(jstr) = 0 Then begin
Result := '';
Exit;
end;
A := 0;
for I := 0 To Length(jstr) do
A := A + (Ord(jstr[I]) * Pos(jstr[I],jstr)) / 33;
Result := FormatFloat('0000000000.0000000000',A);
if Pos(',',Result) > 0 then begin
Insert('.',Result,Pos(',',Result));
Delete(Result,Pos(',',Result),1);
end;
end;
+161
<html>
<head>
<script language="JavaScript">
<!-- hide
function check(input) {
var ok = true;
for (var i = 0; i < input.length; i++) {
var chr = input.charAt(i);
var found = false;
for (var j = 1; j < check.length; j++) {
if (chr == check[j]) found = true;
}
if (!found) ok = false;
}
return ok;
}
function test(input) {
if (!check(input, "1", "2", "3", "4",
"5", "6", "7", "8", "9", "0", "/", "-", " ")) {
alert("Input not ok.");
}
else {
alert("Input ok!");
}
}
// -->
</script>
</head>
<body>
<form>
Telephone:
<input type="text" name="telephone" value=>
<input type="button" value="Check"
onClick="test(this.form.telephone.value)">
</form>
</body>
</html>
http://www.webmasterwiki.ru/JavaScript/Formy
+158
class WindowStateSelector { // helper class to share visibility between some DialogStates
public:
explicit WindowStateSelector(WindowState * current = NULL): mCurrent(current) {}
void Add(WindowState *windowState) { windowState->Show(windowState == mCurrent); }
virtual void Select(WindowState *windowState)
{
if (windowState == mCurrent) return;
if (mCurrent != NULL) mCurrent->Show(false);
if (windowState != NULL) windowState->Show(true);
mCurrent = windowState;
}
WindowState * GetCurrent() { return mCurrent; }
protected:
WindowState * mCurrent;
};
Пример кода, говнокласса и его говнофункций;