2013年10月20日 星期日
2013年10月18日 星期五
使用Google Blockly訓練邏輯思考
Google Blockly是一款Web-based,以圖形拖拉組合、類似堆積木的方法,來寫程式的一個圖形化程式語言(graphical programming language)。
它是開放原始碼,可以在 Google Prjoect 上找到:https://code.google.com/p/blockly/
目前提供5個範例網頁,可以一窺Google Blockly堂奧
Puzzle - 學習使用堆積木來進行認識國家測驗
Maze - 迷宮遊戲訓練邏輯思考
Turtle - 使用Blockly繪圖.
Graph - Blockly's圖形計算機.
Code - 將Blockly程式轉換為JavaScript, Python or XML.
它是開放原始碼,可以在 Google Prjoect 上找到:https://code.google.com/p/blockly/
目前提供5個範例網頁,可以一窺Google Blockly堂奧
Puzzle - 學習使用堆積木來進行認識國家測驗
Maze - 迷宮遊戲訓練邏輯思考
Turtle - 使用Blockly繪圖.
Graph - Blockly's圖形計算機.
Code - 將Blockly程式轉換為JavaScript, Python or XML.
2013年10月15日 星期二
XAMPP - MySQL編碼設定
MySQL新增表格預設編碼為latin1,在MySQL monitor環境下輸入中文,結果會變成亂碼或無法顯示,建議改為utf8,並使用utf8_unicode_ci連線校對,做法如下:
修改xampp\mysql\bin\my.ini
在[client]區塊加入
default-character-set = utf8
把[mysqld]區塊加入
character-set-server = utf8
collation-server = utf8_unicode_ci
修改xampp\mysql\bin\my.ini
在[client]區塊加入
default-character-set = utf8
把[mysqld]區塊加入
character-set-server = utf8
collation-server = utf8_unicode_ci
2013年10月9日 星期三
XAMPP - 設定MySQL管理帳號密碼
安裝XAMPP後,MySQL預設管理帳號為root,但未加密碼。我們可以透過以下網址變更MySQL管理帳號密碼
http://localhost/security/index.php
變更MySQL root密碼後,必須一併更新PHPMyAdmin的設定檔,否則將無法登入PHPMyAdmin管理頁面。
PHPMyAdmin的設定檔在xampp之phpmyadmin子目錄,檔名config.inc.php
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'new_password';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
http://localhost/security/index.php
變更MySQL root密碼後,必須一併更新PHPMyAdmin的設定檔,否則將無法登入PHPMyAdmin管理頁面。
PHPMyAdmin的設定檔在xampp之phpmyadmin子目錄,檔名config.inc.php
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'new_password';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
2013年9月30日 星期一
串接式排版樣本 CSS
CSS『串接式排版樣本』是將文件樣式自內容與結構分離出來定義的抽象概念。它使資料展現和資料本身分隔開,多份資料可共用樣式表,也允許同一資料套用不同樣式表。
每一樣式宣告包括樣式選擇器(selector)及樣式規格(rule)二部份,格式如下:
selector {rule1; rule2; rule3; ...}
v 樣式規則(rule)
即樣式設定內容,格式如下:property:value
property為屬性名稱,而value為屬性設定值。例如:
color:GREEN
每一樣式選擇器允許設定一個以上的樣式規則,只要將樣式規則間以分號區隔即可,例如:
color:GREEN; text-align:CENTER;
v 樣式選擇器(selector)
通常文件中的不同標籤會需要不同的展現效果,換言之,必須能依標籤所扮演角色來套用不同的樣式。樣式選擇器就是用來區隔所屬的樣式規則要套用到那些標籤上。
CSS選擇器設定方式
v 類別選擇器(Class Selector)
類別選擇器的概念方便我們將文件中的標籤分門別類,然後套用不同樣式。
.classname {rule1; rule2; ... ;}
.bigSize {font-size:24pt;}
.hilited {color:#FFFFFF;}
v 代碼選擇器(ID Selector)
#idname {rule1; rule2; ... ;}
#mark {font-weight: bold;
font-style:italic;}
v 前後文選擇器(Contextual Selector)
outertag innertag {rule1; rule2; ... ;}
H1 EM {color:RED}
2013年9月4日 星期三
Android App設計 - 從網頁開啟App
首先為App之AndroidManifest.xml加入一個App專屬的<intent-filter>,例如
<activity
android:name="MyappMain"
android:label="@string/app_name"
android:noHistory="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="nkut.edu.sswuApp" android:host="nkut" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
</intent-filter>
</activity>
<html >
<head >
<title>launch apk from
browser</title >
<meta
http-equiv = "Content-Type" content = "text/html;
charset=utf-8" >
</head >
<body >
<p >
<a
href = "intent://nkut#Intent;scheme=nkut.edu.sswuApp;end">點我開啟APP</a></p >
</body >
</html>
訂閱:
文章 (Atom)



