Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.util.stream.Collectors; | |
/** | |
* TransactionType enum as an example. | |
* In your challenge environment, this might be pre-defined. | |
*/ | |
enum TransactionType { | |
P2P, | |
P2M, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
import time | |
import random | |
import asyncio | |
def async_retry(max_retries=3, start_delay=2, backoff_factor=2, exceptions=(Exception,)): | |
"""Retry decorator for async functions with exponential backoff.""" | |
def decorator(func): | |
@functools.wraps(func) | |
async def wrapper(*args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import aiohttp | |
import random | |
from bs4 import BeautifulSoup | |
class AsyncScraper: | |
def __init__(self, max_concurrency=20): | |
self.semaphore = asyncio.Semaphore(max_concurrency) | |
self.user_agents = [ | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# clearly makes git better | |
[column] | |
ui = auto | |
[branch] | |
sort = -committerdate | |
[tag] | |
sort = version:refname | |
[init] | |
defaultBranch = main | |
[diff] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LRUCache { | |
private int capacity; | |
private Map<Integer, Integer> cache; | |
private LinkedHashMap<Integer, Long> accessTime; | |
public LRUCache(int capacity) { | |
this.capacity = capacity; | |
this.cache = new HashMap<>(); | |
this.accessTime = new LinkedHashMap<>(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def permuteUnique(nums): | |
def backtrack(path, used): | |
if len(path) == len(nums): | |
result.append(path[:]) | |
return | |
for i in range(len(nums)): | |
if used[i]: | |
continue | |
# Skip duplicates | |
if i > 0 and nums[i] == nums[i - 1] and not used[i - 1]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Xms1g -Xmx2g -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintMemoryMapAtExit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
shutdown: graceful | |
compression: | |
enabled: true | |
port: 8080 | |
address: localhost | |
error: | |
include-binding-errors: ALWAYS | |
include-exception: true | |
include-message: ALWAYS |
NewerOlder