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
| const URL = 'http://localhost:7003/embed/'; | |
| const PAYLOAD = JSON.stringify({ sentences: ['Hello World!'] }); | |
| const HEADERS = { 'Content-Type': 'application/json' }; | |
| const CONCURRENT_REQUESTS = 10; // ๋์ ์์ฒญ ๊ฐ์ | |
| const TOTAL_REQUESTS = 100; // ์ด ์์ฒญ ๊ฐ์ | |
| async function measureLatency() { | |
| let times = []; | |
| for (let i = 0; i < TOTAL_REQUESTS; i++) { | |
| let start = performance.now(); |
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 { google } from 'googleapis'; | |
| import * as fs from 'fs'; | |
| function authGoogleApi() { | |
| let auth = new google.auth.GoogleAuth({ | |
| keyFile: './service-account.json', | |
| scopes: [ | |
| 'https://www.googleapis.com/auth/drive.readonly', | |
| ], | |
| }); |
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 os | |
| from os import walk | |
| list_file = "img_paths.txt" | |
| for (_, _, filenames) in walk("img"): | |
| with open(list_file, "w") as f: | |
| f.writelines(map(lambda name: f"file img/{name}\n", filenames)) | |
| break |
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 urllib.request | |
| from datetime import datetime, timedelta | |
| import time | |
| tm = datetime(2020, 8, 5, 22, 00) # ์ด ์์ ๋ถํฐ ๊ณผ๊ฑฐ๋ก ๊ฐ๋ฉด์ ์ป์. | |
| while True: | |
| tm_str = tm.strftime("%Y%m%d%H%M") | |
| url = f"https://www.weather.go.kr/w/cgi-bin/rdr_new/nph-rdr_sat_lgt_img_v3?tm={tm_str}&sat=ir1&rdr=lng&map=HC&size=640&zoom_level=0&zoom_x=0000000&zoom_y=0000000&fog=0" | |
| print(tm_str) | |
| try: |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Threading; | |
| using System.Net; | |
| using System.IO; | |
| using Google.Apis.Auth.OAuth2; | |
| using Newtonsoft.Json; |
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 requests | |
| import datetime | |
| head_len = 4 | |
| station_cnt = 265 # ์๋๋ s ํ์ผ์์ ์ป์ด์์ผํ ์ ๋ณด. | |
| time_offset = 1000 | |
| time = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(milliseconds=time_offset) | |
| bin_time = time.strftime('%Y%m%d%H%M%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
| use ggez::{ | |
| audio::{self, SoundSource}, | |
| conf::{WindowSetup, WindowMode}, | |
| error::GameError, | |
| event, graphics, | |
| input::keyboard, | |
| graphics::DrawParam, | |
| Context, GameResult, | |
| }; | |
| use rodio::Source; |
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::iter::FromIterator; | |
| /// A rule for repositioning characters in a string. | |
| struct Rule(Vec<usize>); | |
| impl Rule { | |
| /// Applies this rule to the input and returns the result. | |
| /// | |
| /// # Examples | |
| /// |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| using System.Threading.Tasks; | |
| using System.Threading; | |
| using System.Net.Http; | |
| using System.Net; | |
| using System.IO; |
NewerOlder