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
// vytvorte 4 tridy: Operation1, Operation2, Operation3 a MainOperation | |
import java.util.Random; | |
public class Operation1 { | |
public static void runOp1(int time) throws InterruptedException { | |
System.out.println("Operation1::run"); | |
Thread.sleep(new Random().nextInt(time)); | |
} |
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
"c:\Program Files\Java\jdk-9\bin\jlink" --module-path "%JAVA_HOME%\jmods;target\uberhello-1.0-SNAPSHOT.jar" --add-modules com.test.uberhello --launcher com.test.uberhello=com.test.uberhello/main.Main --output my-app --strip-debug --compress 2 --no-header-files | |
jlink --module-path $JAVA_HOME/jmods:target/uberhello-1.0-SNAPSHOT.jar --add-modules com.test.uberhello --launcher com.test.uberhello=com.test.uberhello/main.Main --output my-app --strip-debug --compress 2 --no-header-files | |
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
@RibbonClient(name = "invoice") | |
@RestController | |
@RequestMapping("/invoice") | |
public class InvoiceController { | |
@LoadBalanced | |
@Autowired | |
@Bean |
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 java.util.concurrent.*; | |
public class LionPenManagerV1 { | |
private void removeAnimals() { | |
System.out.println("Removing animals"); | |
} | |
private void cleanPen() { | |
System.out.println("Cleaning the pen"); |
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 java.util.Collections; | |
import java.util.Set; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public final class ThreeStooges { | |
private final Set<String> stooges; | |
{ | |
Set<String> set = Stream.of("Moe", "Larry", "Curly") |
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
Stream<String> urls = Stream.of("http://mavensync.zkoss.org/maven2/", "https://oss.sonatype.org/content/repositories/releases/", "http://maven.xwiki.org/releases/", "http://repo.spring.io/milestone/", "http://repo.hortonworks.com/content/repositories/releases/", "http://repo.jenkins-ci.org/releases/", "https://repo.eclipse.org/content/groups/releases/", "https://oss.sonatype.org/content/repositories/appfuse-releases/", "https://oss.sonatype.org/content/repositories/ops4j-releases/", "http://repository.pentaho.org/content/groups/omni/", "http://maven.twttr.com/", "https://maven-eu.nuxeo.org/nexus/content/repositories/public/", "http://bits.netbeans.org/nexus/content/groups/netbeans/", "https://oss.sonatype.org/content/repositories/plexus-releases/", "https://m2.neo4j.org/content/repositories/releases/", "https://oss.sonatype.org/content/repositories/ksoap2-android-releases/", "https://oss.sonatype.org/content/repositories/agimatec-releases/", "https://oss.sonatype.org/content/repositories/kenai-releases/", "ht |
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
<dependency> | |
<groupId>org.apache.httpcomponents</groupId> | |
<artifactId>httpclient</artifactId> | |
<version>4.5.3</version> | |
</dependency> | |
<dependency> | |
<groupId>org.springframework</groupId> | |
<artifactId>spring-web</artifactId> | |
<version>4.3.8.RELEASE</version> | |
</dependency> |
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 java.util.*; | |
import java.util.concurrent.*; | |
import java.util.stream.*; | |
public class WeighAnimalAction extends RecursiveAction { | |
private int start; | |
private int end; | |
private Double[] weights; |
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 java.util.ArrayList; | |
import java.util.List; | |
public class MainThreadStarvation { | |
private static List<Integer> list = new ArrayList<>(); | |
private static final Object mutex = new Object(); | |
public static void main(String[] args) throws InterruptedException { |
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
select translate('žluťoučký kůň pěl ódy', 'žťčýůěóňěščřžýáíé', 'ztcyueonescrzyaie') from dual; |