自分用メモとして残す。
概要
- 出力値の範囲を区間で区切り、適切にバイオームを割り当てる。
- simplex noise の特性的に値は波形的な変化をするので、海 → 砂 → 平地 → 山 → 雪みたいな高さにちなんだ変化をさせる
| void main() async { | |
| final now = DateTime.parse("2022-07-09 12:02:00"); | |
| final expirationTime1 = DateTime.parse("2022-07-09 12:03:00"); | |
| final expirationTime2 = DateTime.parse("2022-07-09 12:01:00"); | |
| final n = now.add(const Duration(minutes: -2)); // 2min前 | |
| final n2 = now.add(const Duration(minutes: 2)); // 2min前(修正版) | |
| if (n.isBefore(expirationTime1)) { | |
| print("not expired1"); | |
| } else { | |
| print("expired1"); |
| var callback; | |
| var p = new Promise(resolve => callback = resolve); | |
| var p2; | |
| var microtask = () => { | |
| console.log("microtask"); | |
| p2.then(microtask); | |
| }; | |
| p2 = p.then(microtask); | |
| console.log("sync"); |
| // core側 | |
| export class HogeManager { | |
| @hookPoint("someUsefulFunc") | |
| someUsefulFunc() { | |
| // core側の処理 | |
| } | |
| } |
| <html> | |
| <body> | |
| <script> | |
| if (window.opener) { | |
| window.addEventListener("message", function(ev) { | |
| var dataStr = ev.data; // get data from parent | |
| // calc and get data | |
| var result = somethingYouWantToDo(parseDataString(dataStr)).stringify(); | |
| window.opener.postMessage(result, "*"); | |
| }); |
| var rx = require("rx"); | |
| var s = new rx.Subject(); | |
| var stream = s.tap(function(){console.log("side effect");}); | |
| stream.subscribeOnNext(function(){}); | |
| stream.subscribeOnNext(function(){}); | |
| s.onNext("foo"); | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading; | |
| namespace UniRxEx | |
| { | |
| public static partial class Observable | |
| { |