Keybase proof
I hereby claim:
- I am marccarre on github.
- I am marccarre (https://keybase.io/marccarre) on keybase.
- I have a public key whose fingerprint is E783 6CDE 2E42 F8FE 3847 0FBF 0626 58EF F69B 8B32
To claim this, I am signing this object:
#!/usr/bin/env python | |
''' | |
List all available versions of Kindle for Mac and Kindle for PC. | |
Dependencies: | |
- asyncio==3.4.3 | |
- aiohttp==3.6.3 | |
''' | |
import os | |
import sys |
#!/usr/bin/env python | |
''' | |
Usage: | |
./leetcode-ranking.py -c 198 marccarre Hydromail daisuke834 | |
2400 marccarre 96 | |
2895 Hydromail 116 | |
6666 daisuke834 267 | |
Prerequisites: | |
- pipenv install click==7.1.2 |
#!/usr/bin/env python | |
''' | |
Springer has released some ebooks freely in order to support learning during | |
these times of lockdown with the COVID-19 spreading. | |
Source: https://www.springernature.com/gp/librarians/news-events/all-news-articles/industry-news-initiatives/free-access-to-textbooks-for-institutions-affected-by-coronaviru/17855960 | |
A spreadsheet containing the URLs of all available books can be found on the | |
aforementioned page. These URLs have been hardcoded below. And this script | |
lets you download all books automatically. |
from __future__ import annotations # To allow "MinHeap.push -> MinHeap:" | |
from typing import Generic, List, Optional, TypeVar | |
from heapq import heapify, heappop, heappush, heapreplace | |
T = TypeVar('T') | |
class MinHeap(Generic[T]): | |
''' |
I hereby claim:
To claim this, I am signing this object:
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.ConcurrentMap; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.TimeUnit; | |
import static java.util.concurrent.TimeUnit.SECONDS; | |
public class AsynchronousLongComputeVsSlowStore { | |
private static final ConcurrentMap<Integer, Integer> store = new ConcurrentHashMap<>(); |
package com.marccarre; | |
import java.util.Arrays; | |
import java.util.Comparator; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.TimeUnit; | |
import java.util.stream.Stream; | |
import static java.util.concurrent.CompletableFuture.completedFuture; |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutionException; | |
public class AsynchronousExceptionsHandlingWithWhenComplete { | |
public static void main(final String[] args) throws InterruptedException, ExecutionException { | |
for (final boolean failure : new boolean[]{false, true}) { | |
CompletableFuture<Integer> x = CompletableFuture.supplyAsync(() -> { | |
if (failure) { | |
throw new RuntimeException("Oops, something went wrong"); |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutionException; | |
import static java.lang.String.format; | |
public class AsynchronousExceptionsHandlingWithHandle { | |
public static void main(final String[] args) throws InterruptedException, ExecutionException { | |
for (final boolean failure : new boolean[]{false, true}) { | |
CompletableFuture<Integer> x = CompletableFuture.supplyAsync(() -> { | |
if (failure) { |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutionException; | |
public class AsynchronousExceptionsHandlingWithExceptionally { | |
public static void main(final String[] args) throws InterruptedException, ExecutionException { | |
for (final boolean failure : new boolean[]{false, true}) { | |
CompletableFuture<Integer> x = CompletableFuture.supplyAsync(() -> { | |
if (failure) { | |
throw new RuntimeException("Oops, something went wrong"); |