首頁我是相片相簿文字
snDateCommentHit
Display 1-20, Total 171 data, 2024-04-18
12345 ... NEXT9
IP 全球地理位置資料庫開發日誌2016-09-06

IP 全球地理位置資料庫開發日誌

話說從頭, 這是中文式流水帳。
開發的綠起是為了把 streetview.cc 的入口寫的完美一些,
所以在網路上找了些免費的 IP 資料庫來使用,
想利用 IP 來定位 Google Maps 的起始位置。

開始先找到的是 MaxMind 的 GeoLite2 (GeoIP2免費版),
接著就花了點時間把將近三百萬筆資料寫進 MySql 裡,
接著隨機性的測試一下, 還可以哇!!
然後發現怎麼故鄉台灣的IP都只能定位到陳有蘭溪??

稍稍研究之後, 原來似乎還沒有人把台灣的IP區段給補完, (人才都跑那去了?)
也許警政或調查機關有, 不過我沒有找到就是了~~
最接近的就是 IPIP.net 的創辦人高先生在今年初時自己的微博說:
「 嗯,就在刚才,已经把手里的台湾的IP 库地级市和区县库数据都搞定了,貌似这个是全球独一份吧?台湾本地公司都没有。。」

哇, 牛人說牛話了, 於是我花了點時間在 IPIP.net 上撈了一份 17monipdb 做再開發。

只是 17monipdb 可能是免費的關係, 數據上有些許錯誤,
不過對於鑑別中國IP的地理應該還是可以的,
所以我就花了點時間把 17monipdb的結果(中國) 整合到 GeoLite2 之中。

然而, 這並沒有解決陳有蘭溪的問題。

我又把念頭放到再來轉個資料庫看看, 查了查。決定就是你了!!
IP2LOCATION 上吧!! (其實真沒有幾家有開源的)
抓回來一看, 天啊!! 4百多萬筆資料啊!!
不過有了匯入 GeoIP2 的經驗, 不怕不怕。
花了些時間等待匯入資料庫後, 交叉比對目前這兩大開源的資料庫如下:



從上表可知, IP2LOCATION 對於IP表切得較細, 不過對於地理地址定位來說, GeoIP2 的比較齊全,
另外IP2LOCATION是只有一張資料表, 在執行上的效率較差, GeoIP2是兩張表格, 效率較好。
理想的作法應該是採用 GeoIP2 的資料結構, 補上 IP2LOCATION 的有效資料。

雖然這樣能解決陳有蘭溪的問題, 不過我得回頭做別的事了。

目前的作法是把IP2LOCATION列為參考資料, 待有空或是有想法時再將兩個資料庫整合再一起囉。
未來的開發的意向大概就是把兩個資料庫截長補短, 然後整合進一個台灣的IP區段, 為家鄉盡一份心力;
然後再加上 Google Maps 的定位去自動資料庫的校正和補充。就算大功告成啦~

現就以此文將此開發暫告一段落; 我得來繼續寫 streetview.cc 大數據!!

--
IP GeoLocation Service2016-08-29


IP GeoLocation Service development 中文版

http://ip.ymc2.com/
Website statement:
1. The ip.ymc2.com is a customized website for IP query purpose.
--
V1.3 Released on 9/6, 2016
1. Include a reference DB from ip2location.com, DB11 LITE
2. Optimize MySQL commands to shorten query time
3. Minor texts fixed.

V1.2 Released on 9/4, 2016
1. Include 17monipdb.dat (Open-Source Database of CHINA IP) to better locate location in China
2. Enable to display city name in both Chinese and English (CHINA only)

V1.1 Released on 8/30, 2016
1. Support Country-CountryName. US-> United States
2. Apply Country - Language- GoogleMaps look-up to set default on Google Maps UI

V1.0 Released on 8/29, 2016

Function: Giving an IP address, return its GeoLocation including City, Country and Latitude & Longitude. (and maybe other information as well)

Support: IPV4 format only.

API usage: Provide JSON result, but only for internal usage now.

Database & Tables :
1. GeoIP2
Version: 20160802 open-source
Max Note: 804,007 geo-location data, and 2,180,870 ip-blocks data were imported.
This product includes GeoLite2 data created by MaxMind, available from http://www.Maxmind.com

2. IP2LOCATION LITE-DB11
Version: 20160901 open-source
Max Note: 4,016,410 data were imported.
This site or product includes IP2Location LITE data available from http://www.ip2location.com

