An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
# custom IntelliJ IDEA VM options | |
# only apply for IntelliJ use JDK8, not JDK11 | |
-server | |
-Xms2048m | |
-Xmx2048m | |
-XX:NewSize=512m | |
-XX:MaxNewSize=512m | |
-XX:ParallelGCThreads=4 | |
-XX:MaxTenuringThreshold=1 |
package com.waruna.xhris.sppdservice.model; | |
import com.fasterxml.jackson.annotation.JsonIdentityInfo; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.annotation.ObjectIdGenerators; | |
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
import com.waruna.xhris.sppdservice.helper.staticdata.DocumentState; | |
import com.waruna.xhris.sppdservice.helper.staticdata.ImpositionType; | |
import com.waruna.xhris.sppdservice.model.deserializer.SppdEmpDeserializer; |
public final class DoubleCheckLockingSingleton { | |
private static volatile DummyService instance; | |
// to protect class from being new instance from outside of class | |
private DoubleCheckLockingSingleton() { | |
} | |
// singleton static method that use double check locking | |
// method are unable to overide |
/** | |
* Fibonacci Naive Recursive vs Memoization Recursive vs Bottom-Up | |
* | |
* This class is to compare the performance result of simple common recursive | |
* use case "The Fibonacci". One is use Naive Recursive algorithm, second is use | |
* Dynamic programming Memoization algorithm, and bottom-up. | |
* | |
* The function is to calculate Fibonacci position N, then return the value. | |
* | |
* @author Maikel Chandika ([email protected]) |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
/** | |
* | |
* @author Maikel Chandika ([email protected]) | |
* | |
* Java Array Window Sliding Average. | |
* With O(n) time complexity. |
/** | |
* | |
* @author Maikel Chandika ([email protected]) | |
*/ | |
public class NextSmallerNumber2 { | |
public static void main(String[] args) { | |
System.out.println(nextSmaller(21)); //12 | |
System.out.println(nextSmaller(531)); //513 | |
System.out.println(nextSmaller(907)); //790 |
package algorithms.streams; | |
import java.math.BigInteger; | |
import java.util.stream.Stream; | |
/** | |
* | |
* @author Maikel Chandika ([email protected]) | |
* | |
* to calculate Fibonacci n position with Java 8 Stream API. |
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output
import java.util.Scanner; | |
public class MikeCoffee { | |
static String member, pengorder; | |
static Order[] orders; | |
public static void main(String[] args) { | |
Scanner entry = new Scanner(System.in); |
public class Paket { | |
String deskripsi; | |
boolean fragile; | |
double berat; | |
double total; | |
} |