macOS で mruby をやるための手順。
mruby が依存するツールを入れる。 See: https://github.com/mruby/mruby/blob/master/doc/guides/compile.md#prerequisites
xcode 入れて Ruby を入れたらだいたい動くと思う。
macOS で mruby をやるための手順。
mruby が依存するツールを入れる。 See: https://github.com/mruby/mruby/blob/master/doc/guides/compile.md#prerequisites
xcode 入れて Ruby を入れたらだいたい動くと思う。
| class Hoge | |
| def define_new_method | |
| def this_is_defined_inside_method | |
| puts "fuga" | |
| end | |
| end | |
| end | |
| begin | |
| h1 = Hoge.new |
| // 1秒待つPromiseを返す関数を定義 | |
| const sleepOneSecond = new Promise(resolve => setTimeout(resolve, 1000)) | |
| // 無限ループしつつ、100000000回ループするごとにconsole.logする関数を定義 | |
| const looping = () => { | |
| let a = 0; | |
| while (true) { | |
| a += 1; | |
| if (a % 100000000 === 0) { | |
| console.log('100000000 looped') |
| // await演算子が一時停止するのは「async関数の実行」であって「ランタイムの実行」ではない、ということを実験的に示す。 | |
| // | |
| // 侍エンジニア塾の記事のミスリーディングな記述(↓)に対する補足 | |
| // https://www.sejuku.net/blog/69618 | |
| // > 「await」はPromise処理の結果が返ってくるまで一時停止してくれる演算子となります | |
| // 1秒待つだけのPromiseを返す関数を定義する | |
| const oneSecond = () => new Promise(resolve => setTimeout(resolve, 1000)) | |
| // 1秒ごとに "a: n seconds"と表示するasync関数を定義する |
| function printDOMTree(curr = document.children[0], indent=0) { | |
| str = `${' '.repeat(indent)}<${curr.tagName}>\n`; | |
| Array.from(curr.children).forEach(child => { | |
| str += printDOMTree(child, indent + 1) | |
| }); | |
| str += `${' '.repeat(indent)}</${curr.tagName}>\n`; | |
| return str | |
| } |
| application: kebab-sub | |
| version: 2 | |
| runtime: python27 | |
| threadsafe: no | |
| api_version: 1 | |
| handlers: | |
| - url: /static | |
| static_dir: static |
| class ri(object): | |
| def __init__(self, arraylike): | |
| self.data = arraylike | |
| def to_a(self): | |
| return list(self.data) | |
| def map(self, func): | |
| return ri(map(func, self.data)) |
| \documentclass[uplatex,11pt]{jsarticle} | |
| \usepackage[dvipdfmx]{graphicx} | |
| \usepackage{comment} | |
| \usepackage{amsmath, amssymb} | |
| \usepackage{wrapfig} | |
| \usepackage{fancybox} | |
| \usepackage{ascmac} | |
| \usepackage{subfig} |
| 素子名 | 1回目 | 2回目 | 3回目 | 4回目 | |
|---|---|---|---|---|---|
| 抵抗 | 1.0kΩ | 100Ω | 1.0kΩ | 1.0kΩ | |
| インダクタ | 10mH | 10mH | 1.0mH | 10mH | |
| キャパシタ | 1.0μF | 1.0μF | 1.0μF | 10μF | |
| 電流源 | 1.0mA |
| \documentclass[a4paper,11pt]{bxjsarticle} | |
| \usepackage{xltxtra} | |
| \usepackage{zxjatype} | |
| \usepackage{here} | |
| \setjamainfont[BoldFont=ipaexm.ttf]{ipaexm.ttf} | |
| \setjasansfont[BoldFont=ipaexg.ttf]{ipaexg.ttf} | |
| \usepackage{amsmath} | |
| \usepackage{amssymb} | |
| \usepackage{booktabs} |