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 abstract class BaseRepository<T extends Object, ID extends Serializable> | |
implements JpaRepository<T, ID>, JpaSpecificationExecutor<T> { | |
private @PersistenceContext EntityManager em; | |
private SimpleJpaRepository<T, ID> target; | |
protected EntityManager getEntityManager() { | |
return em; | |
} |
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
<?php | |
$row = array_pop($db->query("SELECT my_blob_col FROM my_blob_table")); | |
$blob = $ros['my_blob_col']; | |
assertEquals(TRUE, is_resource($blob)); | |
while(!feof($blob)) { | |
echo fread($blob, 8192); | |
} |
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 SUBSTR(my_blob_col, 1, 8192) FROM my_blob_table WHERE blob_id=? |
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 blob_id, CHAR_LENGTH(my_blob_col) AS blob_len FROM my_blob_table |
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
importPackage(Packages.java.text); | |
HolidayEndpoint = { | |
setService: function(hr) { | |
this.service = hr; | |
}, | |
invoke: function(req) { | |
default xml namespace = "http://mycompany.com/hr/schemas"; | |
var params = { | |
startDate: this.parseDate(req..StartDate), | |
endDate: this.parseDate(req..EndDate), |
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
<beans> | |
<bean name="holidayEndpoint" class="org.springframework.scripting.rhino.JavaScriptPayloadEndpointFactory"> | |
<constructor-arg value="classpath:holiday.js" /> | |
<property name="service" ref="hrService" /> | |
</bean> | |
<bean name="hrService" class="test.rhino.DefaultHumanResourceService" /> | |
<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping"> | |
<property name="mappings"> | |
<props> | |
<prop key="{http://mycompany.com/hr/schemas}HolidayRequest">holidayEndpoint</prop> |
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
importPackage(Packages.java.net); | |
importPackage(Packages.org.w3c.tidy); | |
var Euribor = function() { | |
var tidy = new Tidy(); | |
tidy.XHTML = true; | |
tidy.fixComments = true; | |
tidy.trimEmptyElements = true; | |
tidy.onlyErrors = true; | |
tidy.showWarnings = false; | |
tidy.quiet = true; |
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
perl_set $uid ' | |
use Digest::MD5 qw(md5_hex); | |
sub { | |
return md5_hex(`od -vAn -N4 -tu4 < /dev/urandom`); | |
}'; | |
#pass to fcgi | |
location ... { | |
fastcgi_param UNIQUE_ID $uid |
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 throttle; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target(ElementType.METHOD) | |
public @interface Throttle { | |
/** |
OlderNewer