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 | |
/** | |
* Displays a form to edit an existing User entity. | |
* | |
* @Route("/{id}/edit", name="user_edit") | |
* @Method("GET") | |
* @Template() | |
*/ | |
public function editAction( User $entity ) |
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
Math.formatFloat = function (f, digit) { | |
var m = Math.pow( 10, digit); | |
return parseInt(f * m, 10) / m; | |
} | |
var numA = 0.1; | |
var numB = 0.2; | |
alert(Math.formatFloat( numA + numB, 1) === 0.3); |
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
$( 'selector' ).on( event, fn); | |
//Its equal to | |
$( 'selector' ).bind( event, fn); | |
$( document ).on( event, 'selector', fn); | |
//Equal to | |
$( 'selector' ).live( event, fn); |
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
<!doctype html> | |
<html lang="zh-tw"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Deferred Object Simple Demo</title> | |
<script src="//code.jquery.com/jquery-1.9.1.js"></script> | |
</head> | |
<body> | |
<input type="text" value="" /> |
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 | |
echo "system<br/>"; | |
echo "<pre>會將內容直接輸出:</pre>"; | |
echo "<pre>"; | |
$last_line = system('ls', $status_code); | |
echo "</pre>"; | |
echo "<pre>只會有最後一行:".$last_line."</pre>"; | |
echo "<pre>狀態碼:".$status_code."</pre>"; |
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
<!doctype html> | |
<html lang="zh-tw"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Javascript的奇幻物件之旅</title> | |
<script src="//code.jquery.com/jquery-1.9.1.js"></script> | |
</head> | |
<body> | |
<div>公私有屬性方法簡單介紹</div> | |
</body> |
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 | |
namespace com\rsumilang\common; | |
class Object { | |
// ... code ... | |
} | |
?> |
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 | |
/********** Example1: *************/ | |
// Original | |
if ( isset( $var) ) { | |
$var = 'test'; | |
} | |
// 改成這樣-> |
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
// 參考:http://dreamerslab.com/blog/tw/javascript-callbacks/ | |
function do_a ( callback ) { | |
setTimeout( function() { | |
// 模擬一個需要長間的 function | |
console.log( '`do_a`: 這個需要的時間比 `do_b` 長' ); | |
// 如果 callback 存在的話就執行他 | |
callback(); | |
}, 3000 ); | |
} |
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
SELECT | |
LEFT(CONVERT(char(10), starttime, 112), 6) AS 月份, | |
RTRIM([AgentCD]) AS 人員代碼, | |
COUNT(DISTINCT([CustId])) AS 撥打會員數, | |
COUNT(TaskCD) AS 撥打通數, | |
SUM(DATEDIFF(second,StartTime,EndTime)) AS 撥打秒數, | |
COUNT(DISTINCT(day(starttime))) AS 工作日 | |
FROM CALLCENTER.dbo.CallLog | |
WHERE | |
custId NOT LIKE 'CT.' |