Skip to content

Instantly share code, notes, and snippets.

View ihji's full-sized avatar

Heejong Lee ihji

View GitHub Profile
@ihji
ihji / gist:c4962d98cb1662f541f2ab23cba00a43
Created May 10, 2022 18:34
Example Expansion Response - Beam College 2022
components {
transforms {
key: "External_0_AppliedPTransform_external0-ReadFromText-Read-Impulse_5"
value {
spec {
urn: "beam:transform:impulse:v1"
}
outputs {
key: "None"
value: "External_0_PCollection_PCollection_1"
java.lang.RuntimeException: The Runner experienced the following error during execution:
Traceback (most recent call last):
File "/Users/heejong/Work/beam/build/gradleenv/1922375555/lib/python3.8/site-packages/apache_beam/runners/portability/local_job_service.py", line 269, in _run_job
result = fn_runner.FnApiRunner(
File "/Users/heejong/Work/beam/build/gradleenv/1922375555/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 193, in run_via_runner_api
return self.run_stages(stage_context, stages)
File "/Users/heejong/Work/beam/build/gradleenv/1922375555/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 358, in run_stages
stage_results = self._run_stage(
File "/Users/heejong/Work/beam/build/gradleenv/1922375555/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 549, in _run_stage
last_result, deferred_inputs, fired_timers = self._run_bundle(
@ihji
ihji / upload_ivy_cache_to_nexus.py
Last active April 22, 2016 03:20
upload local ivy cache to nexus hosted remote maven repo
#!/usr/bin/python3
import sys,os,subprocess
from os.path import join,isfile
from urllib.parse import urljoin
import xml.etree.ElementTree as ET
REPO_URL = "http://myrepo/nexus/content/repositories/ivy-releases/"
CREDENTIAL = "admin:passwd"
object ScalaJSExample extends js.JSApp{
def main(): Unit = {
println("좋은 하루 되세요&#x002E".split(" ").map{_.replace("&#x","").split(";").map{x=>Integer.parseInt(x,16).toChar}.mkString}.mkString(" "))
println("좋은 하루 되세요&#x002E".split(" ").map{_.split(";").map{x=>BigInt(x.drop(3),16).toChar}.mkString}.mkString(" "))
}
}
@ihji
ihji / gist:60cc4ccf6cc075b895ca
Last active August 29, 2015 14:01
brew configuration log for ghc dynamic linking error
$ brew doctor
Warning: No developer tools installed.
Install the Command Line Tools:
xcode-select --install
Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!
Warning: Some installed formula are missing dependencies.
@ihji
ihji / PascalTriangle.scala
Created June 17, 2013 11:15
Simple Pascal's triangle in Scala
object PascalTriangle extends App {
def triangle(n: Int) {
def nextList(l: List[Int]) : List[Int] =
if(l.length > 1) 1 +: l.sliding(2).toList.map{_.reduce{_+_}} :+ 1
else List(1,1)
val (result,_) = (n-1 to 0 by -1).foldLeft("",List(1)) {
case ((str,lst),space) => (str + " "*space + lst.mkString(" ") + "\n",nextList(lst))
}
print(result)
}
@ihji
ihji / gist:5503604
Last active December 16, 2015 21:59
Elapsed time of foreach and while for 30k iterations in micro seconds - HEAD means the latest (as of now) 2.11.0 target master branch. - lazy means the patched version of Range using lazy val. - 2.10.1 means vanilla 2.10.1 distribution.
(HEAD) 1f2772a2375a02937d71b33ac5a6a9cc6eb2fdb5
[info] Running pack org.example.Runner
[info] 0% Scenario{vm=java, trial=0, benchmark=ForeachUnit, length=30000} 19818.83 ns; σ=129.82 ns @ 3 trials
[info] 5% Scenario{vm=java, trial=0, benchmark=WhileUnit, length=30000} 11169.80 ns; σ=128.51 ns @ 10 trials
[info] 10% Scenario{vm=java, trial=0, benchmark=ForeachInt, length=30000} 96353.24 ns; σ=215.26 ns @ 3 trials
[info] 14% Scenario{vm=java, trial=0, benchmark=WhileInt, length=30000} 11102.04 ns; σ=126.23 ns @ 10 trials
[info] 19% Scenario{vm=java, trial=0, benchmark=ForeachDec, length=30000} 20043.78 ns; σ=195.64 ns @ 6 trials
[info] 24% Scenario{vm=java, trial=0, benchmark=ForeachReverse, length=30000} 20240.87 ns; σ=193.39 ns @ 3 trials
[info] 29% Scenario{vm=java, trial=0, benchmark=WhileDec, length=30000} 10437.41 ns; σ=133.51 ns @ 10 trials
[info] 33% Scenario{vm=java, trial=0, benchmark=ForeachOpen, length=30000} 20169.16 ns; σ=330.66 ns @ 10 trials