熱門文章

2016年8月31日 星期三

嘉義美食小記

僅此紀錄我實際吃過的店,每個人的喜好口味略有差異僅供參考

劉里長雞肉飯

好吃,推薦50元的雞片飯還有30元的下水湯(半碗都是料)湯也很夠味
味增湯($15)也不錯

內用有冷氣可以吹,二樓也有位置和冷氣
週末請避免午餐時段,會很多人
停車稍嫌困難

地址: 600嘉義市東區公明路197號

成仁街蛋餅


哈牛排

便宜好吃(有稍微漲價了)

地址:嘉義市民族路176號
電話:05-2253851 
營業時間:11:00 ~14:00、16:30~22:00 (周一至周三中午時段不營業、不定時店休)


好滋味水餃 

鮮蝦整尾的蝦子   nt.8  整隻蝦
麥辣牛肉好香小辣  nt.6
一般的韭菜高麗菜也好吃 nt.5
Facebook



東門火婆煎粿 比國華街煎粿好吃 


火婆粿比較Q軟,醬油比較香 小份30元就很飽


國華街煎粿

國華街的 粿我覺得一般 不過煎甜不辣超好吃 湯也好喝


桔吉力早午餐 


丹麥麵包塗上德國歐登堡奶油好吃 
法國吐司系列的吐司塗上白醬也好吃


地址: 600嘉義市西區仁愛路344號
營業時間 06:00–13:00
https://m.facebook.com/gigilibreakfast/?locale2=zh_TW

阿美臭豆腐 

發酵過程加入水果與中藥 香而不臭好吃 不過是炸一次的臭豆腐 不是脆皮


地址: 嘉義市東區民權路353號

興加臭豆腐


地址: 600嘉義市東區興業東路191號
開放時間:1500-0000 

上海路 貴州街 臭豆腐


泰式麻辣乾麵
炒米苔目
免費柴魚湯

熊與兔 

義大利麵好吃 
明太子白醬蛤蠣海鮮燉飯
青醬蛤蠣燉飯換筆尖麵 +20
義式燻雞起司奶油白醬燉飯 因為有燻雞所以比較有味道 較鹹
沙拉加百香果與橘子醬 好吃 
甜點巧克力奶酪好吃(很像福樂巧克力牛奶的味道)



惡魔蛋糕

白河炸餛飩


東山鴨頭 藍記



後庄 軍輝路小籠包
榨菜肉絲麵 好吃 麵條適中不過軟

飯糰 浩子的家
有黑糯米 五穀 一般 可以選擇 配料有 傳統,燒肉... 很多選擇
豆漿不好喝 水水的

民族國小 油飯


和平路 胡椒餅

和平素食

頂好滷麵 
好吃炒飯 有獨特的香氣

2016年8月30日 星期二

[WP]使用Font Awesome

Font Awesome

The iconic font and CSS toolkit
Version 4.6.3   ·   GitHub Project   ·   Old 3.2.1 Docs   ·   Created by Dave Gandy

有超過644個iocns可以使用 僅需要一個簡單的步驟

CDN
將以下程式碼加到你的header

<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

即可到網站找icon



Example of cc
 fa-cc
<i class="fa fa-cc" aria-hidden="true"></i>

2016年8月18日 星期四

[Raspberry Pi]架設FTP Server

sudo apt-get update
sudo apt-get upgrade
安裝vsftpd軟體
sudo apt-get install vsftpd 
進入修改設定
sudo nano /etc/vsftpd.conf
把文件中的改為如圖所示,去除'#'符號,意思是允許本地端、允許用戶上傳寫入資料
#local_enable=YES
#write_enable=YES
改成
 local_enable=YES
write_enable=YES


啟動
sudo apt-get install vsftpd

接下來可以用本地端電腦FTP連線測試

本範例使用OS X- El Capitan 10.11版本,使用FileZilla軟體,或其他FTP軟體也可行


輸入樹莓派所在IP位置及帳號密碼 (預設帳號為pi,密碼為raspberry) Port不預設為21

只有home/pi 可以傳輸
在我要安裝外掛的時候,發生無法傳輸





成功!也可以使用手機Android /iSO 進行FTP連線


rails 搜尋表單實做方法 form_tag

1.3 產生表單元素的輔助方法

