熱門文章

2015年8月6日 星期四

[Ruby]筆記

#定義方法,設定bag內容
def bag
    #產生一個陣列
    #把每個元素利用 yield傳給程式區塊
    ["鉛筆盒","課本","手帕","衛生紙","小說"].each { |stuff| yield(stuff) }
end


.each 將["鉛筆盒","課本","手帕","衛生紙","小說"]個別當作
|stuff|的值


stuff ="鉛筆盒"
stuff ="課本"
stuff ="手帕"
stuff ="衛生紙"
stuff ="小說"



#呼叫方法,把傳過來的內容做處理
bag { |s| puts "我的包包有 #{s}" }

=begin
我的包包有 鉛筆盒
我的包包有 課本
我的包包有 手帕
我的包包有 衛生紙
我的包包有 小說
=end

定義時, |a|yield(a)
呼叫時 , |s| puts "我的包包有 #{s}" 




2015年8月5日 星期三

[Mac]查詢ip位置

就我所知有三個方法:

  1. 點擊右上角的wifi圖示
  2. 點擊左上角的蘋果圖示
  3. 使用終端機


1.









2.



3.終端機,以我的電腦為例,在lunchpad的“其他”資料夾可以找到他。開啟後,輸入“ifconfig"




以上!是Mac OSX 的 IP查詢方法。

[Website]8 Basic Design Tips for New Websites


addthis-designstrategiesThinking about designing a new website, or even redesigning a site you already have? Here are some basic design strategies to keep in mind for higher engagement and usability. 

1. Keep it Simple

Whether you’re thinking about your home page, navigation, or content, keep it simple. Don’t make it hard to your visitors to find what they’re looking for. If you want visitors to press a button or fill out a form, don’t make them scroll to find it. Make it easy to find, and use your site’s navigation.
If you have a particular goal in mind, you can even invite visitors to do something, right when they arrive at your site. Now that’s simple!

2. Keep it Concise

Shorter content is easier to read, and will get your point across more quickly. See?

3. Header Hierarchy

Be sure to use a consistent hierarchy of headers. In HTML, these look like H1, H2, H3, and so forth. These headers convey the structure of your content, helping readers understand how your content is organized. Think about this structure when choosing font sizes and weights, so that an H3 doesn’t look more visually prominent than its parent H2.

4. White Space is Your Friend

Provide some room between lines of text and set up borders on the sides of your pages to keep content from becoming too wide and hard to read. Allow some space around pictures. These strategies allow visitors’ eyes to visually organize and scan your content more easily.

5. Speaking of Colors . . .

Use restraint—your visitors will thank you. Pick a primary color that will provide the foundation of your design, then pick a contrasting accent color for important buttons and other interface elements. Use tools like Adobe Color to explore different combinations of colors that look great together.

6. Make it Easy to Stay

Sometimes visitors arrive at your home page, but often search results or other links bring them to some other page in your site. Be sure to provide links in your content, and offer content recommendations to suggest other pages to read next. This invites visitors to stay longer and view more of what your site has to offer.

7. Make it Easy to Share

While content recommendations keep your current visitors around longer, sharing will invite new visitors to come to your site. Think about how sharing tools fit into your new design. They can float on the side your pages (remember those borders you created?) or can appear within your content, at the beginning or end of an article. Check out these best practices for more suggestions.

8. Make it Easy to Follow

Don’t forget to invite visitors to follow you on Facebook, Twitter and other social networks. This helps bring visitors back, and is a great way to know who your most loyal audience is—which, as our data shows, is very valuable.
There are many resources available online to help you with your new design. Visit sites you enjoy, think about how their designs help you use them more easily, and experiment with those ideas on your own site.
We’d love to hear how your design turned out, and how you used AddThis tools with your new creation. Good luck!


:http://www.addthis.com/blog/2014/10/24/8-basic-design-tips-for-new-websites/#.VcGxUXgkP40

[OSX]常用快捷鍵


我也終於開始踏入了 Mac 世界。不過我的原因和 Mac、 Windows 優劣之爭無關,單純因為規劃自己今年需要一台隨身筆電,而既然要買新筆電,不如買一台我自己沒有接觸過的系統,重新學習,看看不同的世界。於是,趁著前陣子 Apple 的單日特價,我就買了一台 11 吋螢幕的 Macbook Air。

放心,我不會寫開箱文,但是我要在電腦玩物加入一個新的系列:「 Mac 新手日記」,分享我在學習使用 Mac OS X 系統的過程中,遇到的問題如何解決?有沒有找到什麼活用內建功能的方法?怎麼善用 Apple Mac 上的各種基本應用?

感覺這幾年身邊的朋友真的有不少人改用 Mac,我現在也是 Mac 新手了,相信我遇到的問題、產生的疑惑,都會和這一群 Mac 新朋友很接近,希望這系列新手日記,可以幫到也一樣準備上手 Mac 的朋友。

