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 sdk.whitebeard; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import org.jsoup.Jsoup; | |
| import org.jsoup.nodes.Document; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.Elements; |
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/python | |
| # -*- coding:utf-8 -*- | |
| # mylist 는 iterable 하다. | |
| print 'mylist 는 iterable 하다.' | |
| mylist =[1, 2, 4] | |
| for i in mylist: | |
| print i | |
| # Generator | |
| print 'Generator 샘플' |
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 java.util.List; | |
| import org.apache.hadoop.hive.ql.exec.Description; | |
| import org.apache.hadoop.hive.ql.exec.UDFArgumentException; | |
| import org.apache.hadoop.hive.ql.exec.UDFArgumentLengthException; | |
| import org.apache.hadoop.hive.ql.metadata.HiveException; | |
| import org.apache.hadoop.hive.ql.udf.generic.GenericUDF; | |
| import org.apache.hadoop.hive.serde2.lazy.LazyString; | |
| import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector; | |
| import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; |
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.hive.ql.exec.UDFArgumentTypeException; | |
| import org.apache.hadoop.hive.ql.metadata.HiveException; | |
| import org.apache.hadoop.hive.ql.parse.SemanticException; | |
| import org.apache.hadoop.hive.ql.udf.generic.AbstractGenericUDAFResolver; | |
| import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFEvaluator; | |
| import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; | |
| import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector; | |
| import org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector.PrimitiveCategory; | |
| import org.apache.hadoop.hive.serde2.objectinspector.primitive.IntObjectInspector; | |
| import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; |
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
| -- STR_TO_MAP 사용법 | |
| SELECT STR_TO_MAP("key1: value1, key2: value2, key3: value3", list_delimiter, key_value_delimiter); | |
| -- example #1 | |
| hive> SELECT STR_TO_MAP("key1: value1, key2: value2, key3: value3", ",", ":"); | |
| OK | |
| {"key1":" value1"," key3":" value3"," key2":" value2"} | |
| Time taken: 0.049 seconds, Fetched: 1 row(s) | |
| -- json string to map |
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
| #!/bin/python | |
| # -*- coding:utf-8 -*- | |
| ''' | |
| 방법6이 가장 효율적인 방법이나, | |
| 메모리 사용량은 방법4가 가장 효율적이고, | |
| 문자열에 조작을 해야 하는 경우라면 방법4가 가장 효율적이다. | |
| ''' | |
| # 방법1: + 를 이용한 연결 | |
| def method1(): |
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 sdk.algo.dynamic; | |
| import java.util.Scanner; | |
| /** | |
| * 정올, 다이나믹 프로그래맹, 1848 | |
| * | |
| * @author whitebeard-k | |
| * | |
| */ |
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 sdk.algo.shortdist; | |
| import java.util.LinkedList; | |
| import java.util.Queue; | |
| import java.util.Scanner; | |
| /** | |
| * 정올, 알고리즘, 최단거리, 1108 | |
| * 페이지 전환 | |
| * |
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
| -- 테이블 생성 | |
| CREATE TABLE complex_type_table | |
| ( | |
| user_id BIGINT, | |
| new_item ARRAY<STRUCT<product_id:BIGINT, product_name:STRING, timestamps:STRING>> | |
| ) | |
| ROW FORMAT DELIMITED | |
| FIELDS TERMINATED BY '\t' | |
| COLLECTION ITEMS TERMINATED BY ',' | |
| MAP KEYS TERMINATED BY '=' |
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 sdk.algo.dynamic; | |
| import java.util.Scanner; | |
| /** | |
| * 정올, 1407, 다이나믹 | |
| * 숫자카드 | |
| * | |
| * @author whitebeard-k | |
| * |