Rails 提供一系列的輔助方法,用來產生表單元素,像是多選方框(checkboxes)、文字欄位(text fields)以及單選按鈕(radio button)。名字以 _tag 結尾的輔助方法(譬如 text_field_tag 與 check_box_tag)只會產生一個 <input> 元素。這些輔助方法的第一個參數都是 input 的名稱(name)。表單送出時,name 會與表單資料一起送出,使用者輸入的資料會存在 params Hash 裡,可在 Controller 取用。舉個例子,若表單的 input 是 <%= text_field_tag(:query) %>,則可在 Controller 用 params[:query] 來獲得使用者的輸入。


http://rails-practice.com/content/Chapter_3/3.2.html

rails 搜尋表單實做方法 檢體
form_tag
看此篇學會



http://www.saalonmuyo.com/2010/01/27/using-form_tag-in-ruby-on-rails/

http://stackoverflow.com/questions/10489314/how-can-i-use-form-tag-as-opposed-to-form-for-in-this-file
英文

api
http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-form_tag

2016年8月17日 星期三

[Raspberry Pi]安裝MySQL資料庫-part2

1.[Raspberry Pi]安裝PHP網頁伺服器-part1
2.[Raspberry Pi]安裝MySQL資料庫-part2
3.[Raspberry Pi]架設Wordpress英文版,並且中文化-part3
4.[Raspberry Pi]架設中文版Wordpress-part3B

請先安裝PHP網頁伺服器,再接下來安裝MySQL資料庫工具
此教學為遵照柯博文老師的Raspberry Pi超炫專案與完全實戰 之學習紀錄。


安裝MySQL

sudo apt-get install mysql-server


[Raspberry Pi]架設中文版Wordpress-part3B

在安裝wordpress之前請先參照先前的文章安裝
1.[Raspberry Pi]安裝PHP網頁伺服器-part1
2.[Raspberry Pi]安裝MySQL資料庫-part2
3.[Raspberry Pi]架設Wordpress英文版,並且中文化-part3
此教學為遵照柯博文老師的Raspberry Pi超炫專案與完全實戰 之學習紀錄。


WordPress 是一個開放原始碼網誌/内容管理系统,專注於美學、網頁標準和易用性的個人發佈平台。WordPress 兼具自由與無價,你可以下載並且免費使用。
目前已超過8000萬以上網站使用,在全世界的網站中26%是使用wordpress架設的,我也有架設我個人的攝影作品集- Fuji-X Tribe 。


安裝前,先用以下指令確認網頁根目錄是否為 /var/www 
sudo  nano /etc/apache2/sites-enabled/000-default.conf

[Raspberry Pi]架設Wordpress英文版,並且中文化-part3

在安裝wordpress之前請先參照先前的文章安裝
1.[Raspberry Pi]安裝PHP網頁伺服器
2.[Raspberry Pi]安裝MySQL資料庫
此教學為遵照柯博文老師的Raspberry Pi超炫專案與完全實戰 之學習紀錄。


WordPress 是一個開放原始碼網誌/内容管理系统,專注於美學、網頁標準和易用性的個人發佈平台。WordPress 兼具自由與無價,你可以下載並且免費使用。
目前已超過8000萬以上網站使用,在全世界的網站中26%是使用wordpress架設的,我也有架設我個人的攝影作品集- Fuji-X Tribe 。


安裝前,先用以下指令確認網頁根目錄是否為 /var/www 
sudo  nano /etc/apache2/sites-enabled/000-default.conf

[Raspberry Pi]安裝PHP網頁伺服器-part1

1.[Raspberry Pi]安裝PHP網頁伺服器-part1
2.[Raspberry Pi]安裝MySQL資料庫-part2
3.[Raspberry Pi]架設Wordpress英文版,並且中文化-part3
4.[Raspberry Pi]架設中文版Wordpress-part3B
此教學為遵照柯博文老師的Raspberry Pi超炫專案與完全實戰 之學習紀錄。

安裝

使用以下三行,先更新系統,在下載apache2和設定php5的指令
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2 php5 libapache2-mod-php5

2016年8月15日 星期一

[rails]form-tag

>>index.html.erb

<%= form_tag(groups_path, method: "get") do %>
  <%= label_tag(:q) %>
  <%= text_field_tag(:q) %>
  <%= submit_tag("搜索") %>
<% end %>
<%= @a %>
</div>


groups_path  :處理的路徑
:q 將被存在 controller 裡相對路徑的 method 裡
此範例是 groupscontroller.rb的 index 裡如下

