在windows底下,可以透過此指令查出電腦名稱:
nbtstat -A [IP address]
只要在 [IP address] 填入你想查詢的ip位址
2012年4月19日 星期四
2012年3月22日 星期四
將GPS經緯度座標轉換成直線距離
我在網路上找到別人寫好,疑似是C#的版本:
http://www.dotblogs.com.tw/jeff-yeh/archive/2009/02/04/7034.aspx
我改成C/C++的版本:
#define M_PI 3.14159265358979323846
double ConvertDegreeToRadians(double degrees)
{
return (M_PI/180)*degrees;
}
double GetDistance(double Lat1, double Long1, double Lat2, double Long2)
{
double Lat1r = ConvertDegreeToRadians(Lat1);
double Lat2r = ConvertDegreeToRadians(Lat2);
double Long1r = ConvertDegreeToRadians(Long1);
double Long2r = ConvertDegreeToRadians(Long2);
double R = 6371; // Earth's radius (km)
double d = acos(sin(Lat1r) *
sin(Lat2r) + cos(Lat1r) *
cos(Lat2r) *
cos(Long2r-Long1r)) * R;
return d;
}
想要使用這個function很簡單
例如想要得知24.797254,120.969189到24.803545,120.979038的距離,就這樣呼叫:
cout<<GetDistance(24.797254,120.969189,24.803545,120.979038)<<endl;
function回傳的單位是公里。
http://www.dotblogs.com.tw/jeff-yeh/archive/2009/02/04/7034.aspx
我改成C/C++的版本:
#define M_PI 3.14159265358979323846
double ConvertDegreeToRadians(double degrees)
{
return (M_PI/180)*degrees;
}
double GetDistance(double Lat1, double Long1, double Lat2, double Long2)
{
double Lat1r = ConvertDegreeToRadians(Lat1);
double Lat2r = ConvertDegreeToRadians(Lat2);
double Long1r = ConvertDegreeToRadians(Long1);
double Long2r = ConvertDegreeToRadians(Long2);
double R = 6371; // Earth's radius (km)
double d = acos(sin(Lat1r) *
sin(Lat2r) + cos(Lat1r) *
cos(Lat2r) *
cos(Long2r-Long1r)) * R;
return d;
}
想要使用這個function很簡單
例如想要得知24.797254,120.969189到24.803545,120.979038的距離,就這樣呼叫:
cout<<GetDistance(24.797254,120.969189,24.803545,120.979038)<<endl;
function回傳的單位是公里。
2012年1月11日 星期三
解決 pcnet32 device eth0 does not seem to be present
今天在vmware上面跑fedora的時候,不知道為什麼之前網卡正常,但是後來網卡都無法啟動
於是我找到這個網站的教學:
http://newyorks.blog.51cto.com/2612618/498819
於是我找到這個網站的教學:
http://newyorks.blog.51cto.com/2612618/498819
解決方法就是在/lib/modules/`uname -r`/下執行 depmod,重新生成modules.dep和modules.alias,重新開機。
2012年1月2日 星期一
C++ Big5 與 Unique 轉換
big5轉unicode是用MultiByteToWideChar
char *str = "big5轉unicode.txt";
wchar_t wcbuf[32];
MultiByteToWideChar (950,0,str,-1,wcbuf,32);
unique轉big5是用WideCharToMultiByte
wchar_t *wstr = L"unicode轉big5";
char mbcsbuf[32];
WideCharToMultiByte(950 ,0,wstr,-1,mbcsbuf,32,NULL,NULL);
記得要#include<Windows.h>
char *str = "big5轉unicode.txt";
wchar_t wcbuf[32];
MultiByteToWideChar (950,0,str,-1,wcbuf,32);
unique轉big5是用WideCharToMultiByte
wchar_t *wstr = L"unicode轉big5";
char mbcsbuf[32];
WideCharToMultiByte(950 ,0,wstr,-1,mbcsbuf,32,NULL,NULL);
記得要#include<Windows.h>
2011年12月13日 星期二
HTC Desire HD ROM 改造與製作
以下網址有教學,雖然我還沒有空去研究:
http://www.mobile01.com/topicdetail.php?f=566&t=2491170&last=32614666
http://blog.chinaunix.net/space.php?uid=8272118&do=blog&id=2033354
http://note.sdo.com/u/1445822006/n/mbnUS~jx67nwLX02c001aY
http://web.nchu.edu.tw/~jlu/cyut/android/magic.shtml
http://code.google.com/p/androidbmi/wiki/Compile
http://gfans.bryan.tw/2011/06/08/1941
http://www.mobile01.com/topicdetail.php?f=566&t=1750016&last=32753916
http://www.mobile01.com/topicdetail.php?f=566&t=2491170&last=32614666
http://blog.chinaunix.net/space.php?uid=8272118&do=blog&id=2033354
http://note.sdo.com/u/1445822006/n/mbnUS~jx67nwLX02c001aY
http://web.nchu.edu.tw/~jlu/cyut/android/magic.shtml
http://code.google.com/p/androidbmi/wiki/Compile
http://gfans.bryan.tw/2011/06/08/1941
http://www.mobile01.com/topicdetail.php?f=566&t=1750016&last=32753916
2011年11月6日 星期日
使用不相容新版Firefox的舊附加元件
只要安裝 Add-on Compatibility Reporter ,firefox就會停用附加元件相容性檢查,於是就可以使用一些不相容的附加元件
https://addons.mozilla.org/zh-tw/firefox/addon/add-on-compatibility-reporter/
https://addons.mozilla.org/zh-tw/firefox/addon/add-on-compatibility-reporter/
尋找庫存頁面(頁庫存檔)的Firefox附加元件
透過 Resurrect Pages附加元件,可以搜尋各大庫存網頁的server,看看是否有之前網頁的存檔:
https://addons.mozilla.org/zh-tw/firefox/addon/resurrect-pages/
https://addons.mozilla.org/zh-tw/firefox/addon/resurrect-pages/
訂閱:
文章 (Atom)