假設自己的經緯度為 LAT,LNG
資料庫欄位_LAT,_LNG,_NAME,
SELECT CEIL((((ACOS(SIN((LAT*PI()/180)) * SIN((_LAT*PI()/180))+COS((LAT*PI()/180))
* COS((_LAT*PI()/180)) * COS(((LNG- _LNG)*PI()/180))))*180/PI())*60*1.1515*1.609344)*1000)
AS DISTANCE,_NAME
FROM TABLE_NAME
ORDER BY DISTANCE ASC
算出距離幾公尺
Delphi 10 Andriod/iOS開發小筆記(常常更新)
System.IOUtils.TPath.GetHomePath
Platform | Sample path | Path ID |
---|---|---|
Windows XP | C:\Documents and Settings\<username>\Application Data | CSIDL_APPDATA |
Windows Vista or later | C:\Users\<username>\AppData\Roaming | FOLDERID_RoamingAppData |
Mac OS X | /Users/<username> | NSUserDirectory |
iOS Device | /private/var/mobile/Containers/Data/Application/<application ID> | |
iOS Simulator | /Users/<username>/Library/Developer/CoreSimulator/Devices/<Device ID>/data/Containers/Data/Application/<application ID> | |
Android | /data/data/<application ID>/files | Context.getFilesDir |
For Android, set the Remote Path to assets\internal
For iOS, set the Remote Path to StartUp\Documents
// XE3 : DBJSON // Seattle: System.JSON var LJsonArr : TJSONArray; LJsonValue : TJSONValue; LItem : TJSONValue; begin memo1.Lines.Clear; LJsonArr := TJSONObject.ParseJSONValue(TEncoding.utf8.GetBytes(memo2.Lines.Text),0) as TJSONArray; for LJsonValue in LJsonArr do begin for LItem in TJSONArray(LJsonValue) do memo1.lines.add(Format('%s : %s',[TJSONPair(LItem).JsonString.Value, TJSONPair(LItem).JsonValue.Value])); memo1.Lines.Add(''); end; end;
參考: http://blogs.embarcadero.com/davidi/2013/11/23/43005/
30天學會Delphi手機應用程式開發書籍撰寫
先前有外國人 sam lu的 100 days of Swift的學習專案,後來 allenwong也在Github發佈了 30DaysofSwift 。於是開始著手寫一本 30天學會Delphi手機應用程式開發的計畫~
為什麼會用30天?不是60天或100天呢?
主要是因為Embarcadero的產品試用是30天~也就是剛好可以試用到完 🙂
有興趣購買的可以到我的FB社團觀看最後的消息
Facebook Delphi Developer【Delphi開發者】 社團
Learn how to Quickly Build and Deploy a complete REST/JSON based Enterprise Business Application – YouTube
借測Star TSP650II出單機撰寫行動POS
Delphi 10 在Android、iOS取得內部IP方式
在寫應用程式時,常常需要知道機器的IP是什麼!答案相當簡單~只要拉出IdIPWatch這個元件
然後透過 IdIPWatch裡的LocalIP這個屬性就可以了!
相較於以前要透過Winsock來撰寫!一整個方便多了~更重要的是可以同時在Windows/Mac跟iOS/Android上面跑~
Opera開發團隊公佈JavaScript可控制Bluetooth的API文件
最近Opera的開發團隊發表了Web Bluetooth API的文件,也就是說以後可以使用JavaScript控制Bluetooth的硬體了。
目前在Google Play新版本的Opera Beta已經有支援Web Bluetooth的功能。
當然這部份只是草擬而已,但能付諸實際應用也指日可待。
連續30天30個Swift專案,學習Swift好資源
Sam Lu先前寫了一篇100 Days of Swift的文章,不過比較可惜的是並沒有開放原始碼出來讓大家一起學習。不過有位Allen Wong網友,效法Sam Lu做了30 Days Of Swift的計畫,更難能可貴的是他老兄開放了所有原始碼給大家參考。對有興趣自學Swift語言的朋友是很好的學習教材。
https://github.com/allenwong/30DaysofSwift
http://samvlu.com/
Fusuma仿Instagram相片瀏覽的Swift Library
https://raw.githubusercontent.com/wiki/ytakzk/Fusuma/images/fusuma.gif
Fusuma是一個仿Instagram選取照片介面的Swift Library。如果搭配像iOS-CoreImage-Swift這樣的濾鏡Library,也可以打造出一個Instagram Like的程式
Delphi10 Seattle後的Delphi 11叫Berlin?
最近瞄到官方的資料,內容為
QA description
*.info.plist doesn’t contain NSAllowsArbitraryLoads key to enable http, although “Enable HTTP protocol request” project option is checked. The issue is reproduced with Seattle Update 1, but works fine on Berlin 24.0.22128.5503.
乍看之下沒啥,不過最後那句but works fine on Berlin 24.0.22128.5503.。告訴了下一版本Berlin的存在!
三不五時瞄一下QC的文件,果然有驚喜!