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
ES_URL="http://127.0.0.1/index-table/type/_search/?scroll=1m" | |
SCROLL_URL="http://127.0.0.1/_search/scroll" | |
headers = {'Content-Type': 'application/json; charset=utf-8'} | |
data = {"size": 100} | |
res = json.loads(requests.get(ES_URL, data=json.dumps(data), headers=headers).content) | |
scroll_data = {"scroll":"1m", "scroll_id" : res['_scroll_id']} | |
while(len(res) > 0): | |
res = json.loads(requests.get(SCROLL_URL, data=json.dumps(scroll_data), headers=headers).content) |
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
ES_URL ="http://127.0.0.1/index-table/type/_search" | |
headers = {'Content-Type': 'application/json; charset=utf-8'} | |
data = {"from": 0, "size": 100 } | |
res = requests.post(ES_URL, data=json.dumps(data), headers=headers).content | |
total = res['total'] | |
index = 0 | |
size = 100 | |
for i in range(0, total, size): |
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 tensorflow as tf | |
import numpy as np | |
data = np.loadtxt('../data/data.csv', delimiter=',', | |
unpack=True, dtype='float32') | |
x_data = np.transpose(data[0:2]) | |
y_data = np.transpose(data[2:]) | |
######### |
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 tensorflow as tf | |
import matplotlib | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib import font_manager, rc | |
print(font_manager.get_fontconfig_fonts()) | |
font_name = font_manager.FontProperties(fname="/usr/share/fonts/truetype/dejavu/gulim.ttf").get_name() | |
# matplot 에서 한글을 표시하기 위한 설정 | |
matplotlib.rc('font', family=font_name) |
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 tensorflow as tf | |
import numpy as np | |
x_data = np.array([[0, 0], [1, 0], [1, 1], [0, 0], [0, 0], [0, 1]]) | |
y_data = np.array([ | |
[1, 0, 0], # 기타 | |
[0, 1, 0], # 포유류 | |
[0, 0, 1], # 조류 | |
[1, 0, 0], | |
[1, 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
import tensorflow as tf | |
import numpy as np | |
x_data = np.array([[0, 0], [1, 0], [1, 1], [0, 0], [0, 0], [0, 1]]) | |
y_data = np.array([ | |
[1, 0, 0], # 기타 | |
[0, 1, 0], # 포유류 | |
[0, 0, 1], # 조류 | |
[1, 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
import org.apache.hadoop.util.bloom.BloomFilter; | |
import org.apache.hadoop.util.hash.Hash; | |
//bloomFilter 생성 | |
BloomFilter bloomFilters[] = new BloomFilter[1]; | |
bloomFilter[0] =BloomFilter(10000, 2, Hash.MURMUR_HASH); | |
String data = "apple"; | |
// data 넣기 | |
bloomFilter[0].add(new Key(data.getBytes())); |
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
try { | |
PackageInfo info = getPackageManager().getPackageInfo("com.yjw.android.busanbus", PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
String str = Base64.encodeToString(md.digest(), Base64.DEFAULT); | |
Log.d("KeyHash:", str); | |
Toast.makeText(this, str, Toast.LENGTH_LONG).show(); | |
} | |
}catch(NoSuchAlgorithmException e){ |
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
#!/usr/bin/env python | |
# coding: utf8 | |
"""Example of training spaCy's named entity recognizer, starting off with an | |
existing model or a blank model. | |
For more details, see the documentation: | |
* Training: https://spacy.io/usage/training | |
* NER: https://spacy.io/usage/linguistic-features#named-entities | |
Compatible with: spaCy v2.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
#!/usr/bin/env python | |
# coding: utf8 | |
"""Load vectors for a language trained using fastText | |
https://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md | |
Compatible with: spaCy v2.0.0+ | |
""" | |
from __future__ import unicode_literals | |
import plac | |
import numpy |
NewerOlder