Mac OS LionでのOpenCV 2.3.1 のサンプル実行

ひさびさに書いてみる。半年以上ぶり。 問題 OpenCVのサンプル実行までの手順をどうするか 解決 とりあえずできたのでメモ。 $ cd /OpenCV-2.3.1/sample $ g++ imagelist_creator.cpp -o imagelist_creator `pkg-config --libs --cflags opencv` $ ./imageli…

openFrameworks

macでopenFrameworks動いた! Lionで動かなくて多少手こずる。何だかアートな感じ(^^ 参考 http://blog.davidpaulrosser.co.uk/2011/08/getting-openframeworks-0-07-compiling-with-osx-10-7/ http://kawa.at.webry.info/201101/article_1.html

タスクリスト

部品定義の仕様を見直す frame:フレーム view:中間部品 ctrl:中間部品 part:基本部品 info:情報部品 フレーム単位にXMLを解析する ViewやCtrlも自身のXMLは自身で解析する ポップアップやBasicフレーム組み込む

NyAR4psgを試す

Processing + NyARToolkit という組合せもあるとのことで試す。一通りサンプルを動かしてみた。 非常に簡単 短いコードでできる グラフィックが派手 OpenGLを使って色々できる 3Dモデルを用意する手間を省ける とりあえずアイディアを試すには最高の組合せで…

タスクリスト

・設計 ・アプリモデルのバリエーションを考える・調査 ・競合の価格・表現力を調べる・開発 ・モジュールを整理する ・jar化する

OpenCVをVC++2008で実行時エラー

問題 error LNK2019: 未解決の外部シンボル _cvReleaseImage が関数 _main で参照されました。 解決 「プロジェクト」→「○×△のプロパティ」→「構成プロパティ」→「リンカ」→「入力」→「追加の依存ファイル」に cv210.lib cxcore210.lib highgui210.lib を書く

Project Eueler: problem22

問題 Using names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this v…

Project Eueler: problem21

問題 Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and b are called amicable numbers.For exampl…

Project Eueler: problem20

問題 n! means n (n 1) ... 3 2 1For example, 10! = 10 9 ... 3 2 1 = 3628800, and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.Find the sum of the digits in the number 100! 回答 def kai(n) return n if n == 1 retu…

Android: 別パッケージのActivityを起動する

問題 別パッケージのActivityを起動する Intent intent = new Intent(this,jp.leontec.coresaap.CSFrameBrowser.class); intent.setClassName("jp.ex", "jp.ex.myactivity"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent);という…

Project Eueler: problem18

問題 By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.3 7 4 2 4 6 8 5 9 3That is, 3 + 7 + 4 + 9 = 23.Find the maximum total from top to bottom of the t…

Project Eueler: problem19

問題 You are given the following information, but you may prefer to do some research for yourself.1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thirty-one, Saving February alone, Which has …

Project Eueler: problem16

問題 215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.What is the sum of the digits of the number 21000? 回答 def calc(num) 2**num end def do_sum(num) sum = 0 str = num.to_s 0.upto(str.size.to_i-1) do |n| sum += str[n,1].to_…

Project Eueler: problem17

問題 If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many le…

Project Eueler: problem14

問題 The following iterative sequence is defined for the set of positive integers:n n/2 (n is even) n 3n + 1 (n is odd)Using the rule above and starting with 13, we generate the following sequence:13 40 20 10 5 16 8 4 2 1 It can be seen th…

Project Eueler: problem15

問題 Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? 回答 def root(x,y,c) cnt = 0 return c[x][y] if c[x][y] return cnt += 1 …

Project Eueler: problem13

問題 Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.37107287533902102798797998220837590246510135740250 46376937677490009712648124896970078050417018260538 ..... 回答 ar = [] DATA.each do |line| ar << …

Project Eueler: problem12

問題 The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...Let us list the fact…

Project Eueler: problem11

問題 In the 2020 grid below, four numbers along a diagonal line have been marked in red.08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 4…

Project Eueler: problem10

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million. prime = [2] sum = 2 limit = 2000000 (3..limit).each do |x| flg = true prime.each do |y| if x % y == 0 flg = false ;break end end if flg …

Project Eueler: problem9

A Pythagorean triplet is a set of three natural numbers, a b c, for which,a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52.There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. (1..333).each do …

Project Eueler: problem8

Find the greatest product of five consecutive digits in the 1000-digit number. #Ruby str = "" DATA.each do |x| x = x.chomp! str = str + x end res = 0 (0..995).each do |x| t = 1 (0..4).each do |y| t = t*str[x+y,1].to_i end if res < t res = …

Project Eueler: problem7

問題 By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.What is the 10001st prime number? 回答 prime = [2] flg = 0 (3..9999999).each do |n| flg = 0 prime.each do |p| if n % p == 0 flg = 1 br…

Project Eueler: problem6

問題 The sum of the squares of the first ten natural numbers is,12 + 22 + ... + 102 = 385 The square of the sum of the first ten natural numbers is,(1 + 2 + ... + 10)2 = 552 = 3025 Hence the difference between the sum of the squares of the…

Project Euler : problem4

問題 A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.Find the largest palindrome made from the product of two 3-digit numbers. 回答 res = 0 t = 0 (1..999).e…

GAE/JRubyを試す

作業手順 以下を参考にwindows環境で作業http://www.machu.jp/diary/20090903.html#p01 # ruby dev_appserver.rb .をやるとエラー。 RubyGems 1.5.2では動かないらしい。 1.3.7にダウングレードが必要。http://www.oiax.jp/rails/zakkan/rubygems_1_5.html #…

Androidのapkをunzip/rezipして再署名する方法

問題 apkファイルをunzip/rezipして使う unzip/rezipのみ行ってinstallすると以下の署名エラーが出る Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION] 方法 ・.apkの拡張子を.zipに変更してunzipする ・署名関連のファイルを削除する deleting: META-I…

Androidのエミュレータ/system/libにファイルを書き込む方法

問題 エミュレータの/system/lib配下にファイルを書き込む 方法 リードオンリーファイルシステムなのでリマウントする adb root adb remountファイルをpush adb push libxxx.so /system/lib以下のエラーが出る場合は emulator起動時に「–partition-size 128…

PythonのIDLEの使い方

問題 IDLEのシェルでコマンドのヒストリを出す 方法 Alt+P:コマンド履歴戻る Alt+N:コマンド履歴進む入力途中で実行すると前方一致で出す 参考 http://d.hatena.ne.jp/dimbla/20100106/1262763311 http://docs.python.org/library/idle.html

gae/pのgqlの書き方

問題 データストアへクエリを発行したい 方法 タイトル降順、10件まで 必ず SELECT * FROM で始める SELECT * FROM WikiWords ORDER BY title DESC LIMIT 10pythonから from google.appengine.ext import db q = db.GqlQuery("SELECT * FROM WikiWords") res…