2015年11月26日 星期四

[PHP7]PHP7新特性的介绍

新特性介紹


    PHP NG – Zend Engine 3

    抽象語法樹

    64位的 INT 支持

    統一的變量語法

    新增Closure::call()

    一致性foreach循環

    匿名類的支持

    新增 <=>、**、?? 、\u{xxxx}操作符

    增加了返回類型的聲明

    增加了標量類型的聲明

    核心錯誤可以通過異常捕獲

    增加了上下文敏感的詞法分析

2015年11月21日 星期六

[elasticsearch]elasticsearch安裝

最近由於elasticsearch升級至2.0版本,需要更新自己主機上的版本,順便做個紀錄
首先,先下載你需要的版本的壓縮檔
https://www.elastic.co/downloads/elasticsearch
分別有 zip,tar,deb,rpm等四種格式,下載後解壓縮,
執行解壓縮後目錄中的 bin/elasticsearch即可,
打開瀏覽器連結到http://127.0.0.1:9200應該就可以看到畫面,
類似這樣的文字
{
  "name" : "Stentor",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.0.0",
    "build_hash" : "de54438d6af8f9340d50c5c786151783ce7d6be5",
    "build_timestamp" : "2015-10-22T08:09:48Z",
    "build_snapshot" : false,
    "lucene_version" : "5.2.1"
  },
  "tagline" : "You Know, for Search"
}  

2015年11月16日 星期一

[Laravel] Laravel 5.2 更新內容

隱晦模型綁定(Implicit model binding)

隱晦模型綁定是一個新的特性,他將會自動綁訂一個模型到路由,以下是範例程式碼:

Route::get('/api/posts/{post}', function(Post $post) {
    return $post;
});




上述程式碼將會在背後直接呼叫 Post::findOrFail($post) 並且將它注入到 $post 這個變數。對於有經驗的Laravel開發者,這個功能就很像是已經存在的 路由模型綁定 ,但現在移除了手動綁定它。

2015年7月29日 星期三

常見jQuery的三種不同架構 $(function(), (function($), $.fn.myFunctionName

第一種
$(function(){
// Document is ready
});
其作用和 $(document).ready()一樣 ,用意在DOM載入後執行ready()方法。

第二種
(function($) {
// Here "$" is a jQuery reference
})(jQuery)
基本上是()(para)匿名方法(anonymous function),傳承jQuery的函式庫,jQuery plugins都是用這樣的架構。

第三種
$.fn.myFunctionName = function(){
// script codes
}
自己定義function

轉貼自:http://www.j4.com.tw/web-design/%E5%B8%B8%E8%A6%8Bjquery%E7%9A%84%E4%B8%89%E7%A8%AE%E4%B8%8D%E5%90%8C%E6%9E%B6%E6%A7%8B-function-function-fn-myfunctionname/

2015年3月30日 星期一

[osx]在windows 7 的virtualbox啃蘋果


How to install OS X Mavericks in Virtualbox with Niresh

We've previously shown you how to install OS X Mountain Lion on a virtual machine by using iAtkos ML2, which is great practice for installing Mac OS X on your actual computer. And now that Apple has released OS X Mavericks, it's only fitting that we show you how to install Mavericks in a virtual machine as well. Unlike in previous versions of this guide, we'll be using the newly-popular "Niresh" distro of Mavericks instead the old iAtkos distro (which is no longer publicly available for free). While we've already shown you how to install Mavericks on your actual computer with Niresh, it also works great with virtual machines.

2015年3月27日 星期五

[VirtualBox] Ubuntu 14.04 調整螢幕解析度

點選模擬器視窗上方的 "裝置"→"插入 Guest Additions CD 映像",
系統內就會顯示需要密碼取得權限繼續安裝,
輸入密碼後點選確定,安裝完畢後重開機即可調整解析度。

Google Analytics初學者入門簡介