Using Geojson to Draw a Map

Why Leaflet

Leaflet is an open-source JavaScript library, which supply so many plugins we can use for map making.
Based on Leaflet, geojson is even more friendly to geo-data visualization. Tutorials are easy to follow.

Read More

Convert CSV to Geojson in Python

What is Geojson

According to wikipedia, GeoJSON is an open standard format designed for representing simple geographical features, along with their non-spatial attributes, based on JavaScript Object Notation.

Read More

「译」JavaScript对象生命周期(Eloquent JavaScript 第六章)

此文翻译《Eloquent Javascript》中第六章,The Secret Life of Objects,侵删。
该书有中文译本出版。此译文仅作交流学习之用。

Read More

How to Find Substrings in Python

.find() function is used for find a substring in a string, and will return location index. E.g. -1 means no such substirng in this string.

Read More

How to Install PostgreSQL on a MAC

Installation

Environment: macOS Sierra 10.12.4.

Install this database with ternimal:

Read More

Markdown Tools with Sublime

Explorer entensions

  • Markdown here
    Markdown here is an cross plantform extension for Chrome, Safari, Firefox and Thunderbird. It can help you write your email with markdown language quickly.
    I am using Chrome extension for gmail. As long as I wrote my email in gmail interface, just hit Markdownhere button, then a nice formatted email will be there. That’s awesome.

Read More

「译」JavaScript正则表达式应用(Eloquent JavaScript 第九章)

此文翻译《Eloquent Javascript》中第九章,Regular Expressions,侵删。
该书有中文译本出版。此译文仅作交流学习之用。

Read More

3D Convex Hull

本方法适用于3D点云的凸包的提取,使用python实现。
这里用的方法是对quick hull做了一点小小的改进,主要分为两大块内容,初始化迭代


初始化

构建初始四面体

为了在初始化过程中构建一个相对比较大的四面体,我们需要分别找到6个最值点,分别是XY或者Z轴上的最大或者最小值点。找出6个点中距离最远的两个点,构建一条线。再找出距离这条线最远的点,构建一个面。再找出距离这个面最远的点,构建初始四面体。

Read More

Mac下tomcat的安装与配置

下载及安装

下载并安装Java SE,下载对应版本的Tomcat,版本对应关系tomcat给出了文档. 我下载之后把apache-tomcat-7.0.75.zip放在Application目录下,方便起见改名为tomcat。mac应该下载tar.gz文件,zip文件会报错。
查看java版本

Read More

Javac无法编译Servlet

编译环境:MAC OS

编译servlet需要servlet API,但servlet API不是JDK的一部分。如果直接用javac去编译会报错:

Read More