2015/4/19 補充教學:Mac 用戶一定要知道這10個 Finder 獨特檔案整理技巧
2015/5/23 補充教學:Mac 用戶不可不用預覽程式:13招取代修圖 PDF 軟體



  • 那些快速鍵提示裡的特殊符號代表哪些按鍵?
在我的 Mac 新手之路上,我遇到的第一個需求是什麼呢?答案就是「快捷鍵」,我打算盡可能利用筆電的觸控板,這時候沒有滑鼠時,有些動作用快捷鍵就比較方便。

不過當我打開 Mac 的鍵盤快速鍵設定時,發現了一些我有看沒有懂的神秘符號??這些神秘符號沒有刷在我的 Macbook Air 鍵盤上,或許老用戶一看就懂,但是對於新手來說,根本無法跟鍵盤做對應啊!

當然,只要願意找,網路上一定有解答,只要去翻一下 Apple 的線上資料庫,就可以找出這些符號對應的按鍵:

Command 鍵   
Control 鍵
Option 鍵
Shift 鍵
Caps Lock 鍵
Fn 鍵功能鍵
雖然還是要硬記一下,不過用一段時間應該就能即時反應,以後看到快捷鍵的符號提示時,就知道要按哪些按鍵了。



前面提到的 Apple 「快速鍵線上說明」頁面,其實已經詳列了絕大多數的快速鍵指令,不過,應該不會有用戶真的「讀完」那一長串表格,就算看過一遍,也無法記住,自然不會真的用在實際的工作中。

所以下面讓我先來幫大家去蕪存菁,就以文書工作為主,來看看有哪些我們一定要知道、學會的 Mac OS X 快速鍵。



  • 1.快速切換輸入法
Mac OS X 的輸入法提示出現在右上方,已經內建了各國語言的輸入法,只要在第一次啟動時安裝自己需要的輸入法即可。

那麼,如果想要在英文、中文等不同輸入法之間立即切換,不用等滑鼠移動到右上方才切換,要用什麼快捷鍵呢?這時候,只要按下:

Command 鍵」 + 「 Space 空格鍵」
按下「Caps lock」按鍵可以在中文輸入法中開啟英數模式




  • 2.快速控制視窗
透過一些快捷鍵可以進行快速視窗切換,尤其在比較小的筆電螢幕上,可以空出空間給主要工作,但是又能快速切換到需要的工作 App(軟體)。

Command 鍵」+ M:把目前的工作視窗快速縮小到右下角。
Command 鍵」+ W:有時候一個軟體可能打開多個視窗,這個功能可以單獨關閉目前的「視窗」,但其他同一個程式的工作視窗仍在。
Command 鍵」+ Q:把目前使用中的程式關閉,所有跟程式相關的視窗當然也都一起關閉。
Command 鍵」+ N:在目前使用的程式中新增一個工作視窗或新文件。
Command 鍵」+ 「 Tab 」:在不同的程式之間切換。
「Command 鍵」+H:隱藏目前的應用程式。

這幾個視窗控制按鍵是很常用到的,這樣就不用移動游標老半天,而能快速進行工作切換。而且這幾個快速鍵非常好記憶,「M 」就是縮小(Mini)、「 W 」就是視窗( Window )、「 Q 」就是停止(Quit)、「 N 」就是新增( New )。



  • 3.用 Mac 內建快速鍵抓圖截圖
Mac OS X 已經內建抓圖功能,可以抓取全桌面,也能抓取自訂範圍,甚至可以單獨抓取正在使用中的視窗,這些都有相應的快捷鍵,一定要記下來。

Command 鍵」+「 Shift 鍵」+「 3 」:抓取全螢幕畫面。
Command 鍵」+「 Shift 鍵」+「 4 」:抓取自訂範圍畫面。
Command 鍵」+「 Shift 鍵」+「 4 」,然後在出現截圖游標時,按下「 Space 空格鍵」,可以指定要截取哪一個正在使用中的視窗。

以上這些內建的截圖功能,都會幫我們把截取的圖片存到桌面上,方便立刻使用。




  • 4.編輯文書的基本:複製、剪下、貼上、還原
最基本的功能,通常才是最常使用的功能,對於工作上最好用的快速鍵,還是複製、貼上這些基本功,而在 Mac OS X 中,這些功能的快速鍵指令是什麼呢?

Command 鍵」+ C :「複製」或「剪下」
Command 鍵」+ V :貼上
「Option 鍵」+「Command鍵」+ V:剪下後貼上
Command 鍵」+ A :全選
Command 鍵」+ Z :復原之前內容
Command 鍵」+ S :存檔



  • 5.沒有滑鼠時如何快速圈選段落文字?
前面提到我想要盡可能利用觸控板完成操作,這時候,有一件事情在觸控板上做起來真的很麻煩,那就是要圈選一大段的文字時,但是偏偏這又是文書處理中常常會用到的需求。

沒關係,其實這也可以用快速鍵解決,而且其實 Windows、 Mac 都一樣有這樣的功能,很簡單,不用記複雜的指令,只要記住:

