Skip to content

Instantly share code, notes, and snippets.

View ffbit's full-sized avatar

D H ffbit

  • Here GmbH
  • Germany, Frankfurt am Main Area
View GitHub Profile
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.NoSuchElementException;
public class ShadReader implements Closeable {
private static final int BUFFER_SIZE = 1024;
@ffbit
ffbit / dbcp-validation-queries.txt
Created August 14, 2015 17:37
DBCP's Database validationQuery notes
hsqldb - select 1 from INFORMATION_SCHEMA.SYSTEM_USERS
Oracle - select 1 from dual
DB2 - select 1 from sysibm.sysdummy1
mysql - select 1
microsoft SQL Server - select 1 (tested on SQL-Server 9.0, 10.5 [2008])
postgresql - select 1
ingres - select 1
derby - values 1
H2 - select 1
Firebird - select 1 from rdb$database
@ffbit
ffbit / create-user.sql
Last active August 29, 2015 14:27
MySQL create user SQL
create database sonarqube character set 'utf8';
create user 'sonarqube'@'localhost' identified by 'password';
grant all privileges on sonarqube.* TO 'sonarqube'@'%';
flush privileges;

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

I want to implement a simple simulator (Cellular automaton) and can use both java.util.concurrent.* or java.util.stream.* for parallel execution (later produces nicer code). With Java9 I want to execute on the GPU. Which package to use to prepare for GPU computation? Will there be a .parallelGPUStream()?
@ffbit
ffbit / Makefile
Created December 29, 2013 12:36 — forked from AlexDenisov/Makefile
all: calc
calc: parser lexer
CC lexer.c parser.c -o calc
lexer:
flex -o lexer.c lexer.l
parser:
bison -d -o parser.c parser.y
@ffbit
ffbit / build.gradle
Last active December 31, 2015 21:19 — forked from Dierk/build.gradle
apply plugin:'java'
apply plugin:'idea'
repositories { mavenCentral() }
dependencies {
testCompile 'junit:junit:4.11'
}
task makeDirs(description:'make all dirs for project setup') << {
@ffbit
ffbit / IntToBitesTest.java
Last active December 31, 2015 20:49
int to bytes
import org.junit.Test;
import java.util.Arrays;
public class IntToBitesTest {
@Test
public void intToBytes() throws Exception {
int n = 1234567890;
byte[] a = new byte[4];
@ffbit
ffbit / .vimrc
Created July 25, 2013 09:19
Set check spell on in vim
set spell
@ffbit
ffbit / gpg.txt
Created June 6, 2013 19:08
gpg export key
gpg --export -a