コレクションのcollect
メソッドについて考えてみる。
case class User(id: Int, name: String, isAdmin: Boolean)
val users: List[User] = List(
package io.trino.operator.scalar; | |
import com.google.common.collect.ImmutableList; | |
import io.airlift.slice.Slice; | |
import io.airlift.slice.Slices; | |
import io.trino.annotation.UsedByGeneratedCode; | |
import io.trino.metadata.SqlScalarFunction; | |
import io.trino.spi.block.Block; | |
import io.trino.spi.block.SqlRow; | |
import io.trino.spi.function.BoundSignature; |
https://hub.docker.com/r/jupyter/scipy-notebook/
$ docker pull jupyter/scipy-notebook
$ docker run -v `pwd`:/home/jovyan/work -p 10000:8888 --name jupyter jupyter/scipy-notebook
...
To access the server, open this file in a browser:
package com.example.service; | |
import static org.junit.Assert.*; | |
import static org.mockito.Mockito.*; | |
import java.util.Collections; | |
import com.example.repository.CustomerRepository; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; |
require 'trino-client' | |
require 'tiny-presto' | |
client = Trino::Client.new(server: 'localhost:8080', catalog: 'memory', user: 'test-user', schema: 'default') | |
cluster = TinyPresto::Cluster.new('trinodb/trino', '355') | |
container = cluster.run | |
loop do | |
begin | |
# Make sure to all workers are available. | |
client.run('show schemas') |
name: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [8, 11] |
trait CyclicA { | |
val b = bind[CyclicB] | |
} | |
trait CyclicB { | |
val a = bind[CyclicA] | |
} | |
val d = Design.newDesign | |
d.build[CyclicA] { a => |
import scala.util.parsing.json._ | |
val result = JSON.parseFull(""" | |
{"name": "Naoki", "lang": ["Java", "Scala"]} | |
""") | |
result match { | |
case Some(e) => println(e) // => Map(name -> Naoki, lang -> List(Java, Scala)) | |
case None => println("Failed.") | |
} |
package mylisp | |
import scala.util.parsing.combinator.RegexParsers | |
import scala.collection.mutable.{Map => MutableMap} | |
object MyLispParser extends App { | |
val source = """ | |
(defun sayHello (name) (println "Hello " name "!")) | |
(defun sum (a b)(if (eq a b) a (sum (+ a 1) b))) | |
(println (sum 1 1000)) |