<#-- | |
The request here is not the original request and doesn't contain the url query parameters | |
hence the usage of the serviceContext from ServiceContextThreadLocal. | |
--> | |
<#assign serviceContext = staticUtil["com.liferay.portal.service.ServiceContextThreadLocal"].getServiceContext()> | |
<#assign httpServletRequest = serviceContext.getRequest()> | |
myparam="${(httpServletRequest.getParameter('myparam')?html)!''}" |
import org.junit.jupiter.params.ParameterizedTest; | |
import org.junit.jupiter.params.aggregator.ArgumentsAccessor; | |
import org.junit.jupiter.params.converter.ConvertWith; | |
import org.junit.jupiter.params.provider.CsvSource; | |
import java.time.LocalDate; | |
import java.time.format.DateTimeFormatter; | |
import static org.junit.jupiter.api.Assertions.assertEquals; |
import javax.swing.*; | |
import javax.swing.table.TableCellEditor; | |
import java.awt.*; | |
import java.util.Calendar; | |
import java.util.Date; | |
/** | |
* DateCellEditor that is based on {@link JSpinner} and {@link JFormattedTextField}. | |
*/ | |
public class DateCellEditor extends AbstractCellEditor implements TableCellEditor { |
From https://gist.github.com/oanhnn/80a89405ab9023894df7
I have two Github accounts: defaul for work and personal. I want to use both accounts on same computer via git ssh (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (an alias per account).
import org.reflections.Reflections; | |
import org.springframework.util.LinkedMultiValueMap; | |
import org.springframework.util.MultiValueMap; | |
import java.net.URL; | |
import java.util.Set; | |
public class ClassUtil { | |
public <T> MultiValueMap<String, Class<? extends T>> getSubTypeLocationsOf(final String prefix, final Class<T> type) { |
Prior to v7.4, schema registry did not support any custom metadata associated with a schema uploaded to the schema registry.
So the following mapping between
- the version of a jar artifact containing a schema content
- and the id and version of the schema in the schema registry
can only be derived by comparing the content of the schemas in different schema registry environments (using
POST /subjects/(string: subject)
).
I did some reading on CORS and I think I understand how they can restrict which origins the requests are coming from. However, allowing the cross origin calls from the browser increases a possibility of XSS:
a person with malicious intent injects some JavaScript into a page to steal users' cookies and send them to a URL he controls, all he has to do is add the following header
Access-Control-Allow-Origin: *
on the server side to make the request work. https://security.stackexchange.com/questions/108835/how-does-cors-prevent-xss
The scenario that CORS is preventing is different:
For example, the victim logged into their bank's application. Then they were tricked into loading an external website on a new browser tab. The external website then used the victim's cookie credentials and relayed data to the bank application
Kafka metrics:
- kafka.consumer.fetch.manager.records.consumed.rate
- kafka.consumer.fetch.manager.records.lag
Spring Kafka Listener metrics
- spring.kafka.listener.count
- spring.kafka.listener.max
Metrics queries:
- sum(align(1m, ts(kafka.consumer.fetch.manager.records.consumed.rate, space=${env} and service=${service} and dc=${dc})), service, dc)
https://micrometer.io/docs/concepts#_the_timed_annotation
@Configuration
public class TimedConfiguration {
@Bean
public TimedAspect timedAspect(MeterRegistry registry) {
return new TimedAspect(registry);
}
}