Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@vlsi
vlsi / comma_sequence_per_line.csv
Created September 9, 2014 06:27
Sample data for crash in data.table/fread
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,",,",,",,",,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,",,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 24 columns, instead of 1 in line 4.
GPMLHTLN,TWBBEUVGM,KZ.GPGLB,CC.NVZUPRFF,NR.LEI,VA.TEXK.SCS,AN.GJTH.CRQ,UCEXFMDT,YVYB,HKSGOOSB.TF,LPBE.KE,BKJKNT,HL.DGTVRM,UZPA.XRTY.P,IYFV.ARGD.O,DHYJ.ZM.Y,GAPV.NP.U,ND.EITRXCL,OL.KYHGHYN,EI.YCOTJA,HC.DZJHDNHZWJW,BLYBZ,ZBJBLOAJAQI,JKCRUUBAVQ
3308386085360,8038-28-08 36:14:73.535 KFH,8558567300135,6221,6,0522,36,XYODIOKKZCCNEGUCKWW FWQO#0,GSZHWCRM/GWBTE DM OLYRRDELES/UUWOUR QZTHE,,,086,WEHPCNATJ,,"XS OW144022775818 (246-8745160-63) 07741 AFHE SKBLW UN 06350, VIFQLKA, TP 66662~SUUQ HNLBKPTNS~YINZRR___WIPQLCNI/TPJLMWRU/VKVFV-ZLZUVWN-KZHMUNU.ZZV",,"YP EQ577415216661 (431-2502616-04) 53276 GPNN BNKCX WZ 75440, PURNWPI, AL 03065~5264037610188512257~TGZFTW___FRAFEAPQ/ENWJMZOG/XKWRE-TALDFRJ-ILFEYNL.JVA",,,,,0,LHCYS AYE ZLEMYA IFU HEI JG FEYE,
7417870277687,0546-33-45 86:27:47.410 VZF,,,,,,DELTVKPYBNZMTWMHSNN VTAQ#6,ICWBMQAJ/ZZKVK KR OFRNAVRJUU/HEJF [PTTN],,,572,,,,,,,,,,6,,
6181761166745,2723-44-04 56:75:27.000 BGY,,,,,,QGDKGXPBAFCKWKMXOAV XVKD#5,QCYYFYJU/JKAKA IH QXOZHEEYDJ/KHPU [OXPJQHJW],,,650,,,,,,,,,,3,,
0874335
@vlsi
vlsi / cms.r
Last active August 29, 2015 14:09
R simulation for "N servers running 1 full gc of duration 's' once every 'l' seconds". Probability of "all servers in GC" is computed
require(data.table)
N=3 #servers
l=86400 # interval
s=90 # gc duration
m=1000000 # samples
# Here we calculate "intersection of N intervals in each m groups independently"
# This is much faster than trying to do 'm' iterations of "intersect N intervals".
num_of_all_in_gc_cases <- function(d) {
@vlsi
vlsi / A source query
Last active August 29, 2015 14:10
Test query
select *
from (select 2+pPartkey pPartkey, 3+pPartkey pPartkey2 from part) p
where
exists (
select 1
from (select psPartkey+1 psPartkey from partsupp) ps
where psPartkey=p.pPartkey2
and exists (
select 2
from (select psPartkey+3 p3, psPartkey+4 p4, psPartkey+5 p5 from partsupp)
bash-3.2$ mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building calite-map-demo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- scala-maven-plugin:3.1.6:add-source (scala-compile-first) @ calite-map-demo ---
[INFO] Add Source directory: /Users/vladimirsitnikov/Documents/work/calcite-map-demo/src/main/scala
[INFO] Add Test Source directory: /Users/vladimirsitnikov/Documents/work/calcite-map-demo/src/test/scala
@vlsi
vlsi / useIncrementalCompilation=false
Last active August 29, 2015 14:10
Maven-compiler-plugin 3.1 useIncrementalCompilation=false test
Repeated executions of "mvn install -DskipTests -Dcheckstyle.skip=true" of
https://github.com/apache/incubator-calcite
with <useIncrementalCompilation>false</useIncrementalCompilation> are _faster_ than in default mode.
It looks like the setting is inversed somehow.
The issue is described here:
http://stackoverflow.com/questions/17944108/maven-compiler-plugin-always-detecting-a-set-of-sources-as-stale
https://jira.codehaus.org/browse/MCOMPILER-209
No "Compiling ... source files to..." messages during the build.
@vlsi
vlsi / externals
Last active August 29, 2015 14:14
CopyOnWriteArrayList footprint in jre 1.8
$ sudo java -jar jol-cli-0.3-full.jar externals java.util.concurrent.CopyOnWriteArrayList
Running 64-bit HotSpot VM.
Using compressed oop with 3-bit shift.
Using compressed klass with 3-bit shift.
Objects are 8 bytes aligned.
Field sizes by type: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes]
Array element sizes: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes]
objc[33686]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
java.util.concurrent.CopyOnWriteArrayList object externals:
@vlsi
vlsi / HotspotAllocationProfilerTest output
Created April 12, 2015 13:44
HotspotAllocationProfilerTest output
# Run complete. Total time: 00:00:05
Benchmark Mode Cnt Score Error Units
HotspotAllocationProfilerTest.allocateObject avgt 4,297 ns/op
HotspotAllocationProfilerTest.allocateObject:·allocated avgt 16,002 B/op
HotspotAllocationProfilerTest.allocateObject:·allocation.rate avgt 3202,343 MB/sec
HotspotAllocationProfilerTest.allocateObjectSampleTime sample 15583 56,291 ± 3,064 ns/op
HotspotAllocationProfilerTest.allocateObjectSampleTime:·allocated sample 16,001 B/op
HotspotAllocationProfilerTest.allocateObjectSampleTime:·allocation.rate sample 1941,053 MB/sec
HotspotAllocationProfilerTest.allocateObjectSingleShot ss 5 1287,800 ± 302,336 ns/op
@vlsi
vlsi / jmh_report
Created June 3, 2015 11:30
Suggestion for jmh failure reporting
Benchmark Mode Cnt Score Error
FinalizeStatement.createAndLeak avgt 2 OutOfMemoryError at iteration 3
FinalizeStatement.createAndLeak:·gc.alloc.rate.norm avgt 2 192,026