Saturday, May 17, 2014

Visualize This. Ch. 2 - Switch Between Data Formats

Here are more fixed codes for Chapter 2. I use Python 3.4.0 with BeautifulSoup 4.3.2.

1. CSV to XML
import csv
reader = csv.reader(open('wunder-data.txt', 'r'), delimiter = ',')

f = open('wunder-data.xml','w')
f.write("\n")

for row in reader:
 f.write("\t\n")
 f.write("\t\t" + row[0] + "\n")
 f.write("\t\t" + row[1] + "\n")
 f.write("\t\n")
 
f.write("")

f.close()

Wednesday, May 14, 2014

Karatsuba Algorithm

This is a C code implementing Karatsuba Algorithm for integer multiplications using recursive function calls that I programmed while taking "Algorithms: Design and Analysis, Part 1" courses from free Stanford online course provided at Coursera. It's been a while since I used C, but this is a good start to stir up my old memories and get into the world of Algorithms.

Tuesday, May 13, 2014

Social Physics - Alex Pentland

I'm taking the FREE web course Social Physics from edX. The lecture itself has just 3 to 5 mins of introduction to the professor's book chapters, but the additional videos coming along tell very interesting ideas, or business ideas if you will. It's worth seeing those videos just to get a glimpse on how MIT Media Lab spin-offs started with this line of ideas and what kinds of researches they are doing.


I even ordered this book from Amazon. I was personally very interested in how this new flow of ideas of 'Social Physics' work out and how human behaviors can be modeled in a rigorous mathematical way. I later found out though there are many negative reviews saying it has nothing new in it nor little maths, I'll give a shot and get some ideas out of it. I should've read the reviews before clicking the order button.

Sunday, May 11, 2014

Visualize This. Ch. 2 - Data Scraping

Since the book is written in 2011, parts of Python codes in the book are no longer working in my environment (Python 3.4.0 with BeautifulSoup 4.3.2). I had to go line by line and do a log of googling to figure out what has been changed and what to do for those changes. This is for my future reference, and hopefully others can find this helpful when they study with this book.
import urllib2 urllib.request
from BeautifulSoup bs4 import BeautifulSoup
print "Getting data for" + timestamp ("Getting data for " + timestamp)
page = urllib2.urlopen(url) urllib.request.urlopen(url)
dayTemp = soup.findAll(attrs={"class":"nobr wx-value"})[5 1].span.string
It works like a charm!

Wednesday, April 9, 2014

Tuesday, April 1, 2014

00. First Gundam

동생결혼때 한국 잠시 들렸다가 그동안 생각만 해오던 건담을 구입! 처음이니깐 MG 로ㅋ

RX-78-2 GUNDAM MG Ver. 3.0
다 조립하는데 얼마나 걸릴까..ㄷㄷㄷ