한글과 유니코드
유니코드에서 한글을 어떻게 다루는지를 정리하였다.
유니코드
- 유니코드(Unicode)는 전 세계의 모든 문자를 컴퓨터에서 일관되게 표현하고 다룰 수 있도록 설계된 산업 표준 (위키 백과)
- 단순히 문자마다 번호를 붙임
- 계속 업데이트되며 현재는 Unicode Version 9.0.0 이 최신이다.
UTF
- 유니코드를 실제 파일 등에 어떻게 기록할 것인지를 표준화한 것이다.
유니코드에서 한글을 어떻게 다루는지를 정리하였다.
#!/usr/bin/env python3 | |
# Copyright 2014 Brett Slatkin, Pearson Education Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
{0: 'tench, Tinca tinca', | |
1: 'goldfish, Carassius auratus', | |
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias', | |
3: 'tiger shark, Galeocerdo cuvieri', | |
4: 'hammerhead, hammerhead shark', | |
5: 'electric ray, crampfish, numbfish, torpedo', | |
6: 'stingray', | |
7: 'cock', | |
8: 'hen', | |
9: 'ostrich, Struthio camelus', |
# coding: utf-8 | |
""" | |
빅파이, 빅데이터를 위한 파이썬 | |
facebook.com/bigpython | |
이성주 seongjoo@codebasic.co | |
>>> print('테스트1', file=open('테스트1.txt', 'w')) | |
>>> print('테스트2', file=open('테스트2.txt', 'w')) | |
>>> 파일목록 = ['테스트1.txt', '테스트2.txt'] | |
>>> export_to_zip('test.zip', 파일목록) |
# coding: utf-8 | |
""" | |
주신 질문에 대한 해결책을 제안합니다. | |
빅파이: 빅데이터를 위한 파이썬 | |
www.facebook.com/bigpython | |
""" | |
import pandas as pd | |
from pandas import Series, DataFrame |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, int count){ | |
if(start >0 && before == 1 && count == 1){ | |
if(geocoderTask != null){ | |
gecoderTask.cancel(true); | |
} | |
geocodeTask = new GeocodeTask(); | |
} | |
} |
import urllib | |
import BeautifulSoup | |
data = urllib.urlopen('http://www.fdic.gov/bank/individual/failed/banklist.html') | |
soup = BeautifulSoup.BeautifulSoup(data) | |
banklist = soup.find('table', attrs={'class', 'sortable'}) |
#!/usr/bin/env python | |
import itertools | |
class Graph(dict): | |
def __init__(self, vs=[], es=[]): | |
"""create a new graph. (vs) is a list of vertices; | |
(es) is a list of edges.""" | |
for v in vs: | |
self.add_vertex(v) | |
public class MainActivity extends android.support.v4.app.FragmentActivity { | |
// Only one MapView instance is allowed per MapActivity, | |
// so we inflate it in the MainActivity and tie its | |
// lifetime here to the MainActivity. Package scope | |
// so we can grab them from different instances of map | |
// fragments. | |
// | |
// The other option was to make them static, but that causes | |
// memory leaks on screen rotation. | |
View mMapViewContainer; |
// ERROR! | |
void printArray(int arr[][]) | |
{ | |
for(int i=0; i<2; i++) | |
for(int j=0; j<3; j++) | |
cout << a[i][j] << " "; | |
cout << endl; | |
} |