ARG in Dockerfile
The
ARG
instruction defines a variable that users can pass at build-time to the builder with the docker build command using the--build-arg <varname>=<value>
flag. More details at docs.docker.com
The
ARG
instruction defines a variable that users can pass at build-time to the builder with the docker build command using the--build-arg <varname>=<value>
flag. More details at docs.docker.com
Enable
.GitInfo
object for each page (if the Hugo site is versioned by Git). This will then update theLastmod
parameter for each page using the last git commit date for that content file.
You can skip this section if you have not formatted the drive after connecting it to your computer and have the original partitions.
As Debian wheezy version has reached the end of life, the usual repositories do not exist anymore and have been moved to the archive.
npm install --save-dev eslint-plugin-import eslint
Use the base version for Node.js applications. They also publish a version for React applications as eslint-config-airbnb
.
Git stash is a great set of commands while working on volatile porjects where you are just trying out a proof of concept or a module.
While returning data from the database as an API response, the virtuals/methods available on a mongoose document are unnecessary. Lean option can be set on such queries to return just the data directly from the database. It also improves the overall performance of the API.
Spotinst is one of the providers which support deploying serverless functions or FaaS (Function as a Service). Serverless Framework is an NPM module which makes building serverless applications easy and open.
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int T = scan.nextInt();
for(int j=0;j<T;j++){
int N = scan.nextInt();
int K = scan.nextInt();
scan.nextLine();
char[] data = scan.nextLine().toCharArray();
int max = 0;
for(int i=0;i<N-K;i++){
int prod = getProduct(data,i,K);
if(prod>max){
max = prod;
}
}
System.out.println(max);
}
}
static int getProduct(char[] data, int start, int length){
int product = 1;
for(int i=start;i<start+length;i++){
product = product * Character.getNumericValue(data[i]);
}
return product;
}
}
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int numCases = scan.nextInt();
for(int index=0;index<numCases;index++){
long num = scan.nextInt()-1;
System.out.println(sumOfMultiples(num/3,3)+sumOfMultiples(num/5,5)-sumOfMultiples(num/15,15));
}
}
public static long sumOfMultiples(long num, long multiple){
return (multiple*num*(num+1))/2;
}
}