I hereby claim:
- I am nurkiewicz on github.
- I am nurkiewicz (https://keybase.io/nurkiewicz) on keybase.
- I have a public key whose fingerprint is 53BB 9925 9172 1BC4 5201 42A3 BC59 60D4 5F3C 7EA3
To claim this, I am signing this object:
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
/** | |
* Solution: https://ideone.com/qcHw1f | |
*/ | |
class Main { | |
public static void main(String[] args) { | |
Path path = Paths.get("/"); |
@Bean | |
public EmbeddedServletContainerFactory embeddedServletContainerFactory() { | |
final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(); | |
factory.addServerCustomizers(server -> { | |
MBeanContainer mbContainer = new MBeanContainer(ManagementFactory.getPlatformMBeanServer()); | |
server.addEventListener(mbContainer); | |
server.addBean(mbContainer); | |
}); | |
return factory; | |
} |
final CronExpression cronExpression = new CronExpression("0 0 5 * * ?"); | |
Date since = new Date(); | |
for (int i = 0; i < 100; i++) { | |
since = cronExpression.getNextValidTimeAfter(since); | |
System.out.println(since); | |
} |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.BeansException; | |
import org.springframework.beans.factory.config.BeanPostProcessor; | |
import org.springframework.stereotype.Component; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.util.Map; | |
import java.util.concurrent.ConcurrentHashMap; |
import spock.lang.Specification | |
import spock.lang.Unroll | |
import java.time.* | |
@Unroll | |
class BankSpec extends Specification { | |
final ZoneId warsaw = ZoneId.of("Europe/Warsaw") | |
def 'should calculate downtime also in DST'() { |
package com.nurkiewicz.mixit; | |
import lombok.Value; | |
import lombok.extern.slf4j.Slf4j; | |
import org.junit.Test; | |
import rx.Observable; | |
import rx.observers.TestSubscriber; | |
import rx.schedulers.Schedulers; | |
import rx.schedulers.TestScheduler; |
I hereby claim:
To claim this, I am signing this object:
const fs = require('fs') | |
const json = fs.readFileSync('large.json').toString() | |
// Run this several times, collect times in spreadsheet, like an animal | |
start = Date.now(); JSON.parse(json); Date.now() - start |