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
#!/bin/bash | |
cn="" | |
dn="" | |
ou="" | |
ldap_password="" | |
# 一番大きいuidを取得 | |
last_uidnumber=`ldapsearch -x -D cn=$cn -h localhost -w$ldap_password -b ou=$ou | grep uidNumber |awk '{if(m<$2) m=$2} END{print m}'` |
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
-fp in scalaのexercuseの解をUp |
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
dn: uid=a123456,ou=People,dc=hoge,dc=co,dc=jp | |
objectClass: inetOrgPerson | |
objectClass: posixAccount | |
objectClass: shadowAccount | |
objectClass: ldapPublicKey | |
sn: hoge | |
cn: foo | |
uid: a123456 | |
uidNumber: 10001 | |
gidNumber: 10001 |
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
おはようございます!プログラマーの神様!(T_T) | |
おはよう プログラマー 代表 神様 t t |
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
// Q | |
リスト4ー4のすべての関数をOptionで実装せよ。 | |
各関数を実装するときに、その関数の意味と、それを使用するであろう状況について考えること。 | |
どの関数をいつ使用するかについては、後ほど考察する。 | |
ヒントは以下のとおり。 | |
- パターンマッチングを使用しても構わないが、 | |
mapとgetOrElseを除く関数はすべてパターンマッチングに頼らなくても実装できるはずである。 | |
- map,flatMapの実装は、過多シグネチャの情報に基づいて充分に決定できるはずである。 | |
- getOrElseはOptionがNoneのバアアイは、指定されたデフォルト値を返す。 | |
- orElseは、1つ目のOptionが定義されている場合はそれを返し、そうでない場合は2つ目のOptionを返す。 |
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
// Q | |
n番目のフィボナッチ数を取得する再帰関数を記述せよ。 | |
// answer | |
def fib(n: Int): Int = { | |
@annotation.tailrec | |
def loop(v: (Int,Int), count: Int): Int = { | |
val (x, y) = v | |
if (n > count) loop((y,x+y),count+1) | |
else x |
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 8 columns, instead of 1. in line 6.
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
id,first_name,last_name,email,gender,ip_address,color,company_name | |
1,Kenneth,Wheeler,kwheeler0@domainmarket.com,Male,54.230.82.29,Khaki,Voonyx | |
2,Brenda,Young,byoung1@networkadvertising.org,Female,79.121.226.209,Goldenrod,Feedbug | |
3,Steven,Knight,sknight2@hud.gov,Male,161.79.31.161,Purple,Aimbo | |
4,Timothy,Daniels,tdaniels3@ovh.net,Male,233.15.252.170,Mauv,Oba | |
5,Adam,Wright,awright4@cbc.ca,Male,56.247.113.21,Indigo,Kwilith | |
.... |
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
// Q | |
以下のマッチ式はどのような結果になるか | |
scala> val x = List(1,2,3,4,5) match { | |
| case Cons(x, Cons(2, Cons(4, _))) => x | |
| case Nil => 42 | |
| case Cons(x, Cons(y, Cons(3, Cons(4,_)))) => x + y | |
| case Cons(h,t) => h+List.sum(t) | |
| case _ => 101 | |
| } |
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
## db/_dev.yml.liquid | |
type: mysql | |
host: 127.0.0.1 | |
user: user | |
password: password | |
database: embulk_test | |
## query/_query.yml.liquid | |
query: | | |
select * from {{ target_table }} |
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
●OS | |
[ec2-user@ip-172-20-204-91 ~]$ uname -an | |
Linux ip-172-20-204-91 4.1.7-15.23.amzn1.x86_64 #1 SMP Mon Sep 14 23:20:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux | |
●Embulk | |
Embulk v0.8.11 | |
●MySQL | |
5.6.34 |
OlderNewer