Skip to content

Instantly share code, notes, and snippets.

View RaffaeleSgarro's full-sized avatar

Raffaele Sgarro RaffaeleSgarro

View GitHub Profile
@RaffaeleSgarro
RaffaeleSgarro / ConvolutionTest.java
Last active March 25, 2023 05:33
Image processing: convolution matrices in Java
package stackoverflow;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
public class ConvolutionTest {
package com.stackoverflow;
import org.apache.commons.io.IOUtils;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.io.*;
import java.nio.file.Files;
import static org.testng.Assert.assertEquals;
@RaffaeleSgarro
RaffaeleSgarro / EnsureAllFieldsAreRead.java
Created January 13, 2016 22:13
Test library to assert that all getters of a bean are called using Javassist proxies
package com.stackoverflow;
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.beans.*;
import java.lang.reflect.Method;
@RaffaeleSgarro
RaffaeleSgarro / ProducerConsumer.java
Created January 19, 2016 09:58
Plain Java ProducerConsumer example
package stackoverflow;
import java.util.LinkedList;
import java.util.Queue;
public class ProducerConsumer {
public static void main(String... args) throws Exception {
final Object lock = new Object();
final Queue<Long> data = new LinkedList<>();
package stackoverflow;
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
public class DomParser {
package com.stackoverflow;
import javassist.*;
public class JavassistVerifyError {
public interface Domain {
Integer getIdentifier();
Object getColumnByIndex(int i);
}

This app

This application does not store, use or send user information on its own.

Advertising

This application includes third party software that likely uses user information like language and sex to profile advertising. You can purchase the ad-free version if you'd like to opt-out.

@RaffaeleSgarro
RaffaeleSgarro / Privacy Policy.md
Created February 7, 2017 21:10
Abbecedario Privacy Policy

Privacy Policy

This application does not collect user data on its own.

Third program includes advertising software that may access and share user data with third parties.

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity version="8.0.144.1" processorArchitecture="X86" name="Oracle Corporation, Java(tm) 2 Standard Edition" type="win32"></assemblyIdentity>
<description>Java(TM) SE javaw process</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
</dependentAssembly>
</dependency>
create table stackoverflow_user (
user_name varchar(100) primary key
);
create table stackoverflow_language (
language_name varchar(100) primary key
);
create table stackoverflow_user_language (
user_name varchar(100) references stackoverflow_user(user_name),