2013年12月16日 星期一
2013年12月9日 星期一
LAB28
第十四天:在鏈結上加入標題
第八天:建立有意義的網頁標題
<title>第八天:建立有意義的網頁標題 - Dive Into Accessibility</title>
第二十三天:提供能取代圖片的文字
<img width="106" border="0" title="氣象局開放資料平臺" alt="氣象局開放資料平臺" src="/V7/images/template/opendata_s.jpg"></img>
</a>
第十六天:不要開出新視窗
<a href="http://dia.z6i.org/mt/mt-search.cgi" accesskey="4">進階搜尋</a>
第九天:提供額外的導覽協助
<a id="pg-next" href="/search;_ylt=A8tUwZajvqVSlQcAHLZr1gt.?p=SS&ei=utf-8&fr=yfp&xargs=12KPjg1oduy5a3vOHvKvjFTvXBhg9O0JC35Is%5FWMQaRp8L%5FXNrR6AuOfa%5F3pgqGK5q7y%5Fg%5FQ%2E%2E&b=11&pstart=3" data-b="11">下一頁</a>
2013年12月2日 星期一
LAB27
有A, B, C 三個網頁,A引用了B, C,B引用了C,C也引用了 A
計算A,B,C 三個網頁的PageRank,三者PageRank排序為何?
Pa=0.15+0.425Pc
Pb=0.15+0.85Pa
Pc=0.15+0.85Pa+0.85Pb
Pb=0.15+0.85(0.15+0.025Pc)
=0.15+0.1275+0.36125Pc
Pc=0.15+0.85(0.15+0.425)+0.85(0.15+0.1275+0.35125Pc)
=0.15+0.1275+0.36125Pc+0.1275+0.108375+0.3070625Pc
=0.513375+0.6683125Pc
=> 0.3316875Pc=0.513375
=> Pc=1.5477671
Pb=0.15+0.1275+0.36125*1.5477671=0.83663086
Pa=0.15+0.45*1.5477671=0.807801012
Pc>Pb>Pa
計算A,B,C 三個網頁的PageRank,三者PageRank排序為何?
Pa=0.15+0.425Pc
Pb=0.15+0.85Pa
Pc=0.15+0.85Pa+0.85Pb
Pb=0.15+0.85(0.15+0.025Pc)
=0.15+0.1275+0.36125Pc
Pc=0.15+0.85(0.15+0.425)+0.85(0.15+0.1275+0.35125Pc)
=0.15+0.1275+0.36125Pc+0.1275+0.108375+0.3070625Pc
=0.513375+0.6683125Pc
=> 0.3316875Pc=0.513375
=> Pc=1.5477671
Pb=0.15+0.1275+0.36125*1.5477671=0.83663086
Pa=0.15+0.45*1.5477671=0.807801012
Pc>Pb>Pa
2013年11月11日 星期一
Lab 26 Design your business card
<html>
<body>
<div style="background-color: black; height: 500px; left: 600px; opacity: 0.5; position: absolute; width: 100px;">
</div>
<div style="border-radius: 50px; border: 50px solid #EE872A; font-family: verdana; padding: 10px;">
<div style="background-color: #8ac007; height: 60px; left: 60px; opacity: 0.3; position: absolute; width: 500px;">
</div>
<h3>
HO-YAN LIN</h3>
<div style="letter-spacing: 5px;">
Chung Yuan Christian University</div>
<div style="color: #40b3df;">
Electronic Engineering
<span style="background-color: #bbbbbe; color: black;">CYCU<span>
</span></span></div>
<div style="color: black;">
10026313</div>
</div>
</body>
</html>
<body>
<div style="background-color: black; height: 500px; left: 600px; opacity: 0.5; position: absolute; width: 100px;">
</div>
<div style="border-radius: 50px; border: 50px solid #EE872A; font-family: verdana; padding: 10px;">
<div style="background-color: #8ac007; height: 60px; left: 60px; opacity: 0.3; position: absolute; width: 500px;">
</div>
<h3>
HO-YAN LIN</h3>
<div style="letter-spacing: 5px;">
Chung Yuan Christian University</div>
<div style="color: #40b3df;">
Electronic Engineering
<span style="background-color: #bbbbbe; color: black;">CYCU<span>
</span></span></div>
<div style="color: black;">
10026313</div>
</div>
</body>
</html>
2013年11月10日 星期日
Homework 11-5-2013
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
var re = /\(?\d{3}\)?([-\/\.])\d{3}\1\d{4}/;
function check(){
var OK = re.exec(f.q.value);
if (!OK)
{window.alert(RegExp.input + " isn't a phone number with area code!");
f.q.value="";
document.f.q.focus();
return false; }
else
window.alert("Thanks, your phone number is " + OK[0]);
}
</script>
</head>
<body>
<p>Enter your phone number (with area code) and then click "Check".
<br>The expected format is like ###-###-####.</p>
<form name="f" action="#" onsubmit="return check()" method="get">
check:<input type="text" name="q">
<input id="phone" type="submit" value="check">
</form>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
var re = /\(?\d{3}\)?([-\/\.])\d{3}\1\d{4}/;
function check(){
var OK = re.exec(f.q.value);
if (!OK)
{window.alert(RegExp.input + " isn't a phone number with area code!");
f.q.value="";
document.f.q.focus();
return false; }
else
window.alert("Thanks, your phone number is " + OK[0]);
}
</script>
</head>
<body>
<p>Enter your phone number (with area code) and then click "Check".
<br>The expected format is like ###-###-####.</p>
<form name="f" action="#" onsubmit="return check()" method="get">
check:<input type="text" name="q">
<input id="phone" type="submit" value="check">
</form>
</body>
</html>
2013年11月4日 星期一
LAB22
<html> <head> </head> <body id="body"> <form action="https://maps.google.com/" name="f" method="get" id="exampleForm" onsubmit="return check()"> search:<input type="text" id="examplePass" name="q" > <input type="submit" value="submit"> <br> </form> </body> <script> function check(){ var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/; if(!passwordRegex.test(f.q.value)){ alert("!!!!!!"); f.q.value=""; return false; } } /* document.getElementById("exampleForm").onsubmit = function(){ var passwordRegex =/\-?\d+(\.\d+)?\,\-?\d+(\.\d+)?$/; if(!passwordRegex.test(document.getElementById("examplePass").value)){ console.log("Regex didn't match"); return false; var notify = document.getElementById("notify"); if(notify === null){ notify = document.createElement("p"); notify.textContent = "ERROR"; notify.id ="notify"; var body =document.getElementById("body"); body.appendChild(notify); } } */ </script> </html>
2013年10月28日 星期一
HOMEWORK 10-21-2013
<html>
<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="text" id="examplePass"/>
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/^(-?[\d])*$/;
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 = "ERROR";
notify.id ="notify";
var body =document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html
<html>
<head>
</head>
<body id="body">
<form action="javascript:void(0);" id="exampleForm">
<input type="text" id="examplePass"/>
<input type="submit" />
</form>
</body>
<script>
document.getElementById("exampleForm").onsubmit = function(){
var passwordRegex =/^(-?[\d])*$/;
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 = "ERROR";
notify.id ="notify";
var body =document.getElementById("body");
body.appendChild(notify);
}
}
};
</script>
</html
2013年10月21日 星期一
LAB15
看過上一篇「CGI簡介」,大家想必對CGI這玩意已經有些概念了,簡單來說,CGI只是一個介面,提供一些讓瀏覽器和server程式溝通的方法。 但CGI選是附屬壁HTTP通訊協定下,也就是瀏覽器要送資料給你的CGI程式或是CGI程式要將執行結果送到瀏覽器show出來,這都必須經過HTTPd這道關卡,因此CGI程式的I/O就必須要遵守HTTP通訊協定了。 其實CGI程式和一般程式也沒什麼不同,唯一的不同只有它的I/O部分,只要了解CGI程式I/O的原理,那CGI程式也就不足為懼了,接下來就看你programming的功力了。
在這份文件中有幾點要注意的:當我只寫『CGI』這三個字母,只代表著一個interface、一個gateway; 我若寫『CGI程式』,才是代表程式本身,請大家不要弄混了。 還有就是在文件中我所用的範例程式全部都是Perl程式,使用其他程式語言的人只好說聲抱歉了。但是在CGI程式的觀念部分是沒有語言之別的, 所以慣用其他程式語言的人也請你耐心看完本文件,說不定你也能從中獲得不少好處。 說起我為何只用Perl,一來想起C語言對字串處理的肉腳我就頭大,偏偏CGI程式最重要的工作就是處理字串; 二來,說實在話,雖然我對C還不算太肉腳,但叫我用C來寫CGI程式,我還真的不知從何下手哩。 因此對程式語言的初學者而言,我強烈推薦使用Perl語言,它絕對比任何一程程式語言都容易入門; 至於已經習慣用某一種程式語言的人我也勸你不妨試試Perl,至少在CGI程式方面它是一方霸主,鮮有其他語言能相提並論,對你CGI程式的發展絕對是有益無害的; 若你對C的基本語法有所認識的話,那我更要勸你趕緊試試Perl,它們之間的相似性,保證讓你一學便會、一看便知,不費什麼力氣就能學會如何使用Perl。
訂閱:
意見 (Atom)
















































