This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(set-language-environment "UTF-8") | |
;; -------------------------------------------------------------------------------------- | |
;; package management | |
;; -------------------------------------------------------------------------------------- | |
(require 'package) | |
;; (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) | |
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t) | |
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.time.ZoneOffset; | |
import java.time.ZonedDateTime; | |
import java.time.format.DateTimeFormatter; | |
import java.util.Objects; | |
import java.util.Optional; | |
import emums.Method; | |
import exception.BadRequestException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Food | |
trait Vegetable extends Food // 野菜 | |
trait Onion extends Vegetable // 玉ねぎ | |
class TrashBin[-A]{ // 反変 | |
def popTrash[B <: A]: B = ??? // 戻り値には上限境界 | |
} | |
class UserHatesOnion { | |
def disposeOnionTo(b: TrashBin[Onion]) = ??? // 玉ねぎ専用のゴミ箱に玉ねぎを捨てるメソッド |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) throws IOException { | |
String cp51932hexString = | |
// NEC特殊文字 | |
"ADA1" + // ① | |
"ADB5" + // Ⅰ | |
"ADC0" + // ㍉ | |
"ADE2" + // № | |
"ADEA" + // ㈱ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(.toUpperCase "hoge") ; "hoge.toUpperCase(); | |
(.indexOf "hoge" "ge") ; "hoge".indexOf("ge"); | |
(new String "Hello") ; new String("Hello"); | |
(String. "Hello") ; new String("Hello"); | |
(InetAddress/getByName "localhost") ; InetAddress.getByName("localhost") | |
(.getHostName host) ; host.getHostName(); | |
; StringBuffer sb = new StringBuffer("Hello "); | |
; sb.append("world"); | |
; sb.append("!!!!!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"👨👩👧👧".replace("👩","👨"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Validation[E, A] represents either: | |
// - Success[A] | |
// - Failure[E] | |
// | |
// Isomporphic to scala.Either[E, A] and scalaz.\/[E, A] | |
// | |
// Unlike \/[E, A], Validation is not a Monad, but an Applicative | |
// Functor. So if you want to use it as a Monad you can convert back | |
// and forth using the `validation` and `disjunction` method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Disjunction - aka Scalaz Either | |
// \/[A, B] is an alternative to Either[A, B] | |
// -\/ is Left (usually represents failure by convention) | |
// \/- is Right (usually represents success by convention) | |
// Left or Right - which side of the Disjunction does the "-" appear? | |
// | |
// Prefer infix notation to express Disjunction Type v: String \/ Double | |
// | |
// References |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
import com.github.tototoshi.csv.CSVWriter | |
object Mojibake extends App { | |
val f = new File("./mojibake-patterns.csv") | |
val writer = CSVWriter.open(f) | |
val targetString = "入れ替わってる〜!?" | |
val encodings = List("UTF-8", "EUC_JP", "Shift-JIS", "ISO-2022-JP") |