ctags
コマンドで%INCLUDE%
フォルダ上のヘッダーの定義情報をファイル(デフォルト名 tags
)に格納しVimなどからリファレンスとして活用できるようにします。
- Visual Studio 2017 CommunityなどでC++開発環境がインストールされていること
- Universal CTAGSの
ctags
およびreadtags
コマンドのPATH
が通ってること
In vim, change fileformat by using :set fenc=utf-16 | set bomb
.
This post provides super-simplified examples that describes how to write C++ unit test without any Visual Studio IDE assistant and template. (Tested on Visual Studio 2015 Community edition)
In fact unit test can be accomplished by only using cl
and vstest.console
commands.
To use these, start with VS Tools Command Prompt, or load vcvarsall
on
vanilla-cmd.exe
to configure. (manual enviromental configuration is too complex and
not recommended)
#include <vector> | |
int main() { | |
struct t{ int i1; int i2; }; | |
std::vector<t> v; | |
v.push_back(t {1, 2}); | |
v.push_back(t {3, 4}); | |
v.push_back(t {5, 6}); | |
for(int l = v.size(), c = 0; c < l; c++) | |
printf("%d, ", (v.data() + c)->i2); | |
} |
#include <string> | |
#include <vector> | |
void main() { | |
std::string foo = "baz"; | |
std::vector<char> bar; | |
printf("%d\n", bar.capacity()); | |
bar.resize(foo.size()); | |
// CAUTION: vector::reserve affects only "capacity", so does not change its "size", | |
// will causes empty-like behavior if using for(:) loop, vector::resize is adequate. |
# Duplicate background images from first one | |
# Paste to Blender Python Console, and press ENTER twice | |
# Authored by Retorillo | |
# CC0 License, No Rights Reserved | |
# <START> | |
for a in bpy.data.screens['Default'].areas: | |
if a.spaces[0].type != 'VIEW_3D': | |
continue | |
bkg = a.spaces[0].background_images | |
if len(bkg) == 0: |