Skip to content

Instantly share code, notes, and snippets.

@ueshin
ueshin / scalamatsuri2014.md
Created September 6, 2014 02:42
SparkSQL samples for ScalaMatsuri2014
@methane
methane / chat.go
Last active August 29, 2015 14:05
シンプルなチャット https://github.com/methane/go-chat-sample に移動
package main
import (
"bufio"
"bytes"
"errors"
"fmt"
"log"
"net"
"os"
@minazou67
minazou67 / java-se-0-note.md
Last active December 3, 2015 02:14
Notes the Java SE
@ueshin
ueshin / 20140715_prestoscr4.md
Created July 15, 2014 06:53
20140715 Presto Source Code Reading #4
@gakuzzzz
gakuzzzz / gist:8d497609012863b3ea50
Last active January 12, 2021 12:50
Scalaz勉強会 主要な型クラスの紹介
@polidog
polidog / gulpfile.coffee
Created July 12, 2014 18:01
gulpでcoffee,jade,stylusを変換するやつ
# 人生初gulpfile
gulp = require "gulp"
coffee = require "gulp-coffee"
jade = require "gulp-jade"
stylus = require "gulp-stylus"
del = require "del"
paths =
coffee: 'src/coffee/*.coffee'
@tsuda7
tsuda7 / gist:a5c058aab86c909ae005
Last active September 18, 2015 11:21
Hadoop 徹底入門(第2版) 輪読会メモ
  • お膳立て
    • 環境は Vagrant から起動する CentOS
    • JDK7
    • Hadoop ディストリビューションは CDH

Chapter 1 "Hadoop の基礎知識"

Hadoop とは

一言で言うと…

@bennylope
bennylope / ansible.yml
Created April 30, 2014 00:35
Deployment w/ Capistrano style deployments with Ansible & Capistrano
---
- name: Deploy new site release
user: deployer
hosts: all
tasks:
- name: Fetch repo updates
git: >
[email protected]:my/repo.git
@mattn
mattn / err.go
Last active August 29, 2015 13:59
package main
import (
"log"
"os"
"syscall"
)
func main() {
f, err := os.Open("not-found-file.txt")
@gakuzzzz
gakuzzzz / 1_.md
Last active June 19, 2023 12:53
trait と abstract class の使い分け

trait と abstract class の使い分け

  • 基本は迷ったら trait にしておけば良いと思います
    • trait は一つの class に複数 mixin できますが、class は一つしか継承できません
    • つまり、trait であれば mixin される class を気にしなくてよいですが、 abstract class にした場合は、extends される class が他に継承したい物が無いか気にする必要があります
  • trait はコンストラクタを持つ事ができませんが、abstract class はコンストラクタを持つ事ができます
    • 従って、型引数に制約をつけたい時や、共通のフィールドの初期化などがある場合は、abstract class にすると楽な場合があります。
  • 以下に具体例を示します。良くある Java の enum を Scala で定義する場合の例です。