Skip to content

Instantly share code, notes, and snippets.

Scala 2.12リリースノート適当まとめ

コンパイラの改善

  • 関数オブジェクト・TraitをJava8ネイティブ機能で実装
  • オプティマイザを見直しして、凄く賢くなった
  • 今まで9.9MBあったScalaTest3.0.0のバイナリはScala2.12で6.7MBに減った

構文・ライブラリ

function easeInOutQuad(pos) {
if ((pos /= 0.5) < 1) return 0.5 * Math.pow(pos, 2);
return -0.5 * ((pos -= 2) * pos - 2);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop;
var diff = to - start;
var currentTime = 0;
var increment = 16;
@kamijin-fanta
kamijin-fanta / descriptor
Last active October 10, 2016 09:24
logicool unifying mouse descriptor
Interface 1 HID Report Descriptor Mouse
Item Tag (Value) Raw Data
Usage Page (Generic Desktop) 05 01
Usage (Mouse) 09 02
Collection (Application) A1 01
Report ID (2) 85 02
Usage (Pointer) 09 01
Collection (Physical) A1 00
Report Count (16) 95 10
Report Size (1) 75 01
@kamijin-fanta
kamijin-fanta / itc_slack_emojimoji.json
Last active March 9, 2016 08:13
部活のSlackで文字として使える絵文字
{
"a": [
":adobe:",
":access:"
],
"b": [
":bluetooth:"
],
"c": [
":oic_no_c:",
@kamijin-fanta
kamijin-fanta / README.md
Last active December 29, 2015 10:14
Unix Bench
Name Cloud VPS
Dhrystone 2 using register variables 30,433,071.8 lps 32,111,159.8 lps
Double-Precision Whetstone 3,711.4 MWIPS 4,241.6 MWIPS
Execl Throughput 2,227.2 lps 2,967.6 lps
File Copy 1024 bufsize 2000 maxblocks 319,882.3 KBps 932,885.8 KBps
File Copy 256 bufsize 500 maxblocks 84,508.4 KBps 259,237.2 KBps
File Copy 4096 bufsize 8000 maxblocks 960,184.8 KBps 1838,138.3 KBps
Pipe Throughput 635,363.0 lps 2130,659.2 lps
Pipe-based Context Switching 151,940.0 lps 241,700.9 lps
var table = "abcdefghijklmnopqrstuvwxyz0123456789".split("");
var rnd = _ => table[Math.random()*table.length|0];
var randomStr = (len) => { var r = rnd().slice(-1); if(len > 0){return r+randomStr(len-1)} else {return ""} };
@kamijin-fanta
kamijin-fanta / README.md
Last active December 2, 2015 04:38
C#でスクレイピングつらい

C#でスクレイピングつらい

OIC ITCreate Club Advent Calendar 2015 1日目ってことにしておいてください。

HTTPクライアント周りあまり触ったことなかったから触ってみたけどつらい。 これだけ書くのにハマったりしながら3時間位かかった…

試しにPixivのブックマークの1ページ目のイラストを保存するものを書いてみた

@kamijin-fanta
kamijin-fanta / setup.md
Last active September 8, 2015 04:26
Scalaハンズオン事前準備

事前準備

インストール

大体パッケージマネージャでインストール可能です。

プラットフォーム パッケージマネージャ
Windows choco
Mac brew
@kamijin-fanta
kamijin-fanta / plus.scala
Last active August 29, 2015 14:22
flatMap Type miss match (Intelij IDEA 14+Scala Plugin 1.5.1)
def plus(num1: Int)(num2: Int): Option[Int] = {
Some(num1 + num2)
}
Seq(1,2,3,4)
.flatMap(plus(1))
// Intellij Worn: Type missmatch, expected: (Int) => GenTraversableOnce[NotInferedB], autual: (Int) => Option[Int]
// Scala Compile: Success
Seq(1,2,3,4)
.map(plus(1))
@kamijin-fanta
kamijin-fanta / nullUndefined.js
Created February 27, 2015 06:30
null undefined占い
Array.apply(null, Array(100)).map(function(){return [null,undefined][Math.random()*2|0];});