「 Shift 鍵」+「上下左右方向鍵」

如此一來,會從你的游標處,根據你的方向指示開始圈選段落文句,非常直覺,也能快速圈選好一大段的圖文內容。



  • 6. Mac 上的 Ctrl+ Alt+ Delete 當機救援
Mac 會不會當機?當然還是會,應用程式還是有可能忽然停住沒反應,這時候要怎麼修復呢?難道 Mac 上也有 Windows 的 Ctrl + Alt + Delete 當機救援嗎?是的,當然有。

在 Mac OS X 中這個當機救援指令是:

Command 鍵」+「Option 鍵」+「 ESC 」

這樣就能呼叫出強制結束應用程式的視窗,讓我們立刻關閉出問題的程式。




  • 7.快速捲動到頁首、頁尾與下一個段落
當然,我在瀏覽網頁、文件時,可以用觸控板的雙指滑動來捲動頁面,不過,如果想要快速瀏覽,有沒有快捷鍵可以直接跳到頁首、頁尾或依據段落跳頁呢?

Command 鍵」+「上」:跳到頁首。
Command 鍵」+「下」:跳到頁尾。
Command 鍵」+「左」:游標跳到句首。
Command 鍵」+「右」:游標跳到句末。
「 Fn 鍵」+「上」:往上捲一個段落。(如果沒有 PageUP 時可用)
「 Fn 鍵」+「下」:往下捲一個段落。(如果沒有 PageDown 時可用)




  • 8.快速以純文字貼上
文書處理的工作中,有時候可能剪貼一些有格式的內容,但是希望在貼上到新文件時可以「去除格式」,也就是「以純文字格式貼上」,這時候只要在貼上時使用下面的指令即可:

Command 鍵」+「Shift 鍵」+「 V 」

這樣在貼上時,就會轉成純文字的格式了。




  • 9.開啟投影模式

當插上投影線,如果要讓工作視窗在投影螢幕上正常顯示,可以按下:

Command 鍵+「F1」:切換鏡像或延伸桌面



  • 小結:
當然,Mac OS X 可以使用的快速鍵還有非常多,即使是上面列出的功能,也可能有不同的快速鍵可以做到一樣的事情。不過上面這些是我經過挑選後,覺得最適合 Mac 新手,尤其是以文書處理為主要工作的朋友值得立刻學起來。

至於後續更進階的快速鍵,就等後續真的有常常用到,再慢慢的熟練即可,畢竟,人的腦袋是不可能記下所有的快速鍵的。

當然,如果你覺得還有哪些快速鍵值得新手學會,也歡迎留言推薦討論

[澳洲]健保退稅-Medicare levy exemption | Australian Taxation Office

澳洲健保medicare是透過ATO收取,費用則是年收入的2%於報稅時繳納,若年收入低於18200 AUD,就不必繳健保費且預繳的稅則能全數退還。換言之,這篇文章是給賺太多的人看得。
因背包客本身不屬於居民,適用於Category 3條例,依法來說是不必繳健保費的,因此得以免繳。點我看ATO說明
申請免繳證明很簡單,到DHS下載Medicare levy exemption certification application1表格,列印並填妥連同相關文件寄到DHS即可。
表格我有簡單加註中文說明,有需要就點我下載
註:ATO:Australia Taxation Office 澳洲國稅局
註:DHS:Department of human service


Medicare levy exemption | Australian Taxation Office


Category 3: Not entitled to Medicare benefits

You are exempt from paying the Medicare levy if you:
  • were a temporary resident and you did not have any dependants or they were all in an exemption category for that period
  • were not an Australian citizen
To claim an exemption you must have a Medicare Entitlement StatementExternal Link from the Department of Human Services. A letter from Medicare is not sufficient.


To apply for an exemption from the Medicare levy, the Minister for Health must certify you as not having entitlement to Medicare benefits for a particular period.
If possible, we encourage you to send completed applications and supporting documentation by email MES@humanservices.gov.au
All applications received by email will receive an acknowledgement of receipt.
Alternatively, you can send these documents to us by:
  • Fax: 1300 554 04
  • Post: Department of Human Services
    Medicare Entitlement Statement Unit
    GPO Box 9822
    ADELAIDE SA 5001



如何申請

附加證明文件
  • 護照,有照片那頁
  • 簽證,該稅務年度所涵蓋的所有簽證(大部分會牽涉到1,2簽,都附上吧)
  • 所有入境澳洲之戳章

Certified copies of the following:
  • photo page of your passport
  • evidence of visa(s) to cover the period you are claiming
  • all Australian arrival stamps, and
  • if you resided in the United Kingdom, Northern Ireland, Italy,
    Malta, Sweden, the Netherlands, Finland, Norway, Belgium or Slovenia, immediately before entering Australia, a copy of your European Health Insurance Card (EHIC), National Health Service (NHS) card or other health/medical insurance card specific to the country, showing an expiry date.