程式語言的發展就像是一部「如何讓人類用更自然的方式與電腦溝通」的演進史。從最早只能看懂二進位的硬體,到現在幾乎像在寫英文一樣的現代語言,這中間經歷了幾個重要階段與不同門派的演變。
大太陽底下甚麼事都會發生,更何況是宇宙呢?(Everything is possible under the sun; letting alone the universe.)
2026年8月16日 星期日
2025年5月4日 星期日
MAMAA 生成式 AI爭霸戰(MAMAA Generative AI Battle)-2025
MAMAA 生成式 AI 大比拼:誰才是AI領域的霸主?
MAMAA,這個縮寫代表著科技巨頭 Meta(Facebook)、Apple、Microsoft、Alphabet(Google)和 Amazon。這些公司在生成式 AI 領域的競爭日益白熱化,各自擁有獨特的優勢和發展方向。
2024年3月17日 星期日
Javascript倒數計時器(Javascript Final Countdown Counter)-2024
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="Snova" />
<title>倒數計時</title>
<script type="text/javascript">
window.onload=function(){
var timer=null;
var show=document.getElementById("show");
function show_date_time(){
var target=new Date("9999/12/31");
var today=new Date();
var timeold=(target.getTime()-today.getTime());
var sectimeold=timeold/1000
var secondsold=Math.floor(sectimeold);
var msPerDay=24*60*60*1000
var e_daysold=timeold/msPerDay
var daysold=Math.floor(e_daysold);
var e_hrsold=(e_daysold-daysold)*24;
var hrsold=Math.floor(e_hrsold);
var e_minsold=(e_hrsold-hrsold)*60;
var minsold=Math.floor((e_hrsold-hrsold)*60);
var seconds=Math.floor((e_minsold-minsold)*60);
if(daysold<0){
document.getElementById("time").innerHTML="逾期,倒數計時已經失效";
clearInterval(timer);
}
else{
if (daysold<10) {daysold="0"+daysold}
if (hrsold<10) {hrsold="0"+hrsold}
if (minsold<10) {minsold="0"+minsold}
if (seconds<10) {seconds="0"+seconds}
show.innerHTML="距離9999/12/31還有:"+daysold+"天"+hrsold+"小時"+minsold+"分"+seconds+"秒";
}
}
timer=setInterval(show_date_time,1000);
}
</script>
</head>
<body>
<div id="show"></div>
</body>
</html>
2024年3月10日 星期日
Javascript萬年曆(Javascript Calendar)-2024
<html>
<style type='text/css'>
.cal {border-collapse:collapse}
.cal TH {background:green;
border:solid 1px green;
text-align:center
}
.cal TD {border:solid 1px green;
text-align:right
}
.cal COL {background:pink}
</style>
<div id=calendar></div>
<script type='text/javascript'>
function drawCal(inc)
{
month+=inc;
if(month == 0 )
{
month=12;
year--;
}
else if( month == 13 )
{
month=1;
year++;
}
calendar(year, month);
}
function calendar(yr, mth)
{
var td=new Date();
var today=new Date( td.getFullYear(), td.getMonth(), td.getDate());
var s='<table class=cal><col>';
s+='<tr><th onclick="drawCal(-1)"><<<th colspan=5>'
+yr +'.'+ mth +'<th onclick="drawCal(1)">>>';
mth--;
s+='<tr><th>S<th>M<th>T<th>W<th>T<th>F<th>S';
var dt=new Date(yr, mth, 1);
var wd=dt.getDay(); //week day
var i;
s+='<tr>';
for( ; wd > 0 ; wd--) s+='<td>';
for( i=1; i<32; )
{
dt=new Date(yr, mth, i);
if( dt.toString() == today.toString() )
s+='<td style="color:blue; font-weight:bolder">'+i;
else
s+='<td>'+i;
dt=new Date(yr, mth, ++i);
if( dt.getMonth() != mth ) break;
wd=dt.getDay();
if( wd == 0 )
s+='<tr>';
}
for( ; wd < 6; wd++) s+='<td>';
s+='</table>';
document.getElementById('calendar').innerHTML=s;
}
var td=new Date();
var year=td.getFullYear();
var month=td.getMonth()+1;
calendar(year, month);
</script>
</html>
2018年8月19日 星期日
JavaScript大樂透(Javascript Lottery Number)
<html>
<head>
<title>Lottery Number</title>
</head>
<script type="text/javascript">
lotnum = new Array();
var t;
for (t=1; t<=49; t++)
{
lotnum[t-1] = t;
}
lotnum.sort( function(){ return Math.round( Math.random() ) - 0.5 ; } );
var counter;
for (counter=0; counter<=5; counter++)
{
document.write("號碼"+counter+":"+lotnum[counter]+"</br>");
}
document.write("特別號"+":"+lotnum[6]+"</br>");
</script>
</html>
2018年2月4日 星期日
HTML 5 地理位置API(HTML 5 Geolocation API)
<!DOCTYPE html>
<meta charset=utf-8>
<head>
<title>HTML5 Geolocation API</title>
<script>
function $i(id) {return document.getElementById(id);}
</script>
</head>
<body>
<table style="border: solid 1px red;">
<thead>
<tr><th>Attribute</th><th>Value</th><th>Unit</th>
</tr>
</thead>
<tbody>
<tr>
<td>Latitude</td>
<td id="latitude"></td>
<td>degree</td>
</tr>
<tr>
<td>Longitude</td>
<td id="longitude"></td>
<td>degree</td>
</tr>
<tr>
<td>Altitude</td>
<td id="altitude"></td>
<td>m</td>
</tr>
<tr>
<td>Accuracy</td>
<td id="accuracy"></td>
<td>m</td>
</tr>
<tr>
<td>Altitude Accuracy</td>
<td id="altitudeAccuracy"></td>
<td>m</td>
</tr>
<tr>
<td>Heading</td>
<td id="heading"></td>
<td>degree/s</td>
</tr>
<tr>
<td>Speed</td>
<td id="speed"></td>
<td>m/s</td>
</tr>
<tr>
<td>Timestamp</td>
<td id="timestamp"></td>
<td>ms</td>
</tr>
</tbody>
</table>
<script>
if (navigator.geolocation) {
var geo=navigator.geolocation;
var option={
enableAcuracy:false,
maximumAge:0,
timeout:60000
};
geo.getCurrentPosition(successCallback,
errorCallback,
option
);
}
else {alert("This browser doesn't support geolocation function!");}
function successCallback(position) {
$i("latitude").innerHTML=position.coords.latitude;
$i("longitude").innerHTML=position.coords.longitude;
$i("altitude").innerHTML=position.coords.altitude;
$i("accuracy").innerHTML=position.coords.accuracy;
$i("altitudeAccuracy").innerHTML=position.coords.altitudeAccuracy;
$i("heading").innerHTML=position.coords.heading;
$i("speed").innerHTML=position.coords.speed;
$i("timestamp").innerHTML=position.timestamp;
}
function errorCallback(error) {
var errorTypes={
0:"Unknown Error",
1:"Permisson Denied",
2:"Position Unavailable",
3:"Timeout"
};
alert(errorTypes[error.code]);
alert("code=" + error.code + " " + error.message);
}
</script>
</body>
或者 errorCallback(error)也可以改寫成
function errorCallback(error) {
var error=0;
switch (error) {
case 0:
alert(error);
alert("code=" + error.code + " " + "Unknown Error");
break;
case 1:
alert(error);
alert("code=" + error.code + " " + "Permisson Denied");
break;
case 2:
alert(error);
alert("code=" + error.code + " " + "Position Unavailable");
break;
case 3:
alert(error);
alert("code=" + error.code + " " + "Timeout");
break;
default:
alert(error);
alert("code=" + error.code + " " + "Unknown Error");
break;
};
}
2017年11月5日 星期日
如何在blogger與網頁顯示現在日期與時間(How to show present date & time in blogger and webpage?)
The current date & time is:<br />
<script>
var display=setInterval(function(){Time()},0);
<p id="currentdate"></p>
<p id="currenttime"></p>
<p id="currentdatetime"></p>
function Time()
{
var date=new Date();
var time=date.toLocaleTimeString();
var date1=date.toLocaleDateString();
document.getElementById("currentdate").innerHTML=date1;
document.getElementById("currenttime").innerHTML=time;
document.getElementById("currentdatetime").innerHTML=date;
}
</script>
2016年8月19日 星期五
2016年1月7日 星期四
隱私權(Privacy)
- Device information
- Log informationWhen you use our services or view content provided by our, we automatically collect and store certain information in server logs. This includes:
- details of how you used our service, such as your search queries.
- telephony log information like your phone number, calling-party number, forwarding numbers, time and date of calls, duration of calls, SMS routing information and types of calls.
- Internet protocol address.
- device event information such as crashes, system activity, hardware settings, browser type, browser language, the date and time of your request and referral URL.
- cookies that may uniquely identify your browser or your our Account.
- Location information
- Unique application numbersCertain services include a unique application number. This number and information about your installation (for example, the operating system type and application version number) may be sent to our when you install or uninstall that service or when that service periodically contacts our servers, such as for automatic updates.
- Local storageWe may collect and store information (including personal information) locally on your device using mechanisms such as browser web storage(including HTML5) and application data caches.
- Cookies and similar technologiesWe and our partners use various technologies to collect and store information when you visit a our service, and this may include using cookies or similar technologies to identify your browser or device. We also use these technologies to collect and store information when you interact with services we offer to our partners, such as advertising services or our features that may appear on other sites. Our our Analytics product helps businesses and site owners analyze the traffic to their websites and apps. When used in conjunction with our advertising services, such as those using the DoubleClick cookie, our Analytics information is linked, by the our Analytics customer or by our, using our technology, with information about visits to multiple sites.
2015年4月19日 星期日
Android學習心得-多國語言資料夾的設定(Android Study Review- Setting Multi-language Folders)
:Toast.makeText(this,"這是一個Toast",Toast.LENGTH_LONG).show();
,而且每個語言的strings.xml中text的值也要跟著變化,

