- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
<?php
if (preg_match('/^mysql/', $string == 1)) {
$dsn = $string;
}
###
###
###
?>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+147
<?php
if (preg_match('/^mysql/', $string == 1)) {
$dsn = $string;
}
###
###
###
?>
+124.8
varnamebegin // начало имени новой переменной
a // имя новой переменной
varnameend // конец имени новой переменной
varvaluebegin // начало значения новой переменной
newarray // новый массив
varvalueend // конец значения новой переменной
varcallbegin // начало имени вызываемой переменной
a // имя вызываемой переменной
varcallend // конец имени вызываемой переменной
push // добавить элементы в массив
lcobjectsbegin // начало области добавляемых элементов
bg // начало значения элемента массива
codedn // code — символ, d — префикс для цифр, n — спец-символ для цифры "0"
end // конец значения элемента массива
bg // начало значения элемента массива
codedo // code — символ, d — префикс для цифр, n — спец-символ для цифры "1"
end // конец значения элемента массива
lcobjectsend // конец области добавляемых элементов
functioninit // аналог ()
Создание массива с содержимым [0, 1] на одном из эзотерических ЯП. Фишка в том, что убраны все знаки препинания, цифры и т.д., оставлены лишь прописные латинские буквы.
Интересно, как на таком ЯП будет выглядеть полностью валидная проверка E-Mail (наподобии этой — ex-parrot.com/pdw/Mail-RFC822-Address.html) ?
+111.6
private ArrayList MNK(Matrix x, ArrayList y) {
normalization(ref x);
for (int i = 0; i < x.N; i++)
for (int j = 0; j < x.M; j++)
x.data[i, j] = Chebyshev.function(x.data[i,j],POWER_POLYNOM);
Matrix yNew = Matrix.CreateMatrixFromArrayList(y);
Matrix tranc = x.Tranc_Matrix(x);
Matrix temp = x.Obernena_Matrix(x.Mul_Matrix(tranc, x));
temp = x.Mul_Matrix(temp, tranc);
temp = x.Mul_Matrix(temp, yNew);
yNew = yNew.Mul_Matrix(x,temp);
return (returnValue(yNew, y));
}
//****************************************************
#region
private static ArrayList returnValue(Matrix yNew, ArrayList y)
{
ArrayList t = new ArrayList();
Random r = new Random();
double k = 2;
for (int i = 0; i < y.Count; i++)
{
if (y.GetHashCode() == y1.GetHashCode())
k = 1;
if (y.GetHashCode() == y2.GetHashCode())
k = 4000;
if (y.GetHashCode() == y3.GetHashCode())
k = 1000000;
t.Add((double)y[i] + ((double)(r.NextDouble() * k - k/2)));
}
return t;
}
#endregion
вот как тру системные аналитики пишут свои прогнозы))))))))))
+157.4
while (count(array_diff(array_keys($rows), $roots)) > 0)
{
$theLeaves = $this->_getLeaves($rows);
foreach ($theLeaves as $leafId)
{
if(isset($rows[$rows[$leafId]['parent_id']]['Menu']['data']) and
!is_array($rows[$rows[$leafId]['parent_id']]['Menu']['data']))
if(!is_array($rows[$rows[$leafId]['parent_id']]['Menu']['data']))
unset($rows[$rows[$leafId]['parent_id']]['Menu']['data']);
if(isset($rows[$rows[$leafId]['parent_id']]['data']) and
!is_array($rows[$rows[$leafId]['parent_id']]['data']))
if(!is_array($rows[$rows[$leafId]['parent_id']]['data']))
unset($rows[$rows[$leafId]['parent_id']]['data']);
$rows[$rows[$leafId]['parent_id']]['data'][] = $rows[$leafId];
unset($rows[$leafId]);
}
}
пришел проектик на доработку. сижу, пытаюсь разобраться
+75.4
if (!Float.valueOf("0.0").equals(price.getActualPrice()))
{
return true;
}
Сравнение чисел (float) нездоровым способом.
+166.3
function smla(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':)';}
function smls(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='>( ';}
function smld(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':D';}
function smlf(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='B)';}
function smlg(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='%)';}
function smlh(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':(';}
function smlj(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':o';}
function smlw(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='^_^';}
function smlk(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+='<_<';}
function smll(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=';)';}
function smlq(){parent.window.document.getElementById('soob').focus();parent.window.document.getElementById('soob').value+=':p';}
Ещё один китаец. Вставляет смайлы в текстовое поле вот таким вот кодом. Источник — http://mirtorrent.ru/css/pppm.js
+161.8
$tpl->assign("L_OPENER", ($arr[7] == 40 || $arr[7] == 41 || $arr[7] == 42) ? 'opener.opener' : 'opener');
Вот так в один из шаблонов в зависимости от одного из параметров передаётся сами видите что. Почему так? Потому что бесчётное количество людей переделывали код. По мне, так это уже перебор.
+163.2
var idTa; //id of the textarea (param to makeWhizzyWig)
//OTHER GLOBALS
var oW, sel, rng, papa, trail, ppw, wn=window; //Whizzy contentWindow, current sel, range, parent, DOM path, popwindow;
var sels='';
var buts='';
var vals=new Array();
var opts=new Array();
var dobut=new Array();
//...
w('<div style="width:'+taWidth+'" onmouseover="c(\''+idTa+'\')"><div id="CONTROLS'+idTa+'" class="wzCtrl" unselectable="on">');
//...
function c(id) {//set current whizzy
if (id=="" || whizzies.join().indexOf(id)=='-1') return;
if (id!=idTa){
idTa=id;
try {oW=o("whizzy"+id).contentWindow;} catch(e){alert('set current: '+id);}
if (oW) {if(oW.focus)oW.focus();wn.status=oW.document.body.id; }
}
}
//...
Хтоническое порождение сумрачного гения
Все параметры редакторы лежат в global'ах. Но что делать если редакторов на странице несколько?
Правильно: mouse over!
http://www.unverse.net/wysiwyg.html
+124.6
<td width:6px="">
Без комментариев...
+170.3
// http://userscripts.org/scripts/review/23705
var replyBoxContentPostAreaTableSubjectRowRightColumnSubmitButton = document.createElement("input");
replyBoxContentPostAreaTableSubjectRowRightColumnSubmitButton.setAttribute("type", "submit");
replyBoxContentPostAreaTableSubjectRowRightColumnSubmitButton.setAttribute("value", "Submit");
replyBoxContentPostAreaTableSubjectRowRightColumn.appendChild(replyBoxContentPostAreaTableSubjectRowRightColumnSubmitButton);
replyBoxContentPostAreaTableSubjectRow.appendChild(replyBoxContentPostAreaTableSubjectRowLeftColumn);
replyBoxContentPostAreaTableSubjectRow.appendChild(replyBoxContentPostAreaTableSubjectRowRightColumn);
replyBoxContentPostAreaTBody.appendChild(replyBoxContentPostAreaTableSubjectRow);
Грустно. Очень грустно.