Skip to content

Instantly share code, notes, and snippets.

View TakayukiKando's full-sized avatar

Takayuki Kando TakayukiKando

View GitHub Profile
/*
* 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 org.xgmtk.lore.ast.stream.test;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.hamcrest.CoreMatchers.is;
@TakayukiKando
TakayukiKando / std_main.vm
Created April 22, 2016 09:53
Velocity template sample for shell script generation
##Required parameters are: $storageName, $vmSpec, $userName, $vmId, $templatesPath
#!/bin/sh
##Set variables
logPath=$1
#set ($cfg = "/root/.s3cfg")
#set ($pollingInterval = 10)
#set ($retries = 9)
##Stop iptables service
service iptables stop
@TakayukiKando
TakayukiKando / AntFileGenerator.java
Created April 21, 2016 18:40
Velocity sample code for Java tools study session in Fukuoka.
package fukuoka.javatool;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Properties;
import java.util.stream.Collectors;
package org.xgmtk.xmpp.sample;
import java.io.*;
import java.text.DateFormat;
import java.util.*;
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.ChatManagerListener;
import org.jivesoftware.smack.MessageListener;
import org.jivesoftware.smack.XMPPConnection;
@TakayukiKando
TakayukiKando / Dir.java
Last active November 27, 2015 09:53
ANT programming samples (Java sources would be placed into src/sample/ directory of your project. Ant files would be placed into test/ directory of your project. Before trying to run the other build files, you should try to run build_greeting.xml.)
package sample;
import java.io.File;
import java.util.Arrays;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.MatchingTask;
public class Dir extends MatchingTask {
package fpijfukuoka7;
import java.math.BigInteger;
/**
* "Functional Programming in Java"
* A sample code of concept explanation of chapter 7.
*
* @author kando
*
@TakayukiKando
TakayukiKando / SimIntStream.java
Last active August 29, 2015 14:24
SimIntStream : Simple sample implementation for integer stream. (fpijFukuoka Chapter.6)
package fpijfukuoka6;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Predicate;
/**
* "Functional Programming in Java"
* A sample code of concept explanation of chapter 6.
*