我们在Visual Studio 2010中有一个项目,它在后期构建事件中运行批处理文件.该批处理从Microsoft SDK调用signtool.exe来对二进制文件进行签名和时间戳.
然而,时间戳服务器(我们使用http://timestamp.verisign.com/scripts/timstamp.dll)由于某种原因往往不可靠,有时会失败.这导致构建失败.
我们实现了更高级的批处理脚本(基于此代码),拆分签名和时间戳,并允许重试时间戳操作(如果失败).
以下是批处理脚本(signfile.bat)的简化版本:
@echo off
REM sign the file...
signtool.exe /f Authenticode.pfx /p PASS %1
if %errorlevel% neq 0 exit /b %errorlevel%
set timestamp_server=http://timestamp.verisign.com/scripts/timstamp.dll
for /L %%a in (1,1,10) do (
REM try to timestamp the file...
signtool.exe timestamp /t %timestamp_server% %1
if errorlevel 0 if not errorlevel 1 GOTO succeeded
REM wait 2 seconds...
ping -n 2 127.0.0.1 > nul
)
REM return an error code...
echo signfile.bat exit code is …Run Code Online (Sandbox Code Playgroud) build-process code-signing visual-studio-2010 errorlevel timestamping
我想在地图中使用原子变量。我正在使用 Visual Studio 2012 (msvc-11) 和 gcc 4.7。我定义了一个类型:
typedef std::map<uint64_t, std::atomic<int64_t>> value_map_t;
Run Code Online (Sandbox Code Playgroud)
在 msvc-11 中,行
value_map_t map;
map[1] = 0;
Run Code Online (Sandbox Code Playgroud)
产生错误:
错误C2248::
std::atomic<__int64>::atomic无法访问类中声明的私有成员std::atomic<__int64>
gcc 4.7 也会发生同样的情况(参见此处)
错误:使用已删除的函数
std::atomic<long int>::atomic(const std::atomic<long int>&)
但是,在 Visual Studio 2013 (msvc-12) 及更高版本以及 gcc 4.8 及更高版本中,它运行良好。
亲自查看gcc 4.8和Visual Studio 2013+
我可以在 msvc-11/gcc 4.7 中做什么才能使其工作?
在MySQL 5.6 DB中,我具有以下结构的巨大SQL表:
CREATE TABLE `tbl_requests` (
`request_id` BIGINT(20) UNSIGNED NOT NULL,
`option_id` BIGINT(20) UNSIGNED NOT NULL,
`symbol` VARCHAR(30) NOT NULL,
`request_time` DATETIME(6) NOT NULL,
`request_type` SMALLINT(6) NOT NULL,
`count` INT(11) NOT NULL,
PRIMARY KEY (`request_id`),
INDEX `key_request_type_symbol` (`request_type`, `symbol`),
INDEX `key_request_time` (`request_time`),
INDEX `key_request_symbol` (`symbol`)
);
Run Code Online (Sandbox Code Playgroud)
该表中有超过8亿条记录,其中约有25,000个symbol字段种类,其中约有100个不同的值request_type。我的目标是使查询尽可能快:
SELECT tbl_requests.*
FROM tbl_requests use index (key_request_type_symbol)
-- use index (key_request_time) -- use index (key_request_type_symbol)
WHERE (tbl_requests.request_time >= '2016-02-23' AND
tbl_requests.request_time <= '2016-12-23')
AND (tbl_requests.request_type IN (0, 1, …Run Code Online (Sandbox Code Playgroud) atomic ×1
c++11 ×1
code-signing ×1
database ×1
dictionary ×1
errorlevel ×1
gcc ×1
indexing ×1
mysql ×1
performance ×1
sql ×1
timestamping ×1