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 funsets | |
import common._ | |
/** | |
* 2. Purely Functional Sets. | |
*/ | |
object FunSets { | |
/** | |
* We represent a set by its characteristic function, i.e. |
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
#!/usr/bin/env ruby | |
def replace(index, list) | |
if (index == 0) | |
return list | |
end | |
if (list[index-1] < list[index]) | |
return list | |
end | |
x = list[index-1] |
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
#!/usr/bin/env ruby | |
def devide(list) | |
if (list.length == 1) ; return [list]; end | |
index = (list.length - 1)/2 | |
return [list[0..index], list[index+1..list.length-1]] | |
end | |
def merge(acc, xs, ys) | |
# p "acc=#{acc}" |
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
#!/usr/bin/env python | |
import SimpleHTTPServer | |
import BaseHTTPServer | |
import sys | |
""" A Wrapper impl of SimpleHTTPServer - with CORS and header settable. | |
Usage: | |
python ${dir}/cors-server.py ${port} ${headers in key:value format} |
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
### How to make UTME OCamlChottoDekiru T-shirt | |
#### SmartPhone | |
1. [Github Repository: camlspotter/watashiocaml](https://github.com/camlspotter/watashiocaml/blob/master/watashiocaml.png)から画像をダウンロード(画像を長押しして、`画像を保存`を選択) | |
1. 写真アルバムに画像が保存されていることを確認 | |
1. App Store / Android PlayからUTMEアプリをインストール、起動 |
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 com.company; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Stream; | |
public class Main { | |
public static void main(String[] args) { | |
// write your code here |
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
import java.util.concurrent.atomic.AtomicLong | |
object Main extends App with LabHelper { | |
private[this] val random = new scala.util.Random() | |
private[this] val nameList: Seq[String] = Seq("bob", "bab", "bib") | |
val resultList = scala.collection.mutable.ArrayBuffer.empty[Long] | |
for (i <- 1 to 5) { | |
// average 2111 |
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
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
/** |
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
import java.io.IOException; | |
import java.net.InetSocketAddress; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.SelectionKey; | |
import java.nio.channels.Selector; | |
import java.nio.channels.ServerSocketChannel; | |
import java.nio.channels.SocketChannel; | |
import java.nio.charset.Charset; | |
import java.util.Iterator; |
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
import scalaz._ | |
import Scalaz._ | |
import scalaz.OptionT._ | |
import com.twitter.util.Future | |
/** | |
* Simple example of Future chain, which only shows type level consistency. | |
* Future chain can be implemented with optionT or simple flatMap chain. | |
*/ | |
object Main extends App { |