- 1
- 2
Comparing structs with, let's say, memcmp, does not work,
as you end up comparing the "unspecified" padding bytes as well — you must compare member-by-member.
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+2
Comparing structs with, let's say, memcmp, does not work,
as you end up comparing the "unspecified" padding bytes as well — you must compare member-by-member.
While writing this post, the author observed that some verions of GCC (experimentally, >= 4.7, < 8.0) do not zero padding if an empty intializer list is passed, under certain a certain code pattern; if an entire struct (i.e. sizeof(STRUCTNAME)) is subsequently memcpy'd after assigment of its members, and this intermediate buffer is what is used by the code going forward. This appears to be based on how optimization passes interact with GCC's built-in memcpy, since passing -fno-builtin-memcpy returns the behavior to the expected.
https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2019/october/padding-the-struct-how-a-compiler-optimization-can-disclose-stack-memory/
+13
<?php
$lines = file('quest.txt');
if($_POST['Quest'] == "") {
echo "<HTML>";
echo "<HEAD>";
echo "<TITLE>Тестер</TITLE>";
echo "<script language=JavaScript type=text/javascript>";
echo "<!-- " . "\n";
echo "var differ = 90*60;";
echo "function timer() {";
echo "var hours, minutes, seconds;";
echo "differ = differ - 1;";
echo "document.forms['vopros'].TimeLeft.value=differ;";
echo "hours = Math.floor(differ/(60*60));";
echo "hours = (hours >= 60) ? hours%60 : hours;";
echo "hours = (hours < 10) ? \"0\" + hours : hours;";
echo "minutes = Math.floor(differ/(60));";
echo "minutes = (minutes >= 60) ? minutes%60 : minutes;";
echo "minutes = (minutes < 10) ? \"0\" + minutes : minutes;";
echo "seconds = differ;";
echo "seconds = (seconds >= 60) ? seconds%60 : seconds;";
echo "seconds = (seconds < 10) ? \"0\" + seconds : seconds;";
echo "var strDate = hours + \":\" + minutes + \":\" + seconds;";
echo "document.forms['timerForm'].timerBox.value=strDate;";
echo "if (differ<=0) {";
echo " document.forms['vopros'].Quest.value=100;";
echo " vopros.submit();";
... (и так далее)
Отличный кодец из дипломной работы студента!
+126
shop_manager.WarnCurrentStoreNotTracked = Current store is not tracked. Please <a href="#" onclick="company.load_page(\'analytics/activate.html\', '{'\'{0}\': \'{1}\''}');">activate here</a> to start tracking.
Файл properties в какой-то спринг-эм-вэ-цэ херне.
+113
Стартовал форум работы еще много, тестить уже можно
http://gvforum.ru/
0
Type: Null
https://bulbapedia.bulbagarden.net/wiki/Type:_Null_(Pok%C3%A9mon)
+21
class socket_exception
{
public:
char *buf;
int ret;
socket_exception()
{
buf=new char[10000];
ret=RET_OK;
}
socket_exception(char *b, int r)
{
buf=new char[10000];
snprintf(buf,9999,"%s",b);
ret=r;
}
socket_exception(vsocket_exception &ex)
{
buf=new char[10000];
snprintf(buf, 9999, "%s", ex.buf);
ret=ex.ret;
}
const char * what (){return buf;}
int get_ret(){return ret;}
~socket_exception(){delete[] buf;}
};
фрактал
+102
function naq(a:integer;n:integer;m:integer):string;
var astr:string;
begin
astr:=inttostr(a);
case m of
1: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*1)+'*p^'+inttostr(n+1);
2: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*2)+'*p^'+inttostr(n+1)+'+'+inttostr(a*1)+'*p^'+inttostr(n+2);
3: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*3)+'*p^'+inttostr(n+1)+'+'+inttostr(a*3)+'*p^'+inttostr(n+2)+'-'+inttostr(a*1)+'*p^'+inttostr(n+3);
4: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*4)+'*p^'+inttostr(n+1)+'+'+inttostr(a*6)+'*p^'+inttostr(n+2)+'-'+inttostr(a*4)+'*p^'+inttostr(n+3)+'+'+inttostr(a*1)+'*p^'+inttostr(n+4);
5: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*5)+'*p^'+inttostr(n+1)+'+'+inttostr(a*10)+'*p^'+inttostr(n+2)+'-'+inttostr(a*10)+'*p^'+inttostr(n+3)+'+'+inttostr(a*5)+'*p^'+inttostr(n+4)+'-'+inttostr(a*1)+'*p^'+inttostr(n+5);
6: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*6)+'*p^'+inttostr(n+1)+'+'+inttostr(a*15)+'*p^'+inttostr(n+2)+'-'+inttostr(a*20)+'*p^'+inttostr(n+3)+'+'+inttostr(a*15)+'*p^'+inttostr(n+4)+'-'+inttostr(a*6)+'*p^'+inttostr(n+5)+'+'+inttostr(a*1)+'*p^'+inttostr(n+6);
7: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*7)+'*p^'+inttostr(n+1)+'+'+inttostr(a*21)+'*p^'+inttostr(n+2)+'-'+inttostr(a*35)+'*p^'+inttostr(n+3)+'+'+inttostr(a*35)+'*p^'+inttostr(n+4)+'-'+inttostr(a*21)+'*p^'+inttostr(n+5)+'+'+inttostr(a*7)+'*p^'+inttostr(n+6)+'-'+inttostr(a*1)+'*p^'+inttostr(n+7);
8: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*8)+'*p^'+inttostr(n+1)+'+'+inttostr(a*28)+'*p^'+inttostr(n+2)+'-'+inttostr(a*56)+'*p^'+inttostr(n+3)+'+'+inttostr(a*70)+'*p^'+inttostr(n+4)+'-'+inttostr(a*56)+'*p^'+inttostr(n+5)+'+'+inttostr(a*28)+'*p^'+inttostr(n+6)+'-'+inttostr(a*8)+'*p^'+inttostr(n+7)+'+'+inttostr(a*1)+'*p^'+inttostr(n+8);
9: naq:=astr+'*p^'+inttostr(n)+'-'+inttostr(a*9)+'*p^'+inttostr(n+1)+'+'+inttostr(a*36)+'*p^'+inttostr(n+2)+'-'+inttostr(a*84)+'*p^'+inttostr(n+3)+'+'+inttostr(a*126)+'*p^'+inttostr(n+4)+'-'+inttostr(a*126)+'*p^'+inttostr(n+5)+'+'+inttostr(a*84)+'*p^'+inttostr(n+6)+'-'+inttostr(a*36)+'*p^'+inttostr(n+7)+'+'+inttostr(a*9)+'*p^'+inttostr(n+8)+'+'+inttostr(a*1)+'*p^'+inttostr(n+9);
end;
end;
Лень было искать алгоритм раскрытия (1-q)^n
+160
$url = $_SERVER['HTTP_REFERER'];
$pos = strrpos($url, 'id');
$id = substr($url, $pos + 2);
Получаем id человека)))
−2
// POST /login
exports.login = function login(req, res) {
var email = req.body.email;
var password = req.body.password;
security.rateLimitRequest( 'reset', req, function( err ) {
if ( err )
return res.status( 400 ).send( err );
db.Account.find({email: email, password: password}, function(err, account) {
if ( err )
return res.status( 400 ).send( err );
account.getAccountStatistics(account, function(err, account) {
if ( err )
return res.status( 400 ).send( err );
account.incrementAccountLoginCount(account, function(err) {
if ( err )
return res.status( 400 ).send( err );
res.send(account);
});
});
});
});
});
У меня радость во все поля:
// POST /login
exports.login = function *login() {
var email = req.body.email;
var password = req.body.password;
try
{
// Throws an error if rate limit exceeded
yield security.rateLimitRequest( 'reset', req );
// Query MongoDB for account
var account = yield db.Account.find({email: email, password: password});
account.statistics = yield account.getAccountStatistics(account);
// Increment login count
yield account.incrementAccountLoginCount(account);
this.body = account;
}
catch( err ) {
// Return the error as JSON
return res.status( 400 ).send( err );
}
});
+3
foreach($arResult['ITEMS'] as $key => &$arItem) {
$priceRes2 = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 34, "PROPERTY_PERIOD" => 1, "PROPERTY_PERIOD_TYPE" => 85, "PROPERTY_OBJECT_RELATION" => $arItem['ID']), false, false, array("NAME"));
"Я программист 1C-bitrix и с каждой новой итерацией я делаю новый запрос к инфоблоку."