Skip to content

Instantly share code, notes, and snippets.

@SAMMY7th
SAMMY7th / Practice7.java
Created March 6, 2015 10:21
TechInstitute大阪 2015/03/01 メソッド演習
/**
* このPractice7もクラスです
* このクラスはまだみなさんにえていないstaticという
* キーワードによりインスタンスをらなくてもメソッドをせています
* 今えないようにしてくださいstaticを勉強してから
* 改めてこのクラスをめてみてね
*
* この演習ではメソッドにのみ着目してください
* {} でくくられている範囲意識するように
*
@SAMMY7th
SAMMY7th / Makefile
Last active December 10, 2015 10:43
2015/09/26 いまどきのフロントエンド環境構築(関西フロントエンドUG) 発表用サンプル
PATH := node_modules/.bin:$(PATH)
all: build
.PHONY: all init build styles js html image clean
init:
npm init
npm install -D node-sass postcss-cli autoprefixer clean-css uglify-js
mkdir -p app/styles app/scripts app/images
@SAMMY7th
SAMMY7th / jjug_ccc_2017.md
Last active May 27, 2017 07:38
JavaエンジニアのためのScala入門 #jjug_ccc #ccc_l2
@SAMMY7th
SAMMY7th / javajo_scala_20170513.md
Created June 17, 2017 13:26
【東京】【女性/女性同伴男性限定】Java x Scala 交流会 - Java女子部 (https://javajo.doorkeeper.jp/events/59755) での登壇資料です。

副作用と参照透過性

自己紹介

  • Abe Asami “きの子 ”
  • フリーランスプログラマ
  • http://nocono.net/
  • @aa7th
  • Scala、Andorid(Java/Kotlin)

ScalaのOptionとmap

val name: Option[String] = Some("きの子")
val greet = name.map(n => s"${n}さんこんにちは")  // greet: Option[String] = Some(きの子さんこんにちは)
greet.getOrElse("なまえがないよ")  // Optionから値をとりだした。 res1: String = きの子さんこんにちは

KotlinのNullableとlet

import scala.annotation.tailrec
import scala.collection.immutable.TreeMap
val lines = List(
"- 2018年02月08日 木曜日 20:51",
"今日は仕事をしました",
"お昼にパスタをつくりました",
"- 2018年02月09日 金曜日 20:51",
"お出かけしました"
)

フリーランスエンジニアやっていてよく聞かれる質問に答えていくよ

自己紹介

[info] hello-scalikejdbc:hello-scalikejdbc_2.11:0.1 [S]
[info] +-com.github.tototoshi:play-json4s-native_2.11:0.5.0 [S]
[info] | +-com.github.tototoshi:play-json4s-api_2.11:0.5.0 [S]
[info] | | +-org.json4s:json4s-core_2.11:3.3.0 [S]
[info] | | +-com.thoughtworks.paranamer:paranamer:2.8
[info] | | +-org.json4s:json4s-ast_2.11:3.3.0 [S]
[info] | | +-org.json4s:json4s-scalap_2.11:3.3.0 [S]
[info] | | +-org.scala-lang.modules:scala-xml_2.11:1.0.5 [S]
[info] | |
[info] | +-com.github.tototoshi:play-json4s-core_2.11:0.5.0 [S]
play.api.UnexpectedException: Unexpected exception[CreationException: Unable to create injector, see the following errors:
1) Error injecting constructor, java.lang.NoSuchMethodError: scalikejdbc.NamedDB$.apply$default$2()Lscalikejdbc/SettingsProvider;
at scalikejdbc.PlayFixture.<init>(PlayFixtureModule.scala:38)
at scalikejdbc.PlayFixtureModule.bindings(PlayFixtureModule.scala:29):
Binding(class scalikejdbc.PlayFixture to self eagerly) (via modules: com.google.inject.util.Modules$OverrideModule -> play.api.inject.guice.GuiceableModuleConversions$$anon$1)
while locating scalikejdbc.PlayFixture
1 error]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:170)
@SAMMY7th
SAMMY7th / sbt_error.log
Created June 8, 2018 09:50
sbtを2重起動しようとした際に発生するエラー
% sbt (git)-[develop]
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
/usr/local/Cellar/sbt/1.1.6/libexec/bin/sbt-launch-lib.bash: 58 行: 1934 Abort trap: 6 "$@"