Skip to content

Instantly share code, notes, and snippets.

@koduki
koduki / SparkExample01.java
Created April 7, 2016 23:08
SparkでRDDをテキストファイルとしてファイル出力するサンプル。copyMergeがポイント。
String tmpDir = "target/output_tmp";
String outputFile = "target/output.txt";
// clear
FileUtil.fullyDelete(new File(tmpDir));
FileUtil.fullyDelete(new File(outputFile));
// init spark config
SparkConf sparkConf = new SparkConf().setAppName("test").setMaster("local");
JavaSparkContext sc = new JavaSparkContext(sparkConf);
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.example.csv;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.concurrent.CompletableFuture;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.example.csv;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.example.csv;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
@koduki
koduki / TestdataGenerator.java
Created March 13, 2016 06:35
Generate CSV data include binary.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.example.csv;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.DataInputStream;
package main
import (
"fmt"
"strconv"
)
func main() {
xs := []int{2, 3, 4}
@koduki
koduki / Watcher.java
Created January 28, 2016 21:57
example DBMS_ALERT.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cn.orz.pascal.example.reactive_javaee.bean;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
@koduki
koduki / draw.html
Created May 8, 2015 08:02
Simple Draw Tool
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Simple Draw Tool</title>
</head>
<body>
<head>
<h1>Simple Presentation Tool</h1>
@koduki
koduki / utils.js
Created May 8, 2015 04:02
my js utils.
// LTSV format logger.
function log(event_name, params){
var msg = "event:" + event_name;
for(var key in params){
msg += "\t" + key + ":" + params[key];
}
console.log(msg);
}
hugo server --theme=journal --buildDrafts
hugo new post/first.md
hugo new page/about.md
hugo new page/resume.md