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 streams; | |
import java.util.stream.LongStream; | |
import java.util.stream.Stream; | |
public class FibonacciStream { | |
public static LongStream fibonacciGG() { | |
class FibonacciGenerator{ | |
int prev=0; |
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
apiVersion: v1 | |
kind: Template | |
metadata: | |
name: ${NAME} | |
labels: | |
name: ${NAME} | |
annotations: | |
description: Redis master/slave templates based on Statefulsets | |
parameters: | |
- name: NAME |
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
int start = 1, end = 10; | |
List<Integer> primeNumbers = IntStream.range(start, end) | |
.filter(number -> number > 1 && IntStream.range(2, number).noneMatch(divider -> number % divider == 0)) | |
.boxed().collect(Collectors.toList()); | |
System.out.println(primeNumbers); | |
Integer sumOfPrimes = IntStream.range(start, end).filter( | |
number -> number > 1 && IntStream.range(2, number - 1).noneMatch(divider -> number % divider == 0)) | |
.reduce(0, (a, b) -> a + b); |
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
/** | |
* @author Nadeem Mohammad | |
*/ | |
public class RestUrl { | |
private String url; | |
private RestUrl(String url) { | |
this.url = url; | |
} |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.demo.app</groupId> | |
<artifactId>demo-app</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<properties> | |
<version.maven-install-plugin>2.5.2</version.maven-install-plugin> | |
<version.non-maven1>1.0.0</version.non-maven1> |
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.io.Serializable; | |
import java.util.Date; | |
import java.util.concurrent.TimeUnit; | |
public final class FixdedDelayJobData implements Serializable { | |
private static final long serialVersionUID = 1L; | |
private long delay; | |
private TimeUnit delayUnit; |
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 static org.quartz.TriggerBuilder.newTrigger; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.List; | |
import org.quartz.JobDataMap; | |
import org.quartz.JobDetail; | |
import org.quartz.JobExecutionContext; | |
import org.quartz.JobExecutionException; |
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.Collection; | |
import java.util.Iterator; | |
import java.util.concurrent.LinkedTransferQueue; | |
import java.util.concurrent.RejectedExecutionException; | |
import java.util.concurrent.RejectedExecutionHandler; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TransferQueue; | |
public final class ScalingThreadPoolExecutor extends ThreadPoolExecutor { |
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.Collection; | |
import java.util.Iterator; | |
import java.util.concurrent.LinkedTransferQueue; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TransferQueue; | |
import java.util.concurrent.locks.ReentrantLock; | |
public final class ScalableThreadPoolExecutor extends ThreadPoolExecutor { |
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:\Users\Nadeem>gpg --list-keys | |
gpg: checking the trustdb | |
gpg: marginals needed: 3 completes needed: 1 trust model: pgp | |
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u | |
C:/Users/Nadeem/AppData/Roaming/gnupg/pubring.kbx | |
------------------------------------------------- | |
pub rsa2048 2016-08-29 [SC] | |
5694AA563793429557F1727835B3BD2A223A | |
uid [ultimate] Nadeem Mohammad <[email protected]> | |
sub rsa2048 2016-08-29 [E] |
NewerOlder