zshでbrew optionsを補完できるようにする

/usr/local/Library/Contributions/brew_zsh_completion.zsh の中に,optionsが書いてないので保管できない(他にも書いてないサブコマンドがある) 書き足したら補完できるようになる.

Emacs.appでMacの印刷メニューを使う

CarbonEmacsパッケージだと,普通に印刷しようとしたらMacの印刷メニューが使える. それを見て,ちゃんと対応しててEmacs偉いなーとか思っていたけど,偉いのはCarbonEmacsパッケージだった. homebrewで ビルドしたEmacs.app(23)だと,というか素のEmacs.a…

gccで,プリプロセッサでOS を判定したかった

参考: http://uyota.asablo.jp/blog/2009/03/18/4190013 http://vidtaker.com/0/805241 % gcc -v -E -dM - % cpp -dM /dev/null

gem を update した

log

MacBook Airのgemをアップデートした. % sudo gem update --system Password: Updating RubyGems Updating rubygems-update Successfully installed rubygems-update-1.7.1 Updating RubyGems to 1.7.1 Installing RubyGems 1.7.1 RubyGems 1.7.1 installed…

Homebrew入れた

mac

MacBook Air を手に入れたのと,研究室のiMacを再インストールしたので,環境設定をしている. 今まではmacportsを使っていたが,今回はhomebrewにしてみた. homebrewの良いところは, スクリプトがrubyなので読み書きできる(知識不足で結局読めてないのだ…

http://www.amazon.co.jp/gp/product/B0025Y6C5G/ref=s9_simh_gw_p23_d0_i1?pf_rd_m=AN1VRQENFRJN5&pf_rd_s=center-2&pf_rd_r=1B0XJ46PE6MPM667WG12&pf_rd_t=101&pf_rd_p=463376756&pf_rd_i=489986http://www.amazon.co.jp/Arduinoをはじめよう-Make-PROJECT…

rvm

% bash curl http://rvm.beginrescueend.com/releases/rvm-install-latest ) % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1426 100 1426 0 0 1031 0 0:00:01 0:00:01 --:--:-- 1281 rvm-1.2.…

MacBook Air 11インチ欲しい! Mac Book Air 11インチもらったら,Mac Book Air 11インチの設定めもをブログに書く.

gem install rvm の めも

$ sudo gem install rvm Password: ******************************************************************************* This gem contains only the Ruby libraries for the RVM Ruby API. In order to install RVM please use one of the methods listed i…

railsのバージョンを指定する

$ gem list rails *** LOCAL GEMS *** rails (3.0.1, 3.0.0, 2.3.5, 2.2.2, 1.2.6)$ rails -v Rails 3.0.1$ rails _2.3.5_ -v Rails 2.3.5$ alias rails2='rails _2.3.5_' $ rails2 -v Rails 2.3.5

入門git

第1章 リポジトリ 何を格納する?:全部だ. 作業ツリー .git/ masterブランチ リポジトリのクローン check out:Gitが作業ツリーを特定の時点のリポジトリに合わせる commit: 変更をコミットすると新しいrevisionが追加され,変更を説明するログメッセージが…

Snow Leopard インストールめも

MacPorts dmgでインストール sudo port -d selfupdate sudo port -d sync (sudo port upgrade outdated) git $ sudo port install git-core +svn +doc +bash_completion ports colordiff スクリーンキャプチャ保存先変更 mkdir ~/Pictures/ScreenShots defau…

フォルダ階層を上がるボタン.app

twitterで見て感心したのでやってみた

test.c #include <stdio.h> int main(){ int hoge[] = { #include "dat.csv" }; int n = sizeof(hoge)/sizeof(int); int i; for(i=0;i</stdio.h>

memo

Non-terminal programs don't inherit the system wide PATH and MANPATH variables that your terminal does. If you'd like them to be able to see Git, for whatever reason, you can run this script. It will add the PATH and MANPATH to your ~/.Mac…

ignore_comment モジュール open(filename) do |input| line = input.gets.ignore_comment("#") end みたいな コマンドラインフィルタっぽくつくる stdin > filter > stdout file1 > filter1 | filter2 > file2

memo:nohup

sshでログインして, $ ./command &とやって,exitしたら消えない? 端末のウインドウを「x」で消したり,不意に接続が切れたりすると,SIGHUPシグナルによってcommandは終了される. → nohup ./command & でOK → ちゃんとexitしたらOK?

test

ツイッター連携てすと

ちょっとだけべんりかも

#include <stdio.h> #include <stdlib.h> void argdump(int argc, char** argv){ FILE* fp = fopen("params","w"); int i; if(fp==NULL){ fprintf(stderr,"file open error"); } for(i=0; i</stdlib.h></stdio.h>

memo

c

malloc_or_exit() とか fopen_or_exit() とか fopenf() とか つくるFILE* fopenf( const char* format, const char* mode, ...){ var_argがなんとかかんとか char* filename = malloc(); strcmp(filename); return fopen(filename,mode); }

memo

RDB

リレーショナルデータベースでテーブルを設計するときは 一対一とか一対多でもcreate table hoge( id int );create table piyo( id int, hoge_id int );とはしないで,create table hoge_piyo( hoge_id int, piyo_id int );っていうのを作ったほうが変更しや…

macでemacsのマドをたくさん開く

mac

けっこう困ってたんだけど,実はCarbonEmacsの公式に書いてありました openに-nなんてあったのか...http://homepage.mac.com/zenitani/emacs-j.html - 複数の Emacs を起動するには? (Emacs.app)/Contents/MacOS/Emacs を実行してください。 2つめ以降を…

予告

これから,主に身内向けにプログラミング(主にC)のtipsを書いていこうと思います. ぼちぼちやります. ↓予定というかめも◆スタイル #参考:「センス・オブ・プログラミング」「プログラミング作法」数ヶ月後の自分(あるいは他人)が読んでもわかるよう…

Macで,起動しているけど未ログインの状態で,Dropboxは起動していてアカウントとリンクしている状態にしたいっ!

したい.

memo

Range#each_by(distance) {|i|} みたいのを作りたい.matlabのlinspace()みたいなニュアンス. さがせばあるような気もする. (0..0.8).each_by(0.2){|i| p i} #=> 0 0.2 0.4 0.6 0.8 てゆうか for(i=0;i<=0.8;i+=0.2){} これがやりたいだけ. gnuplot内でつ…

rubyのsystemとコマンド出力`str`の違い

#include <stdio.h> int main(){ fprintf(stderr,"stderr\n"); fprintf(stdout,"stdout\n"); } #!/usr/bin/ruby def number n; puts "(#{n})"; end number 1 puts `./a.out` number 2 `./a.out` number 3 system "./a.out" (1) stderr stdout (2) stderr (3) stderr s</stdio.h>…

#define MAX 100 とかやるかわりに rubyスクリプトの中で max = `wc -l #{datafile}` `gcc prog.c -DMAX=#{max}` `./a.out #{datafile}` とかやれば 多少ならデータ数かわっても対応できる気がする

あとで

こんなのみつけたhttp://dev.bioruby.org/ja/?tutorialあとでみる.NeuroRubyとかないかなー

mercurial使い方メモ

初期化 hg init (== hg init .) hg init フォルダ名 ファイルの管理登録と登録解除 simulationフォルダの中身を全部登録,ただしsimulation/output以下を除く.テストファイルも除く. cd simulation hg add . hg forget output hg forget test* forget の…