2011-01-01から1年間の記事一覧
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フレーム組み込む
Processing + NyARToolkit という組合せもあるとのことで試す。一通りサンプルを動かしてみた。 非常に簡単 短いコードでできる グラフィックが派手 OpenGLを使って色々できる 3Dモデルを用意する手間を省ける とりあえずアイディアを試すには最高の組合せで…
・設計 ・アプリモデルのバリエーションを考える・調査 ・競合の価格・表現力を調べる・開発 ・モジュールを整理する ・jar化する
問題 error LNK2019: 未解決の外部シンボル _cvReleaseImage が関数 _main で参照されました。 解決 「プロジェクト」→「○×△のプロパティ」→「構成プロパティ」→「リンカ」→「入力」→「追加の依存ファイル」に cv210.lib cxcore210.lib highgui210.lib を書く
問題 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…
問題 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…
問題 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…
問題 別パッケージの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);という…
問題 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…
問題 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 …
問題 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_…
問題 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…
問題 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…
問題 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 …
問題 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 << …
問題 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…
問題 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…
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 …
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 …
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 = …
問題 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…
問題 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…
問題 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…
作業手順 以下を参考に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 #…
問題 apkファイルをunzip/rezipして使う unzip/rezipのみ行ってinstallすると以下の署名エラーが出る Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION] 方法 ・.apkの拡張子を.zipに変更してunzipする ・署名関連のファイルを削除する deleting: META-I…
問題 エミュレータの/system/lib配下にファイルを書き込む 方法 リードオンリーファイルシステムなのでリマウントする adb root adb remountファイルをpush adb push libxxx.so /system/lib以下のエラーが出る場合は emulator起動時に「–partition-size 128…
問題 IDLEのシェルでコマンドのヒストリを出す 方法 Alt+P:コマンド履歴戻る Alt+N:コマンド履歴進む入力途中で実行すると前方一致で出す 参考 http://d.hatena.ne.jp/dimbla/20100106/1262763311 http://docs.python.org/library/idle.html
問題 データストアへクエリを発行したい 方法 タイトル降順、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…
問題 ローカルサーバの管理コンソールを見たい 方法 以下のURLでアクセスする http://localhost:8000/_ah/admin/datastore 参考 http://jx-script.blogspot.com/2010/02/gaej.html