This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create database sonarqube character set 'utf8'; | |
create user 'sonarqube'@'localhost' identified by 'password'; | |
grant all privileges on sonarqube.* TO 'sonarqube'@'%'; | |
flush privileges; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
public class MergeSorter { | |
private long inversions = 0; | |
public void sort(int[] array) { | |
int length = array.length; | |
if (length <= 1) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TowerofHanoi | |
{ | |
public static void main(String...args) { | |
int nDisks = 3; | |
doTowers(nDisks, 'A', 'B', 'C'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ffbit.sorting; | |
import java.util.Arrays; | |
public class QuickSorter implements Sorter { | |
@Override | |
public void sort(int[] array) { | |
System.out.println(Arrays.toString(array)); | |
sort(array, 0, array.length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DB="dbname" | |
HOST="host" | |
UNAME="uname" | |
dropdb --host $HOST --port=5432 --username $UNAME $DB | |
createdb --host $HOST --port 5432 --username $UNAME --owner $UNAME $DB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://docs.rubygems.org/read/chapter/11 | |
install: --no-rdoc --no-ri | |
update: --no-rdoc --no-ri |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedList; | |
import java.util.Queue; | |
import java.util.Scanner; | |
public class GC { | |
private static Queue<Object> queue = new LinkedList<Object>(); | |
private static Scanner scanner = new Scanner(System.in); | |
public static void main(String...args) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Random; | |
public class RandomMatrix { | |
public static void main(String... args) { | |
double[][][] matrix = getMatrix(40); | |
print(matrix); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
log.debug("Started extracting resources."); | |
final String ZIP_FILE_PATH_SEPARATOR = "/"; | |
URL location = AClassFromTheNeededJar.class.getProtectionDomain().getCodeSource() | |
.getLocation(); | |
String jarPath = location.getPath(); | |
try { | |
JarInputStream jar = new JarInputStream(new FileInputStream(jarPath)); | |
JarEntry jarEntry = null; |
OlderNewer