My Avatar

Jun Li

Live it! Love it! Enjoy it!

Citi-Bike Data Analysis with Python

2016年11月14日 Monday

In my previous blog post Shell Programming, I give an example to illustrate how to use Shell to get data from the Internet and then do some simple data analysis. Nowadays, as Python which is a high level dynamic programming language is widely used in Data Science. I am also interested in it and want to use Python to deal with the data in Shell Programming.

Also, I want to introduce two communication tools which is helpful to organize your thoughts and identify your key points. Show how to clearly tell your audience why you did it and what you have done. This is very important when you finish a project and is going to give a presentation.


  • Python Basic
  • Communication Tool: Message Box and Story Arc
  • Simple Project: Citi-Bike Data Analysis
  • Reference

1.Python Basic


Git Command Summarization

2016年11月08日 Tuesday

Git is a free and open source distributed version control system. Today, I just want to summarize the most useful and common commands about git.


  • Git Initialization
  • Basic Git Workflow
  • Using Branches
  • Resolving Conflicts
  • Reference

1. Git Initialization

First, we need to configure our git client, especially when you use a new computer for the first time. This step will tell your computer who you are, and it is also convenient for a project with multiple contributors.


Shell Programming

2016年11月07日 Monday

Today, I want to summarize some useful shell programming for ease of reference. These are just some basic commands but I used to forget them and have to Google them over and over and over again.


  • Basic Bash Shell
  • Manipulate Output
  • Loops and Conditionals
  • Workig with Remote Server
  • Shell Scripts
  • A Simple Practice Task:Sort CitiBike Data
  • Reference

1. Basic Bash Shell

First, enter your “Terminal”. The most useful and common commands as follows:

  • jl7333@server:~$ : it shows my username(jl7333), hostname(server),my current working directory(~), showing that I am working as a normal(unprivileged) user($).

  • ls :list the contents of the directory you are in. (ls -l, ls -lt, ls -ltr, you can check using ls –help)

  • pwd :print working directory

  • mkdir directory_name :create a new directory inside our current directory

  • cd directory_name :change directory

  • cd :takes you to your home directory

  • cd .. :takes you to the one level higher directory

  • /home/jl7333 : using “/” can give us a full path

  • nano filename.txt :create a file, open it for editing. (ctrl+o to write, then “enter”,then ctrl+x to exit)

  • cat filename.txt :see the contents of a file, print the contents of the file to the terminal output

  • cp filename1.txt filename2.txt :copy a file from file1 to file2

  • mv filename1.txt mycopy.txt :move(or rename) a file

  • rm mycopy.txt :delete a file (Be very, very careful!)

  • echo :to print a quoted string to the terminal output

  • a=”hello world” :saving string in a variable, echo $a, will print “hello world”

  • history :see your command history all at once.

  • !1 :run a command that appears as number 1 in your history

2. Manipulate Output

First, we need to find some data for practice, for example: run


SVMLIB Introduction

2016年09月26日 Monday


Using Bayes Network for Genetic Inheritance

2016年08月05日 Friday

In my previous post SAMIAM Introduction, we have succeeded in helping the bank modele a simple Credit-worthness Predictor! That’s fabulous! Do you have the feeling that we have found a new world! I really appreciate my teacher, Prof.Chen, who taught me the course - Probability and Stochastic Process. He inspired my interest in Probability and I was the top 3 student in his class. This lays a strong foundation for PGM.

Task Description:

Today, we will continue our exploration in PGM. This time, we will help Genetic Counselors, Milly Osworth(NPC in the figure below), advise couples with a family history of a genetic disease. Specifically, we need to help couples decide whether to have a biological child or to adopt by assessing the probability that their unborn child will have the disease.


SAMIAM Introduction

2016年07月28日 Thursday

Recently I am interested in Probabilistic Grephfical Model(PGM). There is no related course in our school and I have to learn it by myself. Luckily I find some textbooks and online courses about PGM. The most important thing in PGM is Networks such as Bayes Network and Markov Network. So a network visualization software like SAMIAM is important for us to analyse our model intuitively.


  • SAMIAM Installation
  • A Simple example: Credit-worthiness Evaluation
  • Reference


Introduction and Installation of CUDA on Mac

2016年07月06日 Wednesday

“You can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in yourfuture. You have to trust in something – your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all the difference in my life.” —Steve Jobs

In this article I will write about parallel programming and CUDA. Also, I will talk about using OpenCV with CUDA which is important for image processing. Hope this article can help you and save your time. Note: This article is for CUDA beginners.


  • Configuration
  • Introduction of CUDA
  • Installation of CUDA on Mac OS X
  • OpenCV with CUDA
  • FAQ
  • Reference

1. Configuration

