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
# Client | |
from multiprocessing.connection import Client | |
address = ('localhost', 6000) | |
conn = Client(address) | |
conn.send('test') |
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 socket import * | |
s_socket = socket(AF_INET, SOCK_STREAM) | |
s_socket.connect(("localhost", 6000)) | |
while (True): | |
s_socket.send('Test\n'.encode()) |
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 selenium import webdriver | |
#browser = webdriver.Firefox() | |
browser = webdriver.Chrome() | |
browser.get("http://movie.naver.com/movie/bi/pi/filmo.nhn?code=71351") | |
browser.switch_to.frame("filmoContentsIframe"); | |
browser.find_elements_by_css_selector('#filmoOrder')[0].click() | |
menus = browser.find_elements_by_css_selector('#filmoOrderLayer ul li a') |
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
// ReadBMjuP.cpp : Defines the entry point for the console application. | |
// | |
#include <iostream> | |
#include <vector> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <algorithm> | |
#include <list> |
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
package main | |
import ( | |
"fmt" | |
) | |
type result struct { | |
src_text string | |
result_sz string | |
is_done bool |
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 operator | |
# https://docs.python.org/3/library/operator.html | |
myOp = operator.and_ | |
print bool( myOp(myOp(3==3,1==1), myOp(2==2, 1==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
import collections.abc | |
class CustomData(): | |
def __init__(self, iterable): | |
self.value = [] | |
for value in iterable: | |
self.value.append(value) | |
def __eq__(self, value): | |
ret = [] | |
for v in self.value: |
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 datetime as dt | |
today = dt.datetime.now() | |
days_in_the_year = (dt.date(today.year, today.month, today.day) - dt.date(today.year,1,1)).days + 1 | |
print(days_in_the_year) |
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 OrderedDict, Counter | |
import pprint | |
def main(): | |
dict_data = { | |
'list_1':[1, 2, 3, 4, 5, 6], | |
'list_2':[1, 5, 6, 7, 8, 9], | |
'list_3':[10, 11, 12, 13, 14, 15], | |
'list_4':[132, 14, 134, 135, 136, 137], | |
'list_5':[232, 214, 224, 235, 236, 237], |
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 pandas as pd | |
import numpy as np | |
from sqlalchemy import create_engine | |
engine = create_engine('sqlite:///:memory:') | |
n=9999 | |
df = pd.DataFrame(np.random.randn(n, 2)) | |
df.columns = ['a','b'] | |
df = df.astype('float32') | |
df.to_sql('data_chunked', con=engine, chunksize=(499), index=None) |
OlderNewer