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
/** | |
Dependencies Used: | |
<dependencies> | |
<dependency> | |
<groupId>org.apache.httpcomponents</groupId> | |
<artifactId>httpclient</artifactId> | |
<version>4.5.3</version> | |
</dependency> | |
<dependency> | |
<groupId>org.json</groupId> |
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.math.BigInteger; | |
import java.text.NumberFormat; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
import java.util.stream.IntStream; | |
/** | |
* @author devendra.nalawade on 3/30/17 |
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.util.List; | |
import java.util.ArrayList; | |
/** | |
* @author devendra.nalawade on 2/14/17 | |
* output: | |
* Response for 0: Zero Dollar | |
* Response for 54: Fifty Four Dollars | |
* Response for 333: Three Hundred and Thirty Three Dollars | |
* Response for 5457: Five Thousand Four Hundred and Fifty Seven Dollars |
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
package test.concurrency; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
public class MissingWords { | |
public static void main(String[] args) { | |
String s = "I often wonder how good this Java World is..."; |
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
package test.concurrency; | |
import com.sun.tools.javac.util.Assert; | |
import java.util.Calendar; | |
import java.util.Date; | |
import java.util.concurrent.CompletableFuture; | |
/** | |
* @author devendra.nalawade on 1/11/17 |
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.util.concurrent.ScheduledThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.concurrent.locks.Condition; | |
import java.util.concurrent.locks.Lock; | |
import java.util.concurrent.locks.ReentrantLock; | |
public class BlockingResourcePool { | |
private final Lock OWN_LOCK = new ReentrantLock(); |
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.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.DisposableBean; | |
import org.springframework.beans.factory.InjectionPoint; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.AutoConfigureOrder; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Import; |