https://avatars.githubusercontent.com/u/6058558

程式狂想筆記

Phonegap 編譯APK錯誤訊息

因為phonegap build android顯示需要Android SDK 19,但是卻出現這個訊息。

The SDK Build Tools revision (19.0.3) is too low for project 'Testing'. Minimum required is 19.1.0

開起SDK Manager.exe選擇Tool資料夾裡面的Android SDK Build-tools (Rev)19.1

就解決此問題

[Python]圖片轉成base64碼

實作異常的順力^^

1
2
3
4
5
6
7
import base64

fp = open("a.jpg","rb")
img = fp.read()
fp.close()

print(base64.b64encode(img))

在接下來使用requests來實作

1
2
	imgdata = requests.get(imgurl).content
	imgb64 = base64.b64encode(imgdata)

完成:D

[Python]文件儲存unicode碼的問題

由於用網頁爬蟲抓取的資料存入json
文件都會顯示"{artist": "\u3058\u3093"}
但程式抓取都不會有亂碼的問題

但今天我Google大神一個整天
終於找到方法

1
str.encode().decode('unicode_escape')

html2canvas在Firefox上background-size黑畫面的問題

最近使用html2canvas圖片都無法順利呈現…
最終在https://github.com/niklasvh/html2canvas/issues/288找到解決問題。
https://github.com/niklasvh/html2canvas/commit/e9afe0396019abc39bdb949d78819ae971bf5f2c

不過使用background-size: xxpx;數值仍然在Firefox上還是有問題
但是background-size:coverbackground-size:contain可以順力產生圖片

6個超強增加英文能力網站

在XP上安裝chef

之前Ezgo11安裝vagrant都用的還滿順的
突然換到XP來用…,就發現麻煩的不少
沒法只能用XP來用

這次發現CHEFsupermarket改版了
連找cookbooks下載地方都找不太到
最後發現在右下角 = =|||

Cookbooks網址:https://supermarket.getchef.com/

Fixing “The box ‘base’ could not be found.” (Vagrant)

vagrant box add base http://files.vagrantup.com/lucid32.box

This is an indication that the the base virtual image is not configured, usually from forgetting to finish the installation. This image is copied, and modified to produce the desired virtualized environment. It’s easy to fix, by running the following:

vagrant box add base http://files.vagrantup.com/lucid32.box

It is also possible that you installed the box under a different name (the Vagrant website sometimes refers to lucid32). Instead of downloading a new box, in this case, you can edit Vagrantfile like so, changing the box name to whatever you called it on download: