Micro Frontendsについて議論を深めたい欲が高まっているので
2018年7月下旬 (登壇者決まり次第調整)
| package calendar; | |
| public class Calendar { | |
| public static final int[] DAY_NUMS = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; | |
| public static final String[] Days = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; | |
| public static final int BASIS_YEAR = 2014; | |
| public static final int BASIS_JAN_1ST_DAY_INDEX = 3; // Wed | |
| const createEach = (withIndex) => { | |
| return withIndex ? | |
| (arr, iterator) => arr.forEach((elem, index) => iterator(elem, index)) : | |
| (arr, iterator) => arr.forEach((elem) => iterator(elem)); | |
| }; | |
| const createMap = (withIndex) => { | |
| return withIndex ? | |
| (arr, iterator) => arr.map((elem, index) => iterator(elem, index)) : | |
| (arr, iterator) => arr.map((elem) => iterator(elem)); |
| if (isIE9()) { | |
| // https://github.com/mzabriskie/axios/blob/master/lib/core/Axios.js | |
| const keys = ['post', 'patch', 'put']; | |
| const origPostFetcher = fetcher.post.bind(fetcher); | |
| ['post', 'patch', 'put'].forEach((key) => { | |
| fetcher[key] = function(url, data, config) { | |
| if (data && data.toPlainObject) { | |
| data = data.toPlainObject(); | |
| } | |
| if (key !== 'post') { |
| # 2〜99のカードの中から2枚取り、その2つの数の和だけをAさんに、積だけをBさんに教えた時の会話が | |
| # A「Bさん、わかりませんね」 | |
| # B「お、ならわかった」 | |
| # A「なら僕もわかった」 | |
| # となった場合、2つの数字はそれぞれ何でしょう。なお、AさんとBさんはそれぞれ完璧に合理的に発言しています。 | |
| # (Aさんが一言目をしゃべっているとき、すでに「Bさんがまだわかっていないこと」を察してる前提) | |
| class Candidate | |
| def initialize(low, high) | |
| @low = low |
| Faraday::NestedParamsEncoder.encode({"a"=>[{"b"=>"1", "c"=>"2"}, {"b"=>"3", "c"=>"4"}]}) | |
| # => "a%5B%5D%5Bb%5D=1&a%5B%5D%5Bc%5D=2&a%5B%5D%5Bb%5D=3&a%5B%5D%5Bc%5D=4" | |
| URI.decode('a%5B%5D%5Bb%5D=1&a%5B%5D%5Bc%5D=2&a%5B%5D%5Bb%5D=3&a%5B%5D%5Bc%5D=4') | |
| # => "a[][b]=1&a[][c]=2&a[][b]=3&a[][c]=4" | |
| Faraday::NestedParamsEncoder.encode({"a"=>[{"b"=>"1", "c"=>"2"}, {"d"=>"3", "e"=>"4"}]}) | |
| # => "a%5B%5D%5Bb%5D=1&a%5B%5D%5Bc%5D=2&a%5B%5D%5Bd%5D=3&a%5B%5D%5Be%5D=4" | |
| URI.decode("a%5B%5D%5Bb%5D=1&a%5B%5D%5Bc%5D=2&a%5B%5D%5Bd%5D=3&a%5B%5D%5Be%5D=4") | |
| # => "a[][b]=1&a[][c]=2&a[][d]=3&a[][e]=4" | |
| Faraday::NestedParamsEncoder.decode("a%5B%5D%5Bb%5D=1&a%5B%5D%5Bc%5D=2&a%5B%5D%5Bd%5D=3&a%5B%5D%5Be%5D=4") |
| # 22 引数に配列をとって、重複している値を昇順の配列にして返す関数を作れ。 | |
| # 例)引数 [1, 3, 2, 3, 8, 3, 2] => 返り値 [2, 3] | |
| def q22(array) | |
| dup = {} # key: number, value: duplicate count (2以上のときは2) | |
| ans = [] | |
| array.each do |num| | |
| case dup[num] | |
| when nil | |
| dup[num] = 1 |
ダンボー田中vs軍曹関の設計トークバトル! ひゃたもあるよ
| import React from 'react'; | |
| import './App.css'; | |
| import { Client } from 'boardgame.io/react'; | |
| import { Game, IPlayer, IGameCtx } from 'boardgame.io/core'; | |
| import { AI, IAIMoveObj } from 'boardgame.io/ai'; | |
| type GameState = { | |
| cells: Array<IPlayer | null> | |
| }; |
| import assert from 'assert'; | |
| type State = [number, number, number, number]; | |
| function stateToHashNum(state: State): number { | |
| const [x1, x2, y1, y2] = state; | |
| return (x1 << 9) | (x2 << 6) | (y1 << 3) | y2; | |
| } | |
| function hashNumToState(num: number): State { |