Skip to content

Instantly share code, notes, and snippets.

View developer-sdk's full-sized avatar
Finding...

hs_seo developer-sdk

Finding...
View GitHub Profile
@developer-sdk
developer-sdk / Problem1922.java
Created April 20, 2018 13:40
백준,1922,프림알고리즘
package sdk.backjun.graph;
import java.util.LinkedList;
import java.util.Scanner;
/**
* 백준, 1922
* MST 최소 스패닝 트리, 프림 알고리즘
*
* @author whitebeard-k
@developer-sdk
developer-sdk / Problem2606.java
Created April 20, 2018 13:59
백준,2606, 바이러스, 유니온파인드
package sdk.backjun.graph;
import java.util.Scanner;
/**
* 백준, 2606
* 바이러스
* 유니온 파인드로 해결
*
* @author whitebeard-k
@developer-sdk
developer-sdk / rename_file.py
Created April 24, 2018 12:41
python 디렉토리의 파일명 변경하기, rename files
# -*- coding: utf-8 -*-
import sys
from os import rename, listdir
# 현재 위치의 파일 목록
files = listdir('.')
# 파일명에 번호 추가하기
count = 0
for name in files:
@developer-sdk
developer-sdk / Problem11060.java
Created May 14, 2018 14:01
백준, 11060, 점프점프, 다이나믹 프로그래밍
import java.util.Arrays;
import java.util.Scanner;
/**
* 백준, 점프 점프, 11060
* 다이나믹 프로그래밍
*
* @author whitebeard-k
*
*/
@developer-sdk
developer-sdk / open_file.py
Created May 14, 2018 14:02
file open and read all line
#!/usr/bin/python
with open('파일명', 'r') as f:
for line in f:
print(line)
@developer-sdk
developer-sdk / class_attr.py
Last active May 14, 2018 14:06
파이썬 attribute 예제
#!/usr/bin/python
class God():
def __init__(self):
self.race = "God"
self.age = 1000
self.name = 'Zeus'
class Person():
def __init__(self):
@developer-sdk
developer-sdk / class_inheright.py
Last active May 14, 2018 14:09
파이썬 클래스 상속, 메소드 오버라이딩
#!/usr/bin/python
# -*- coding: utf-8 -*-
class Info():
def __init__(self, name):
self.name = '상품명: ' + name
def __str__(self):
return self.name
@developer-sdk
developer-sdk / str_datetime_list_01.py
Created May 15, 2018 14:14
yyyymmdd 형태의 일자를 반환하는 파이썬 코드조각
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
# 20180501 부터 오늘까지 반환
# yyyymmdd 일자를 datetime 객체로 변환
start_date = datetime.strptime('20180501', '%Y%m%d')
end_date = datetime.today()
@developer-sdk
developer-sdk / ThreadExample1.java
Created June 4, 2018 07:16
java thread, ExecutorSerivce example
/**
* Runnable을 상속한 스레드 예제
*
* @author User
*
*/
public class ThreadExample1 implements Runnable {
@Override
public void run() {
@developer-sdk
developer-sdk / scala-spark-pom.xml
Created June 12, 2018 14:08
scala, spark 설정을 위한 메이븐 설정파일
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ScalaExample</groupId>
<artifactId>ScalaExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>