Skip to content

Instantly share code, notes, and snippets.

View novoj's full-sized avatar
💻
Hacking on evitaDB

Jan Novotný novoj

💻
Hacking on evitaDB
View GitHub Profile
@novoj
novoj / spring-security.xml
Created February 27, 2017 16:02
Spring Security XML example
<?xml version="1.0" encoding="utf-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<http pattern="/css/**" security="none"/>
@novoj
novoj / SpringSecurity.java
Created February 27, 2017 16:05
Spring Security Java Configuration
@Configuration
@EnableWebMvcSecurity
@ComponentScan(basePackageClasses = UserRepositoryUserDetailsService.class)
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
static class MethodSecurityConfiguration extends GlobalMethodSecurityConfiguration {
[
{
"jmhVersion" : "1.27",
"benchmark" : "io.evitadb.spike.ArrayOrHashMap.retrieveValueFromArray",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/opt/Java/jdk11.0.10/bin/java",
"jvmArgs" : [
],
[
{
"jmhVersion" : "1.27",
"benchmark" : "io.evitadb.spike.ArrayOrHashMap.retrieveValueFromArray",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/opt/Java/jdk11.0.10/bin/java",
"jvmArgs" : [
],
[
{
"jmhVersion" : "1.27",
"benchmark" : "io.evitadb.spike.ArrayOrHashMap.retrieveValueFromArray",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/opt/Java/jdk11.0.10/bin/java",
"jvmArgs" : [
],
[
{
"jmhVersion" : "1.27",
"benchmark" : "io.evitadb.spike.ArrayOrHashMap.retrieveValueFromArray",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/opt/Java/jdk11.0.10/bin/java",
"jvmArgs" : [
],
[
{
"jmhVersion" : "1.27",
"benchmark" : "io.evitadb.spike.ArrayOrHashMap.retrieveValueFromArray",
"mode" : "thrpt",
"threads" : 1,
"forks" : 1,
"jvm" : "/opt/Java/jdk11.0.10/bin/java",
"jvmArgs" : [
],
String book = "This represents contents of the book.";
final Function<String, IntSupplier> wordCounter = aString ->
() -> aString.split("\\s+").length;
final IntSupplier curry = wordCounter.apply(book);
int countBeforeChange = curry.getAsInt();
book = "Book contents has been changed as of now.";
int countAfterChange = curry.getAsInt();
System.out.print(
StringBuilder book = new StringBuilder("This represents contents of the book.");
final Function<StringBuilder, IntSupplier> wordCounter = aString ->
() -> aString.toString().split("\\s+").length;
final IntSupplier curry = wordCounter.apply(book);
int countBeforeChange = curry.getAsInt();
book.setLength(0);
book.append("Book contents has been changed as of now.");
int countAfterChange = curry.getAsInt();
@novoj
novoj / http-web-server-baseline-2022-05.json
Last active April 7, 2023 18:19
HttpServerEvaluationTests oritinal results with web server versions from 05/2022
[
{
"jmhVersion" : "1.35",
"benchmark" : "one.edee.oss.http_server_evaulation_test.jmh.ServersThroughputBenchmark.graphQLApiEchoQuery_JavalinServer",
"mode" : "thrpt",
"threads" : 4,
"forks" : 1,
"jvm" : "/opt/Java/jdk-17.0.2/bin/java",
"jvmArgs" : [
],