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
// ConvertWGS84ToWCONGNAMUL converts coordinates from WGS84 to WCONGNAMUL. | |
func ConvertWGS84ToWCONGNAMUL(lat, long float64) WCONGNAMULCoord { | |
x, y := transformWGS84ToKoreaTM(6378137, 0.0033528106647474805, 500000, 200000, 1, 38, 127, lat, long) | |
x = math.Round(x * 2.5) | |
y = math.Round(y * 2.5) | |
return WCONGNAMULCoord{X: x, Y: y} | |
} | |
// transformWGS84ToKoreaTM conversion | |
func transformWGS84ToKoreaTM(d, e, h, f, c, l, m, lat, lon float64) (float64, float64) { |
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 re | |
import requests | |
import urllib3 | |
from selectolax.parser import HTMLParser | |
urllib3.disable_warnings() | |
def cleanup(tree): |
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
use std::collections::HashMap; | |
fn get_jongseong_index(jongseong: char) -> Option<u16> { | |
let jongseong_map: HashMap<char, u16> = [ | |
(' ', 0), ('ㄱ', 1), ('ㄲ', 2), ('ㄳ', 3), | |
('ㄴ', 4), ('ㄵ', 5), ('ㄶ', 6), ('ㄷ', 7), | |
('ㄹ', 8), ('ㄺ', 9), ('ㄻ', 10), ('ㄼ', 11), | |
('ㄽ', 12), ('ㄾ', 13), ('ㄿ', 14), ('ㅀ', 15), | |
('ㅁ', 16), ('ㅂ', 17), ('ㅄ', 18), ('ㅅ', 19), | |
('ㅆ', 20), ('ㅇ', 21), ('ㅈ', 22), ('ㅊ', 23), |
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
> python pdf.py -f 1.png 2.png 3.png | |
> python pdf.py -f 1.png 2.png -n outname |
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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
int main(int argc, char *argv[]) | |
{ | |
if (argc < 1) | |
return 0; | |
int i; |
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 smtplib | |
import time | |
from datetime import datetime | |
from email.mime.image import MIMEImage | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import requests | |
from bs4 import BeautifulSoup | |
from pytz import timezone |
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
bash -c ' \ | |
echo -e "\n\n=============\nWaiting for Kafka Connect to start listening on localhost\n=============\n" | |
while [ $(curl -s -o /dev/null -w %{http_code} http://localhost:8083/connectors) -ne 200 ] ; do | |
echo -e "\t" $(date) " Kafka Connect listener HTTP state: " $(curl -s -o /dev/null -w %{http_code} http://localhost:8083/connectors) | |
" (waiting for 200)" | |
sleep 5 | |
done | |
echo -e $(date) "\n----------\n\o/ Kafka Connect is ready! Listener HTTP state: " $(curl -s -o /dev/null -w %{http_code} http://localhost:8083/connectors) "\n----------\n" | |
' |
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 io import BytesIO | |
from fastavro import parse_schema, schemaless_reader, writer | |
# a data to send | |
message = { | |
"id": 10000, | |
"title": "[FastAVRO] title", | |
"date": "20.12.23", | |
"link": "https://somelink", |
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
heights = [0, 8, 0, 0, 5, 0, 0, 10, 0, 0, 1, 1, 0, 3] | |
"""Result | |
(0 for void, 1 for a pillar, 2 for water) | |
[[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], | |
[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], | |
[0, 1, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0], | |
[0, 1, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0], | |
[0, 1, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0], |
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 collections import defaultdict | |
UNVISITED = -1 | |
class Graph: | |
global UNVISITED | |
def __init__(self, vertices): | |
self.v = vertices |
NewerOlder