def index
@groups = Group.all
a = params[:q]
end

對網頁應用程式來說,表單是非常重要的用戶輸入介面。Rails在這方面也提供了很多好用的Helper方法。基本上,Rails處理表單分成兩種類型:
一種是對應到Model物件的新增、修改,我們會使用form_for這個Helper。它的好處在於透過傳入Model物件,可以在修改的時候自動幫你將預設值帶入。例如我們已經在Part1使用過的event表單:
<%= form_for @event do |f| %>
    <%= f.text_field :name %>
    <%= f.submit %>
<% end %>
另一種是就是沒有對應Model的表單,我們使用form_tag這個方法。例如:
<%= form_tag "/search" do %>
    <%= text_field_tag :keyword %>
    <%= submit_tag %>
<% end %>
form_for有些類似,但是其中不需要傳Block變數f,其中的欄位Helper需要多加_tag結尾。不像form_for的欄位名稱一定要是Model的屬性之一,在form_tag之中的欄位名稱則完全不受限。


form_tag 是啥?跟 form_for 有什麼不一樣?

Adler @ 2015-07-18

2016年8月11日 星期四

2016年8月9日 星期二

[Rails]表單 form 的運作方法

rails真的寫得太簡略了,雖然快速,不過對於剛接觸的我來說真的不是很好懂,所以在網上找到了關於form的詳細解說

http://adz.cool/posts/211663-rails-notes-form-helper

初學 Ruby on Rails 筆記 form 表單相關











[Rails]表單 form 的運作方法

rails真的寫得太簡略了,雖然快速,不過對於剛接觸的我來說真的不是很好懂,所以在網上找到了關於form的詳細解說

http://adz.cool/posts/211663-rails-notes-form-helper

初學 Ruby on Rails 筆記 form 表單相關


2016年8月8日 星期一

[python]for 用法

import requests
from bs4 import BeautifulSoup

res = requests.get("http://www.nfd.com.tw/house/year/2016.htm")

soup= BeautifulSoup(res.text)

tb = soup.select('table')[0]
tr = tb.select('tr')
print tr[0]

for i in tr:
    print i.select('td')




[Python]Post取得資料方法

POST取得資料方法 youtube


import requests
dd = {
'BB':'2',
'fromYear':'2016',
'fromMonth':'1',
'fromDay':'9',
'toYear':'2016',
'toMonth':'8',
'toDay':'9',
    }
res = requests.post('http://www.biga.com.tw/Record1.asp',data = dd)


data 的資料在headers 下方的Form Data裡面


將格式改成雜湊檔格式




import requests from bs4 import BeautifulSoup dd = { 'BB':'2', 'fromYear':'2016', 'fromMonth':'1', 'fromDay':'9', 'toYear':'2016', 'toMonth':'8', 'toDay':'9', } res = requests.post("http://www.biga.com.tw/Record1.asp",data = dd) soup= BeautifulSoup(res.text) print soup.select('table')[0]


ipython notebook


soup = BeautifulSoup(res.text)
print soup.text
將網頁中的文字取出

print soup.contents
內容

print soup.select()
print soup.select('html')
將所有html 存到list ,但html通常只有一個所以

print soup.select('html')[0]
這樣就是字串

print soup.select('h1')
print soup.select('a')

id -> #開頭
class -> .開頭



for item in soup.select('.thread'):
    print (soup.select('.subject')[0].text)

這裡容易出錯

for item in soup.select('.item'):
    print (item.select('strong')[0].text,item.select('.title')[0].text)






import requests
import re
headers = {'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36'}
from bs4 import BeautifulSoup
res = requests.get('https://www.stockdog.com.tw/stockdog/index.php?m=0&sid=')
soup= BeautifulSoup(res.text)

Python 安裝 (Mac OS X)

➜  ~ git:(master) pip

zsh: command not found: pip

沒有python


安裝homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

檢查是否安裝成功
brew -v
Homebrew 0.9.9 (git revision ed9b; last commit 2016-07-13)

安裝python3
brew install python3
==> Installing dependencies for python3: sqlite, gdbm==> Installing python3 dependency: sqlite==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.13.0.el_capitan.bottle.tar.gz######################################################################## 100.0%==> Pouring sqlite-3.13.0.el_capitan.bottle.tar.gz==> CaveatsThis formula is keg-only, which means it was not symlinked into /usr/local.
OS X provides an older sqlite3.
Generally there are no consequences of this for you. If you build yourown software and it requires this formula, you'll need to add to yourbuild variables:
    LDFLAGS:  -L/usr/local/opt/sqlite/lib    CPPFLAGS: -I/usr/local/opt/sqlite/include