3. 17monipdb:
Version: FREE 20160601
Max Note: This db is mainly to locate specific IP-address where $country=CN. Total 96,817 data were imported. (225 duplicate values on row startIpNum row; 2 duplicate values on row EndIpNum. Unable to setup primary key.)
The API includes 17monipdb.dat, 作者©高春辉, available from https://www.ipip.net/download.html


4. GoogleMaps Languages Support list: GMap-language.csv, source-> https://developers.google.com/maps/faq#languagesupport

5. a revised Country codes (ISO 3166) and official language table: country-language.csv, source-> http://download.geonames.org/export/dump/countryInfo.txt

6. a table to look-up locId with city name in Chinese and in English (China IP only) locId-cn_city.csv
Max Note: Please open it with Notepad before importing to your db. It includes Chinese characters.

--
Report Error: Please leave a comment below if there was an error result.
文字樣式作弊表2016-03-28
文字樣式作弊表 - 僅供 Max Chen website 文字部份使用. 使用方式 span class="xx"

標題

v1
underline,bolder,16pt

v2
border-bottom,15pt


內文

t1
藍底白字 : 使用在某種程度的高光顯示

t2
黃底紅字: 不太確定該怎麼使用

t3
黃底: 一般程度的高光顯示

t4
灰色刪除線: 使用在某種需留住但不重要或是有笑果的時候


coding 程式碼專用

$result = $db->query($sql);
if($result){
while ($row = $result->fetch_object()){ // Cycle through results
$stdClass[] = $row;
}
$result->close(); // Free result set
}
$val = json_decode(json_encode($stdClass), true); //Transform stdClass to Array
$val = array_map('array_values', $val); //remove Key of the Array (may not required)


自定情況: 就自定吧
PHP MySQL DB 資料庫網站開發2016-02-18

最近忙著和Google Maps API奮鬥, 想寫一個跟街景有關的資料庫網站。(好痛苦啊! DOM完全不熟的說!)
不過今天突然心血來潮, 想回顧自己到底寫過幾組完整的PHP+MySQL網站,也一併回顧自己寫程式的來時路。

» Read More
聖母峰2015-09-25

聖母峰

電影描述1996年5月11日, 聖母峰上改變登山史上的山難事件, 共有八位登山者卒於當天傍晚以後的暴風雪。

看完電影後, 我讀了一些背景資料, 才知道原來不只電影描述的兩支主要登山隊伍, 同時南坡路線攻頂還有一隊由高銘和領軍的"中華民國聖母峰遠征隊"以及一隊印度隊伍。

這部電影以Adventure Consultant這個登山隊伍為主體的角度進行故事的描寫, Jon Krakauer 是這個隊伍的隊員之一, 他以 Outdoor 戶外雜誌記者的身份參與這次隊伍, 準備描寫過度商業化的聖母峰登頂, 結果反而成為這次山難事件的經歷者之一。 他回到美國後, 以他的角度出版了 Into Thin Air 這本書; 其中文翻譯本為聖母峰之死, 而此書的內容之後成為幾次好萊屋電影中的劇本參考。這部電影同樣也以 Jon 此書為主進行翻拍。

整部電影看完, 我對於濃濃的紐西蘭腔英文感到不解, Doug 冒死登頂的勇氣也不解, Rob 捨命陪君子的不專業也不解... 總之實在太多問號了? 而導演運鏡配合IMax 3D的效果, 整體視覺上還不錯, 電影的過程中都一股寒意冒上來, 冷冷的~

高銘和之後也寫了一本書 "九死一生" 其中的描寫與 Jon 的角度多為不同, 同樣的事情由不同人說出的故事就是這樣吧。也許之後在書店有看到可以一讀。
Street View | Trusted Photographer2015-08-22
Street View Trusted | Trusted Photographer

Do you want to apply the Google Street View technology to show your business to the world? Try below sample:

Jade Mountain Café
2611 E Johnson St, Madison, WI 53704

Ting-Li Lin and Max Chen (myself), who founded Snowforst.co, are helping Wisconsin local business to spread their visibility! Although they are both Google Trusted Photographers, their photography capabilities is way beyond than this.

I am currently marketing Google Street View services in most towns in Sauk county, like: Sauk City, Baraboo, Reedsburg and Wisconsin Dells area. If you see me stop by your business store, don't be surprised. I see your potential and would like to help promote your store. I believe Street View for business is a great marketing tool for local business for the below reasons:

