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 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() { |
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.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 | |
{ |
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
// 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", |
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 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 { |
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
/** | |
* Delicious2Diigo | |
* | |
* Author: | |
* Pierre Lindenbaum | |
* http://plindenbaum.blogspot.com | |
* | |
* Motivation: | |
* save bookmarks from delicious to diigo using the Diigo API. | |
* |
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
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 |
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
sudo lsof | egrep "java"| egrep "TCP" | wc -l | |
sudo lsof | egrep "java" | wc -l | |
sudo lsof | egrep "java"| egrep "TCP|sock" | wc -l |
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
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 |
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
// 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 |
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
<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"/> |
OlderNewer