This file contains 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 send_email( gmail_user, gmail_pwd, mail_from, mail_to, title, message ): | |
import smtplib | |
# Prepare actual message | |
message = """\From: %s\nTo: %s\nSubject: %s\n\n%s | |
""" % (mail_from, ", ".join(mail_to), title, message) | |
try: | |
#server = smtplib.SMTP(SERVER) | |
server = smtplib.SMTP("smtp.gmail.com", 587) #or port 465 doesn't seem to work! | |
server.ehlo() |
This file contains 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 datalibs import app | |
import unittest | |
class AppViewTestCase(unittest.TestCase): | |
def setUp(self): | |
app.config['TESTING'] = True | |
self.app = app.test_client() | |
def tearDown(self): |
This file contains 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 urllib2 | |
from datalibs import app | |
import unittest | |
from flask import Flask | |
from flask.ext.testing import LiveServerTestCase | |
class MyTest(LiveServerTestCase): | |
def create_app(self): | |
app.config['TESTING'] = True |
This file contains 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 pyspark import SparkContext | |
from subprocess import call, check_output | |
import numpy as np #Spark has numpy for python. | |
def run(sc): | |
data = [np.arange(0, 99), np.arange(100, 200) ] | |
distData=sc.parallelize(data) | |
sc.addFile("/master/sum_of_numbers") |
This file contains 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
tesseract --tessdata-dir ./ ./TestSet2/name.png name -l kor -psm 8 | |
tesseract --tessdata-dir ./ ./TestSet2/id_number.png id_number -l kor -psm 8 | |
tesseract --tessdata-dir ./ ./TestSet2/address.png address -l kor -psm 6 | |
tesseract --tessdata-dir ./ ./TestSet2/printed_date.png printed_date -l kor -psm 3 | |
tesseract --tessdata-dir ./ target.png -l kor -psm 0 |
This file contains 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 tensorflow as tf | |
x1_data = [1, 0, 3, 0, 5] | |
x2_data = [0, 2, 0, 4, 0] | |
y_data = [1, 2, 3, 4, 5] | |
W1 = tf.Variable(tf.random_uniform([1], -1.0, 1.0) ) | |
W2 = tf.Variable(tf.random_uniform([1], -1.0, 1.0) ) | |
b = tf.Variable(tf.random_uniform([1], -1.0, 1.0) ) |
This file contains 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 UnityEngine; | |
using System.Collections; | |
using System.Runtime.InteropServices; | |
public class imageProcessing : MonoBehaviour { | |
[DllImport ("__Internal")] | |
private static extern void UpdateTexture(System.IntPtr colors, int width, int height); | |
WebCamTexture webcamTexture; | |
Texture2D texture = null; |
This file contains 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 aiohttp import web | |
import json | |
async def index(request): | |
return web.Response(text='Hello Aiohttp!') | |
async def post_todo(request): | |
body = await request.json() | |
return web.Response(body=json.dumps(body).encode('utf-8')) |
This file contains 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
curl http://192.168.100.155:9000/api/v1/transactions/result?hash=03aaafbf3dc8bc4b7e78f0ec1153722957b2d3a58366dbe6f364a6930650e21b&channel=nia_kyobo_claim | |
curl http::localhost:9000/api/v1/transactions/result?hash=03aaafbf3dc8bc4b7e78f0ec1153722957b2d3a58366dbe6f364a6930650e21b&channel=nia_kyobo_claim | |
asdasd |
This file contains 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 | |
set +x | |
# Setup all of the pyenvs | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
export CONFIGURE_OPTS='--enable-shared' | |
eval "$(pyenv init -)" | |
pyenv shell 2.7.5 | |
pyenv virtualenvwrapper | |
pyenv rehash |
OlderNewer