This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl https://start.spring.io/starter.zip -d dependencies=web,devtools,lombok,configuration-processor,security,actuator,testcontainers \ | |
-d bootVersion=2.3.4.RELEASE -o my-project.zip | |
#https://docs.spring.io/initializr/docs/current/reference/html/#command-line | |
#https://start.spring.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyClass { | |
public static void main(String args[]) { | |
Object object = (byte) ~ | |
(char) - | |
(int) + | |
(long) -1; | |
System.out.println(object); | |
if (object instanceof Integer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.extern.slf4j.Slf4j; | |
import org.eclipse.jgit.api.Git; | |
import org.eclipse.jgit.lib.AnyObjectId; | |
import org.eclipse.jgit.lib.Ref; | |
import org.eclipse.jgit.revwalk.RevCommit; | |
import org.eclipse.jgit.transport.PushResult; | |
import org.junit.jupiter.api.Test; | |
import java.io.File; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.SneakyThrows; | |
import lombok.extern.slf4j.Slf4j; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.util.Objects; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.TimeUnit; | |
import java.util.function.Consumer; | |
import java.util.function.Supplier; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example; | |
import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.function.Consumer; | |
import java.util.stream.Collectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example.programming; | |
import ev3dev.robotics.tts.Espeak; | |
/** | |
* Java example to show the new language feature (Java 13): Text block | |
* | |
* Original text: https://cvc.cervantes.es/literatura/clasicos/quijote/edicion/parte1/cap01/default.htm | |
*/ | |
public class DonQuijoteDemo { |
API General design:
POST /api/companies/items GET /api/companies/items GET /api/companies/items/{id} DELETE /api/companies/items/{id} PUT /api/companies/items/{id}
PATCH /api/companies/items/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ThreadDeathCatch { | |
public static void main(String[] args) { | |
try { | |
Thread t = new Thread(() -> { | |
try { | |
Thread.sleep(2500); | |
} catch (Throwable ex) { | |
System.out.println("Caught in run: " + ex); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package examples.actuators; | |
import ev3dev.actuators.lego.motors.EV3LargeRegulatedMotor; | |
import ev3dev.actuators.lego.motors.Motor; | |
import lejos.hardware.port.MotorPort; | |
import lejos.robotics.RegulatedMotor; | |
import lejos.utility.Delay; | |
import lombok.extern.slf4j.Slf4j; | |
import java.util.concurrent.ExecutorService; |