Skip to content

Instantly share code, notes, and snippets.

import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.*;
import java.util.regex.*;
import java.util.stream.*;
import static java.util.stream.Collectors.joining;
class Solution {
public char slowestKey(int[] releaseTimes, String keysPressed) {
char answer = keysPressed.charAt(0);
int max = releaseTimes[0];
for (int i=1; i<releaseTimes.length; i++){
if(releaseTimes[i]- releaseTimes[i-1]> max){
max = releaseTimes[i]- releaseTimes[i-1];
answer = keysPressed.charAt(i);
} else if((releaseTimes[i]- releaseTimes[i-1]== max) && (keysPressed.charAt(i) > answer)){
answer = keysPressed.charAt(i);
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.function.Function;
class Solution {
public static class Node<T> {
public T val;
import java.util.Arrays;
import java.util.*;
import java.lang.*;
import java.util.Scanner;
import java.util.stream.Collectors;
class Solution {
public static int twoSumUniquePairs(List<Integer> nums, int target) {
// Lists of the pairs
echo ON
echo PDF to docx
echo usage: pdf2doc FooBarBoo.pdf
echo This will generate: FooBarBoo-jpeg.docx (a docx with JPEG pictures of the PDF) and FooBarBoo-OCR.docx (a docx with OCR-ized content of the PDF)
cd %CD%
where /q gswin32.exe || set PATH=C:\win32app\ghostscript-9.27\bin;%PATH%
where /q soffice.exe || set PATH=C:\win32app\LibreOffice-6.1\App\libreoffice\program;%PATH%
:LOOP
@JonathanLalou
JonathanLalou / semanticAnalysisError.stacktrace
Last active March 27, 2018 03:45
Error:Groovyc: While compiling tests of ABC-integration-test: BUG! exception in phase 'semantic analysis'
Error:Groovyc: While compiling tests of ABC-integration-test: BUG! exception in phase 'semantic analysis' in source unit '...\groovy\com\foo\...\.groovy' Problem loading class com.foo.....
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:935)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:542)
at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:62)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
package com.github.jonathanlalou
import org.junit.Test
import static org.junit.Assert.fail
class RerunFailedTests {
@Test void testOne() { fail("testOne") }
@Test void two() { fail("two") }
@JonathanLalou
JonathanLalou / gist:d7cfce1dd5b87637bf526543508f08f8
Created December 21, 2017 01:49
maven assembly plugin block to build a thin jar
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/resources/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
@JonathanLalou
JonathanLalou / thin-jar.xml
Created December 21, 2017 01:47
Maven-Assembly descriptor to generate a thin (regular) JAR in addition to SpringBoot's fat jar
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>thin</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>