» Read More
Max Chen2015-08-01

>> 中文版

Hey~ Nice to meet you~

I'm Max Chen <u870820@gmail.com>, an engineer, backpacker, photographer, web programmer, and blogger.

I have an M.S in Industrial System Engineering from UW-Madison, and I've worked at ASUSTek Inc., PEGATRON corp., and now Hankscraft Inc.. In the past, I did research in the UW-Madison Naturalistic Decision Making and Simulation Lab with Dr. Douglas Wiegmann , and at the Waisman Center. My research interests were focused on User Experience, Aviation Safety and Patient Safety.

I am a professional in project management and quality engineering, and I enjoy working on "complex problem" projects with hard to identify root causes or projects involving with cross-functional teams. I make a living by utilizing my knowledge and experience in both the quality and manufacturing fields. I am also a certified six sigma black belt of the American Society for Quality.

I was born in Taipei, Taiwan, and I have lived in Prague, Czech for 2 years, Shanghai, China for 3 years, and I now live in Madison, Wisconsin. Traveling and seeing the world is what brings excitement to me in life. While traveling I found a passion for photography. Taking photos and sharing what I have seen has become my treasure. In 2003 I launched a blog to present my photography.

In my free time, I like to do web programming. After not finding a photo album service I liked, I decided to code on for myself, it is called Max Chen Photo Database. It was just a start, my other web application could be found here(mandarin). In addition, my latest web project isPlace.Report which utilized Google Maps API and Facebook Graph API, a data-mining informative service.

In mid 2015, I started a new adventure with Ting-Li Lin. We set up Snowforest, a company specialzing in architecture photography and beyond. Snowforest's mission is to deliver artful images and to ensure every customer is satisfied. Snowforest is a new challenge and a new chance to us, and I devote myself in it and like to picture a wonderful future with it.

In my leisure time, I enjoy swimming, running, reading, watching movies, and playing games. I am not good at writing, but I will try my best to record thoughts, studies, and stories in here. I would like to share my life experiences with my friends and future generations. Someday, we will become someones' memory, and here is the best place to remember me.

Below is a list of social medias I am using. Let's exchange our thoughts via:

twittertwitter

twitterfacebook: mandarin

Edited by Max Chen on Oct 10, 2016. Thank you Tara for proof reading.


<span class='search_high'>Max</span> and his camera.
Max was waiting to take a sunset


<span class='search_high'>Max</span> in Grand Canyon.
Max in Grand Canyon.

Tingli and I were at Grand Teton
Max and Tingli were at Grand Teton.

玩命關頭六2013-05-29


爽片! 玩命關頭6

最近看了很多電影, 但唯一想寫的就這部 Fast & Furious 6 速度與激情

劇情其實邏輯是不怎麼通的, 例如兩個窩裡反的女人我就很看不明白...

但是 BUT!!!

爽度一流啊! 實在太可惜小麥城沒有 i-Max 版本, 動作場景相當華麗而且扯蛋!

由其是飛天熊抱那招, 媽呀...連我都想鼓掌了 (笑)

總之還是推一下。雖然看完後去批踢踢爬文猛然發現第三集竟是這集的延續!

二話不說, 全資源用上在家看完第三集, 結果第三集只是講一個中二飆車手的曲折故事。

實在是太傷我這位大叔的時間和心情了。

好吧言盡於此, 回到第六集上頭, 爽片還是值得一看的。
妹妹的貓2013-07-03
sis

妹妹的貓,

幫妹記錄一下, 沒記錯本周一是我妹兩條貓的開始之日。

這樣我也算有外甥貓了。哈哈哈!!

樓下是我的小虎二號機,

這三隻虎斑要相見最快的方式就是從金門把小虎二號偷渡回家了 (當然是開玩笑的! 哈哈)

Afternoon2014-04-27
20140427-142558.jpg
Afternoon at Starbucks, Madison
Ting-Li photography exhibition2014-05-05
20140502-192458.jpg

Ting-Li exhibition in 800 UBD gallery.

Best wishes!
美國環狀國家公園之旅2014-05-06
Oring trip

計畫下一個9天8夜之旅:

Day1 Salt Lake City -> Arches Natl park (Camping)
宿: Devils Garden Campground No.32 $20

Day2: Natl Park -> Cortez, CO
宿: Motel


