以前用HTC安卓2.3的時候找過電話錄音軟件,基本都是錄的外放的聲音,聽筒的人聲極小。而這款Automatic Call Recorder是有很多錄音線路可供選擇的,前面的都失敗後纔會選擇揚聲器模式。我在Sony Z上全部默認設置,錄下的聲音有電流聲干擾,但人聲還挺清晰,已經能作爲一個普通的電話錄音軟件來使用。有空再事實其他音源。
作者: 42
使用數位板時關閉水紋特效。運行gpedit.msc,用戶配置/管理模板/Windows組件/Tablet PC/光標,雙擊關閉筆反饋,選擇已啓用即可。
Window 10 文件管理器直接打開我的電腦(C、D盤界面,不是庫界面)可以這麼設置:菜單欄點 View > 右側 Options。在新開的設置窗口中 General 標籤頁下第一個設置項選擇「This PC」套用即可。Win7 先關閉文件管理器,然後按着Shift鍵,右鍵點擊快捷啓動欄到的文件管理器圖標,選屬性,修改快捷方式標籤頁中“目標”值爲“%windir%\explorer.exe ,”,即在原值後添加半角的空格和逗號。保存之後再點擊文件管理器打開的就是我的電腦了。
還是文件管理器,如果不常用左側的導航窗格,可以在左上角選組織/佈局來控制其顯示。其中還可以配置菜單欄、細節窗口和預覽窗口。
最近穿牆阻力大增,小紅傘升級艱難,試了下微軟官方到MSE,也挺好用的。其實平常自己注意下上網習慣,比裝個厲害到殺毒軟件重要。後來我轉到了免費的 COMODO Firewall。
win10 的微軟拼音抽風的把翻頁鍵設置成了[],如果想改回,.翻頁,需要修改註冊表。按 Windows鍵 + r 然後輸入 regedit 敲回車。在註冊表編輯器中依次打開 HKEY_CURRENT_USER\Software\Microsoft\InputMethod\CandidateWindow\CHS\1。在右側空白處按右鍵 New > DWORD (32bit) Value。名字輸入 CustomizedPagingKey ,然後雙擊剛剛建立的 CustomizedPagingKey ,Value data 輸入 f0f ,OK。更多 win10 微軟拼音輸入法的設置請參考:Win10微软拼音输入法设置-注册表。
本文更新於 2020/11/03。
以下是從微軟全球生活匯中摘抄下來的名言:
They come through you but not from you, And though they are with you, yet they belong not to you. You may give them your love but not your thoughts.
Children - Kahlil Gibran
《论孩子》——卡里尔·纪伯伦
Health is certainly more valuable than money, because it is by health that money is procured.
- Samuel Johnson
塞缪尔·约翰逊
How many loved your moments of glad grace, And loved your beauty with love false or true; But one man loved the pilgrim soul in you, And loved the sorrows of your changing face.
When you are old - W.B.Yeats
《当你老了》——叶芝
She walks in beauty, like the night
Of cloudless climes and starry skies;
And all that’s best of dark and bright
Meet in her aspect and her eyes;
Thus mellowed to that tender light
Which heaven to gaudy day denies.
- George Gordon Byron
乔治·戈登·拜伦
That is bright as a lamp
Simple, as a ring
You are like the night
With its stillness and constellations
Your silence is that of a star
As remote and candid
I Like For You To Be Still - Pablo Neruda
我喜欢你是寂静的——巴勃鲁·聂鲁达
The water understands
Civilization well;
It wets my foot, but prettily,
It chills my life, but wittily,
It is not disconcerted,
It is not broken-hearted:
Well used, it decketh joy,
Adorneth, doubleth joy:
Ill used, it will destroy,
In perfect time and measure
With a face of golden pleasure
Elegantly destroy.
Water - Ralph Waldo Emerson
《水》——拉尔夫·瓦尔多·爱默生
All that I am or ever hope to be, I owe to my angel Mother. I remember my mother's prayers and they have always followed me. They have clung to me all my life.
- Abraham Lincoln
亚伯拉罕-林肯
Where we love is home, home that our feet may leave, but not our hearts.
- Oliver Wendell Holmes
奥利弗-温德尔-霍姆斯
Charm. It's a sort of bloom on a woman. If you have it, you don't need to have anything else; and if you don't have it, it doesn't much matter what else you have.
- J.M. Barrie
詹姆斯-马修-巴利
木のもとに 汁も膾も 桜かな
汤雅脍薄,如樱飘落,不胜轻风,宴饮其下,早樱如娇
-松尾芭蕉(まつお ばしょう)
灯消えたり卓上に 鮓の香 迷ふ
灯火忽明暗 寿司的香气 幽幽弥漫开
-高滨虚子(たかはま きょし)
It was the policy of the good old gentlemen to make his children feel that home was the happiest place in the world. And I value this delicious home feeling as one of the choicest gifts a parent can bestow.
-Washington Irving
华盛顿-欧文
Youth is not a time of life; it is a state of mind; it is not a matter of rosy cheeks, red lips and supple knees; it is a matter of the will, a quality of the imagination, a vigor of the emotions; it is the freshness of the deep springs of life.
-Samuel Ullman
塞缪尔-厄尔曼
以上是截至20150608的名言。最近看了土木壇子一篇文章,提到認真做事注重細節。我在整理這些名言時就發現即使是微軟的頁面也照樣有拼錯的單詞以及標點後不空格的情況,可能到了中國區質量一般就行了吧,反正中文頁面的英文都是裝飾性的。
前兩天發現之前寫的在線小六壬有個重大問題,在火狐安卓版上算出的數據是錯的!經過一番查看瞭解到火狐安卓版時間選擇期發送的日期格式是“2015-05-19+12:39”這樣,而其他主流瀏覽器都是“2015-05-19T12:39”這樣,於是導致在解析收到的時間時發生錯誤。經過測試用數組炸開日期字符串時一共用需要("-","T",":","+"," ")這幾個,加號和空格都是爲了能讓火狐網頁版正常工作。詳細代碼在Github小六壬。
下面說下用PC調試火狐手機端網頁。先在電腦端火狐中安裝Firefox OS Simulator。然後跟着Debugging Firefox for Android with WebIDE一步一步來就可以了,很簡單。
前兩天看了《互聯網之子》(The Internet's Own Boy),覺得用Creative Commons挺好於是就用了。這個電影很好下,英語不錯的可以到https://archive.org/details/TheInternetsOwnBoyTheStoryOfAaronSwartz在線看。
其實CC也本地化了各種版本包括臺灣和大陸,關於Creative Commons請大家參考維基百科:知识共享。我這裏用的英文的證書,簡體中文的CC聲明點開是中英混雜的好詭異。另外推薦大家看一下維基百科:公有领域詞條。
大衆點評的知识产权声明可真是霸道啊!還是自己先保存一份。下面代碼先將評論及商戶保存到sqlite數據庫,如果需要還可以導出成CSV,這樣辦公軟件就能直接打開查看了。
from bs4 import BeautifulSoup import sys,time,random,urllib,http.cookiejar,socket,sqlite3,csv goOn=1 stopDate='' UserID='' review={'shopName':'','shopAddr':'','shopURL':'','reviewURL':'','star':'', 'starDetail':'','costPerPeople':'','reviewText':'','dishes':'','reviewTime':''} def getHTML(url): print("Fetching "+url) request = urllib.request.Request(url) request.add_header("User-Agent", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0") try: response = urllib.request.urlopen(request) except (urllib.error.HTTPError, socket.error,urllib.error.URLError) as e: print('Connection error occurred when inserting data.'+str(e)) else: if response.code != 200: print("Error code:"+response.code) else: html = response.read().decode('utf-8') return html def getList(url): global review,goOn reviewList=getHTML(url) soupAll = BeautifulSoup(reviewList).find_all("div",{"class":"txt J_rptlist"}) for soup in soupAll: shopLink = soup.find("a",{"class":"J_rpttitle"}) review['shopName']=shopLink.text review['shopURL']=shopLink.get("href") shopAddr = soup.find("p",{"class":"col-exp"}) review['shopAddr']=shopAddr.text reviewID = soup.find("a",{"class":"J_flower aheart"}) review['reviewURL']="http://www.dianping.com/review/"+reviewID.get("data-id") reviewDateDiv = soup.find("div",{"class":"mode-tc info"}) reviewDateSpan=reviewDateDiv.find("span",{"class":"col-exp"}) reviewDate=str(reviewDateSpan.text)[3:] if(len(reviewDate)==8 and reviewDate>stopDate): getReview(review['reviewURL']) #抓取頻率 time.sleep(random.randrange(5,10)) else: goOn=0 if(goOn==0): print("Finished.") exit() def save(): global review,UserID conn = sqlite3.connect('DZDB_'+UserID+'_Reviews.db') c = conn.cursor() c.execute("""create table if not exists reviews (ID integer primary key not NULL,shopName char(50),shopAddr char(100),shopURL char(100),reviewURL char(100),star char(1),starDetail char(15),costPerPeople char(15),reviewText TEXT,dishes char(100),reviewTime char(20))""") s="""insert into reviews (ID,shopName,shopAddr,shopURL,reviewURL,star,starDetail,costPerPeople,reviewText,dishes,reviewTime) VALUES (NULL,\'"""+review['shopName']+'\',\''+review['shopAddr']+'\',\''+review['shopURL']+'\',\''+review['reviewURL']+'\',\''+str(review['star'])+'\',\''+review['starDetail']+'\',\''+review['costPerPeople']+'\',\''+review['reviewText']+'\',\''+review['dishes']+'\',\''+review['reviewTime']+'\')' c.execute(s) conn.commit() c.close print("Record at "+review['shopName']+" saved to Datebase.") review={'shopName':'','shopAddr':'','shopURL':'','reviewURL':'','star':'', 'starDetail':'','costPerPeople':'','reviewText':'','dishes':'','reviewTime':''} def getReview(url): global review reviewHTML=getHTML(url) reviewAll=BeautifulSoup(reviewHTML) shopInfo= reviewAll.find("ul",{"class":"contList-info"}) star=str(shopInfo.find("li")) if("msstar50" in star): review['star']=5 elif ("msstar40" in star): review['star']=4 elif ("msstar30" in star): review['star']=3 elif ("msstar20" in star): review['star']=2 elif ("msstar10" in star): review['star']=1 else: review['star']=0 starDetails=shopInfo.find_all("span",{"class":"rst"}) starDetail="" for s in starDetails: s1=s.text[0:3] starDetail=starDetail+s1 review['starDetail']=starDetail reviewText= reviewAll.find("div",{"class":"contList-con"}) review['reviewText']=reviewText.text units= reviewAll.find_all("div",{"class":"comment-unit"}) for unit in units: unit=str(unit.text).replace('\n','') if("人均:" in unit): review['costPerPeople']=unit[4:] elif("喜欢的菜:" in unit): unit=unit.replace(' ','') unit=unit.replace('\xa0',' ') review['dishes']=unit[7:] reviewInfo= reviewAll.find("ul",{"class":"contList-fn"}) reviewTime=reviewInfo.find("li") review['reviewTime']=reviewTime.text save() def main(): fun=int(input("请输入数字选择功能:\n[1]抓取数据,[2]导出数据: \n")) if(fun==1): fetchReview() elif(fun==2): sqliteToCSV() else: print("请输入1或2。") def sqliteToCSV(): dbFile=str(input("请输入数据库文件名:\n")) with open(dbFile+'.csv','w+',newline='') as csvfile: spamwriter = csv.writer(csvfile) conn=sqlite3.connect(dbFile) c = conn.cursor() spamwriter.writerow(['ID','shopName','shopAddr','shopURL','reviewURL','star', 'starDetail','costPerPeople','reviewText','dishes','reviewTime']) for row in c.execute('SELECT * FROM reviews'): spamwriter.writerow(row) c.close() print("CSV文件成功導出。") def fetchReview(): #抓取参数:用户ID,起始页,结束日期 global stopDate,UserID UserID=str(input("请输入您的大众点评ID,可以在您大众点评主页的网址中看到,如23262500:\n")) startPageNo=int(input("开始的页码,如1:\n")) stopDate=str(input("请输入评论结束日期(yy-mm-dd),如00-00-00:\n")) urlBase="http://www.dianping.com/member/"+UserID+"/reviews?pg=" startPageNo=startPageNo-1 while(goOn==1): startPageNo=startPageNo+1 getList(urlBase+str(startPageNo)) if __name__ == "__main__": main()
幾點說明
- 抓取頻率不要過大,否則大衆點評會屏蔽IP。我在抓取到20頁左右的時候碰到過一次屏蔽IP。如果意外中斷,你可以設置參數繼續下載,附w3school的SQL基礎教程。
- BeautifulSoup真是個好工具,連Qpython3都自帶了,但是遺憾的是這個代碼在Qpython3上跑報NoneType錯誤。
- 我用了幾次都沒問題。
移動2G網速好爛!看個IP歸屬地都要等好久。於是自己寫了個小小的php,輸出用不了1K數據,這樣既省流量又快速。代碼在Github:根據IP查看地理位置。
//服務端獲取客戶端IP $ip = getenv('HTTP_CLIENT_IP')?: getenv('HTTP_X_FORWARDED_FOR')?: getenv('HTTP_X_FORWARDED')?: getenv('HTTP_FORWARDED_FOR')?: getenv('HTTP_FORWARDED')?: getenv('REMOTE_ADDR');
本文更新於 2016/09/19。