Skip to content

Instantly share code, notes, and snippets.

View iwadon's full-sized avatar

IWATSUKI Hiroyuki iwadon

View GitHub Profile
@iwadon
iwadon / stow-failed.log
Last active December 16, 2015 03:29
FreeBSDでGNU Stow 2.2.0がうまく動かない。おそらく/homeが/usr/homeへのsymlinkであることが原因っぽい。
% LANG=C stow -d /home/don/local/stow -S mono-git --verbose=3
stow dir is /usr/home/don/local/stow
stow dir path relative to target /home/don/local is ../../../usr/home/don/local/stow
cwd now /home/don/local
cwd restored to /usr/home/don/src/mono-git/_build_
cwd now /home/don/local
stow: ERROR: The stow directory ../../../usr/home/don/local/stow does not contain package mono-git (No such file or directory)
[1] 62559 exit 2 LANG=C stow -d /home/don/local/stow -S mono-git --verbose=3
@iwadon
iwadon / .gitignore
Last active December 15, 2015 20:19
Object.GetType()を呼び出さないとうまく動かないところが納得いかない。 → QA@ITに質問してみた。http://qa.atmarkit.co.jp/q/2834 → Monoの不具合だった。 → ushortからshortでの不具合は修正された。 → boolからsbyteでの不具合が見つかった。
/tmp.exe
/tmp2.exe
@iwadon
iwadon / a.c
Last active December 15, 2015 10:09
Visual Studio 2012 for Windows Desktopで配列の添字を省略できるかどうかを確認してみた。 →[]でも[0]でも結果は変わらず。
#include <stdio.h>
#include <stdlib.h>
struct A
{
int i[];
};
int main(int argc, char *argv[])
{
@iwadon
iwadon / a.png
Last active December 15, 2015 03:19
a.png
@iwadon
iwadon / a.cc
Last active December 14, 2015 14:08
-0x80000000と-2147483648とstd::numeric_limits<int>::min()がそれぞれ方が異なるのはなぜ?
#include <iostream>
#include <limits>
#include <typeinfo>
#define PRINT_TYPE(x) std::cout << #x << ": " << typeid(x).name() << std::endl
#define PRINT_VALUE(x) std::cout << #x << ": " << typeid(x).name() << "(" << x << ")" <<std::endl
int main()
{
PRINT_TYPE(int);
PRINT_TYPE(long int);
PRINT_TYPE(long long int);
@iwadon
iwadon / gtest-msvc11.diff
Last active December 12, 2015 05:38
gtest-1.6.0をmsvc11でビルドした時に用意したソリューションファイルやプロジェクトファイル。
diff --git a/msvc11/gtest-md.sln b/msvc11/gtest-md.sln
new file mode 100644
index 0000000..d82bd34
--- /dev/null
+++ b/msvc11/gtest-md.sln
@@ -0,0 +1,55 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Express 2012 for Windows Desktop
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest-md", "gtest-md.vcxproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE8}"
+EndProject
Index: struct.c
===================================================================
--- struct.c (revision 38743)
+++ struct.c (working copy)
@@ -283,9 +283,10 @@
/*
* call-seq:
- * Struct.new( [aString] [, aSym]+> ) -> StructClass
- * StructClass.new(arg, ...) -> obj
@iwadon
iwadon / Makefile
Created October 31, 2012 13:39
Factory関数を複数登録できるようにした(その2)
CXX = g++
CXXFLAGS = -Wall -Wextra -O2 -g
CPPFLAGS =
AR = ar
LD = g++
LDFLAGS =
LIBS =
RM = rm -f
all: ok ng
@iwadon
iwadon / Makefile
Created October 31, 2012 13:28
Factory関数を複数登録できるようにした。
CXX = g++
CXXFLAGS = -Wall -Wextra -O2 -g
CPPFLAGS =
AR = ar
LD = g++
LDFLAGS =
LIBS =
RM = rm -f
all: ok ng
@iwadon
iwadon / Makefile
Created October 30, 2012 06:27
gist:3978621 の問題を単純化してみた。まあ仕方ないのかなあ。
CXX = g++
CXXFLAGS = -Wall -O0 -g
CPPFLAGS =
AR = ar
LD = g++
LDFLAGS =
LIBS =
RM = rm -f
all: ok ng