Skip to content

Instantly share code, notes, and snippets.

@tomoTaka01
tomoTaka01 / gist:1858634
Created February 18, 2012 10:25
tomoTaka01:read text file(key,value) and make treeMap
/**
* text file(key , value) -> TreeMap
* without charest
* @return
*/
private static Map<String, String> getMapFromTxt1() {
Map<String, String> map = new TreeMap<String, String>();
String path = new File(getPath()).getParent();
StringBuilder sb = new StringBuilder();
sb.append(path).append(File.separator).append("xxx.txt");
@tomoTaka01
tomoTaka01 / HelloSampleGeb
Created November 4, 2012 00:33
my first Geb (for HelloSample)
@Grab("org.codehaus.geb:geb-core:latest.release")
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:latest.release")
import geb.*
class HelloPage extends Page {
static url = 'http://localhost:8080/HelloSample/'
static at = {title == 'Hello'}
static content = {
nameInput {
@tomoTaka01
tomoTaka01 / enum memo
Created November 4, 2012 06:00
just memo
import javax.faces.model.SelectItem;
/**
*
* @author tomo
*/
public enum GreetSelect {
Hello("1", "Hello"),
GoodMorning("2", "Good Morning"),
GoodNight("3", "Good Night")
@tomoTaka01
tomoTaka01 / HelloSampleTest2
Created November 11, 2012 06:07
Web test by selenium(with radio, select menu)
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.OutputType;
@tomoTaka01
tomoTaka01 / test for Lambda
Created December 9, 2012 02:22
Lambdaの実装を練習
package test;
import java.util.ArrayList;
import java.util.List;
public class PersonFind {
public static void main(String[] args) {
List<Person> persons = new ArrayList<>();
persons.add(new Person("name10", 10));
persons.add(new Person("name20", 20));
@tomoTaka01
tomoTaka01 / First Lambda practice
Created December 9, 2012 02:48
Lambda practice(do not know what is the problem)
import java.util.ArrayList;
import java.util.List;
public class PersonFindErr {
public static void main(String[] args) {
List<Person> persons = new ArrayList<>();
persons.add(new Person("name10", 10));
persons.add(new Person("name20", 20));
persons.add(new Person("name30", 30));
persons.add(new Person("name40", 40));
@tomoTaka01
tomoTaka01 / LogSample.java
Last active December 19, 2015 03:18
Logging sample(JDK8)
import java.util.concurrent.FutureTask;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class LogSample {
private static final Logger logger = Logger.getLogger(LogSample.class.getName());
public static void main(String[] args) {
logger.setLevel(Level.ALL);
@tomoTaka01
tomoTaka01 / LogSample2.java
Created June 29, 2013 00:03
Log Sample2(by using JDK8)
import java.util.concurrent.FutureTask;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class LogSample2 {
private static final Logger logger = Logger.getLogger(LogSample.class.getName());
public static void main(String[] args) {
logger.setLevel(Level.INFO);
@tomoTaka01
tomoTaka01 / LogSample.java
Created June 29, 2013 00:05
Log sample(by using JDK7)
import java.util.concurrent.FutureTask;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class LogSample {
private static final Logger logger = Logger.getLogger(LogSample.class.getName());
public static void main(String[] args) {
logger.setLevel(Level.ALL);
@tomoTaka01
tomoTaka01 / gist:6700138
Created September 25, 2013 14:05
The temperature application using JavaFX and RaspberryPi.
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.text.Text;
import javafx.stage.Stage;