- 1
- 2
$date = date("Y-m-01", strtotime("-1 month"));
$like = substr($date, 0, 8) . "%";
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+154
$date = date("Y-m-01", strtotime("-1 month"));
$like = substr($date, 0, 8) . "%";
а потом $like вставляется в sql-код
+157
var infoDiv = "<div id='fastInfo' style='font-size:16px !important;padding: 6px;padding-bottom:10px; z-index:1000000;position:fixed;top:20%;width:3px;right:0;background:white;border: 1px solid green;border-right:0;'></div>";
$('#navi').before(infoDiv);
var ggwp = $('a[href*="user_info="]');
$.each(ggwp, function(index, value) {
value.setAttribute("onmouseenter", "$('#fastInfo').animate({'width': '300px'}, 200);function received(data) { if ($($(data).find('.gradient_block1:has(\"table\")')[0]).html() == undefined) {dtxs = $($(data).find('.stnd_padd:has(\"table\")')[0]).html().replace('img', 'xuimg');} else {dtxs = $($(data).find('.gradient_block1:has(\"table\")')[0]).html().replace('img', 'xuimg');} $('#fastInfo').html('<span style=\"font-size:small\">' + dtxs + '<hr style=\"border:0;height:1px;background-color:black;margin:6px;color:black\" /><div style=\"padding-left:13px\">' + $($(data).find('.bottom_link_block')[0]).html() + '</div><hr style=\"border:0;height:1px;background-color:black;margin:6px;color:black\" /><div style=\"padding-left:13px;font-size:small\">' + $($(data).find('.blue_border_bottom')[0]).html().replace(/padding-bottom:10px;/gim, ''));}$.ajax({'url': 'http://spaces.ru/anketa/?name=" + value.href.match(/user_info=([a-zA-Z0-9\-\_]+)/gim)[0].replace("user_info=", "") + "', success: received});");
value.setAttribute("onmouseleave", "$('#fastInfo').animate({'width': '3px'}, 200);function clrscr() {$('#fastInfo').html('');} setTimeout(clrscr, 200);");
});
Ребят, это диагноз?
Навесить обработчик через .on/.bind/.live не смог.
+122
Не смог выделить 100 строк, объединённых общей логикой, да и всей картины это бы не передавало.
Для любителей покопаться в.
Ссылка в описании.
https://github.com/KustoSoft/ru2ch-toolset
© Корпорация KustoSoft
+78
public class LocalizedMatcher implements Matcher, ContainsExtraTypeInformation, CapturesArguments, MatcherDecorator, Serializable {
...
public void _dont_implement_Matcher___instead_extend_BaseMatcher_() {
// yeah right
}
...
}
Порадовал именно коммент :)
+9
# define BOOST_MPL_AUX_NTTP_DECL(T, x) T x
Очень интересный стайлгайд Алексей Гуртового
+9
int numBlock = 0;
for(int i = 0; i < 16; i++)
for(int j = 0; j < 25; j++)
{
if(levelInfo[i][j].active)
{
if(levelInfo[i][j].part && levelInfo[i][j].type) continue;
if(levelInfo[i][j].type)
{
tempLevel[numBlock*8 ] = i*24;
tempLevel[numBlock*8+1] = (j)*24;
tempLevel[numBlock*8+2] = (i+2)*24;
tempLevel[numBlock*8+3] = (j)*24;
tempLevel[numBlock*8+4] = (i+2)*24;
tempLevel[numBlock*8+5] = (j+1)*24;
tempLevel[numBlock*8+6] = i*24;
tempLevel[numBlock*8+7] = (j+1)*24;
}
else
{
tempLevel[numBlock*8 ] = i*24;
tempLevel[numBlock*8+1] = (j)*24;
tempLevel[numBlock*8+2] = (i+1)*24;
tempLevel[numBlock*8+3] = (j)*24;
tempLevel[numBlock*8+4] = (i+1)*24;
tempLevel[numBlock*8+5] = (j+1)*24;
tempLevel[numBlock*8+6] = i*24;
tempLevel[numBlock*8+7] = (j+1)*24;
}
if(levelInfo[i][j].type)
for(int k = 0; k < 8; k++) tempTex[numBlock*8+k] = coord[0][k];
else
for(int k = 0; k < 8; k++) tempTex[numBlock*8+k] = coord[1][k];
}
else
{
tempLevel[numBlock*8 ] = i*24;
tempLevel[numBlock*8+1] = (j)*24;
tempLevel[numBlock*8+2] = (i+1)*24;
tempLevel[numBlock*8+3] = (j)*24;
tempLevel[numBlock*8+4] = (i+1)*24;
tempLevel[numBlock*8+5] = (j+1)*24;
tempLevel[numBlock*8+6] = i*24;
tempLevel[numBlock*8+7] = (j+1)*24;
for(int k = 0; k < 8; k++) tempTex[numBlock*8+k] = coord[2][k];
}
numBlock++;
}
for(int i = 0; i < 2; i++)
for(int j = 0; j < 3; j++)
{
if(!fallBlocks[i][j].active) continue;
if(fallBlocks[i][j].part && fallBlocks[i][j].type) continue;
if(!fallBlocks[i][j].type)
{
tempLevel[numBlock*8 ] = (fallPosX+i)*24;
tempLevel[numBlock*8+1] = (fallPosY-j)*24;
tempLevel[numBlock*8+2] = (fallPosX+i+1)*24;
tempLevel[numBlock*8+3] = (fallPosY-j)*24;
tempLevel[numBlock*8+4] = (fallPosX+i+1)*24;
tempLevel[numBlock*8+5] = (fallPosY-j+1)*24;
tempLevel[numBlock*8+6] = (fallPosX+i)*24;
tempLevel[numBlock*8+7] = (fallPosY-j+1)*24;
for(int k = 0; k < 8; k++) tempTex[numBlock*8+k] = coord[1][k];
}
else
{
tempLevel[numBlock*8 ] = (fallPosX+i)*24;
tempLevel[numBlock*8+1] = (fallPosY-j)*24;
tempLevel[numBlock*8+2] = (fallPosX+i+2)*24;
tempLevel[numBlock*8+3] = (fallPosY-j)*24;
tempLevel[numBlock*8+4] = (fallPosX+i+2)*24;
tempLevel[numBlock*8+5] = (fallPosY-j+1)*24;
tempLevel[numBlock*8+6] = (fallPosX+i)*24;
tempLevel[numBlock*8+7] = (fallPosY-j+1)*24;
for(int k = 0; k < 8; k++) tempTex[numBlock*8+k] = coord[0][k];
}
numBlock++;
}
Нямка. В унитаз уже не помещается, вылью сюда
+155
if ($localize && is_array($results))
foreach ($results as $_k => $_row)
foreach ((array) $_row as $_rc => $_col)
if ($_col_unserialized = unserialize($_col))
if (is_array($_col_unserialized))
if (isset($_col_unserialized[$_SESSION['language']]))
$results[$_k]->{$_rc} = $_col_unserialized[$_SESSION['language']];
else
$results[$_k]->{$_rc} = array_shift($_col_unserialized);
+28
QVector<double*>*** ElemBoundCond = tbc->getElementsBC();
+133
var firstLocation = new Tuple<Point, Point>(new Point(12, 444 - 38), new Point(30, 446 - 38));
var secondLocation = new Tuple<Point, Point>(new Point(12, 464 - 38), new Point(30, 464 - 38));
var thirdLocation = new Tuple<Point, Point>(new Point(12, 486 - 38), new Point(30, 484 - 38));
var first = new Tuple<Control, Control>(chbDimaGaugeNewContractPS, lblDimaGaugeNewContractPS);
var second = new Tuple<Control, Control>(chbDimaGaugeNewContractIBanking, lblDimaGaugeNewContractIBanking);
var third = new Tuple<Control, Control>(chbDimaGaugeNewContractActivePS, lblDimaGaugeNewContractActivePS);
var controls = new List<Tuple<Control, Control>> { first, second, third };
var points = new List<Tuple<Point, Point>> { firstLocation, secondLocation, thirdLocation };
int i = 0;
foreach (var t in controls.Where(x => !x.Item1.Enabled))
{
t.Item1.Location = points[i].Item1;
t.Item2.Location = points[i].Item2;
i++;
}
кортежи в .NET - хорошо или плохо?
+16
function<future<int> (int)> f = [](int a){ cout << a << '\n'; return mreturn(a + 6); };
int a = (mreturn(5) >>= f).get();
cout << a;