I use my Mac Pro as operating platform. The hardware&software environment and softwares I will install are as follows. You can verify that your system is CUDA-capable here CUDA-supported GPUs. If it is an NVIDIA card that is listed on the CUDA-supported GPUs page, your GPU is CUDA-capable.

1.1 Hardware environment

  • MacBook Pro (Retina, 15-inch, Mid 2014)
  • Processor : 2.5 GHz Intel Core i7
  • GPU : NVIDIA GeForce GT 750M

1.2 Software environment

  • OS X Yosemite version 10.10.5
  • Apple LLVM version 7.0.2 (clang-700.1.81)
  • Xcode Version 7.2.1 (7C1002)

1.3 Software installation

  • CUDA 7.5
  • OpenCV 3.1.0


Tour of the Intrepid Sea,Air&Space Museum

2016年06月25日 Saturday

Today I visit Intrepid Sea,Air&Space Museum with my friends. The tour is amazing! Actually I didn’t expect too much at first because of the bad customer experience in my previous museum tour. This gigantic museum really gives me a big surprise! I think this should be one of the must visiting place in NY.

You can actually board the authentic aircraft carrier and submarine, then explore inside! It is super clean and filled with history cool stuff which are all kept in their vintage pristine condition. Plenty of pictures,videos and exhibits to read and experience. If you have any questions, the friendly helpful staff will help you. And on the deck of the aircraft carrier, there are a large collection of battle planes such as F15,F16,Migs. So many awesome stuff that drives you to another world which is completely different from the crazy Manhattan. It is necessary to wirte down this enjoryable educational tour and wonderful place.


Intrepid Sea,Air&Space Museum consists of four parts, that is also why it carries this unwieldy long name:

  • Intrepid aircraft carrier (Intrepid)
  • Authentic military aircraft (Air)
  • U.S. submarine Growler (Sea)
  • Space Shuttle Pavilion (Space)

The Intrepid Sea, Air and Space Museum is the only museum where visitors can explore a legendary aircraft carrier, the first space shuttle, the world’s fastest jets and a guided missile submarine. We thrill visitors of all ages and connect them to history through hands-on exploration, stories of heroism and firsthand accounts of the people who were there. As New York City’s only educational institution housed on an aircraft carrier, we’re advancing innovation by developing the next generation of leaders in science, technology engineering and math.

1. Intrepid aircraft carrier

This is my first time visiting a museum which is embeded in a decommissioned aircraft carrier. Look at this ginomous guy. Broad shoulders,slender waist! What a good shape!



2016年06月23日 Thursday

经过不断尝试,反复修改,我的个人网站终于在今天搭建成功,哈哈哈哈哈哈。css,html懂得不多,技术水平有限,加上自己 也不喜欢花里胡哨的东西,所以我建网站的原则就是干净,简单ψ(`∇´)ψ

因为平时看到好玩的技术,会非常兴奋,但是又没有人和我一起分享这种快乐( T_T)\(^-^ ),毕竟朋友圈,微博那种 地方,如果写技术方面的感悟,估计会被人当作装逼吧,哈哈。父母呢,又不懂这些技术,朋友们呢,都挺忙的,我也不想去打 扰他们,毕竟如果他们不是和你一个专业,鬼知道你在讲什么 . . . ? ( • _ • ) ? 有许多简单的道理,小时候就听长辈讲,但是直到长大了才能理解,比如:时间是最宝贵的。因为有太 多想学的东西。小时候每每看完一部优秀的动漫或者文学作品,都特别失落,因为觉得以后再也看不到这么精彩的作品了。但是 学海无涯,在这里,有太多的前辈,在不断探索,留给后人更高效更先进的技术,你永远不会感到空虚,因为随时都有新玩意出 现,根本学不完,只会觉得一辈子真短,不能把他们都学会(自己真是太贪心了)。

写博客的好处就是,这里就像我的一个“小家”,我可以和自己聊天,我什么时候有空,就什么时候写,想写多少写多少,你有空 了就来看,想看多少看多少,也许这就是双赢,哈哈。我会在这里写一些技术类文章和好玩的东西,分享自己的心得体会,just for fun~ Y(^_^)Y,偶尔也会掺杂一些学术总结,杂文随笔性质的文章,其实自己还挺文艺青年的↖(▔▽▔)↗ 。如果自己的文章恰巧帮助到了你,那就更好了。

以后的Blog主要以英语为主,因为觉得自己的英语还有很大的提升空间,需多加练习。而且后续我会添加一些评论和转发功能, 空闲时间我会去研究下这方面的代码,希望大家多多支持。

本博客使用 jekyll + bootstrap搭建!

感谢 github 提供的 Github Pages 功能!

此博客布局参考了 liungkejin 博客

个人页面应用了 resumecard 项目