練習使用RESTful Web Servicet技術打造一個簡單書藉管理Web應用程式。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os; | |
import sys; | |
filePathSrc="YOUR FILE PATH" # Path to the folder with files to convert | |
for root, dirs, files in os.walk(filePathSrc): | |
for fn in files: | |
if fn[-4:] == '.java': # Specify type of the files | |
notepad.open(root + "\\" + fn) | |
notepad.runMenuCommand("Encoding", "Convert to UTF-8 without BOM") | |
notepad.save() | |
notepad.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Author: DonaldIsFreak | |
// Practice to programming Naive Bayes. | |
define("MAX_CATEGORY",10); | |
$category = array(); | |
$num_category = 0; | |
$num_samples = 0; | |
$num_columns = 0; | |
資料來源:http://disp.cc/b/11.cj-2q1S
當要抓取一段不固定的字串,例如 <b>
與 </b>
中間的字。
最常看到的方法就是使用正規表示式 regular expression (以下簡稱 regex):
- Controller從Router取得Model,作為Model與View/Template之間橋樑。
- Controller若不宣告,EmberJS會自動產生。
- 要留意resouce是routes群組且允許巢狀,同時也重新設定巢狀命名為最後的resource name。
modelFor
方法可以讓你使用別的Route的Model。- Actions是在目前Controller觸發相關聯Method的事件,若在Controller沒發現Method,就會透過Route將action往上傳遞直到配對為止。
- 從Route切換和從Controller切換有點小方地不一樣。
// from a route
「負負得正」一直都是常識,但為什麼負負會得正? 以前疑惑的點,今天終於獲得自由。
好奇兩個負債的人,為何撞在一起,就會發大財(誤)。
假設 (-1).(-1) = -1,若以 -1.(1-1) 套入分配律會得到 -1-1 = -2,可是明眼人都知道-1.(1-1) = -1.0 = 0,故產生矛盾。
真是看書長知識。 — reading 數學是什麼.