Functional Interfaces
- usecase for wildcards
- lambda expressions have types
- good for library building
// has ingoing type T and return type R
Function<T, R> -> R apply(T arg)
package com.javaxp; | |
import java.io.File; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.integration.annotation.InboundChannelAdapter; | |
import org.springframework.integration.annotation.Poller; | |
import org.springframework.integration.annotation.ServiceActivator; | |
import org.springframework.integration.channel.DirectChannel; |
NOTE: This post is a personal update to Neeraj Singh's post. [PostgreSQL must also be configured to allow remote connections][1], otherwise the connection request will fail, even if all firewalls rules are correct and PostgreSQL server is listening on the right port.
Couldn't create links, but this is a rather long answer so this may helps.
## Batch Create Assertion Duplicate | |
curl -X "POST" "http://localhost:4000/api/batch/assertions" \ | |
-H 'Content-Type: application/json; charset=utf-8' \ | |
-H 'Cookie: jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjYXJsb3NAYmFkZ2V0cmVlLmNvbSIsImlkIjoyfQ.yL0nNX_l3VtPjgZdVk7-1Q7TD4XF_IiVk2VgwhwoOqs; ueberauth_linkedin_state=INKFNIWeDa6TbzGP9aI/VA==' \ | |
-d $'{ | |
"data": [ | |
{ | |
"issuer_id": "4", | |
"user_email": "[email protected]", | |
"message": "Mensaje", |
// Simple Java program | |
public class Person { | |
private int age; | |
private boolean isFemale; | |
Person(int age, boolean isFemale) { | |
this.age = age; | |
this.isFemale = isFemale; | |
} |
import com.yammer.dropwizard.util.Duration; | |
import com.google.common.cache.*; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.concurrent.*; | |
import static com.google.common.base.Throwables.propagateIfInstanceOf; | |
public class LocalAppConfigStorage implements AppConfigStorage { |
#!/bin/bash | |
## Script start time | |
START=$(date +%s) | |
## Total run time | |
DURRATION=$((60 * 60 * 24)) | |
## Total running time | |
UPTIME=$(($(date +%s) - $START)) |
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> | |
<property name="entityManagerFactory" ref="entityManagerFactory" /> | |
<property name="dataSource" ref="myDS" /> | |
</bean> | |
<tx:annotation-driven transaction-manager="transactionManager" /> | |
<aop:config> | |
<aop:pointcut id="defaultServiceMethodTxPointcut" | |
expression="execution([email protected] * *(..)) |