- 1
|РАЗНОСТЬДАТ(ДАТАВРЕМЯ(1980, 1, 1), НакладнаяНаОтпускМатериалы.ДатаВозврата, ДЕНЬ) + 2444240 КАК ДатаВозврата,
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−120
|РАЗНОСТЬДАТ(ДАТАВРЕМЯ(1980, 1, 1), НакладнаяНаОтпускМатериалы.ДатаВозврата, ДЕНЬ) + 2444240 КАК ДатаВозврата,
Внезапно! Календарь майя
+156
<?php if(!isset($_REQUEST['doGo'])){?>
<form action=4.php>
Введите ФИО <input type=text name="text" value="" size=40><br>
<input type=submit name="doGo" value="knopka">
<?php }
else {
$tas=trim($_REQUEST['text']);
$text_arr=str_split($tas);
$i=0;
while($text_arr[$i]!==" ")
{
echo $text_arr[$i]."";
$i++;
}
for($i=0; $i<count($text_arr); $i++)
{
if($text_arr[$i]==" ") echo " ".$text_arr[$i+1]."."; continue;
}
}
?>
Задача обрезать имя и фамилию
+158
$scope.pageCount = (newValue / $scope.pageSize | 0) || +!!newValue;
Кратскость - сестра таланта
+158
var firstpostime = 1417254005;var numpos = 1; //номер посещения
var sredvrem = 0; //среднее время на каждой странице
var lasdo15sek = 0;
function debug444(ff) {
console.log(ff);
//alert(ff);
}
var newTxt="!!";
var oldTxt=document.title;
function migalka(){
if(document.title==oldTxt){
document.title=newTxt;
}else{
document.title=oldTxt;
}
}
function neuspeli() {
var element55577 = document.createElement('div');
element55577.innerHTML = '<img style="width:1px;height:1px;" src="http://rbcall.com/neuspeli.php?&tel='+document.getElementById('wi_tele233').value+'&site=47&user=159">',
element55577.id = 'wi_r223';
document.body.appendChild(element55577);
document.getElementById("superjalobal").style.display='block';
}
function jduzvonka() {
if (zvonim == 1) { return true; }
if(document.getElementById("wi_tele233").value.length>=8 || document.getElementById("wi_tele233").value == 400){
wiyacall();
insertscript(document.getElementById("wi_tele233").value);
} else {
document.getElementById("wi_tele233").style.border="1px solid red";
}
}
...... и весь скрипт такой
http://rbcall.com/ ROBOCALL - технологии будущего (они же: технологии ИИ)
+51
PVOID ZDbgDoc::getVaByName(PCSTR name)
{
PLIST_ENTRY head = &_dllListHead, entry = head;
while ((entry = entry->Flink) != head)
{
ZDll* pDll = static_cast<ZDll*>(entry);
if (PWSTR ImageName = pDll->_ImageName)
{
PCSTR sz = name;
__loop:
int c = tolower(*sz++);
if (!c || c != towlower(*ImageName++))
{
continue;
}
if (c != '.')
{
goto __loop;
}
pDll->Parse(this);
return pDll->getVaByName(sz, this);
}
}
return 0;
}
+133
private static List<User> Users
{
get
{
if (_customers == null) { _customers = new List<Customer>(); }
lock (((ICollection)_customers).SyncRoot)
{
return _customers;
}
}
set
{
lock (((ICollection)Customer).SyncRoot)
{
_customers = value;
}
}
+50
size_t __stdcall ZAsmView::addrSet(DIS const *pDis, unsigned __int64 Va, wchar_t * buf, size_t cb, unsigned __int64 * displacement)
{
FORMATDATA* pf = (FORMATDATA*)pDis->PvClient();
size_t fixupLen = pf->fixupLen;
pf->fixupLen = 0;
*displacement = 0;
BOOL f = TRUE;
PVOID _Va = (PVOID)Va;
ZDbgDoc* pDoc = pf->pDoc;
__loop:
if (PCSTR Name = pDoc->getNameByVa((PVOID)Va))
{
char cc[256];
PCSTR fName = unDNameEx(cc, Name, sizeof(cc), UNDNAME_NAME_ONLY);
int len = _snwprintf(buf, cb, L"%S(%p)", fName, Va);
if (len < 0)
{
buf[len = (DWORD)cb - 1] = 0;
}
else
{
buf[0] |= 0x4000, buf[len - 3 - 2*sizeof(PVOID)] |= 0x8000;
}
return len;
}
if (f && 2*sizeof(PVOID)+2<cb)
{
switch (pDis->Trmta())
{
case DIS::a_jmp_u_2:
case DIS::a_jmp_u_5:
case DIS::a_jmp_c_2:
case DIS::a_jmp_c_6:
_snwprintf(buf, cb, L"%p %c", (PVOID)Va, Va > pf->pLI->Va ? 0x2193 : 0x2191);
buf[0] |= 0x4000, buf[2*sizeof(PVOID)-1] |= 0x8000;
return 2*sizeof(PVOID)+2;
}
}
if (fixupLen)
{
if (0 <= pDoc->Read((PVOID)Va, &Va, sizeof(PVOID)))
{
fixupLen = 0, f = FALSE;
goto __loop;
}
}
if (2*sizeof(PVOID)+2<cb && pDoc->getDllByVaNoRef(_Va))
{
_snwprintf(buf, cb, L"%p", _Va);
buf[0] |= 0x4000, buf[2*sizeof(PVOID)-1] |= 0x8000;
return 2*sizeof(PVOID);
}
return 0;
}
+134
public void OnKillEvent_ServerOnly(PhotonPlayer player)
{
case MatchTypeInfo.TDM:
if (player != null)
{
var hash = player.customProperties;
if (hash != null)
{
var team = (int) hash["team"];
var realScore = match.GetTeamScores();
var teamAScor = team == 0 ? realScore.x + TeamDeathScores : realScore.x;
var teamBScor = team == 1 ? realScore.y + TeamDeathScores : realScore.y;
//DebugModule("Kill Processed On Server completed: " + team + "// " + teamAScor + "/" + teamBScor);
match.ChangeTeamScores((int)teamAScor, (int)teamBScor);
}
else
{
Debug.LogError("OnKillEvent_ServerOnly ERROR Team hash");
}
}
break;
} {
//через 500 строк кода
private void LocalUpdate()
{
if (Application.isEditor)
{
if (Input.GetKeyDown(KeyCode.Y))
{
switch (MatchType)
{
case MatchTypeInfo.TDM:
ChangeTeamScores((int)(_teamScores.x - 1), (int)(_teamScores.y - 1), true);
break; }
SendTeamScoresToUI();
}
}
switch (MatchType)
{
case MatchTypeInfo.TDM:
// DebugModule("Load TDM type game");
break;
}
}
//ещё 500 строк
public void ChangeTeamScores(int a, int b, bool force = false)
{
if (PhotonNetwork.isMasterClient)
{
// check server rules
var rules = GetGameRules();
if (rules != null)
{
if (!rules.CheckPlayerCountRules() && !force)
{
Debug.LogError("Game is not started, beacuse server has no players: " + rules.MinimumPlayerToPlay + "/" +
PhotonNetwork.room.playerCount);
return;
}
}
else
{
Debug.LogError("Rule error");
return;
}
_teamScores.x = Mathf.Clamp(a, 0, float.MaxValue);
_teamScores.y = Mathf.Clamp(b, 0, float.MaxValue);
var matchIsCompleted = false;
switch (MatchType)
{
case MatchTypeInfo.TDM:
matchIsCompleted = _teamScores.x <= 0 || _teamScores.y <= 0;
break;
}
if (matchIsCompleted)
{
Server_CallEndRound();
}
else
{
// Call Event??
}
}
}
Чтобы я ещё раз полез помогать инди-разработчикам, мать их за ногу.
+135
public void Login(ClientHandlers<int> actions)
{
var request = GetGetRequest("/user/xml/{0}", _login);
var act = new Action<IRestResponse<GetUserInfoResult>>(response =>
{
if (CheckUserInfo(response))
{
throw new Exception("Невозможно получить информацию о пользователе\r\nНеобработанное исключение");
}
UserInfo = response.Data.UserInfo;
actions.Completed(UserInfo.idUser);
});
_client.ExecuteAsync(request, act);
}
private bool CheckUserInfo(IRestResponse<GetUserInfoResult> response)
{
if (response != null && response.Data != null && response.Data.UserInfo != null && response.Data.UserInfo.idUser != 0)
{
return true;
}
var message = "Невозможно получить информацию о пользователе";
if (response == null)
{
message = string.Format("{0}\r\n{1}",
message,
"Response is null");
throw new Exception(message);
}
message = string.Format("{0}\r\nResponse data is null\r\nContext: {1}",
message,
response.Content);
if (response.Data == null)
{
throw new Exception(message);
}
message = string.Format("{0}\r\nIs exception: {1}\r\nMessage: {2}",
message,
response.Data.IsException,
response.Data.Message);
if (response.Data.UserInfo == null)
{
throw new Exception(message);
}
message = string.Format("{0}\r\nSiteName: {1}\r\nUserName: {2}\r\nUserRole: {3}",
message,
response.Data.UserInfo.SiteName,
response.Data.UserInfo.UserName,
response.Data.UserInfo.UserRole);
if (response.Data.UserInfo.idUser == 0)
{
throw new Exception(message);
}
return false;
}
Внимательность, внимательность и еще раз внимательность...
−864
sResult:= '';
select code||' '||h.longname into sResult
from tbl1 mo, tbl2 ob, g_cli c, tbl3 h
where mo.m_dep_id = ob.obj_dep_id and mo.m_id = ob.obj_id
and ob.dep_id = nDepId and ob.id = nId
and mo.cli_dep_id = c.dep_id and mo.cli_id = c.id
and c.id = h.id and c.dep_id = h.dep_id and p_operday between h.FROMDATE and h.TODATE;
return sResult;
exception
when NO_DATA_FOUND then return null;
when TOO_MANY_ROWS then
for rec in( select distinct code as cli_code, h.longname as cli_name
from tbl1 mo, tbl2 ob, g_cli c, tbl3 h
where mo.m_dep_id = ob.obj_dep_id and mo.m_id = ob.obj_id
and ob.dep_id = nDepId and ob.id = nId
and mo.cli_dep_id = c.dep_id and mo.cli_id = c.id
and c.id = h.id and c.dep_id = h.dep_id and dT between h.FROMDATE and h.TODATE)
loop
if nvl(length(sResult),0) = 0 then
sResult:= rec.cli_code||' '||rec.cli_name;
else
sResult:= sResult||', '||rec.cli_code||' '||rec.cli_name;
end if;
end loop;
return sResult;
when others then return null;