自己常常搞混,特此紀錄一下:
#python s='ww' type(s)
#ruby s='qq' s.type()
this blog records some issues I faced when I was developing my program. Hope these articles may help someone who faced the same problem.
#python s='ww' type(s)
#ruby s='qq' s.type()
gem install ocra接著,用ocra compile你的.rb檔
ocra example.rb第一次使用時,可能會產生下列錯誤(因為我已經解決下列錯誤,所以以下訊息是google來的)
Invalid gemspec in [c:/Ruby187/lib/ruby/gems/1.8/specifications/ocra-1.3.0.gemspec]: invalid date format in specification: "2011-06-19 00:00:00.000000000Z " Invalid gemspec in [c:/Ruby187/lib/ruby/gems/1.8/specifications/win32-autogui-0.5.0.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z" 1.8.8循著錯誤訊息的路徑(c:/Ruby187/lib/ruby/gems/1.8/specifications/)找到「ocra-1.3.0.gemspec」這分檔案後,把"2011-06-19 00:00:00.000000000Z"改成"2011-06-19"即可。
$().ready(function() { var $scrollingDiv = $("#scrollingDiv"); // #scrollingDiv請改成自己要移動的元素 $(window).scroll(function(){ $scrollingDiv .stop() .animate({"marginTop": ($(window).scrollTop() + 30) + "px"}, "slow" ); }); });
match 'm' => 'home#m'
class HomeController < ApplicationController layout 'application', :except =>"m" #avoid applying layout config to m.html.erb def index platform=request.env["HTTP_USER_AGENT"] #get user agent to check users' platform if /android/i =~ platform or /iPhone/i =~ platform #if users' platforms are phones, redirect it redirect_to m_path end end def m end end第二行的用意是防止layouts/application.html.erb 裡的設定干擾行動版網頁
set number "顯示行數" set autoindent "自動縮排" set shiftwidth=4 "使用'>'或'<'調整縮排時,一次調4格" set tabstop=4 "讓每個tab空4格,而非預設的8格" autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab "假如檔案為.py檔,則讓tab=空白。因為python視tab和space為不同的東西,這個設定可以避免不必要的困擾" syntax on "依檔案副檔名顯示色碼" filetype on filetype plugin on "開啟plug in" nnoremap <c-n> :NERDTree <cr> "以ctrl+n開啟NERDTree這個plugin" nmap <silent> <c-l> :tabnext<cr> "以ctrl+l 切到下一個vim tab" nmap <silent> <c-k> :tabprev<cr> "以ctrl+k 切到上一個vim tab"以上中文解說皆是註解,可以直接複製貼上到.vimrc中
<link href='http://homepage.ntu.edu.tw/~b97103021/shCore.css' rel='stylesheet' type='text/css'/link> <href='http://homepage.ntu.edu.tw/~b97103021/shThemeDefault.css'rel='stylesheet'type='text/css'>
<script language='javascript' src='http://homepage.ntu.edu.tw/~b97103021/shCore.js'/>
//your code
#your code
function remember( selector ){ $(selector).each( function(){ //if this item has been cookied, restore it var name = $(this).attr('name'); if( $.cookie( name ) ){ $(this).val( $.cookie(name) ); } //assign a change function to the item to cookie it $(this).change( function(){ $.cookie(name, $(this).val(), { path: '/', expires: 6 }); } ); } ); } $(document).ready( function(){ if($.cookie('host')=='ptt2') $("#host_ptt2").attr("checked","checked"); else $("#host_ptt").attr("checked","checked"); remember('[name=ptt_ID]'); remember('[name=aid]'); remember('[name=board]'); } );本文未完成,有待補完
rails server -p xxxx #xxxx為想要的port rails s -p xxxx #亦可用縮寫s取代server如此一來,就可以同時測試不同版本的project!