哲学者を分類してみる
パースのカテゴリー論を使って哲学者を分類してみるの面白い。プラトンとヘーゲルは典型的な第三性の哲学者。パース自身も第三性にやや傾きがち。アリストテレスとカントはバランス型。ウィトゲンシュタインや永井均は第二性特化型。デカルトも第二性が強いが、中世哲学由来の第三性への感度もある。
— 阿蘇の史(さかん) (@asonosakan) 2017年11月4日
自分のことが書いてあるのでとりあえずリツイートします。「第三性」「第二性」といった用語については、パース『連続性の哲学』(岩波文庫)の第3章「関係項の論理学」に説明があります。 https://t.co/dqlYVLVtxu
— 永井均 (@hitoshinagai1) 2017年11月4日
という,2つのつぶやきを理解したく『連続性の哲学』第3章「関係項の論理学」を読み始めたので,少しずつメモしていく.
- 作者: パース,伊藤邦武
- 出版社/メーカー: 岩波書店
- 発売日: 2001/07/16
- メディア: 文庫
- 購入: 3人 クリック: 25回
- この商品を含むブログ (14件) を見る
第三章 関係項の論理学 p.86
推論は3つのタイプからなる
- 演繹
- 帰納
- 仮説形成
パースの形式論理学は,主要な部分すべてに三肢性を認めるという特徴をもっていた
いずれの推論も
3つの命題と
3つの項[名辞]
からなる.
論理的形式には3つのタイプがある
- 項
- 命題
- 推論
論理学とは記号の研究
記号とは第二のものを,第三のもの[解釈する思考]に向けて表象するもの
記号を研究する方法は3つある
- 記号が意味をもつ一般的な条件にかんする研究
- 記号の真理にかんする研究であり,狭義の論理学
- 記号が他の記号にその意味を転移する条件にかんする研究
さらに,記号一般は次の三肢性の三番目のもの
- 物である限りの物
- 他の物と相互作用する限りでの物
- 他の物を第三者に表象する限りでの物
これら全ての三肢構造が同じ3つの概念を体現していて,それらの概念をカテゴリーと呼ぶことにし,最初,「質」「関係[作用・反作用]」「表象」と名付けた.
最初 | 「質」 | 「関係[作用・反作用]」 | 「表象」 |
現在 | 「第一性」 | 「第二性」 | 「第三性」 |
第一性
定義 あるものがそれ自体で,それ以外のものには無関係に存在しているような存在の様相=「感じ(フィーリング)」
さらに,第一性をもつものは,部分のないもの.
第一性を外から見れば,互いに異なったあらゆる可能な感覚質[qualia]ということになり,人が実際に感じるのはその微小な部分に過ぎない,無限の多様性からなることになる.その無限の多様性のおのおのは他のすべてと同様にまったく単純.
感覚質は絶対的に単純
第二性
読書の進捗管理するスニペット
ゼミ当日までにテクストを読むペースを計算したくなったのでPythonで関数を作った. 読書家のみなさんのお役に立てたら嬉しい.
from datetime import date def reading_plan(title, total_number_of_pages, period): current_page = int(input("Current page?: ")) deadline = (date(int(period[0]), int(period[1]), int(period[2])) - date.today()).days print(title, period, "まで残り", deadline, "日,", (total_number_of_pages - current_page) // deadline, "p/日")
例えば,『現象学の理念』という本で,ノルマが118ページ,2017年11月15日までに読む必要がある場合
reading_plan("『現象学の理念』", 118, (2017,11,15))
Current page?と聞かれるので現在のページ数を入力すると
Current page?: 1 『現象学の理念』 (2017, 11, 15) まで残り 14 日, 8 p/日
残り日数と,1日のノルマが計算される.
『小中学生からはじめるプログラミングの本』のスクリプト
小中学生からはじめるプログラミングの本(日経BPパソコンベストムック)
- 作者: 日経パソコン
- 出版社/メーカー: 日経BP社
- 発売日: 2017/02/16
- メディア: 単行本
- この商品を含むブログを見る
インデント等,本に書かれているように書きます.
p.14
<script> a=1; b=1; while(a<10000){ a++; b=b+a; } document.write(b); </script>
p.15
<script src="http://maps.google.com/maps/api/js"> </script> <script> navigator.geolocation.getCurrentPosition( function(a){b=new google.maps.LatLng(a.coords.latitude, a.coords.longitude);new google.maps.Marker({position:b, map:new google.maps.Map(document.getElementById("c"), {zoom: 17, center:b})}); }); </script> <div id="c" style="width:100%; height: 100%"> </div>
p.129 図10−2
def bmicheck(shintyou, taijuu): bmi=taijuu/((shintyou/100)**2) message="BMIは%.1fです。" if bmi>=25: message=message+"肥満です" print(message % bmi) bmicheck(170,60) bmicheck(170,80)
とてもわかりやすいプログラミングの本を見つけた
『10才からはじめるプログラミング図鑑』という本がとても良い本だったので, この本で学ぶ子供,親向けに,Python のコードを写経する. 詰んだ時などに参考にしてもらえたら嬉しい.
10才からはじめるプログラミング図鑑:たのしくまなぶスクラッチ&Python超入門
- 作者: キャロルヴォーダマン,Carol Vorderman,山崎正浩
- 出版社/メーカー: 創元社
- 発売日: 2015/10/20
- メディア: 単行本
- この商品を含むブログを見る
ちなみに,表紙の見た目からは,スクラッチとPythonの入門書に見えるが, それ以外にも,
- 論理ゲート (pp.186-187)
- プロセッサとメモリ (pp.188-189)
- コンパイラとインタプリタ (p.191)
- インターネットのポート (p.195)
- スマートフォンのアプリの説明 (pp.206-207)
- JavaScript (pp.208-211)
- Raspberry Pi, Arduino (p.214)
等についてもわかりやすく書かれていて驚いた.10才のころに読みたかったし,この本から学ぶことができる子供達がとても羨ましい.もちろん,ステマではない.
では早速,写経する.
3 パイソンで遊ぼう
プロジェクト4 : ゆうれいゲーム
# p.96 ゆうれいゲーム # Ghost Game from random import randint print('ゆうれいゲーム') feeling_brave = True score = 0 while feeling_brave: ghost_door = randint(1, 3) print('ドアが3つある。') print('そのうち1つのドアの向こうにゆうれいがいる。') print('さあ、何番のドアを開ける?') door = input('1、2、それとも3?') door_num = int(door) if door_num == ghost_door: print('ゆうれいだ!') feeling_brave = False else: print('ゆうれいはいなかった!') print('となりの部屋に入れたよ。') score = score + 1 print('逃げろ!') print('ゲームオーバー! スコアは', score, 'です。')
分岐
# p.121 いくつかの処理のうち1つを選ぶ a = int(input('a = ')) b = int(input('b = ')) op = input('たす/ひく/かける/わる:') if op == 'たす': c = a + b elif op == 'ひく': c = a - b elif op == 'かける': c = a * b elif op == 'わる': c = a / b else: c = 'エラー' print('答え = ',c)
パイソンでのくり返し
# p.122 パイソンでのくり返し from turtle import * forward(100) right(120) forward(100) right(120) forward(100) right(120)
for i in range(3): forward(100) right(120)
# p.123 入れ子構造 (ネスティング)のループ n = 3 for a in range(1, n + 1): for b in range(1, n + 1): print(b, 'x', a, '=', b * a)
関数
# p.130 関数の作り方とよび出し方 def greeting(): print('こんにちは!') greeting()
# p.131 関数にデータをわたす def height(m, cm): total = (100 * m) + cm print(total, 'センチの高さだね') height(1,45)
# p.131 関数からデータを返す def num_input(prompt): typed = input(prompt) num = int(typed) return num a = num_input('a を入力して下さい') b = num_input('b を入力して下さい') print('a + b =', a + b)
プロジェクト5 : 自動作文マシン
# pp.132-133 自動作文マシン # 文章を自動的に作る name = ['タカシが', 'ニュートンが', 'パスカルが'] noun = ['ライオンを', '自転車を', '飛行機を'] verb = ['買う', '乗り回す', 'たたく'] from random import randint def pick(words): num_words = len(words) num_picked = randint(0, num_words - 1) word_picked = words[num_picked] return word_picked print(pick(name), pick(noun), pick(verb), end='。\n')
# 文章を作り続ける while True: print(pick(name), pick(noun), pick(verb), end='。\n') input()
プロジェクト6 : 作図マシン
# p.140 from turtle import * reset() left(90) forward(100) right(45) forward(70) right(90) forward(70) right(45) forward(100) right(90) forward(100)
関数「turtle_controller」
# p.142 from turtle import * def turtle_controller(do, val): do = do.upper() if do == 'F': forward(val) elif do == 'B': backward(val) elif do == 'R': right(val) elif do == 'L': left(val) elif do == 'U': penup() elif do == 'D': pendown() elif do == 'N': reset() else: print('不明な命令がありました')
turtle_controller('F' , 100) turtle_controller('R' , 90) turtle_controller('F' , 50)
関数「string_artist」を作る
# p.144 program = 'N-L90-F100-R45-F70-R90-F70-R45-F100-R90-F100' cmd_list = program.split('-') cmd_list
次のソースコードを142ページのソースコードの下に続けて書こう.
def string_artist(program): cmd_list = program.split('-') for command in cmd_list: cmd_len = len(command) if cmd_len == 0: continue cmd_type = command[0] num = 0 if cmd_len > 1: num_string = command[1:] num = int(num_string) print(command, ':', cmd_type, num) turtle_controller(cmd_type, num)
# p.145 string_artist('N-L90-F100-R45-F70-R90-F70-R45-F100-R90-F100')
ユーザー用の入力画面を作る
次のソースコードは、ユーザーが作図命令を入力するポップアップウィンドウを作るためのものだ.「while True」ループでユーザーの入力を待ち続けるんだ.142ページと144ページのソースコードに続けて入力してね.
# p.146 instructions = '''タートルへの指示を入力して下さい: 例 F100-R45-U-F100-L45-D-F100-R90-B50 N = 新しくかき始める U/D = ペンを下げる / 上げる F100 = 前方へ100歩進む B50 = 後方へ50歩進む R90 = 右へ90度回転する L45 = 左へ45度回転する''' screen = getscreen() while True: t_program = screen.textinput('作図マシン', instructions) print(t_program) if t_program == None or t_program.upper() == 'END': break string_artist(t_program)
p.147
N-L90-F100-R45-F70-R90-F70-R45-F100-R90-F100- B10-U-R90-F10-D-F30-R90-F30-R90-F30-R90-F3
ちなみに,プロジェクト6 : 作図マシン のコードを続けて書くと
# p.142 関数「turtle_controller」 from turtle import * def turtle_controller(do, val): do = do.upper() if do == 'F': forward(val) elif do == 'B': backward(val) elif do == 'R': right(val) elif do == 'L': left(val) elif do == 'U': penup() elif do == 'D': pendown() elif do == 'N': reset() else: print('不明な命令がありました') # p.144 関数「string_artist」を作る def string_artist(program): cmd_list = program.split('-') for command in cmd_list: cmd_len = len(command) if cmd_len == 0: continue cmd_type = command[0] num = 0 if cmd_len > 1: num_string = command[1:] num = int(num_string) print(command, ':', cmd_type, num) turtle_controller(cmd_type, num) # p.146 ユーザー用の入力画面を作る instructions = '''タートルへの指示を入力して下さい: 例 F100-R45-U-F100-L45-D-F100-R90-B50 N = 新しくかき始める U/D = ペンを下げる / 上げる F100 = 前方へ100歩進む B50 = 後方へ50歩進む R90 = 右へ90度回転する L45 = 左へ45度回転する''' screen = getscreen() while True: t_program = screen.textinput('作図マシン', instructions) print(t_program) if t_program == None or t_program.upper() == 'END': break string_artist(t_program)
バグとデバッグ
# p.148 top_num = 5 total = 0 for n in range(top_num): total = total + n print('1から', top_num, 'までの合計は', total)
# p.149 top_num = 5 total = 0 for n in range(top_num): total = total + n print('デバッグ: n=', n, 'total=', total) input() print('1から', top_num, 'までの合計は', total)
# p.149 top_num = 5 total = 0 for n in range(1, top_num + 1): total = total + n print('デバッグ: n=', n, 'total=', total) input() print('1から', top_num, 'までの合計は', total)
ウィンドウを作る
# p.154 かんたんなウィンドウ from tkinter import * window = Tk()
# p.154 ウィンドウにボタンを足す from tkinter import * def bAaction(): print('ありがとう!') def bBaction(): print('いたい!ひどいじゃないか!') window = Tk() buttonA = Button(window, text='押して!', command=bAaction) buttonB = Button(window, text='押さないでよ!', command=bBaction) buttonA.pack() buttonB.pack()
# p.155 サイコロをふる from tkinter import * from random import randint def roll(): text.delete(0.0, END) text.insert(END, str(randint(1, 6))) window = Tk() text = Text(window, width=1, height=1) buttonA = Button(window, text='ここを押してサイコロをふろう', command=roll) text.pack() buttonA.pack()
色と座標
# p.156 from tkinter import * t = Tk() colorchooser.askcolor() # なぜか動かなかった
# p.157 from random import * from tkinter import * size = 500 window = Tk() canvas = Canvas(window, width=size, height=size) canvas.pack() while True: col = choice(['pink', 'orange', 'purple', 'yellow']) x0 = randint(0, size) y0 = randint(0, size) d = randint(0, size/5) canvas.create_oval(x0, y0, x0 + d, y0 + d, fill=col) window.update()
図形をかく
# p.158 基本的な図形をかく >>> from tkinter import * >>> window = Tk() >>> drawing = Canvas(window, height=500, width=500) >>> drawing.pack() >>> rect1 = drawing.create_rectangle(100, 100, 300, 200) >>> square1 = drawing.create_rectangle(30, 30, 80, 80) >>> oval1 = drawing.create_oval(100, 100, 300, 200) >>> circle1 = drawing.create_oval(30, 30, 80, 80)
# p.158 座標を使ってかく >>> drawing.create_rectangle(50, 50, 250, 350) # p.159 図形に色をつける >>> drawing.create_oval(30, 30, 80, 80, outline='red', fill='blue')
# p.159 エイリアンをかこう from tkinter import * window = Tk() window.title('エイリアン') c = Canvas(window, height=300, width=400) c.pack() body = c.create_oval(100, 150, 300, 250, fill='green') eye = c.create_oval(170, 70, 230, 130, fill='white') eyeball = c.create_oval(190, 90, 210, 110, fill='black') mouth = c.create_oval(150, 220, 250, 240, fill='red') neck = c.create_oval(200, 150, 200, 130) hat = c.create_polygon(180, 75, 220, 75, 200, 20, fill='blue')
グラフィックスを変化させる
# p.160 図形を動かす >>> c.move(eyeball, -10,0) >>> c.move(eyeball, 10,0)
p.159 のソースコードに続けて入力してね.
# 色を変えてみる def mouth_open(): c.itemconfig(mouth, fill='black') def mouth_close(): c.itemconfig(mouth, fill='red')
>>> mouth_open() >>> mouth_close()
p.160 のソースコードに続けて入力してね.
# p.161 図形をかくす def blink(): c.itemconfig(eye, fill='green') c.itemconfig(eyeball, state=HIDDEN) def unblink(): c.itemconfig(eye, fill='white') c.itemconfig(eyeball, state=NORMAL)
>>> blink() >>> unblink()
# p.161 しゃべらせる words = c.create_text(200, 280, text='私はエイリアンだ!') def steal_hat(): c.itemconfig(hat, state=HIDDEN) c.itemconfig(words, text='ぼうしをかえしてよ!')
>>> steal_hat()
イベントに反応する
# p.162 マウスのイベント window.attributes('-topmost', 1) def burp(event): mouth_open() c.itemconfig(words, text='げっぷ!') c.bind_all('<Button-1>', burp)
# p.163 キーボードのイベント def blink2(event): c.itemconfig(eye, fill='green') c.itemconfig(eyeball, state=HIDDEN) def unblink2(event): c.itemconfig(eye, fill='white') c.itemconfig(eyeball, state=NORMAL) c.bind_all('<KeyPress-a>', blink2) c.bind_all('<KeyPress-z>', unblink2)
# p.163 キーの操作で動かす def eye_control(event): key = event.keysym if key == "Up": c.move(eyeball, 0, -1) elif key == "Down": c.move(eyeball, 0, 1) elif key == "Left": c.move(eyeball, -1, 0) elif key == "Right": c.move(eyeball, 1, 0) c.bind_all('<Key>', eye_control)
プロジェクト6 : せん水かんゲーム
# p.165 ウィンドウとせん水かんを作る from tkinter import * HEIGHT = 500 WIDTH = 800 window = Tk() window.title('せん水かんゲーム') c = Canvas(window, width=WIDTH, height=HEIGHT, bg='darkblue') c.pack()
ship_id = c.create_polygon(5, 5, 5, 25, 30, 15, fill='red') ship_id2 = c.create_oval(0, 0, 30, 30, outline='red') SHIP_R = 15 MID_X = WIDTH / 2 MID_Y = HEIGHT / 2 c.move(ship_id, MID_X, MID_Y) c.move(ship_id2, MID_X, MID_Y)
# p.166 せん水かんを動かす SHIP_SPD = 10 def move_ship(event): if event.keysym == 'Up': c.move(ship_id, 0, -SHIP_SPD) c.move(ship_id2, 0, -SHIP_SPD) elif event.keysym == 'Down': c.move(ship_id, 0, SHIP_SPD) c.move(ship_id2, 0, SHIP_SPD) elif event.keysym == 'Left': c.move(ship_id, -SHIP_SPD, 0) c.move(ship_id2, -SHIP_SPD, 0) elif event.keysym == 'Right': c.move(ship_id, SHIP_SPD, 0) c.move(ship_id2, SHIP_SPD, 0) c.bind_all('<Key>', move_ship)
# p.167 「あわ」を用意する from random import randint bub_id = list() bub_r = list() bub_speed = list() MIN_BUB_R = 10 MAX_BUB_R = 30 MAX_BUB_SPD = 10 GAP = 100 def create_bubble(): x = WIDTH + GAP y = randint(0, HEIGHT) r = randint(MIN_BUB_R, MAX_BUB_R) id1 = c.create_oval(x - r, y - r, x + r, y + r, outline='white') bub_id.append(id1) bub_r.append(r) bub_speed.append(randint(1, MAX_BUB_SPD))
# p.168 あわを動かす def move_bubbles(): for i in range(len(bub_id)): c.move(bub_id[i], -bub_speed[i], 0)
from time import sleep, time BUB_CHANCE = 10 # メインのループ while True: if randint(1, BUB_CHANCE) == 1: create_bubble() move_bubbles() window.update() sleep(0.01)
def get_coords(id_num): pos = c.coords(id_num) x = (pos[0] + pos[2])/2 y = (pos[1] + pos[3])/2 return x, y
# p.169 あわをわる方法 def del_bubble(i): del bub_r[i] del bub_speed[i] c.delete(bub_id[i]) del bub_id[i]
def clean_up_bubs(): for i in range(len(bub_id) -1, -1, -1): x, y = get_coords(bub_id[i]) if x < -GAP: del_bubble(i)
- 10 のコードは省略しました.
# p.170 2つの点の間の距離をはかる from math import sqrt def distance(id1, id2): x1, y1 = get_coords(id1) x2, y2 = get_coords(id2) return sqrt((x2 - x1)**2 + (y2 - y1)**2)
# あわをわる def collision(): points = 0 for bub in range(len(bub_id)-1, -1, -1): if distance(ship_id2, bub_id[bub]) < (SHIP_R + bub_r[bub]): points += (bub_r[bub] + bub_speed[bub]) del_bubble(bub) return points
- 13 のコードは省略しました.
# p.172 ゲームを完成させる c.create_text(50, 30, text='タイム', fill='white' ) c.create_text(150, 30, text='スコア', fill='white' ) time_text = c.create_text(50, 50, fill= 'white' ) score_text = c.create_text(150, 50, fill='white') def show_score(score): c.itemconfig(score_text, text=str(score)) def show_time(time_left): c.itemconfig(time_text, text=str(time_left))
from time import sleep, time BUB_CHANCE = 10 TIME_LIMIT = 30 # P.172 BONUS_SCORE = 1000 # P.172 score = 0 # p.171 bonus = 0 # P.172 end = time() + TIME_LIMIT # P.172
# p.173 # メインのループ while time() < end: # P.173 if randint(1, BUB_CHANCE) == 1: create_bubble() move_bubbles() clean_up_bubs() # p.169 score += collision() # p.171 if (int(score / BONUS_SCORE)) > bonus: # p.173 bonus += 1 # p.173 end += TIME_LIMIT # p.173 show_score(score) # p.173 show_time(int(end - time())) # p.173 window.update() sleep(0.01)
# p.173 c.create_text(MID_X, MID_Y, \ text='ゲームオーバー', fill='white', font=('Helvetica', 30)) c.create_text(MID_X, MID_Y + 30, \ text='スコア'+ str(score), fill='white') c.create_text(MID_X, MID_Y + 45, text='ボーナスタイム' + str(bonus*TIME_LIMIT), fill='white')
これで完成です. 下記は完成したプログラムです.
# p.165 ウィンドウとせん水かんを作る from tkinter import * HEIGHT = 500 WIDTH = 800 window = Tk() window.title('せん水かんゲーム') c = Canvas(window, width=WIDTH, height=HEIGHT, bg='darkblue') c.pack() ship_id = c.create_polygon(5, 5, 5, 25, 30, 15, fill='red') ship_id2 = c.create_oval(0, 0, 30, 30, outline='red') SHIP_R = 15 MID_X = WIDTH / 2 MID_Y = HEIGHT / 2 c.move(ship_id, MID_X, MID_Y) c.move(ship_id2, MID_X, MID_Y) # p.166 せん水かんを動かす SHIP_SPD = 10 def move_ship(event): if event.keysym == 'Up': c.move(ship_id, 0, -SHIP_SPD) c.move(ship_id2, 0, -SHIP_SPD) elif event.keysym == 'Down': c.move(ship_id, 0, SHIP_SPD) c.move(ship_id2, 0, SHIP_SPD) elif event.keysym == 'Left': c.move(ship_id, -SHIP_SPD, 0) c.move(ship_id2, -SHIP_SPD, 0) elif event.keysym == 'Right': c.move(ship_id, SHIP_SPD, 0) c.move(ship_id2, SHIP_SPD, 0) c.bind_all('<Key>', move_ship) # p.167 「あわ」を用意する from random import randint bub_id = list() bub_r = list() bub_speed = list() MIN_BUB_R = 10 MAX_BUB_R = 30 MAX_BUB_SPD = 10 GAP = 100 def create_bubble(): x = WIDTH + GAP y = randint(0, HEIGHT) r = randint(MIN_BUB_R, MAX_BUB_R) id1 = c.create_oval(x - r, y - r, x + r, y + r, outline='white') bub_id.append(id1) bub_r.append(r) bub_speed.append(randint(1, MAX_BUB_SPD)) def get_coords(id_num): pos = c.coords(id_num) x = (pos[0] + pos[2])/2 y = (pos[1] + pos[3])/2 return x, y # あわを動かす def move_bubbles(): for i in range(len(bub_id)): c.move(bub_id[i], -bub_speed[i], 0) # p.169 あわをわる方法 def del_bubble(i): del bub_r[i] del bub_speed[i] c.delete(bub_id[i]) del bub_id[i] def clean_up_bubs(): for i in range(len(bub_id) -1, -1, -1): x, y = get_coords(bub_id[i]) if x < -GAP: del_bubble(i) # p.170 2つの点の間の距離をはかる from math import sqrt def distance(id1, id2): x1, y1 = get_coords(id1) x2, y2 = get_coords(id2) return sqrt((x2 - x1)**2 + (y2 - y1)**2) # あわをわる def collision(): points = 0 for bub in range(len(bub_id)-1, -1, -1): if distance(ship_id2, bub_id[bub]) < (SHIP_R + bub_r[bub]): points += (bub_r[bub] + bub_speed[bub]) del_bubble(bub) return points # p.172 ゲームを完成させる c.create_text(50, 30, text='タイム', fill='white' ) c.create_text(150, 30, text='スコア', fill='white' ) time_text = c.create_text(50, 50, fill= 'white' ) score_text = c.create_text(150, 50, fill='white') def show_score(score): c.itemconfig(score_text, text=str(score)) def show_time(time_left): c.itemconfig(time_text, text=str(time_left)) from time import sleep, time BUB_CHANCE = 10 TIME_LIMIT = 30 # P.172 BONUS_SCORE = 1000 # P.172 score = 0 # p.171 bonus = 0 # P.172 end = time() + TIME_LIMIT # P.172 # メインのループ while time() < end: # P.173 if randint(1, BUB_CHANCE) == 1: create_bubble() move_bubbles() clean_up_bubs() # p.169 score += collision() # p.171 if (int(score / BONUS_SCORE)) > bonus: # p.173 bonus += 1 # p.173 end += TIME_LIMIT # p.173 show_score(score) # p.173 show_time(int(end - time())) # p.173 window.update() sleep(0.01) # p.173 c.create_text(MID_X, MID_Y, \ text='ゲームオーバー', fill='white', font=('Helvetica', 30)) c.create_text(MID_X, MID_Y + 30, \ text='スコア'+ str(score), fill='white') c.create_text(MID_X, MID_Y + 45, text='ボーナスタイム' + str(bonus*TIME_LIMIT), fill='white')
5 現実の世界でのプログラミング
JavaScriptを使う
// p.210 ユーザーに入力してもらう <script> var name = prompt("名前を入れてね "); var greeting = "こんにちは" + name + "!"; document.write(greeting); alert("Hello World!"); </script>
// p.211 イベント <button onclick="tonguetwist()">さあ言ってみよう!</button> <script> function tonguetwist() { document.write("なまむぎなまごめなまたまご"); } </script>
// p.211 JavaScript でのループ <script> for (var x=0; x<6; x++) { document.write("ループ回数: "+x+"<br>"); } </script>
10才からはじめるプログラミング図鑑:たのしくまなぶスクラッチ&Python超入門
- 作者: キャロルヴォーダマン,Carol Vorderman,山崎正浩
- 出版社/メーカー: 創元社
- 発売日: 2015/10/20
- メディア: 単行本
- この商品を含むブログを見る
アドルノ『啓蒙の弁証法』を読む宣言
1年前くらいだろうか,書店にて
A君「アドルノという哲学者がいて,この人が書いた本は滅茶苦茶難しいんですよ.これ[『啓蒙の弁証法』]ですね.」
と文庫を手に取り,渡してきた.
- 作者: ホルクハイマー,アドルノ,Max Horkheimer,Theodor W. Adorno,徳永恂
- 出版社/メーカー: 岩波書店
- 発売日: 2007/01/16
- メディア: 文庫
- 購入: 4人 クリック: 89回
- この商品を含むブログ (79件) を見る
- 作者: Martin Heidegger
- 出版社/メーカー: MAX NIEMEYER
- 発売日: 2006/08
- メディア: ハードカバー
- 購入: 2人 クリック: 4回
- この商品を含むブログ (2件) を見る
- 作者: ハイデガー,熊野純彦
- 出版社/メーカー: 岩波書店
- 発売日: 2013/04/17
- メディア: 文庫
- この商品を含むブログ (14件) を見る
そんなA君が「難しい」と言うのだから,僕にはより難しいし,興味のある分野では無いため,僕はペラペラ捲って「ふ~ん...」と棚に戻した.
しかし,不思議な縁で『啓蒙の弁証法』を読むことになった.
やりたいことや読みたい本が積まれていくが”縁”を大事にして,読むことにした.
と,宣言しないと諦めてしまいそうなので宣言しておく.
(もし興味があれば誰か一緒に読みましょう.『存在と時間』も面白い本です.)
マイク・ホフリンガー『フェイスブック 不屈の未来戦略』がおもしろい
フェイスブック 不屈の未来戦略 (T's BUSINESS DESIGN)
- 作者: マイク・ホフリンガー
- 出版社/メーカー: TAC出版
- 発売日: 2017/07/14
- メディア: Kindle版
- この商品を含むブログを見る
著者が元facebookのエンジニアであり,執られてきた戦略の解説がとても面白い.
人に近い位置にあるiPhone, android, iPad, コンピュータなどのデバイスや通信事業者は、同じカテゴリー内の製品と取り替えても支障はあまりないが,スマホの台頭によりコンテンツを見るサービスやアプリが重要になった.
機能,プロダクト,会社,ミッションの目標ごとの達成までにかかる期間と産み出す価値の総額のグラフも良い.
グロースの数式
facebook のようなサービスの場合,ある特定の期間(例えば1ヶ月)におけるアクティブユーザー数を とした場合,下記のような方程式を書くことができる.
Active: アクティブユーザー
New: 新規ユーザー
Retained: 保持ユーザー
Resurrected: 復活ユーザー
Churned: 解約ユーザー
2015年にザッカーバーグが行った読書の挑戦 Mark Zuckerberg book club で読了した本も紹介されている.以下にリンクを張る.
- 作者: スティーブン・ピンカー,幾島幸子,塩原通緒
- 出版社/メーカー: 青土社
- 発売日: 2015/01/28
- メディア: 単行本
- この商品を含むブログ (32件) を見る
- 作者: バーツラフ・シュミル,立木勝
- 出版社/メーカー: エクスナレッジ
- 発売日: 2012/04/23
- メディア: 単行本(ソフトカバー)
- クリック: 1回
- この商品を含むブログを見る
国家はなぜ衰退するのか(上):権力・繁栄・貧困の起源 (ハヤカワ・ノンフィクション文庫)
- 作者: ダロンアセモグル,ジェイムズ A ロビンソン,鬼澤忍
- 出版社/メーカー: 早川書房
- 発売日: 2016/05/24
- メディア: 文庫
- この商品を含むブログ (4件) を見る
- 作者: ジョナサン・モーダック,スチュアート・ラザフォード,ダリル・コリンズ,オーランダ・ラトフェン,野上裕生,大川修二
- 出版社/メーカー: みすず書房
- 発売日: 2011/12/23
- メディア: 単行本
- 購入: 2人 クリック: 18回
- この商品を含むブログ (9件) を見る