Day3: Mersa Verde -> Monument Valley -> Page -Horseshoe Bend
宿: Camping


Day4: Page -> Horseshoe bend -> Antelope Valley -> Page
宿: Motel

Day5: Paria Canyon -> Grand Canyon
宿: Camping


Day6: Grand Canyon -> Hover Dam-> Las Vegas
宿: Motel


Day7: Las Vegas -> Zion -> Bruce Canyon
宿: Camping

Day8: Bruce Canyon -> Salt Lake City
宿: Motel

Day9: Salt Lake City -> Madison

 
Michigan Stadium2014-05-13
20140513-180056.jpg

Max is in the center of M
KTV2014-06-22
20140622-155355-57235199.jpg
吃完飯後, 聽老婆唱歌
返台2014-12-29
IMG_3144.JPG
回家一趟
Yolas coffee2015-01-03
IMG_1144.JPG
跟老婆在咖啡廳吃早餐
2011 近況2011-02-20


2011 近況

呃, 一陣子沒在 blog 更新嚕, 真是不好意思啊!! (笑)

最近麥大叔開始在找工作嚕, 學校算是暫告一段落。

在找工作之外, 我的心力也持續放在攝影資料庫的開發,  還有藝術電影的欣賞。

到美國之後,

電影欣賞從單純打發時間成為一種可以討論的話題,

這樣的過程還頗為有趣。

此外, 去年暑假起開始打造的攝影資料庫也在持續的改善中,

最近剛完成固定網址的架構。

接下來則是把模組優化, 另外再來想想AJAX要怎麼引入~

其實程式碼的改善與品質一樣, 是永無止盡的..

我也蠻開心自己能找到這個 programming 的興趣~

攝影則是稍微停擺了一陣子, 沒有停下, 只是停步而已,

等待重新啟動的時機。

而我目前的近況幾乎都在個人plurk 更新,

Facebook 的隱私設定讓我卻步了, 請各路好朋友可以來 plurk 加我好友.

另外在獵人狩影, 雖然朋友還蠻支持往個人方向轉,

不過我突然覺得要把過去的情報站丟掉似乎不是個很好的決定,

所以還在考慮變動中,

以上, 麥大叔現況大致降~
新舞台2010-09-30


新舞台

距離開學已近一個月, 本月大事除了麥夫人來當麥城煮飯婆之外,

近期的行為似乎還在為適應這新學期做準備.

例如:

筆電是新的,

工作是新的,

課程是新的, (這不廢話嗎?)

網站是新的,

» Read More
ISS Photo Contest 2010, UW-Madison2010-04-20
ISS Photo Contest 2010, UW-Madison

Best in Show 2010, International Culture



Taiwanese Psychics (2009), Yain-Ming Chen

麥大叔參加學校辦的國際學生攝影比賽得獎囉!!

其中台灣乩童(2009)這張得到 International Culture (國際文化) 首獎!

另外兩張: 長城(2006) 麥城的雪冬(2010); 分別入選該項的前25名。

台灣乩童也是我最希望能得獎的一張!!

貼上我在 Facebook 寫的感言:

~得獎相片是在20009年在鹿港天后宮, 媽祖生日前後所拍攝。


畫面是台灣各地的媽祖分會至天后宮參拜的情景。相片中的


男乩童背上其實滿是紅色的鮮血, 雖然我看不出他是否有起乩了?


但是從認知層面而言, 此情此景最能代表我印象裡的台灣文化,


即使只是片斷。下一次請讓我們在明年的 Taste of Taiwan 上,


用無敵的雞排+珍奶征服 UW-Madison 的天空~ (笑)~


更多的沒有提到的背後是自己思索著對於 [台灣文化]的認知。

還記得在投稿前夕,

算是跑遍不少地方的我, 決定在 International Culture 這個項目以[台灣]為主題。

只因為[台灣]是我成長的土地。

自2008年環島之後, 自己對於[台灣]這塊土地產生了強烈的認同感!

所謂人不親, 土親! 自北而南, 從西到東, 都是如此熟悉地活在我的生命裡!

然而, 在尋找參賽的照片時, 卻產生了一種很懊惱的情感:

為什麼台灣當地的文化活動我都未曾親自參與呢?

最後, 在09年的相本裡找到難得的媽祖廟會, 雖然談不上什麼重大的文化盛事;

