そろばんのしょ

覚書、雑談、その他ほんの少しの気持ち。

技術書について

気づけば技術書が溜まってきた。(といっても50冊くらいか。)
一気に捨てようと思っている。

内容はアルバイト時代に使っていたiOSアプリの本だったり、Javaだったり。オライリー本もいくつかある。
取っておこうと思ったけど、冷静に考えると、ここ1年は開いていないので(というかここ1年くらい出張で家にいなかったので)思い切って捨てようと思う。

必要そう(また見返すことがありそう)な本は思い切って電子化してしまいたいので、とりあえず自炊代行サービスに登録はしたものの全部自炊できるかわからない。
引っ越しまでには必ず必要なもの意外は全部なくす予定である。

みんな技術書どうしてるんだろうか。

mac osx 10.8に手動でapacheを入れようとしたら失敗した

Mac osx 10.8に手動でapache2.2.25をいれてみました。

macにはもともとapcheは入ってるんですが、まあ勉強がてらということで。

てことで、まずgccを確認

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)


apacheのサイトからUnix Source: httpd-2.2.25.tar.gz をダウンロードし解凍

$ tar zxvf  httpd-2.2.25.tar.gz

ここから先でつまずいたんですが、./configureをしようとすると、errorがでてしまうんですね。

$ ./configure 
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking build system type... x86_64-apple-darwin12.4.0
checking host system type... x86_64-apple-darwin12.4.0
checking target system type... x86_64-apple-darwin12.4.0

Configuring Apache Portable Runtime library ...

checking for APR... yes
  setting CC to "/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc"
  setting CPP to "/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -E"
  setting CFLAGS to " "
  setting CPPFLAGS to " -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK"
  setting LDFLAGS to " "

Configuring Apache Portable Runtime Utility library...

checking for APR-util... yes
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
checking whether the C compiler works... no
configure: error: in `/usr/local/httpd-2.2.25':
configure: error: C compiler cannot create executables
See `config.log' for more details


1時間エラーログとか見ながら悩んだんですが、解決しました。
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/
って書いてありますけど、実際は
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/
でした。

なんで、

$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain

で解決!

後はmakeしてmake intallで完了。
一件落着。(初心者には辛い。

macにRをいれてみた。

JavaRubyもまだまだなんですが、
今日図書館で「RとRubyによるデータ解析」っていう本を
たまたま見つけてしまい、brewを使ってRをインストールしてみました。

まず、gfortranをインストール

brew install gfortran

続いてR

brew install R

installが完了したら確認

R

これでRの門を叩いてしまった。。。

デバッグができなかった話

HHKB Lite2 for Macを買いました。
しばらく使ってみて気が向いた時にレビューでも書いてみようと思います。

さて、2週間くらい前でしょうか。
Google App Scriptでコードを書いて実行してみると「配列の中身が空だよ」
的なエラーがでたんで、どや顔で最近習ったデバッグでステップインとかやってみようと試みました。

すると、水洗便所かってくらいサーっとブレークポイントを無視してながれていきました。

1日悩んでたところを同期が助けてくれたんですか、答えが非常にかんたんでした。

→メソッド実行してない

こういうケアレスミスがまだまだ多いんできをつけてやって参ります。m(__)m

DBでauto_incrementしたidに初期値を設定する

研修中に作ったDBのid番号が気いらなかったのか、「これって1000番からはじめられませんか?」といわれたので
調べてみたらいっぱいあったので覚書。
mysqlにて

create table testtable (id int auto_increment = 1000, name varchar(10));

ただ使い道があまりわかっていない。