Reference:
http://www.cnblogs.com/oomusou/archive/2011/08/20/quartus2_in_virtualbox.html
OpenCL
lspci (GeForce GT 2000 3000 ... 8000 (up 8000 is okay) ... 100 .....600)hardware supported
CUDA toolkit - http://developer.nvidia.com/cuda-downloads
http://www.nvidia.com/content/devzone/index.html
CUDA FOR LINUX
1) Download Toolkit for your system
2) Download Drivers for your system
******************************************************************************
Reference: http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/
http://www.streamcomputing.eu/blog/2011-12-29/opencl-hardware-support/
OpenCL hardware support
http://askubuntu.com/questions/131506/how-can-i-get-nvidia-cuda-or-opencl-working-on-a-laptop-with-nvidia-discrete-car
vim /etc/bash.bashrc
#include
sudo cp -r /usr/include/nvidia-current/CL /usr/include
or
sudo cp -r /usr/local/cuda/include/CL /usr/include
CUDA toolkit - http://developer.nvidia.com/cuda-downloads
http://www.nvidia.com/content/devzone/index.html
CUDA FOR LINUX
1) Download Toolkit for your system
2) Download Drivers for your system
******************************************************************************
Installing OpenCL on Ubuntu Linux with NVIDIA graphics card
Download the CUDA toolkit for Ubuntu from NVIDIAs CUDA site. Open a terminal an run the installation file with the command:
sudo sh cudatoolkit_3.1_linux_64_ubuntu9.10.run
Download the Developer Drivers for Linux at the same website and install it by first stopping X, running the file and start X again. Do stop X use:
sudo /etc/init.d/gdm stop
(lightdm)
Then get a terminal up by pressing CTRL+ALT+F5, login and navigate to where you downloaded the devdriver then type:
sudo sh devdriver_3.1_linux_64_256.40.run
After the driver has been installed start x again by typing
startx
Before compiling an OpenCL application you need to add the path to the lib folder of CUDA to LD_LIBRARY_PATH like so:
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
******************************************************************************
Reference: http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/
http://www.streamcomputing.eu/blog/2011-12-29/opencl-hardware-support/
OpenCL hardware support
http://askubuntu.com/questions/131506/how-can-i-get-nvidia-cuda-or-opencl-working-on-a-laptop-with-nvidia-discrete-car
vim /etc/bash.bashrc
#include
or
sudo cp -r /usr/local/cuda/include/CL /usr/include
replace backslach and double quotation mark
'&','&'
'\n','
'
'’',"'"
'<','<'
'>','>'
'™',''
escape
------------------------------------------------------------
addslashes()
單引號 雙引號 反斜線 NULL 添加反斜線
urlencode()
針對參數值
htmlentities()
htmlspecialchars()
- '&' (and符號)轉換成 '&'
- '"' (雙引號)轉換成 '"'
- '<' (小於)轉換成 '<'
- '>' (大於)轉換成 '>'
針對整個?後面的查詢字串
-------------------------------------------------------------
ESCAPE
First)
\ -> \\
Second)
" -> \"
Google App Engine Instruction
google_appengine/dev_appserver.py helloworld/ dev_appserver.py --clear_datastore helloworld/ appcfg.py update helloworld/
URI vs URL
Universal Resource Identifier (URI) -
可以識別出某項資源(object, person, or some...etc)的項目可系分為URN, URL
-----URN
-----URL
所以URL是URI, 但URI並不一定就是URLReference:http://en.wikipedia.org/wiki/Uniform_resource_identifierhttp://en.wikipedia.org/wiki/Url
可以識別出某項資源(object, person, or some...etc)的項目可系分為URN, URL
-----URN
-----URL
所以URL是URI, 但URI並不一定就是URLReference:http://en.wikipedia.org/wiki/Uniform_resource_identifierhttp://en.wikipedia.org/wiki/Url
Regular expression
| Character classes | |
|---|---|
| . | any character except newline |
| \w \d \s | word, digit, whitespace |
| \W \D \S | not word, digit, whitespace |
| [abc] | any of a, b, or c |
| [^abc] | not a, b, or c |
| [a-g] | character between a & g |
| Anchors | |
| ^abc$ | start / end of the string |
| \b | word boundary |
| Escaped characters | |
| \. \* \\ | escaped special characters |
| \t \n \r | tab, linefeed, carriage return |
| \u00A9 | unicode escaped © |
| Groups & Lookaround | |
| (abc) | capture group |
| \1 | backreference to group #1 |
| (?:abc) | non-capturing group |
| (?=abc) | positive lookahead |
| (?!abc) | negative lookahead |
| Quantifiers & Alternation | |
| a* a+ a? | 0 or more, 1 or more, 0 or 1 |
| a{5} a{2,} | exactly five, two or more |
| a{1,3} | between one & three |
| a+? a{2,}? | match as few as possible |
| ab|cd | match ab or cd |
Reference: http://www.regexpal.com/
我們可以使用預先定義的字元類別:
| . | 符合任一字元 |
| \d | 等於 [0-9] 數字 |
| \D | 等於 [^0-9] 非數字 |
| \s | 等於 [ \t\n\x0B\f\r] 空白字元 |
| \S | 等於 [^ \t\n\x0B\f\r] 非空白字元 |
| \w | 等於 [a-zA-Z_0-9] 數字或是英文字 |
| \W | 等於 [^a-zA-Z_0-9] 非數字與英文字 |
. 符合任一字元。例如有一字串abcdebcadxbc,使用.bc來比對的話,符合的子字串有abc、ebc、xbc三個;如果使用..cd,則符合的子字串只有bcd。
以上的例子來根據字元比對,您也可以使用「字元類」(Character class)來比較一組字元範圍,例如:
| [abc] | a、b或c |
| [^abc] | 非a、b、c的其它字元 |
| [a-zA-Z] | a到z或A到Z(範圍) |
| [a-d[m-p]] | a到d或m到p(聯集) |
| [a-z&&[def]] | d、e或f(交集) |
| [a-z&&[^bc]] | a到z,除了b與c之外(減集) |
| [a-z&&[^m-p]] | a到z且沒有m到p(a-lq-z)(減集) |
一次只指定一個字元不過癮,也可以用Greedy quantifiers來指定字元可能出現的次數:
| X? | X出現一次或完全沒有 |
| X* | X出現零次或多次 |
| X+ | X出現一次或多次 |
| X{n} | X出現n次 |
| X{n,} | X出現至少n次 |
| X{n,m} | X出現至少n次,但不超過m次 |
Reference:
http://www.codeproject.com/Articles/9099/The-Minute-Regex-Tutorial
http://regex.learncodethehardway.org/book/
Subscribe to:
Posts (Atom)