Skip to content

Instantly share code, notes, and snippets.

@iromu
iromu / pom.xml
Created December 4, 2012 07:04
Maven, surefire, junit and multiple executions
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
<argLine>-DdataSource=dataSource.ORACLE.properties</argLine>
<reportNameSuffix>ORA</reportNameSuffix>
</configuration>
<executions>
<execution>
@iromu
iromu / pom.xml
Created December 4, 2012 07:05
Sonar dynamicAnalysis
<properties>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
</properties>
@iromu
iromu / gist:4202561
Created December 4, 2012 10:41
Oracle XE Listener refused the connection with the following error: ORA-12519
ALTER SYSTEM SET PROCESSES=1500 SCOPE=SPFILE;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Aspect
//Replace "com.package" with your project package
public class StatementTracing {
static final Logger logger = LoggerFactory.getLogger("jdbc.sql");
@iromu
iromu / gist:4387451
Created December 27, 2012 11:06
DB2 'REPEAT ' function replacement for Oracle
CREATE OR REPLACE
FUNCTION REPEAT(
p_string VARCHAR2 ,
p_times INTEGER )
RETURN VARCHAR2
AS
BEGIN
RETURN rpad (p_string, LENGTH(p_string)*p_times, p_string);
END REPEAT;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Aspect
public class LoggingInterceptor {
static final Logger logger = LoggerFactory.getLogger(LoggingInterceptor.class);
@Pointcut("call(* java.io.PrintStream.print*(..)) && within(com.mybasepackage..*)")
.pagination {
-fx-skin: "con.iromu.custom.skin.pagination.PaginationSkin";
}
private static final Duration DURATION = new Duration(500.0);//new Duration(125.0);
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
public class ProgressiveImageView extends ImageView {
public ProgressiveImageView(final String image, String placeholder) {
final Image img = new Image(image, true);
img.progressProperty().addListener(new ChangeListener<Number>() {
public void changed(ObservableValue ov,
private Node createPage(int pageIndex) {
ProgressiveImageView iv = null;
try {
String s = files.get(pageIndex).toUri().toURL().toExternalForm();
String p = placeholders.get(pageIndex).toUri().toURL().toExternalForm();
iv = new ProgressiveImageView(s, p);
} catch (MalformedURLException e) {
e.printStackTrace();// TODO, I feel too lazy today
}
iv.setPreserveRatio(true);