Model Relations
Relations are logical links which define how models are connected with each other. A document of a model can be connected to one or more documents of the same or another model.
Relations are logical links which define how models are connected with each other. A document of a model can be connected to one or more documents of the same or another model.
Crypto Compare is a website and API provider which brings you all the latest streaming pricing data in the world of cryptocurrencies. Their API documentation is available here.
It is an NPM module that converts complex JSON with arrays and nested objects into URL parameters or query string. It can also parse such query string back to JSON.
/* Solution to HackerRank: Divisible Sum Pairs
* URL: https://www.hackerrank.com/challenges/divisible-sum-pairs
*/
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
// Complete the divisibleSumPairs function below.
static int divisibleSumPairs(int n, int k, int[] ar) {
int count = 0;
for(int i=0; i < n; i++){
for(int j=i+1; j < n; j++){
if((ar[i]+ar[j])%k == 0){
count++;
}
}
}
return count;
}
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) throws IOException {
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
String[] nk = scanner.nextLine().split(" ");
int n = Integer.parseInt(nk[0]);
int k = Integer.parseInt(nk[1]);
int[] ar = new int[n];
String[] arItems = scanner.nextLine().split(" ");
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
for (int i = 0; i < n; i++) {
int arItem = Integer.parseInt(arItems[i]);
ar[i] = arItem;
}
int result = divisibleSumPairs(n, k, ar);
bufferedWriter.write(String.valueOf(result));
bufferedWriter.newLine();
bufferedWriter.close();
scanner.close();
}
}
/* Solution to HackerRank: The Time in Words
* URL: https://www.hackerrank.com/challenges/the-time-in-words
*/
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
// Complete the timeInWords function below.
static String timeInWords(int h, int m) {
String[] words = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty"};
if (m == 0){
return words[h] + " o' clock";
} else if (m == 15){
return "quarter past " + words[h];
} else if (m == 30){
return "half past " + words[h];
} else if (m == 45){
return "quarter to " + words[h+1];
} else if (m == 1){
return "one minute past " + words[h];
} else if (m == 59){
return "one minute to " + words[h+1];
} else if (m < 21){
return words[m] + " minutes past " + words[h];
} else if (m > 39){
return words[60-m] + " minutes to " + words[h+1];
} else if (m > 30){
return "twenty " + words[(60-m)%20] + " minutes to " + words[h+1];
}
else{
return "twenty " + words[m%20] + " minutes past " + words[h];
}
}
private static final Scanner scanner = new Scanner(System.in);
public static void main(String[] args) throws IOException {
BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH")));
int h = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
int m = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
String result = timeInWords(h, m);
bufferedWriter.write(result);
bufferedWriter.newLine();
bufferedWriter.close();
scanner.close();
}
}
nvm ls-remote
nvm install v10.6.0
nvm use v10.6.0
node --version
npm install -g @angular/cli
my-project
(you can use any name you need)ng new my-project
cd my-project
start
script in package.json
{
...
"scripts": {
...
"start": "ng serve --host $IP --port $PORT --public-host $C9_HOSTNAME",
...
}
...
}
Preview > Preview Running Application
to get the preview URL.Everything works perfectly expect that the live reload, sometimes, is slower than usual.
Glitch is a online workspace that support javascript for development with live previews.
Proxy settings can be changed in {{maven_installation_folder}}/conf/settings.xml
. Un-comment and change the values in proxies
section of the file. Changes to this file doesn’t require maven restart.
Create two folders named project.git
and project.source
. Create a bare git repo in project.git