2013年12月30日 星期一
2013年12月23日 星期一
2013年12月9日 星期一
2013年12月2日 星期一
Lab 27
Pa=0.15+0.85(1/2Pc) ---(1)
Pb=0.15+0.85Pa ---(2)
Pc=0.15+0.85(Pa+Pb) ---(3)
(1)代(2)
Pb=0.15+0.1275+0.36125Pc ---(4)
(1).(4)代(3)
Pc=0.15+0.85(0.15+0.425Pc)+0.850.15+0.1275+0.36125Pc
=0.513375+0.6683125Pc
0.3316875Pc=0.513375 => Pc=1.5477671
Pb=0.15+0.1275+0.36125*1.5477671=0.83663086 => Pb=0.83663086
Pa=0.15+0.425*0.15477671=0.807801012 => Pa=0.807801012
Pc>>Pb>Pa
Pb=0.15+0.85Pa ---(2)
Pc=0.15+0.85(Pa+Pb) ---(3)
(1)代(2)
Pb=0.15+0.1275+0.36125Pc ---(4)
(1).(4)代(3)
Pc=0.15+0.85(0.15+0.425Pc)+0.850.15+0.1275+0.36125Pc
=0.513375+0.6683125Pc
0.3316875Pc=0.513375 => Pc=1.5477671
Pb=0.15+0.1275+0.36125*1.5477671=0.83663086 => Pb=0.83663086
Pa=0.15+0.425*0.15477671=0.807801012 => Pa=0.807801012
Pc>>Pb>Pa
2013年11月11日 星期一
HW 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 .
<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 .
<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日 星期一
Lab 22
<html>
<body>
<form action="https://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*(\.\*)?$)/;
function check(){
if(!floatReg.test(f.q.value)){
alert("It's not correct format,please retry");
f.q.value="";
document.f.q.focus();
return false;
}
}
document.write(Date());
</script>
</html>
<body>
<form action="https://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*(\.\*)?$)/;
function check(){
if(!floatReg.test(f.q.value)){
alert("It's not correct format,please retry");
f.q.value="";
document.f.q.focus();
return false;
}
}
document.write(Date());
</script>
</html>
2013年10月28日 星期一
Lab 18
<html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="q" method="get" id="exampleForm" onsubmit="return check()">
search:<input type="text" id="examplePass" name="q" >
<input type="submit" value="submit">
<br>
</form>
</body>
<script>
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>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="q" method="get" id="exampleForm" onsubmit="return check()">
search:<input type="text" id="examplePass" name="q" >
<input type="submit" value="submit">
<br>
</form>
</body>
<script>
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>
Lab 17
<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+(\.\d+)?\,\-?\d+(\.\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>
<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+(\.\d+)?\,\-?\d+(\.\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>
Lab 16
<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+(\.\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>
<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+(\.\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日 星期一
Lab 15
<html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="q" method="get" id="exampleform">
search:<input type="text" name="q" id="examplePass">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>
<head>
</head>
<body id="body">
<form action="https://maps.google.com/" name="q" method="get" id="exampleform">
search:<input type="text" name="q" id="examplePass">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>
Lab 14
1.
<html>
<head>
</head>
<body id="body">
<form action="http://www.google.com.tw/search" id="exampleForm" name="q" method="get">
<input type="text" name="q" id="examplePass" />
<input type="submit" />
</form>
</body>
<html>
<head>
</head>
<body id="body">
<form action="http://www.google.com.tw/search" id="exampleForm" name="q" method="get">
<input type="text" name="q" id="examplePass" />
<input type="submit" />
</form>
</body>
2.<html>
<head>
</head>
<body>
<form action="http://www.google.com.tw/search" name="q" method="post">
search:<input type="text" name="q">
<input type="submit" value="submit">
<br>
</form>
</body>
</html>
Lab 13
<html>
<body>
<img onmouseover="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG'" onmouseout="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78aVAdTEK9cDKbPHhtAAp5m8Tu1kLUPNs4Pb0hxoNwxXgROU8UkiNLFYpF61_LtQ6mwQfkpPclFqZ1d82T1UepzHGo2BPMBdZs4nWBHMuhUGbD1oA_S5qWDK7vnx1MCUszNB2quZKG25T/s320/DSC_1772.JPG'" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG"</img>
</body>
</html>
<body>
<img onmouseover="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG'" onmouseout="this.src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78aVAdTEK9cDKbPHhtAAp5m8Tu1kLUPNs4Pb0hxoNwxXgROU8UkiNLFYpF61_LtQ6mwQfkpPclFqZ1d82T1UepzHGo2BPMBdZs4nWBHMuhUGbD1oA_S5qWDK7vnx1MCUszNB2quZKG25T/s320/DSC_1772.JPG'" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG"</img>
</body>
</html>
2013年10月14日 星期一
Lab 12
<html>
<body>
<img onmouseover="build(this)" onmouseout="buil(this)" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG"</img>
<script>
function build(myImg)
{
myImg.setAttribute("src","https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJZj6Kp_iPNEVB58Ppb45-xkH9sc3XlpPPaF-bGcBQyr-aMaiXidZ8EqVob76tV93L4YspRKOaheBB33ytJa3DIeViJLp2eq98frp5qX8Cbq-xqToA-ax8pCshXPn60GmmDIS_k4p1II8/s320/DSC_1795.JPG")
}
function buil(myImg)
{
myImg.setAttribute("src","https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78aVAdTEK9cDKbPHhtAAp5m8Tu1kLUPNs4Pb0hxoNwxXgROU8UkiNLFYpF61_LtQ6mwQfkpPclFqZ1d82T1UepzHGo2BPMBdZs4nWBHMuhUGbD1oA_S5qWDK7vnx1MCUszNB2quZKG25T/s320/DSC_1772.JPG")
}
</script>
</body>
</html>
訂閱:
文章 (Atom)