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.io.*; | |
import java.nio.file.*; | |
import java.util.concurrent.*; | |
public class CsvConcurrentProcessor { | |
static final int NUM_CONSUMERS = 4; | |
static final int QUEUE_CAPACITY = 1000; | |
static final BlockingQueue<String[]> queue = new LinkedBlockingQueue<>(QUEUE_CAPACITY); | |
static final String POISON_PILL = "__EOF__"; |
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
#!/bin/bash | |
status=$(curl -I $1 2>/dev/null | head -n 1 | cut -d$' ' -f2) | |
while [ $status -ne 200 ]; | |
do | |
echo ret is: [$status] | |
status=$(curl -I $1 2>/dev/null | head -n 1 | cut -d$' ' -f2) | |
done |
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
#!/bin/bash | |
free=$(df -h / | tail -n 1 | awk '{print $4}') | |
total=$(df -h / | tail -n 1 | awk '{print $2}') | |
use=$(df -h / | tail -n 1 | awk '{print $5}') | |
echo Free/Total memory: $free / $total | |
echo Percentage: $use | sed 's/%//' |
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
from dataclasses import dataclass | |
import random | |
@dataclass | |
class States: | |
start: str = "start" | |
gameover: str = "gameover" | |
next: str = "next" |
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 schedule | |
import time | |
""" | |
period interval | |
input-> 12:22 hours,... | |
input-> :22 seconds,... | |
input-> 12 minutes,... | |
""" |
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 schedule | |
import time | |
""" | |
period type | |
input-> 12:22 hours,... | |
input-> :22 seconds,... | |
input-> 12 minutes,... | |
""" |
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 schedule | |
import time | |
""" | |
period interval | |
input-> 12:22 hours,... | |
input-> :22 seconds,... | |
input-> 12 minutes,... | |
""" |