==> Summary🍺  /usr/local/Cellar/sqlite/3.13.0: 10 files, 2.9M==> Installing python3 dependency: gdbm==> Downloading https://homebrew.bintray.com/bottles/gdbm-1.12.el_capitan.bottle.tar.gz######################################################################## 100.0%==> Pouring gdbm-1.12.el_capitan.bottle.tar.gz🍺  /usr/local/Cellar/gdbm/1.12: 18 files, 490.7K==> Installing python3==> Downloading https://homebrew.bintray.com/bottles/python3-3.5.2.el_capitan.bottle.tar.gz######################################################################## 100.0%==> Pouring python3-3.5.2.el_capitan.bottle.tar.gz==> /usr/local/Cellar/python3/3.5.2/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.5.2/bin --install-lib=/usr/local/lib/python3.5/site-packages --si==> /usr/local/Cellar/python3/3.5.2/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.5.2/bin --install-lib=/usr/local/lib/python3.5/site-packages --si==> /usr/local/Cellar/python3/3.5.2/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/local/Cellar/python3/3.5.2/bin --install-lib=/usr/local/lib/python3.5/site-packages --si==> CaveatsPip, setuptools, and wheel have been installed. To update them  pip3 install --upgrade pip setuptools wheel
You can install Python packages with  pip3 install <package>
They will install into the site-package directory  /usr/local/lib/python3.5/site-packages
See: https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Homebrew-and-Python.md
.app bundles were installed.Run `brew linkapps python3` to symlink these to /Applications.==> Summary🍺  /usr/local/Cellar/python3/3.5.2: 3,494 files, 53.2M

測試python
pip

zsh: command not found: pip

還是沒有,結果發現因為是版本3所以要pip3

pip3

Usage:     pip <command> [options]
Commands:  install                     Install packages.  download                    Download packages.  uninstall                   Uninstall packages.  freeze                      Output installed packages in requirements format.  list                        List installed packages.  show                        Show information about installed packages.  search                      Search PyPI for packages.  wheel                       Build wheels from your requirements.  hash                        Compute hashes of package archives.  completion                  A helper command used for command completion  help                        Show help for commands.
General Options:  -h, --help                  Show help.  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.  -V, --version               Show version and exit.  -q, --quiet                 Give less output.  --log <path>                Path to a verbose appending log.  --proxy <proxy>             Specify a proxy in the form [user:passwd@]proxy.server:port.  --retries <retries>         Maximum number of retries each connection should attempt (default 5 times).  --timeout <sec>             Set the socket timeout (default 15 seconds).  --exists-action <action>    Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup.  --trusted-host <hostname>   Mark this host as trusted, even though it does not have valid or any HTTPS.  --cert <path>               Path to alternate CA bundle.  --client-cert <path>        Path to SSL client certificate, a single file containing the private key and the certificate in PEM format.  --cache-dir <dir>           Store the cache data in <dir>.  --no-cache-dir              Disable the cache.  --disable-pip-version-check                              Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.



安裝requests 和 BeautifulSoup4


➜  ~ git:(master) pip3 install requests
Collecting requests
  Downloading requests-2.10.0-py2.py3-none-any.whl (506kB)
    100% |████████████████████████████████| 512kB 633kB/s 
Installing collected packages: requests
Successfully installed requests-2.10.0
➜  ~ git:(master) pip3 install BeautifulSoup4
Collecting BeautifulSoup4
  Downloading beautifulsoup4-4.5.1-py3-none-any.whl (83kB)
    100% |████████████████████████████████| 92kB 289kB/s 
Installing collected packages: BeautifulSoup4

Successfully installed BeautifulSoup4-4.5.1


將以上import到python,這邊跟上面一樣要改成"python3"

 ➜  ~ git:(master) python3
Python 3.5.2 (default, Jun 29 2016, 13:43:58) 
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> from bs4 import BeautifulSoup
>>> 

輸入後 ctrl+Z 跳出
[2]  + 6004 suspended  python3




➜  ~ git:(master) pip3 install "ipython[notebook]"

takes few mins


開啟方法
➜  ~ git:(master) ipython notebook

會自動開啟瀏覽器 or 你可以手動 http://localhost:8888/