Skip to content

Instantly share code, notes, and snippets.

View wikibook's full-sized avatar

위키북스 wikibook

View GitHub Profile
@wikibook
wikibook / MyWritableComparable.java
Created February 25, 2014 05:15
시작하세요! 하둡 프로그래밍 예제 4.3
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.apache.hadoop.io.WritableComparable;
public class MyWritableComparable implements WritableComparable<MyWritableComparable> {
private Integer counter;
private Long timestamp;
@wikibook
wikibook / print_ext.py
Created September 22, 2014 04:46
파일 확장자 출력
print '~/python/one-liners.py'.split('.')[-1]
@wikibook
wikibook / saveastiff.vbs
Last active August 29, 2015 14:13
파일 내 모든 비지오 다이어그램을 TIFF 파일로 저장
Sub SaveAsTIFF()
Dim folder As String, filename As String
Dim doc As Visio.Document
Dim pg As Visio.Page
Dim i As Integer
Dim formatExtension As String
'// Init folder, doc and counter:
folder = ThisDocument.Path
formatExtension = ".tif"
@wikibook
wikibook / DropBoxPublicURLGenerator.java
Last active December 31, 2015 08:19
드롭박스에서 파일에 대한 직접 다운로드 링크 생성하기
DbxEntry.WithChildren listing = dbxClient.getMetadataWithChildren("/");
if (listing.entry instanceof DbxEntry.Folder) {
for (DbxEntry child : listing.children) {
String shareableUrl = dbxClient.createShareableUrl(child.path);
shareableUrl = shareableUrl.replace("www.dropbox.com", "dl.dropboxusercontent.com");
System.out.println(shareableUrl);
}
}
@wikibook
wikibook / linux-commands.sh
Created December 14, 2013 14:33
자주 쓰는 리눅스 명령어
# scp를 이용한 파일 전송
scp -r [local file] id@host:[target directory]
# 크기가 0바이트 이상인 pdf 파일을 찾아 대상 디렉터리로 복사하기
find . -type f -size +0 -iname '*.pdf' -exec cp {} ~/pdf \;
# MySQL 백업
mysqldump -u [id] -p [password] [database] > [filename].sql
# MySQL 복원
@wikibook
wikibook / redirect.jsp
Created December 14, 2013 14:33
JSP 페이지 리디렉션 코드
<%
String url = "http://wikibook.github.io/learnlayout/";
response.setStatus(response.SC_MOVED_PERMANENTLY);
response.setHeader("Location", url);
%>
@wikibook
wikibook / GoogleDrivePublicURLGenerator.java
Created December 14, 2013 14:31
구글 드라이브에서 특정 디렉터리에 들어 있는 파일에 대한 직접 다운로드 링크 생성하기
java.io.File dir = new java.io.File("<path>");
for (java.io.File f : dir.listFiles()) {
String name = f.getName();
File body = new File();
body.setTitle(name);
body.setMimeType("<mimetype>");
FileContent mediaContent = new FileContent("<mimetype>", f);
File file = service.files().insert(body, mediaContent).execute();
from pathlib import Path
from pathlib import Path
input_folder = 'C:/myPyExcel/data/ch07/sales_data/input' # 원본 데이터 폴더
raw_data_dir = Path(input_folder)
excel_files = raw_data_dir.glob('상반기_제품_판매량_*') # 폴더 내 데이터 파일 이름
for excel_file in excel_files:
print(excel_file) # 원본 데이터 파일 경로 출력
input_folder = 'C:/myPyExcel/data/ch07/sales_data/input'