Skip to content

Instantly share code, notes, and snippets.

takezoe /
Created February 25, 2024 17:05
Trino UDF for generating row-level checksum
package io.trino.operator.scalar;
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;
takezoe /
Last active April 29, 2023 05:50
Run JupyterLab on Docker

Run JupyterLab on docker

$ 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:
takezoe /
Last active March 12, 2022 00:35
Keyboard shortcuts in VSCode + Metals

VS Code shortcut in VSCode + Metals

Shorcut Description
CTRL + SPACE Code Completion
COMMAND + P Find File
COMMAND + SHIFT + P Command Pallete
COMMAND + T Find Symbol in Workspace
SHIFT + COMMAND + O Find Symbol in Editor
F12 Go to Definition
takezoe / trino_test.rb
Created May 7, 2021 16:38
Test program for trino-client-ruby using tiny-presto which is library to launch Trino/Presto using docker
require 'trino-client'
require 'tiny-presto'
client = 'localhost:8080', catalog: 'memory', user: 'test-user', schema: 'default')
cluster ='trinodb/trino', '355')
container =
loop do
# Make sure to all workers are available.'show schemas')
takezoe / build.yml
Last active January 23, 2021 16:16
GitHub Actions configuration for GitBucket plugins
name: build
on: [push, pull_request]
runs-on: ubuntu-latest
java: [8, 11]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
trait CyclicA {
val b = bind[CyclicB]
trait CyclicB {
val a = bind[CyclicA]
val d = Design.newDesign[CyclicA] { a =>

Hello Apache PredictionIO!

Start event server:

$ pio eventserver &
diff --git a/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala b/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala
index 97e00e46..f5525ca2 100644
--- a/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala
+++ b/swagger/src/main/scala/org/scalatra/swagger/Swagger.scala
@@ -45,16 +45,6 @@ trait SwaggerEngine[T <: SwaggerApi[_]] {
object Swagger {
- val excludes: Set[java.lang.reflect.Type] = Set(
- classOf[java.util.TimeZone],

Test data:

{"maker":"Apple", "products":[{"name": "iPhobe", "price": 100000}, {"name": "iPad", "price": 120000}]}
{"maker":"ASUS", "products":[{"name": "Zenfone", "price": 20000}]}


scala> val df ="maker"),explode(ds("products")).as("p"))
scala&gt;"maker", "", "p.price").show