這些乩童揮舞大刀棍棒, 紅色鮮血流在皮膚上的露骨畫面,

是我從小懂事以來像個印記一樣的畫面, 就印在腦袋裡不曾離去。

我很慶興自己在選擇台灣文化的相片時, 還至少能找到除了[夜市]以外的題材,

但卻也感嘆自己對於活在這塊土地上人們的不了解?

正是文化來自於人類的活動...

對於此, 台灣文化而言, 我想這是一個比[環島]還更為重要的一個[事件集]需要去做更深度的體會!

那可不是繞個21天環完島就能說出滿嘴道理的事情。

~

OK思緒整理了一番, 接著談另外兩張。

這兩張比較沒有"背後的故事"可言,

題外話是三張內長城曾偷偷發佈在 旅遊相本 裡; 另外兩張則算是首次在網路上公開!



Great Wall (2006)

長城(2006) 是自己頗為滿意的風景相片之一;

刻意用黑白去突顯相片的線條與層次, 讓視覺焦點沿著長城一直相連到天邊~

近來我在後製的處理上時常會選擇以黑白表示, 不曉得是不是種病啊? (笑)

另外偷偷廣告一下, 我其實一直都有更新 旅遊相本, 目前已經攻到第94卷囉 (2008年10月)~

相簿的進度簡直大勝Blog圖文版本啊!!



Eagle Heights (2010)

這是先前宿舍的外面, 當時前天晚上麥城下了一場超級大的"暴風雪";

用颱風來形容就是強烈颱風了, 然後一大早起床看窗戶外!

天啊! 怎麼每台車都成蛋糕車了?

整個銀白色的世界有一種很純淨的美。

這個暴風雪讓我對於這個北國之都-小麥城(Madison)有了很不一樣的認識。

所以我也將它選進參賽的三張相片之一。

OK, 大致是這樣。

最後反省最近自己對於攝影的想法:

簡言之目前自己正處於一種不上不下的情況。

對於現狀呢, 不是很滿意也不算很討厭!!

不滿意的就是美國的人文紀實題材, 目前還找不到個切入點!!

討厭的是熟悉的風景攝影這塊也提不起什麼勁來拍~

人像攝影則仍是原地踏步。

而器材目前只能算是茶餘飯後的話題了,

除了中片幅哈蘇正片能引起我口袋錢的蠢動外;

數位135系統嘛, 自己以為近幾年也就是這麼一回事了~

除了3D 化之外, 真還想不出能有什麼感動的進步!?

最後, 真的是最後了...

沒想到攝影之路己步入第十年了! 想想人生, 能有多少個十年能浪費呢?

現在的我真的笑了! 在2001年的春天, 我堅持買下相機記錄生命的那股衝動。
網路主機伺服器作戰中2010-04-10
網路主機伺服器作戰中

致親愛的朋友們,

目前 Netfirms 的網路主機似乎偷偷在跟 Max2.tw 作對啊!!

所以常常有「無法找到伺服器」的說法, 我也時常無法順利更新文章...

事情大致是這樣的:

1. Domain A Record  指定 IP

由於 ymc2.com 這個 domain 是在 hinet 註冊,  因此利用 hinet 的 DNS 代管服務:

需要把 Domain 的 A 記錄指定到 Netfirms 底下的 Max2.netfirms.com 的 IP。

2. Netfirms 三不五時就改 IP!?

結果 Netfirms 從四月初就開始抓狂的改 Max2.netfirms.com 的 ip...

幾乎是三天改一次!!

而每次一改變 ip; 理所當然的 HINET DNS 就又找不到地方了?

天啊!!! 所以我又得手動到 Hinet DNS 改動 A Record!

再等個大約12小時左右, 才會恢復連線...

3. 解決之道?

我懷疑 Netfirms 就是來找碴的, 用他家的服務用了七年了耶!!

怎麼可以這樣對待老客戶啊!! 這些年來從來沒有被換過 IP 啊!!?

難道 Netfirms 就是要準備吃定我去買固定IP的服務嗎? (收費10USD/月)

說實話, 我還真不曉得能怎麼辦!?

Max2.tw 的到期日是 2013年12月31日

netfirms 的到期日是 2011年10月31日

在想到解決辦法之前,

請大家若無法連上主機暫時改用 http://www.Max2.netfirms.com/blog/

暫時是這樣了~ 真他馬的 netfirms!
12345 ... NEXT9