scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K
scph5500.bin 26-Aug-2018 20:47 512.0K
scph5501.bin 26-Aug-2018 20:47 512.0K
scph5502.bin 26-Aug-2018 20:47 512.0K
// Sampled Logs with 10% logging | |
import ( | |
"go.uber.org/zap" | |
"go.uber.org/zap/zapcore" | |
) | |
func main() { | |
logger, _ := zap.NewProduction() | |
sampled := zap.WrapCore(func(c zapcore.Core) zapcore.Core { |
Given a 2d grid map of '1'
s (land) and '0'
s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Input: grid = [
["1","1","1","1","0"],
["1","1","0","1","0"],
docker-compose run --service-ports prometheus_demo |
version: '3' | |
services: | |
prometheus_demo: | |
build: . | |
ports: | |
- "9100:9100" | |
- "9090:9090" | |
- "3000:3000" | |
- "9093:9093" |
FROM ubuntu:bionic | |
MAINTAINER Arindam Paul, [email protected] | |
RUN apt-get update \ | |
&& apt-get install -y wget \ | |
&& apt-get install -y screen \ | |
&& apt-get install -y vim | |
WORKDIR /root | |
RUN wget -nv https://github.com/prometheus/prometheus/releases/download/v2.18.0/prometheus-2.18.0.linux-amd64.tar.gz |
interface CustomerProvider { | |
List<String> getPersonalRecomendations(final String customerId) throws IOException,IllegalArgumentException; | |
} | |
interface GenericSuggestionProvider { | |
List<String> getGeneralRecomendations() throws IOException; | |
} | |
interface CacheSuggestionProvider { | |
List<String> getCachedRecomendations(); |
// = Success(result) or Failure(exception) | |
Try<Integer> divide(Integer dividend, Integer divisor) { | |
return Try.of(() -> dividend / divisor); | |
} | |
@Test | |
public void createTry() { | |
System.out.println(divide(10,2)); | |
System.out.println(divide(10,0)); | |
} |
// = Right(result) or Left(exception) | |
Either<Exception, Integer> divideEither(Integer dividend, Integer divisor) { | |
try { | |
return Either.right(dividend / divisor); | |
} catch (Exception e) { | |
return Either.left(e); | |
} | |
} | |
@Test |
// = Right(result) or Left(exception) | |
Either<Exception, Integer> divideEither(Integer dividend, Integer divisor) { | |
return Either.right(dividend / divisor); | |
} | |
@Test | |
public void createEither() { | |
System.out.println(divideEither(10,2)); | |
System.out.println(divideEither(10,0)); | |
} |