一、
標準表示式:[A-Za-z0-9]
二、
要求出現某樣表示式:(?=.*[])
(?=.*[])這段於法又稱做「右合樣 (Positive Lookahead)」,右合樣(或左合樣)語法所佔用的寬度為 0,也就是說這段語法本真不會佔用比對的字元,僅僅只是 Regular Expression 中的一種「判斷式」而已,右合樣 (Positive Lookahead)會判斷右邊緊接著的字元是否符合比對條件,如果符合條件才會繼續比對下去。
2014年3月10日 星期一
102-2 Lab4 破解網路大學排名
尋找大學能見度排名時使用http://www.opensiteexplorer.org/
注意事項
選擇page on this root domain
計算注意事項
rank<S>,rank<V>,rank<R>,rank<Sc>
為各自的排名,並非直接帶入實際的值
注意事項
選擇page on this root domain
計算注意事項
rank<S>,rank<V>,rank<R>,rank<Sc>
為各自的排名,並非直接帶入實際的值
2014年3月3日 星期一
102-2 Lab6 Using Chorme
2013年12月30日 星期一
2013年12月16日 星期一
102-1_Lab31:XML
介紹notepad++將xml轉成Html方法
Step1:將程式語言的部分改成XMLStep2:外掛模組→Plugin Manager→Show Plugin Manager
Step3:選擇XML Tool→Install
(灌好會重開一次notepad++)
Step4:準備好另一份XSL檔
Step5:外掛模組→XML Tool→XSL Transformation
Step6:選擇step4的XSL檔
Step7:得到轉好的HTML檔案
註明一:lab31的兩個檔案都需要把[]換成<>
參考一
2013年12月3日 星期二
102-1_Lab27:如何計算PageRank值
Example
有A, B, C 三個網頁,A引用了B, C,B引用了C,C也引用了 A
計算A,B,C 三個網頁的PageRank,三者PageRank排序為何?
Step1:
先找反向連結(被誰引用)
mean:反向連結數
P(A):c
P(B):a
P(C):a,b
Step2:
再找反向連結的正向連結(引用誰)
mean:看反向連結的品質
a*(1/2)
b*1
c*1
Step3:
代公式
P(A)=P(C)*0.85+0.15
P(B)=(P(A)*1/2)*0.85+0.15
P(C)=(P(A)*1/2+P(B))*0.85+0.15
*在課堂上跟大家講錯了Step2*
有A, B, C 三個網頁,A引用了B, C,B引用了C,C也引用了 A
計算A,B,C 三個網頁的PageRank,三者PageRank排序為何?
Step1:
先找反向連結(被誰引用)
mean:反向連結數
P(A):c
P(B):a
P(C):a,b
Step2:
再找反向連結的正向連結(引用誰)
mean:看反向連結的品質
a*(1/2)
b*1
c*1
Step3:
代公式
P(A)=P(C)*0.85+0.15
P(B)=(P(A)*1/2)*0.85+0.15
P(C)=(P(A)*1/2+P(B))*0.85+0.15
*在課堂上跟大家講錯了Step2*
2013年10月24日 星期四
102-1_Lab15 Hand code a form
助教悲劇補充:現在依然無法判斷大小
<html>
<title>lab14</title>
<body>
<form action="http://maps.google.com/maps" method="get" name="f" onsubmit="return check()">
<input name="q" type="text" /><br />
<input name="send" type="submit" value="search" />
</form>
</body>
<script>
var floatReg =/^([+-]?)[1-9]\d*(\.\d*)?,([+-]?)[1-9]\d*(\.\d*)?$/;
//funtion外宣告可以全域使用
var str=",";
f1=f.q.value.indexOf(str);
f2=f.q.value.length;
latitude=f.q.value.substring(0,f1);
longitude=f.q.value.substring(f1+1,f2);
y=parseInt(latitude);
x=parseInt(longitude);
//alert(y);
//alert(x);
//alert(y>90);
//alert(x<180);
//alert(y>90||x>180);
function check(){
if(!floatReg.test(f.q.value)){
alert("It's not correct format");
f.q.value="";
document.f.q.focus();
return false;
}
}
document.write(Date());
</script>
</html>
<html>
<title>lab14</title>
<body>
<form action="http://maps.google.com/maps" method="get" name="f" onsubmit="return check()">
<input name="q" type="text" /><br />
<input name="send" type="submit" value="search" />
</form>
</body>
<script>
var floatReg =/^([+-]?)[1-9]\d*(\.\d*)?,([+-]?)[1-9]\d*(\.\d*)?$/;
//funtion外宣告可以全域使用
var str=",";
f1=f.q.value.indexOf(str);
f2=f.q.value.length;
latitude=f.q.value.substring(0,f1);
longitude=f.q.value.substring(f1+1,f2);
y=parseInt(latitude);
x=parseInt(longitude);
//alert(y);
//alert(x);
//alert(y>90);
//alert(x<180);
//alert(y>90||x>180);
function check(){
if(!floatReg.test(f.q.value)){
alert("It's not correct format");
f.q.value="";
document.f.q.focus();
return false;
}
}
document.write(Date());
</script>
</html>
2013年10月21日 星期一
2013年10月14日 星期一
102-1_Lab12 Change an image by moving the mouse
<img src ="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMLHfEEgNYDFrU9Ula0Uka8uKzfQgrzcLfZ9cvNWySdYK2ia7FN2UXXYnpJd1lb6hgGWPWT5QOmPZb0law4NjhqizXa8RASzX7AvoTXmN7dh8PuU4rh9G_RfrO1wQiTpfnTWtUebm4Gdo/s320/DSC_1795.JPG" onmouseover="mOver(this)" onmouseout="mOut(this)" >
<script>
function mOver(obj)
{
obj.setAttribute("src","https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjuKSUhjEjG0IXijdpJdTBhemp4LkzjB80Mj6JZaJFbfjbZxepAcD9vN_ShNEdiJ8Mg_aaGiiCTzURbWhUeJKiMRL4uae0ilXuff7GuCuv4z8-o5fjEQGztZTCNORtMqeOY6q9YyNgpJl8/s320/DSC_1772.JPG");
}
function mOut(obj)
{
obj.setAttribute("src","https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMLHfEEgNYDFrU9Ula0Uka8uKzfQgrzcLfZ9cvNWySdYK2ia7FN2UXXYnpJd1lb6hgGWPWT5QOmPZb0law4NjhqizXa8RASzX7AvoTXmN7dh8PuU4rh9G_RfrO1wQiTpfnTWtUebm4Gdo/s320/DSC_1795.JPG");
}
</script>
主要為切換兩個事件
mouseover & mouseout
mouseover & mouseout
2013年10月7日 星期一
102-1_Lab7,9:Using browsers for programming
原程式碼:
<html>
<head>
</head>
<Title>Password Regex</Title>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
Password:<input type="password" id="examplePass" name="Enter password" />
<input type="submit" />
</form>
</body>
<script language="javascript">
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex = /^[A-Za-z\d]{6,}$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent = "Passwords need to above 6 words!";
notify.id = "notify";
var body = document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>
Sol of lab7 condition:/^[A-Za-z\d]{6,}$/
(至少要一大寫英或小寫英或數字、超過6字)
Sol of lab9 condition:/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W).{6,}$/
(至少一數字、一小寫英、一大寫英、一特殊字元("_"底線除外)、超過6字)
Sol of lab9 condition:/^(?=.*\d)(?=.*[\W_]).{6,}$/
(至少一數字、一特殊字元、超過6字,大小寫英可有可無)
"\W"為不包含大小寫A-Z和0~9和"_"
"\w"則剛好和\W完全相反
所以取特殊字元必須使用大寫"\W"(此時底線除外)
最後把底線加入:"[\W_]"
第二版程式碼:
<html>
<head>
</head>
<TITLE>exam the password</TITLE>
<body id="body">
<form method="POST" action="form-handler.php" onsubmit="return checkForm(this);">
<p>Username: <input type="text" name="username"></p>
<p>Password: <input type="password" name="pwd1"></p>
<p>Confirm Password: <input type="password" name="pwd2"></p>
<p><input type="submit"></p>
</form>
</body>
<script type="text/javascript">
function checkPassword(str)
{
var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W).{6,}$/;
// /^[A-Za-z\d]{6,}$/至少要一大寫英或小寫英或數字、超過6字
// /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W).{6,}$/ 至少一數字、一小寫英、一大寫英、一特殊字、超過6字
return re.test(str);
}
function checkForm(form)
{
if(form.username.value == "") {
alert("Error: Username cannot be blank!");
form.username.focus();
return false;
}
re = /^\w+$/;
if(!re.test(form.username.value)) {
alert("Error: Username must contain only letters, numbers and underscores!");
form.username.focus();
return false;
}
if(form.pwd1.value != "" && form.pwd1.value == form.pwd2.value) {
if(!checkPassword(form.pwd1.value)) {
alert("The password you have entered is not valid!");
form.pwd1.focus();
return false;
}
} else {
alert("Error: Please check that you've entered and confirmed your password!");
form.pwd1.focus();
return false;
}
return true;
}
</script>
</html>
參考資料:1、2、3、4、5、6
<html>
<head>
</head>
<Title>Password Regex</Title>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
Password:<input type="password" id="examplePass" name="Enter password" />
<input type="submit" />
</form>
</body>
<script language="javascript">
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex = /^[A-Za-z\d]{6,}$/;
if(!passwordRegex.test(document.getElementById("examplePass").value)){
console.log("Regex didn't match");
var notify = document.getElementById("notify");
if(notify === null){
notify = document.createElement("p");
notify.textContent = "Passwords need to above 6 words!";
notify.id = "notify";
var body = document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html>
Sol of lab7 condition:/^[A-Za-z\d]{6,}$/
(至少要一大寫英或小寫英或數字、超過6字)
Sol of lab9 condition:/^(?=.*\d)(?=.*[\W_]).{6,}$/
(至少一數字、一特殊字元、超過6字,大小寫英可有可無)
"\W"為不包含大小寫A-Z和0~9和"_"
"\w"則剛好和\W完全相反
所以取特殊字元必須使用大寫"\W"(此時底線除外)
最後把底線加入:"[\W_]"
第二版程式碼:
<html>
<head>
</head>
<TITLE>exam the password</TITLE>
<body id="body">
<form method="POST" action="form-handler.php" onsubmit="return checkForm(this);">
<p>Username: <input type="text" name="username"></p>
<p>Password: <input type="password" name="pwd1"></p>
<p>Confirm Password: <input type="password" name="pwd2"></p>
<p><input type="submit"></p>
</form>
</body>
<script type="text/javascript">
function checkPassword(str)
{
var re = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W).{6,}$/;
// /^[A-Za-z\d]{6,}$/至少要一大寫英或小寫英或數字、超過6字
// /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W).{6,}$/ 至少一數字、一小寫英、一大寫英、一特殊字、超過6字
return re.test(str);
}
function checkForm(form)
{
if(form.username.value == "") {
alert("Error: Username cannot be blank!");
form.username.focus();
return false;
}
re = /^\w+$/;
if(!re.test(form.username.value)) {
alert("Error: Username must contain only letters, numbers and underscores!");
form.username.focus();
return false;
}
if(form.pwd1.value != "" && form.pwd1.value == form.pwd2.value) {
if(!checkPassword(form.pwd1.value)) {
alert("The password you have entered is not valid!");
form.pwd1.focus();
return false;
}
} else {
alert("Error: Please check that you've entered and confirmed your password!");
form.pwd1.focus();
return false;
}
return true;
}
</script>
</html>
參考資料:1、2、3、4、5、6
2013年10月1日 星期二
102-1_Lab 4:破解網路大學排名DIY
破解網路大學排名DIY
能見度方法因內容過舊而不適用
其原理為找尋該網站之反向連結
故提供兩個網站提供該項服務
MajesticSEO:
Opensiteexplorer:
in Page:choose page on this root domain
參考網站:SEO部落客
能見度方法因內容過舊而不適用
其原理為找尋該網站之反向連結
故提供兩個網站提供該項服務
MajesticSEO:
Opensiteexplorer:
in Page:choose page on this root domain
參考網站:SEO部落客
2013年9月24日 星期二
102-1_LAB3:自訂地圖
地圖補釘
(標記自己想要的位置)
進入Google地圖→我的地點→建立地圖→新增地圖
進入後搜尋地點
在搜尋列下方有"新增標記"的補釘圖案
在搜尋結果下標記其他想要的地點
例:中原大學
完成地圖後需要分享(分享權限為:公開在網路上)
之後就可以點嵌入我的網站產生HTML-code
(標記自己想要的位置)
進入Google地圖→我的地點→建立地圖→新增地圖
進入後搜尋地點
在搜尋列下方有"新增標記"的補釘圖案
在搜尋結果下標記其他想要的地點
例:中原大學
完成地圖後需要分享(分享權限為:公開在網路上)
之後就可以點嵌入我的網站產生HTML-code
2013年9月23日 星期一
102-1_LAB2:新增最新回應
最新回應方法2
版面配置→新增小工具→資訊提供
輸入自己的Blog adress
完成後點選變更網址出現如下網址
http://s9826262.blogspot.com/feeds/posts/default
將"posts"更改為"comments"
再點選儲存即完成最新回應
版面配置→新增小工具→資訊提供
輸入自己的Blog adress
完成後點選變更網址出現如下網址
http://s9826262.blogspot.com/feeds/posts/default
將"posts"更改為"comments"
再點選儲存即完成最新回應
2013年1月7日 星期一
lab39 網際網路與社會服務
網際網路與社會服務
1. 油症支持協會替早期油症公害的受害者發聲及爭取權益。
2.台灣小林平埔原住民族文化重建協會
幫助在莫拉克風災重創的小林地區的居民重建。
3.創世基金會
每年舉辦飢餓30大會師,聚集眾人的力量關心台灣及世界各地的飢餓。
2012年12月17日 星期一
lab34_XML
1.xml與html同為標籤語言html主要為了排版,xml則是描述資料,所以形式上與html雷同,屬性質都需要用"<"、">"隔開,各種文件的定義也不能省略。而xsl就是把xml轉譯成xml的工具。
2012年12月15日 星期六
訂閱:
文章 (Atom)
