- 有休…
- 病休…
- 育休…
- 年収(月給、賞与など)…
- 残業代…
- 早朝/深夜手当…
- 休出手当…
- 住宅補助…
This file contains hidden or 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
(* | |
* Tested in Poly/ML. To compile: `polyc thread.ml && ./a.out` | |
* | |
* Heavily influenced by: http://pages.cs.wisc.edu/~remzi/OSTEP/threads-cv.pdf | |
* Poly/ML Thread documentation here: http://www.polyml.org/documentation/Reference/Threads.html | |
* Poly/ML Thread implementation here: https://github.com/polyml/polyml/blob/master/basis/Thread.sml | |
*) | |
val done = ref false; | |
val m = Thread.Mutex.mutex(); |
This file contains hidden or 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
#!/bin/sh | |
# Apply a Dockerfile to local environment. | |
# usage: sudo ./dock2local.sh [PATH_TO_Dockerfile] | |
DOCKERFILE=${1:-Dockerfile} | |
DOCKERFILE=`dirname $DOCKERFILE`/`basename $DOCKERFILE` | |
LOCALDIR=$(cd `dirname $DOCKERFILE` && pwd) | |
D_WORKDIR=`pwd` | |
D_USER=`whoami` |
This file contains hidden or 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
select timestamp(regexp_replace(string(ts), r'^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}).*', '\\1')) as date_trunc_second, | |
timestamp(regexp_replace(string(ts), r'^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:).*', '\\100')) as date_trunc_minute, | |
timestamp(regexp_replace(string(ts), r'^(\d{4}-\d{2}-\d{2} \d{2}:).*', '\\100:00')) as date_trunc_hour, | |
timestamp(regexp_replace(string(ts), r'^(\d{4}-\d{2}-\d{2}).*', '\\1 00:00:00')) as date_trunc_day, | |
timestamp(regexp_replace(string(ts), r'^(\d{4}-\d{2}).*', '\\1-01 00:00')) as date_trunc_month, | |
timestamp(regexp_replace(string(ts), r'^(\d{4}).*', '\\1-01-01 00:00')) as date_trunc_year, | |
timestamp(regexp_replace(string(ts), r'^(\d{3}).*', '\\10-01-01 00:00')) as date_trunc_decade, | |
timestamp(regexp_replace(string(ts), r'^(\d{2}).*', '\\100-01-01 00:00')) as date_trunc_century, | |
timestamp(regexp_replace(string(ts), r'^(\d{1}).*', '\\1000-01-01 00:00')) as date_trunc_millennium | |
from (select cast('2014-08-19 12:41:35.220000' as t |
This file contains hidden or 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
# Multiple inheritance with Modules as an alternative to injected composition | |
# from Sandi Metz's talk [Nothing is Something](http://confreaks.tv/videos/bathruby2015-nothing-is-something) | |
# Like Sandi's 'direct' DI method this has behavior outside of the base class | |
# that gets composed together. However in this gist I compose modules in class | |
# definitions instead of injecting collaborators. | |
# Tradeoffs between this and Sandi's version are that in this case the API consumer doesn't | |
# have to know how to make a RandomEchoHouse (no `house = House.new(formatter: Whatever.new)`), | |
# but also the API consumer can't make anything not already accounted for either. |
This file contains hidden or 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
// create an IAM Lambda role with access to dynamodb | |
// Launch Lambda in the same region as your dynamodb region | |
// (here: us-east-1) | |
// dynamodb table with hash key = user and range key = datetime | |
console.log('Loading event'); | |
var AWS = require('aws-sdk'); | |
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); | |
exports.handler = function(event, context) { |
This file contains hidden or 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
package example.statemachine | |
import scalaz.{State, Scalaz}, Scalaz._ | |
object FSM { | |
def apply[I, S](f: PartialFunction[(I, S), S]): FSM[I, S] = | |
new FSM((i, s) => f.applyOrElse((i, s), (_: (I, S)) => s)) | |
private def states[S, O](xs: List[State[S, O]]): State[S, List[O]] = | |
xs.sequence[({type λ[α]=State[S, α]})#λ, O] |
This file contains hidden or 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
stop: 現在処理中のメッセージを完了させる。それ以外のMailboxに溜まっているメッセージは処理しない | |
PoisonPill: メッセージの追加なので、投げた時点でたまっているメッセージが処理される (キュー消化+stop) | |
kill: ActorKilledExceptionが速攻出る(処理中の動作を破棄?)。その後はsupervisorのstrategyに依存(default:stop)。Mailboxはそのまま残る(restartしたactorが継続) | |
http://stackoverflow.com/questions/13847963/akka-kill-vs-stop-vs-poison-pill |
This file contains hidden or 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
package controllers.util | |
import play.api.mvc.{Result, Controller} | |
import play.api.data.Form | |
import scala.util.Either.RightProjection | |
object Implicits { | |
implicit def formToEither[A](form: Form[A]): Either[Form[A], A] = form.fold(Left.apply, Right.apply) |
This file contains hidden or 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
This is my short-ish tutorial on how to implement closures in | |
a simple functional language: Foo. | |
First, some boilerplate. | |
> {-# LANGUAGE DeriveFunctor, TypeFamilies #-} | |
> import Control.Applicative | |
> import Control.Monad.Gen | |
> import Control.Monad.Writer | |
> import Data.Functor.Foldable |