This file contains hidden or 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 com.vaadin.annotations.VaadinServletConfiguration; | |
| import com.vaadin.cdi.server.VaadinCDIServlet; | |
| import javax.servlet.ServletConfig; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.annotation.WebServlet; | |
| /** | |
| * PM custom Vaadin servlet. | |
| * <p>Vaading config <code>productionMode</code> is set by default to <code>true</code>. |
This file contains hidden or 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 java.time.Clock; | |
| import java.time.LocalTime; | |
| public class TimeMachine { | |
| private LocalTime from = LocalTime.MIDNIGHT; | |
| private LocalTime until = LocalTime.of(6, 0); | |
| private Clock clock = Clock.systemDefaultZone(); |
This file contains hidden or 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
| CREATE USER MONITORING IDENTIFIED BY password; | |
| GRANT CREATE SESSION TO MONITORING; | |
| GRANT SELECT any dictionary MONITORING; | |
| GRANT SELECT ON V_$SYSSTAT TO MONITORING; | |
| GRANT SELECT ON V_$INSTANCE TO MONITORING; | |
| GRANT SELECT ON V_$LOG TO MONITORING; | |
| GRANT SELECT ON SYS.DBA_DATA_FILES TO MONITORING; | |
| GRANT SELECT ON SYS.DBA_FREE_SPACE TO MONITORING; |
This file contains hidden or 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 org.junit.jupiter.api.AfterEach; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.DisplayName; | |
| import org.junit.jupiter.api.Test; | |
| import org.openqa.selenium.WebDriver; | |
| import org.openqa.selenium.WebElement; | |
| import org.openqa.selenium.remote.DesiredCapabilities; | |
| import org.openqa.selenium.remote.RemoteWebDriver; | |
| import org.openqa.selenium.By; |
This file contains hidden or 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 JTSK { | |
| private double x; | |
| private double y; | |
| public JTSK(double x, double y) { | |
| this.x = x; | |
| this.y = y; | |
| } |
This file contains hidden or 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
| /** | |
| * Optional property <code>myApp.node-name</code>, hostname otherwise. | |
| */ | |
| @Value("#{'${myApp.node-name:}'?:T(java.net.InetAddress).getLocalHost().getHostName()}") | |
| private String nodeName; |
This file contains hidden or 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
| (= 65 | |
| (/ | |
| (reduce + (filter #(> % 50) ages)) | |
| (count (filter #(> % 50) ages)) | |
| ) | |
| ) |
This file contains hidden or 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 javax.annotation.PostConstruct; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.support.BeanDefinitionRegistry; | |
| import org.springframework.context.ApplicationContext; | |
| import org.springframework.stereotype.Component; | |
| /** |
This file contains hidden or 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
| { | |
| "traceId": "491a1826-0fa1-46d8-970d-704027a2548b", | |
| "code": "validation.error", | |
| "message": "Validation failed", | |
| "errors": [ | |
| { | |
| "attributeCode": "firstName", | |
| "messageCode": "validation.empty" | |
| }, | |
| { |
This file contains hidden or 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 SecureRandomTest { | |
| public static void main(String[] args) { | |
| System.out.println("SecureRandom Test"); | |
| final SecureRandom random = new SecureRandom(); // Default: Win - SHA1PRNG, Linux/maxOS - NativePRNG | |
| // final SecureRandom random = SecureRandom.getInstance("NativePRNGNonBlocking"); | |
| System.out.println("Algorithm: " + random.getAlgorithm()); | |
| for (int i = 0; i < 100; i++) { | |
| System.out.print('.'); | |
| final byte[] seed = random.generateSeed(2 * 8); | |
| } |