This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;1.11 | |
;n < 3 f(n) = n, n >= 3 f(n) = f(n - 1) + 2f(n - 2) + 3f(n-3) | |
(define (func n) | |
(cond ((< n 3) n) | |
(else (+ (func (- n 1)) (* 2 (func (- n 2))) (* 3 (func (- n 3))))))) | |
(print (func 10)) | |
(define (func n) | |
(func-iter 2 1 0 n)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;1.12 pascal's triangle | |
(define (func n m) | |
(cond ((= n 1) 1) | |
((= m 1) (func (- n 1) m)) | |
((= m n) (func (- n 1) (- m 1))) | |
(else (+ (func (- n 1) (- m 1) ) (func (- n 1) m))))) | |
(print (func 5 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;1.12 pascal's triangle | |
(define (func n m) | |
(cond ((= n 1) 1) | |
((= m 1) (func (- n 1) m)) | |
((= m n) (func (- n 1) (- m 1))) | |
(else (+ (func (- n 1) (- m 1) ) (func (- n 1) m))))) | |
(print (func 5 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
require "fileutils" | |
require 'find' | |
count = 0 | |
Find.find('./check_xml'){|f| | |
if File.basename(f) == ".DS_Store" | |
next | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ノートブックの指定 | |
property nb : "Ideas" | |
property _newNote : missing value | |
on alfred_script(q) | |
set _inputText to q | |
set AppleScript's text item delimiters to "-open" | |
set _text to text items of _inputText | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "MyWebViewController.h" | |
#import "AFNetworking.h" | |
#if false // facebook | |
#define LOGIN_URL @"http://sample/login.php?command=facebook&app=true" | |
#define REDIRECT_URL @"command=facebook_cb" | |
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#!coding: utf-8 | |
import sys, os, re, shutil | |
from optparse import OptionParser | |
parser = OptionParser(usage= | |
'''%prog [options] <target-dir> | |
Example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "find" | |
require "fileutils" | |
def copy(source_path, target_path) | |
Find.find(source_path) do |source| | |
next if File.directory? source | |
#パスにopencv2が含まれていなければ除外 | |
next unless File.dirname(source).include?("opencv2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (sum term a next b) | |
(if (> a b) | |
0 | |
(+ (term a) | |
(sum term (next a) next b)))) | |
; (define (pi-sum a b) | |
; (define (pi-term x) | |
; (/ 1.0 (* x (+ x 2)))) | |
; (define (pi-next x) | |
; (+ x 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
from numpy import * | |
from scipy import linalg | |
class Camera(object): | |
""" ピンホールカメラを表すクラス """ | |
def __init__(self,P): |
OlderNewer