理科系の勉強日記

Linux/Ubuntu/Mac/Emacs/Computer vision/Robotics

2012-04-01から1ヶ月間の記事一覧

auto-complete-clang

auto-complete.elはEmacsで補完候補を提示してくれるパッケージである. バッファに登場している文字列を候補として出してくれるというものであるが,VisualStudioやEclipseのように関数の候補などを提示することはできない. ▲auto-completeによって候補が…

Ubuntuのメモ

Ubuntu10.10上にkvs(Kyoto Visualization System)をインスト―ルしようと思い,まず以下を入力. sudo apt-get install freeglut3-dev libglut3-devエラー http://jp.archive.ubuntu.com/ubuntu/ maverick-updates/main libkms1 i386 2.4.21-1ubuntu2.1 jp.ar…

KLT tracker

KLT trackingの実装を拾ってきてmake. gcc -O3 -DNDEBUG -o sample02 sample02.cpp -L. -lklt -L/usr/local/lib -L/usr/lib -lm `pkg-config --cflags opencv` `pkg-config --libs opencv`でコンパイルできる. -L ./ -lkltを書いてなくてこけた.klt/の中…

Mac備忘録

selfupdate macportsでselfupdateするとき,rsyncでERRORとなる場合,rsyncにプロキシの設定を書いてやる必要がある. RSYNC_PROXY=http://proxy.hoge.net:8080 port selfupdate opencv sudo port install opencvでOpenCVをインストールする. /opt/local/sh…

vectorのsort

#include <iostream> #include <vector> #include <algorithm> #include <functional> int main(){ std::vector<int> data; for(int i=0; i<5; i++) data.push_back(i); // 昇順 std::sort(data.begin(),data.end()); //std::sort(&data[0],&data[5]); // 降順 std::sort(data.begin(),data.end(),std::grea</int></functional></algorithm></vector></iostream>…

メモ

void func(char* name[256], ... ){ ... string name_str = "hoge"; *name = (char*)(name_str.c_str());// 無理やり } c_str()はconst char*を返す. char*にstringをコピーしたい場合は一旦別の領域にコピーする. char *ch; string str = "ABC"; // 長さ…