Skip to content

Instantly share code, notes, and snippets.

public class EnumerationIndoUtil {
public static <T1> Enumeration<List<T1>> createPartitionedEnumeration(final List<T1> originalList, final int blockSize) {
class PartitionedEnum implements Enumeration<List<T1>> {
int lastIndex = 0;
public boolean hasMoreElements() {
import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
public class DeleteFilesExample
{
// prepare the form when the DOM is ready
$(document).ready(function() {
// Setup the ajax indicator
$('body').append('<div id="ajaxBusy"><p><img src="images/loading.gif"></p></div>');
$('#ajaxBusy').css({
display:"none",
margin:"0px",
paddingLeft:"0px",
public interface PersonRepository extends JpaRepository<Person, Long>, JpaSpecificationExecutor<Person> {
List<Person> findByEmailAddressAndLastname(String emailAddress, String lastname);
// find all persons and apply eclipselink batch hint to fetch their addresses
@Query("select p from Person p")
@QueryHints({@QueryHint(name="eclipselink.batch", value="p.addresses")})
List<Person> findAllWithAddresses();
}
public class Repositories {
/**
* Delicious2Diigo
*
* Author:
* Pierre Lindenbaum
* http://plindenbaum.blogspot.com
*
* Motivation:
* save bookmarks from delicious to diigo using the Diigo API.
*
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt-get update && sudo apt-get -y dist-upgrade
sudo apt-get update && sudo apt-get -y dist-upgrade -f
sudo apt-get install python-uno
sudo apt-get install python-uno -f
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get update
sudo apt-get clean
sudo apt-get install -fy
sudo lsof | egrep "java"| egrep "TCP" | wc -l
sudo lsof | egrep "java" | wc -l
sudo lsof | egrep "java"| egrep "TCP|sock" | wc -l
select
convert(varchar(10),db_name(dbid)) as DBName
, P.spid
, right(convert(varchar,
dateadd(ms, datediff(ms, P.last_batch, getdate()), '1900-01-01'),
121), 12) as 'batch_duration'
, P.program_name
, P.cmd
, p.open_tran
, p.status
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@xexes
xexes / dateBinding.xml
Created January 31, 2018 15:42 — forked from sachin-handiekar/dateBinding.xml
JAXB Binding (WSDL2Java )- XMLGregorianCalendar to java.util.Date
<jaxws:bindings wsdlLocation="SampleService.wsdl"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<jaxws:bindings node="wsdl:definitions/wsdl:types/xs:schema[@targetNamespace='http://example.com/service/SampleService/']">
<jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jxb:javaType name="java.util.Date" xmlType="xs:date"
parseMethod="org.apache.cxf.tools.common.DataTypeAdapter.parseDateTime"
printMethod="org.apache.cxf.tools.common.DataTypeAdapter.printDateTime"/>