Skip to content

Instantly share code, notes, and snippets.

@hiroyuki-sato
hiroyuki-sato / gradle.txt
Created September 19, 2023 06:23
gradlew gemPush with JRuby 9.4.3.0
./gradlew gemPush
> Task :gemPush
Executing: `java org.jruby.Main -rjars/setup -S gem push /path/to/embulk-filter-calc/build/gems/embulk-filter-calc-0.2.1.pretest-java.gem --verbose`
with working directory at: /path/to/embulk-filter-calc/build/gems
with classpath: [ /Users/user/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/9.4.3.0/7324205fb4ad1b40d6aee488db6e72918f397ad4/jruby-complete-9.4.3.0.jar ]
Pushing gem to https://rubygems.org...
POST https://rubygems.org/api/v1/gems
ERROR: While executing gem ... (IOError)
Broken pipe
@hiroyuki-sato
hiroyuki-sato / embulk_setup.md
Last active June 28, 2023 04:57
Embulk v0.11 setup

Install Embulk itself

curl --create-dirs -o ~/.embulk/bin/embulk -L "https://dl.embulk.org/embulk-latest.jar"
chmod +x ~/.embulk/bin/embulk
echo 'export PATH="$HOME/.embulk/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Install JRuby

@hiroyuki-sato
hiroyuki-sato / file_system_book.md
Last active June 16, 2023 11:26
linuxのディスクI/O周りやxfsのソースコードを読めるようになるためのおすすめの参考資料募集中です
# frozen_string_literal: true

require_relative "lib/hoge/version"

Gem::Specification.new do |spec|
  spec.name = "hoge"
  spec.version = Hoge::VERSION
  spec.authors = ["Hiroyuki Sato"]
  spec.email = ["e-mail"]
@hiroyuki-sato
hiroyuki-sato / opencv-glib.md
Created March 21, 2022 14:18
OpenCV glib懸案 3/21
  • OpenCV Image Filtering は様々なフィルタリングが提供されています。関数の中には、デフォルト値が設定されているものがあります。

以下は、デフォルトオプションが指定されている関数の例です。

cv::blur (InputArray src, OutputArray dst, Size ksize, Point anchor=Point(-1,-1), int borderType=BORDER_DEFAULT)
cv::filter2D (InputArray src, OutputArray dst, int ddepth, InputArray kernel, Point anchor=Point(-1,-1), double delta=0, int borderType=BORDER_DEFAULT)
cv::Laplacian (InputArray src, OutputArray dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType=BORDER_DEFAULT)
cv::Sobel (InputArray src, OutputArray dst, int ddepth, int dx, int dy, int ksize=3, double scale=1, double delta=0, int borderType=BORDER_DEFAULT)
@hiroyuki-sato
hiroyuki-sato / ayame_signaling.rb
Last active February 5, 2022 13:36
あやめのログを整形する
#!/usr/bin/env ruby
require 'json'
=begin
KEYS = %[
clientID
connectionId
message
messageroomId
N,NAME
1,林檎
2,蜜柑
3,白桃
4,南瓜
  • 仕組み上タスク毎に作業ディレクトリを作ってpy>, sh>, rb>などのスクリプトオペレータ以外は変えられない。
  • タスク毎にカレンとディレクトリは変わるが、カレントディレクトリにはdigdag pushしたコンテンツがあるディレクトリになっている。
  • digdag pushは .で始まるファイルはpushしない

ということを踏まえて

  • digdag pushするプロジェクト直下に、pipenv というディレクトリを作り pipenvの設定を置く
  • py>オペレータ実行時に、上記ディレクトリを参照するようにする

イメージ

rbenv install jruby-9.3.0.0
Downloading jruby-bin-9.3.0.0.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/2dc1f85936d3ff3adc20d90e5f4894499c585a7ea5fedec67154e2f9ecb1bc9b
Installing jruby-9.3.0.0...
tr: Illegal byte sequence
BUILD FAILED (macOS 11.6 using ruby-build 20210928)
Inspect or clean up the working tree at /var/folders/3s/5cm202m95zsglpy26c6_7j9m0000gn/T/ruby-build.20210930202800.79151.JkfMTR
Results logged to /var/folders/3s/5cm202m95zsglpy26c6_7j9m0000gn/T/ruby-build.20210930202800.79151.log
org.embulk.output.s3.TestS3FileOutputPlugin > testEmbulk STANDARD_ERROR
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Hidden dependencies are uninitialized. Maybe using classes loaded by Embulk's top-level ClassLoader.
testCompile "junit:junit:4.13.2"
testCompile "org.embulk:embulk-core:0.10.32"