也許五年前看起來還很新潮,但現在已經過時了
所以我自己做的一個 Apache 美化套件
檔案下載:fancy.zip

# @version $Id: .htaccess 130 2010-09-29 10:03:56Z jax.hu $ #Options -FollowSymLinks -Indexes #TODO 開發時關閉 # 關閉 Apache Rewrite 模組 <IfModule mod_rewrite.c> RewriteEngine off </IfModule> # 啟用 Apache mod_expires 模組,來管理 browser 端的 cache 時間 <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A0 # ExpiresDefault "<base> [plus] {<num> <type>}*" # base:[ access | modification ] # type:[ years | months | weeks | days | hours | minutes | seconds ] <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"> ExpiresDefault "access plus 1 years" </FilesMatch> <FilesMatch "\.(jpg|jpeg|png|gif|swf|txt|xml|js|css)$"> ExpiresDefault "access plus 7 days" </FilesMatch> </IfModule> # 關閉 Apache 對檔案的實體標籤 FileETag none
# @version $Id: .htaccess 130 2010-09-29 10:03:56Z jax.hu $ RewriteEngine on RewriteRule ^.*$ index.php php_flag magic_quotes_gpc off php_flag register_globals on php_flag output_buffering on # 啟用 Apache 壓縮模組 <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/css AddOutputFilterByType DEFLATE text/javascript AddOutputFilterByType DEFLATE text/js AddOutputFilterByType DEFLATE text/xml AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/plain AddOutputFilterByType DEFLATE image/svg+xml AddOutputFilterByType DEFLATE application/xhtml+xml AddOutputFilterByType DEFLATE application/xml AddOutputFilterByType DEFLATE application/rss+xml AddOutputFilterByType DEFLATE application/atom_xml AddOutputFilterByType DEFLATE application/x-javascript AddOutputFilterByType DEFLATE application/x-httpd-php AddOutputFilterByType DEFLATE application/x-httpd-fastphp AddOutputFilterByType DEFLATE application/x-httpd-eruby AddOutputFilterByType DEFLATE application/postscript AddOutputFilter DEFLATE html htm xml css js svg # properly handle requests coming from behind proxies <IfModule mod_headers.c> Header append Vary User-Agent </IfModule> </IfModule>
<?php // SVN-keywords-test.php /* $Id$ $Date$ $Revision$ $Author$ $HeadURL$ */
<Location /svn> DAV svn SVNParentPath /var/lib/svn AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd AuthzSVNAccessFile /etc/apache2/dav_svn.authz <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>
# 設定使用者群組 [groups] group1 = user1,user2 group2 = user1,user3 # 設定全域皆可讀取 [/] * = r # 指定 repo1 只有 group1 可以寫入 [repo1:/] @group1 = rw # 指定 repo1 中 blog 這個目錄只有 uesr2 可以寫入 [repo1:/blog/] uesr2 = rw # 指定 repo2 只有 group2 可以寫入 [repo2:/] @group2 = rw # 指定 repo3 只有 user1 可以寫入 [repo3:/] user1 = rw
// xxxx.exe -cfg path -tg target #include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { int status = 0; for (int i=1; i<argc; i++){ if (!strcmp(argv[i], "-tg")){ i++; if (i < argc){ printf("target is %s\n",argv[i]); }else { status=1; break; } }else if (!strcmp(argv[i], "-cfg")){ i++; if (i < argc){ printf("config path is %s\n",argv[i]); }else { status=1; break; } } } return status; }
function replacer(str, p1, p2, offset, s){ return str + " - " + p1 + " , " + p2; } var newString = "XXzzzz".replace(/(X*)(z*)/, replacer); //newString to "XXzzzz - XX , zzzz" var re = /(\w+)\s(\w+)/; var str = "John Smith"; var newstr = str.replace(re, "$2, $1"); print(newstr); //This prints "Smith, John".
Possible name | Supplied value |
---|---|
str | The matched substring. (Corresponds to $& above.) |
p1, p2, ... | The nth parenthesized submatch string, provided the first argument to replace was a RegExp object. (Correspond to $1, $2, etc. above.) |
offset | The offset of the matched substring within the total string being examined. (For example, if the total string was "abcd" , and the matched substring was "bc" , then this argument will be 1 .) |
s | The total string being examined. |
MovieClip.prototype.loadMovieClip = function(src:String, onComplete:Function) :MovieClip { var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener({onLoadInit:onComplete}); mcLoader.loadClip(src,this); return this; };
var container:MovieClip = createEmptyMovieClip("container", this.getNextHighestDepth()); container._x = container._y = 0; container.visible = false; container.loadMovieClip("vodBlock.swf", function(container:MovieClip) { trace("load complete"); container._visible = false; });
var dataStr="jax"; var loadMc:MovieClip = createEmptyMovieClip("container", this.getNextHighestDepth()); loadMc._x = loadMc._y = 0; loadMc.visible = false; var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(this); mcLoader.loadClip("vodBlock.swf",loadMc); function onLoadInit(loadMc:MovieClip) { loadMc._visible = false; loadMc.text=this.dataStr; }
var myObject = { dataStr:"jax", loadMc:null, init:function(){ this.loadMc= createEmptyMovieClip("container", this.getNextHighestDepth()); this.loadMc._x = this.loadMc._y = 0; this.loadMc.visible = false; var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(this); mcLoader.loadClip("vodBlock.swf",this.loadMc); }, onLoadInit:function(loadMc:MovieClip) { loadMc._visible = false; loadMc.text=this.dataStr; } } myObject.init();
class MyClass{ var dataStr:String; var loadMc:MovieClip; function MyClass(){ this.dataStr="jax" this.loadMc= createEmptyMovieClip("container", this.getNextHighestDepth()); this.loadMc._x = container._y = 0; this.loadMc.visible = false; var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(this); mcLoader.loadClip("vodBlock.swf",this.loadMc); } function onLoadInit(loadMc:MovieClip) { loadMc._visible = false; loadMc.text=this.dataStr; } } new MyClass();
class MyMovieClip extends MovieClip{ var dataStr:String; function MyMovieClip(){ this.dataStr="jax" this._x = this._y = 0; this.visible = false; } function loadMovieClip(src:String) :MovieClip { var mcLoader:MovieClipLoader = new MovieClipLoader(); mcLoader.addListener(this); mcLoader.loadClip(src,this); return this; } function onLoadInit(mc:MovieClip) { this = MyMovieClip(loadMc); this._visible = false; this.text=this.dataStr; } } var loadMc:MyMovieClip = MyMovieClip( createEmptyMovieClip("container", this.getNextHighestDepth()) ); loadMc.loadMovieClip("vodBlock.swf");
function bind(func:Function, target:Object):Function{ return function(){ arguments.unshift(this); func.apply(target, arguments); }; };
Function.prototype.bind = function(target){ var func=this; return function(){ arguments.unshift(this); func.apply(target, arguments); }; };
function var_dump(value){ var objRecursion=function(value,ofLine){ if(ofLine.length>5){return '';} /*最大深度*/ switch(typeof(value)){ case 'movieclip': case 'object': var i, outTemp=[]; for (i in value) { outTemp.push( ofLine+i+" => "+objRecursion(value[i], ofLine+'\t') ); } outTemp.push("("+typeof(value)+")"); outTemp.reverse(); return outTemp.join('\n'); default: return value; } }; var output = objRecursion(value,''); trace(output); return output; }
g++ -o test *.o -L/MyProject/lib -lApiName
// file xx-api.h #ifndef XX_API_H #define XX_API_H #ifdef __cplusplus extern "C" { #endif void function_1(const char *srcpath); int function_2(void); #ifdef __cplusplus } #endif #endif
extern "C" { #include "yy-api.h" }
#define CMD_STR_LEN 1024 int mysystem(char* cmdstring, char* tmpfile) { char cmd_string[CMD_STR_LEN]; tmpnam(tmpfile); sprintf(cmd_string, "%s > %s", cmdstring, tmpfile); return system(cmd_string); }
/** * 增強的system函數,能夠返回system調用的輸出 * * @param[in] cmdstring 調用外部程序或腳本的命令串 * @param[out] buf 返回外部命令的結果的緩衝區 * @param[in] len 緩衝區buf的長度 * * @return 0: 成功; -1: 失敗 */ int mysystem(char* cmdstring, char* buf, int len) { int fd[2]; pid_t pid; int n, count; memset(buf, 0, len); if (pipe(fd) < 0) { return -1; } if ((pid = fork()) < 0) { return -1; } else if (pid > 0) { /* parent process */ close(fd[1]); /* close write end */ count = 0; while ((n = read(fd[0], buf + count, len)) > 0 && count > len) { count += n; } close(fd[0]); if (waitpid(pid, NULL, 0) > 0) { return -1; } } else { /* child process */ close(fd[0]); /* close read end */ if (fd[1] != STDOUT_FILENO) { if (dup2(fd[1], STDOUT_FILENO) != STDOUT_FILENO) { return -1; } close(fd[1]); } if (execl("/bin/sh", "sh", "-c", cmdstring, (char*) 0) == -1) { return -1; } } return 0; }
#include <stdio.h> int main(int argc, char *argv[]) { char buf[128]; FILE *pp; if ((pp = popen("ls -l", "r")) == NULL) { printf("popen() error!\n"); exit(1); } while (fgets(buf, sizeof buf, pp)) { printf("%s", buf); } pclose(pp); return 0; }
#include <stdio.h> #include <malloc.h> char* file_get_contents(char* filename){ char *content; long length; FILE *fp = fopen(filename, "r"); if(fp == NULL){ return NULL;} fseek(fp, 0, SEEK_END); length = ftell(fp); content = (char*)malloc(length + 1); fseek(fp, 0, SEEK_SET); length=0; while((content[length]=getc(fp)) != EOF) { length++; } content[length] = '\0'; return content; } long file_put_contents(char* filename, char* content){ FILE * fp; int length; if((fp = fopen(filename, "w")) == NULL){ return -1; } fputs(content, fp); fclose(fp); return length; } int main(){ file_put_contents("temp.txt","hello,world! for C \n"); char * contents = file_get_contents("temp.txt"); printf("%s",contents); return 0; }
#include <fstream> #include <string> #include <iostream> using namespace std; string file_get_contents(char* fileName) { ifstream file(fileName); if (!file) { return ""; } string content = "", line; while (!file.eof()){ getline(file,line); content += line+"\n"; } file.close(); return content; } void file_put_contents(char * fileName, char * content) { ofstream file; file.open(fileName); file << content; file.close(); } int main() { file_put_contents("temp.txt", "hello,world! for C++ \n"); cout << file_get_contents("temp.txt"); return 0; }
SRC_DIR = src
OBJ_DIR = obj
SOURCES = \
$(SRC_DIR)/test2.cpp \
TARGET = main.exe
# =================================================
INCLUDE_PATH = \
#-I"include_path" \
NEXUSMGR_LIBDIR = \
#-L"library_path" \
CXXFLAGS = -O0 -g3 -Wall -fPIC -w -c -fmessage-length=0
CFLAGS = -O0 -g3 -Wall -fPIC -w -c -fmessage-length=0
LIBS = \
#-lsqlite \
CC := gcc
CXX := g++
RM := del /Q
# =================================================
OBJS:=$(subst $(SRC_DIR),$(OBJ_DIR),$(SOURCES))
OBJS:=$(OBJS:%.cpp=%.cpp.o)
OBJS:=$(OBJS:%.C=%.C.o)
OBJS:=$(OBJS:%.c=%.c.o)
$(OBJ_DIR)/%.cpp.o: $(SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) $(INCLUDE_PATH) -MMD -MP -MF $(@:%.o=%.d) -MT $(@:%.o=%.d) -o $@ $<
$(OBJ_DIR)/%.C.o: $(SRC_DIR)/%.C
$(CXX) $(CXXFLAGS) $(INCLUDE_PATH) -MMD -MP -MF $(@:%.o=%.d) -MT $(@:%.o=%.d) -o $@ $<
$(OBJ_DIR)/%.c.o: $(SRC_DIR)/%.c
$(CC) $(CFLAGS) $(INCLUDE_PATH) -MMD -MP -MF $(@:%.o=%.d) -MT $(@:%.o=%.d) -o $@ $<
$(TARGET): $(OBJS)
$(CXX) $(NEXUSMGR_LIBDIR) -o $(TARGET) $(OBJS) $(LIBS)
$(OBJ_DIR):
-mkdir $(OBJ_DIR)
all: $(OBJ_DIR) $(TARGET)
clean:
-$(RM) $(OBJ_DIR) $(TARGET)
<?php
function compress($buffer) {
return $buffer;
}
ob_start(); /*開啟輸出緩衝*/
// or
ob_start('ob_gzhandler'); /*開啟輸出緩衝,並使用 gZip 壓縮輸出。*/
ob_start('compress'); /*加入自訂處理函數*/
/*取得緩衝內容*/
$contents = ob_get_contents();
/*取得緩衝內容的長度*/
$length = ob_get_length();
/*送出緩衝內容*/
ob_flush();
/*結束緩衝,並送出內容*/
ob_end_flush();
/*清除緩衝內容*/
ob_clean();
/*結束緩衝,並清除內容*/
ob_end_clean();
<?php
ob_start("ob_gzhandler");
ob_start("compress");
header("Content-type: text/css; charset: UTF-8");
header("Cache-Control: must-revalidate");
$off = 0; # Set to a reaonable value later, say 3600 (1 hr);
$exp = "Expires: " . gmdate("D, d M Y H:i:s", time() + $off) . " GMT";
header($exp);
function compress($buffer) {
// remove comments
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
// remove tabs, spaces, newlines, etc.
$buffer = str_replace(array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $buffer);
$buffer = str_replace('{ ', '{', $buffer); // remove unnecessary spaces.
$buffer = str_replace(' }', '}', $buffer);
$buffer = str_replace('; ', ';', $buffer);
$buffer = str_replace(', ', ',', $buffer);
$buffer = str_replace(' {', '{', $buffer);
$buffer = str_replace('} ', '}', $buffer);
$buffer = str_replace(': ', ':', $buffer);
$buffer = str_replace(' ,', ',', $buffer);
$buffer = str_replace(' ;', ';', $buffer);
return $buffer;
}
require_once('screen.css');
require_once('layout.css');
require_once('custom.php');
require_once('titles.css');
require_once('bus.css');
// css_sprite_ps-script.jsx
#target photoshop
/** 建立參考線
* @param {Int} pixelOffSet 偏移像素
* @param {String} orientation ["Vrtc" => 垂直 ,"Hrzn" => 水平]
*/
function makeGuide(pixelOffSet, orientation) {
var id8 = charIDToTypeID( "Mk " );
var desc4 = new ActionDescriptor();
var id9 = charIDToTypeID( "Nw " );
var desc5 = new ActionDescriptor();
var id10 = charIDToTypeID( "Pstn" );
var id11 = charIDToTypeID( "#Rlt" );
desc5.putUnitDouble( id10, id11, pixelOffSet ); // integer
var id12 = charIDToTypeID( "Ornt" );
var id13 = charIDToTypeID( "Ornt" );
var id14 = charIDToTypeID( orientation ); // "Vrtc", "Hrzn"
desc5.putEnumerated( id12, id13, id14 );
var id15 = charIDToTypeID( "Gd " );
desc4.putObject( id9, id15, desc5 );
executeAction( id8, desc4, DialogModes.NO );
}
function main(){
//判斷是否有開啟圖檔
if (app.documents.length = 0) {return;}
//設定前景色為白色
app.foregroundColor.rgb.hexValue = 'FFFFFF';
var atDoc;
var list = [];
var length = app.documents.length;
//新增目標圖片文件
var newPic = app.documents.add(
1, 1, 72,
"css_sprite",
NewDocumentMode.RGB,
DocumentFill.TRANSPARENT
);
var height=0;
var width = newPic.width;
//複製所有圖檔至新建立的圖檔
for (var i=0; i<length; i++){
atDoc=app.activeDocument=app.documents[i];
//記錄圖層資訊
var newLayer={
name: atDoc.name, //檔名
width: atDoc.width,
height: atDoc.height,
top: height
};
//累計高度
height += app.documents[i].height.value;
//最大寬度
if(width < atDoc.width){ width=atDoc.width;}
//新增圖層
var aLayer = atDoc.activeLayer=atDoc.artLayers.add();
//複製背景底圖
try {
atDoc.backgroundLayer.duplicate(aLayer,ElementPlacement.PLACEAFTER);
atDoc.backgroundLayer.remove();
} catch (e){}
//將新圖層與下一層互換
aLayer.move(atDoc.layers[1],ElementPlacement.PLACEAFTER);
//標註四周的定位點
var w=atDoc.width.value, h=atDoc.height.value;
atDoc.selection.select([[0,0],[1,0],[1,1],[0,1],[0,0]]);
atDoc.selection.fill(app.foregroundColor)
atDoc.selection.select([[0,h-1],[0,h],[1,h],[1,h-1],[0,h-1]]);
atDoc.selection.fill(app.foregroundColor)
atDoc.selection.select([[w-1,0],[w-1,1],[w,1],[w,0],[w-1,0]]);
atDoc.selection.fill(app.foregroundColor)
atDoc.selection.select([[w-1,h-1],[w-1,h],[w,h],[w,h-1],[w-1,h-1]]);
atDoc.selection.fill(app.foregroundColor)
//設定透明度
aLayer.fillOpacity=1;
//合併可見圖層
atDoc.mergeVisibleLayers();
//複製圖層
atDoc.selection.selectAll()
atDoc.selection.copy()
//貼上圖層
atDoc=app.activeDocument=newPic;
newLayer.obj = atDoc.paste();
list.push(newLayer);
};
//變更圖片大小
atDoc=app.activeDocument=newPic;
atDoc.resizeCanvas(width,height,AnchorPosition.TOPLEFT);
//變更圖層定位
for (var i=length-1; i>=0; i--){
//關閉複製過的檔案
app.documents[i].close(SaveOptions.DONOTSAVECHANGES);
//移動圖層
list[i].obj.translate(0,list[i].top);
//建立參考線
if(i>0){ makeGuide(list[i].top,"Hrzn"); }
};
// 輸出 CSS 定位檔
var mySavefile = File.saveDialog("輸出 CSS 定位檔","*.css");
if(!mySavefile){return};
if(mySavefile.exists && !confirm("你確定要覆蓋這個檔案?")){
return false;
}
// 開啟檔案
var fileRef = new File(mySavefile);
if (!fileRef.open("w","","")){
alert("無法開啟檔案!!");
fileRef.close();
return false;
}
// 輸出 CSS 定位設定
for (var i=0; i<list.length; i++){
fileRef.writeln(
list[i].name+'{ background-position: 0 -'+list[i].top+'px; }'
);
};
fileRef.close();
}
//把Photoshop推到最上層
app.bringToFront();
//設定使用的單位為「像素(Pixel)」
app.preferences.rulerUnits = Units.PIXELS;
main();
<Directory /myblogroot/> AllowOverride None </Directory>
<Directory /myblogroot/> AllowOverride FileInfo </Directory>
RewriteEngine on RewriteRule ^.*$ index.php #將所有請求轉至 index.php #除特定檔案的請求以外的轉至 index.php #RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php php_flag register_globals off #將傳入參數註冊為全域變數 php_flag magic_quotes_gpc off #對特殊字元加上的反斜線 php_flag display_error off #在網頁上顯示錯誤訊息 php_flag output_buffering on #開啟輸出緩衝 php_flag log_error on #紀錄錯誤訊息 php_flag allow_url_fopen off #fopen 可開啟遠端網頁 php_flag expose_php off #顯示PHP 版本資訊 php_flag safe_mode on #安全模式 php_value include_path "/path/to/lib" #自訂函數庫的位址
h1(#id). 標題1 * 無序列表 * 無序列表 ** 無序列表 ** 無序列表 *** 無序列表 h2. 標題2 # 有序列表 # 有序列表 ## 有序列表 jhgjhgjgjgj h3. 標題3 p. 文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落,文字段落 h4. 標題4 h4. 標題4 h5. 標題5 h3. 標題3 h6. 標題6
<?php // ?query=[觀測點名稱],例如: Taoyuan Air Base , Taipei $xml = simplexml_load_file( "http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=RCSS" ); // 氣象圖示 foreach ($xml->icons->children() as $icon_set) { if($icon_set['name']=='Contemporary'){ echo $icon_set->icon_url; } } /* 圖示造型種類: Default Smiley Helen Generic Old School Cartoon Mobile Simple Contemporary Dunkin' Donuts */ echo "氣象狀況:",$xml->weather,"\n"; echo "溫度:",$xml->temp_c,"°C\n"; echo "相對濕度:",$xml->relative_humidity,"\n"; echo "風向:",$xml->wind_dir,"\n"; echo "風速:",$xml->wind_mph,"MPH\n"; echo "風速:每小時",round($xml->wind_mph*1.6093),"公里\n"; echo "風速:每秒",round($xml->wind_mph*0.447028),"公尺\n"; echo "海平面氣壓:",$xml->pressure_mb,"百帕\n"; echo "高溫指數:",$xml->heat_index_c,"°C\n"; echo "風寒指數:",$xml->windchill_c,"°C\n"; echo "水凝點:",$xml->dewpoint_c,"°C\n"; echo "能見度:",$xml->visibility_km,"公里\n"; echo "觀測時間:",date( 'Y-m-d H:i', strtotime($xml->observation_time_rfc822) ),"\n"; /* thunderstorm rain = 雷雨 showers rain = 驟雨 light showers rain = 小驟雨 Cloudy = 多雲 Flurries = 小雪 Fog = 霧 Haze = 陰霾 Mostly Cloudy = 多雲時陰 Mostly Sunny = 晴時多雲 Partly Cloudy = 局部多雲 Partly Sunny = 多雲時晴 Freezing Rain = 凍雨 Rain = 雨 Sleet = 冰雹 Snow = 雪 Sunny = 晴朗 Unknown = 未知 Overcast = 陰天 Scattered Clouds = 疏雲 */
ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
Parameter | Explanation |
---|---|
YEAR | Year, spelled out |
YYYY | 4-digit year |
YYY YY Y | Last 3, 2, or 1 digit(s) of year. |
IYY IY I | Last 3, 2, or 1 digit(s) of ISO year. |
IYYY | 4-digit year based on the ISO standard |
Q | Quarter of year (1, 2, 3, 4; JAN-MAR = 1). |
MM | Month (01-12; JAN = 01). |
MON | Abbreviated name of month. |
MONTH | Name of month, padded with blanks to length of 9 characters. |
RM | Roman numeral month (I-XII; JAN = I). |
WW | Week of year (1-53) where week 1 starts on the first day of the year and continues to the seventh day of the year. |
W | Week of month (1-5) where week 1 starts on the first day of the month and ends on the seventh. |
IW | Week of year (1-52 or 1-53) based on the ISO standard. |
D | Day of week (1-7). |
DAY | Name of day. |
DD | Day of month (1-31). |
DDD | Day of year (1-366). |
DY | Abbreviated name of day. |
J | Julian day; the number of days since January 1, 4712 BC. |
HH | Hour of day (1-12). |
HH12 | Hour of day (1-12). |
HH24 | Hour of day (0-23). |
MI | Minute (0-59). |
SS | Second (0-59). |
SSSSS | Seconds past midnight (0-86399). |
FF | Fractional seconds. |
這些華麗的網站大多都是個人網站
大多公司的形象網站不太可能這樣做
# 更改預設語系,設定檔路徑:/var/lib/locales/supported.d/local locale-gen zh_TW locale-gen zh_TW.UTF-8 # 動態變更成[中文語系] [root@linux ~]# export LANG=zh_TW.UTF-8 [root@linux ~]# export LC_ALL=zh_TW.UTF-8 # 動態變更成[英文語系] [root@linux ~]# export LANG=C [root@linux ~]# export LC_ALL=C
# 執行這個指令就會跳出 user 的編輯器選單 [root@linux ~]# /usr/bin/select-editor # 如果要將系統的預設值變更的話,可以執行這個指令 [root@linux ~]# update-alternatives --config editor # 如果不喜歡選項中的編輯器,可以藉由更改下面這個檔案,然後重新登入就會生效 [root@linux ~]# vim ~/.selected_editor # Generated by /usr/bin/select-editor SELECTED_EDITOR="/usr/bin/vim" # 或者動態直接改變環境變數(一次性) [root@linux ~]# export EDITOR=vim
/*建立 Component*/
createObject("TextInput", "name_ti", getNextHighestDepth(),{
_width:200,
_heigh:22,
_x:20,
_y:30
});
/*移除 Component*/
destroyObject("name_ti");
//createTextField(instanceName, depth, x, y, width, height) this.createTextField("swf1", 10, 0, 96, 1024, 576); swf1.html = true; swf1.htmlText = " <img width='1024' height='576' src='my_flash.swf'/>";
-- [新增]
CREATE SEQUENCE my_sequence
INCREMENT BY 1
START WITH 1
MAXVALUE 99999999999
NOCYCLE
CACHE 10
;
-- 參數說明:
INCREMENT BY n -- 每次疊加的值(正負數)
START WITH n -- 指定初始值,建立後將無法透過 ALTER 修改
MAXVALUE n -- 最大編號
NOMAXVALUE -- (預設)不設置最大值,由系統上限決定
MINVALUE n -- 最小編號
NOMINVALUE -- (預設 1)不設置最小值
CYCLE -- 當取至最大值後,是否循環再由最小值開始
NOCYCLE -- (預設)不設置循環,當超過限制時將返回異常
CACHE n -- (預設 20)系統會一次取出 n 個數作為快取,但會造成跳號的現象
NOCACHE -- 不使用快取,保證在產生的編號中沒有跳號,但這樣會降低性能.
-- [修改]
ALTER SEQUENCE my_sequence
INCREMENT BY 10
MAXVALUE 10000
CYCLE
NOCACHE
;
-- [刪除]
DROP SEQUENCE my_sequence;
-- [使用方式]
my_sequence.CURRVAL -- 返回序號的當前值
my_sequence.NEXTVAL -- 增加序號的值,然後返回序號值
*{ /* Gecko browsers */ -moz-border-radius: 20px; /*all*/ -moz-border-radius: 20px 0; /*TL&BR, TR&BL*/ -moz-border-radius: 20px 0 20px; /*TL, TR&BL, BR*/ -moz-border-radius: 20px 0 20px 0; /*TL, TR, BR, BL*/ -moz-border-radius: 20px/ 10px; /*(X)/ (Y)*/ -moz-border-radius: 20px 0 20px 0/ 10px 0 10px 0; /*(X)TL, TR, BR, BL/ (Y)TL, TR, BR, BL*/ -moz-border-radius-topleft: 20px; -moz-border-radius-topright: 0; -moz-border-radius-bottomright: 20px; -moz-border-radius-bottomleft: 0; /* Webkit browsers */ -webkit-border-radius: 20px; /*all*/ -webkit-border-radius: 20px 0 20px 0; /*TL, TR, BR, BL*/ -webkit-border-top-left-radius: 20px; -webkit-border-top-right-radius: 0; -webkit-border-bottom-right-radius: 20px; -webkit-border-bottom-left-radius: 0; /* Konqueror (KDE) */ -khtml-border-radius: 20px; /*all*/ -khtml-border-radius: 20px 0 20px 0; /*TL, TR, BR, BL*/ -khtml-border-top-left-radius: 20px; -khtml-border-top-right-radius: 20px; -khtml-border-bottom-left-radius: 20px; -khtml-border-bottom-right-radius: 20px; /* ??? browsers */ -goog-ms-border-radius: 20px; /*all*/ -goog-ms-border-radius: 20px 0 20px 0;/*TL, TR, BR, BL*/ -goog-ms-border-top-left-radius: 20px; -goog-ms-border-top-right-radius: 0; -goog-ms-border-bottom-right-radius: 20px; -goog-ms-border-bottom-left-radius: 0; /* W3C syntax */ border-radius: 20px; /*all*/ border-radius: 20px 0; /*TL&BR, TR&BL*/ border-radius: 20px 0 20px; /*TL, TR&BL, BR*/ border-radius: 20px 0 20px 0; /*TL, TR, BR, BL*/ border-radius: 20px/ 10px; /*(X)/ (Y)*/ border-radius: 20px 0 20px 0/ 10px 0 10px 0; /*(X)TL, TR, BR, BL/ (Y)TL, TR, BR, BL*/ border-top-left-radius: 20px; border-top-right-radius: 0; border-bottom-right-radius: 0; border-bottom-left-radius: 20px; }
/*Social Icon*/
.social{
background:transparent url(http://www.xxxx.com/social_icons.png) 0 0 no-repeat;
/*16*16按鈕的圖片網址*/
display: -moz-inline-box;
display: inline-block;
height:16px;
margin:0 4px;
text-indent:-999999px;
vertical-align:middle;
width:16px;
opacity:0.75;
overflow:hidden;
}
.social:hover{
opacity:1;
}
a.toFacebook{ background-position: 0 0; }
a.toPlurk{ background-position: 0 -16px; }
a.toTwitter{ background-position: 0 -32px; }
a.toTechnorati{ background-position: 0 -48px; }
a.toDelicious{ background-position: 0 -64px; }
a.toBuzz{ background-position: 0 -80px; }
a.toDigg{ background-position: 0 -96px; }
a.toStumbleUpon{ background-position: 0 -112px; }
a.toDesignFloat{ background-position: 0 -128px; }
a.getAtomRSS{ background-position: 0 -144px; }
a.toReader{ background-position: 0 -160px; }
<div class='post-footer-line post-footer-line-99'><span class='post-social-icons'>
分享至 :
<a class='social toFacebook' expr:href='"http://www.facebook.com/sharer.php?u="+ data:post.url + "&t=" + data:post.title' rel='external nofollow' target='_blank' title='分享至 Facebook'>Facebook</a>
<a class='social toPlurk' expr:href='"http://www.plurk.com/?qualifier=shares&status="+ data:post.url + " (" + data:post.title + ")"' rel='external nofollow' target='_blank' title='分享至 Plurk'>Plurk</a>
<a class='social toTwitter' expr:href='"http://twitter.com/home?status=" + data:post.title + " "+ data:post.url' rel='external nofollow' target='_blank' title='分享至 Twitter'>Twitter</a>
<a class='social toTechnorati' expr:href='"http://technorati.com/faves?add="+ data:post.url + " " + data:post.title' rel='external nofollow' target='_blank' title='分享至 Technorati'>Technorati</a>
<a class='social toDelicious' expr:href='"http://del.icio.us/post?url="+ data:post.url + " " + data:post.title' rel='external nofollow' target='_blank' title='儲存至 Delicious'>Delicious</a>
<a class='social toDigg' expr:href='"http://digg.com/submit?phase=2&url="+ data:post.url + "&title=" + data:post.title' rel='external nofollow' target='_blank' title='分享至 Digg'>Digg</a>
<a class='social toStumbleUpon' expr:href='"http://www.stumbleupon.com/submit?url="+ data:post.url + "&title=" + data:post.title' rel='external nofollow' target='_blank' title='分享至 Stumble Upon'>Stumble Upon</a>
<a class='social toDesignFloat' expr:href='"http://www.designfloat.com/submit.php?url="+ data:post.url + "&title=" + data:post.title' rel='external nofollow' target='_blank' title='分享至 Design Float"'>Design Float</a>
<a class='social toReader' expr:href='"http://www.google.com/reader/link?url="+ data:post.url + "&title=" + data:post.title + "&srcURL="+data:blog.homepageUrl' rel='external nofollow' target='_blank' title='分享至 Google Reader'>Google Reader</a>
<a class='social toBuzz' expr:href='"http://www.google.com/buzz/post?url="+ data:post.url' rel='external nofollow' target='_blank' title='分享至 Buzz'>Buzz</a>
<a class='social getAtomRSS' href='/feeds/posts/default' title='訂閱 Atom / RSS' type='application/atom+xml'>Atom / RSS</a>
</span></div>
1,小明,2010-10-10
2,小王,2010-5-15
3,小白,2010-2-18
/*建立 Vars()*/
loadVars_1 = new LoadVars();
/*載入完成時所執行的程式*/
loadVars_1.onData = function(thedata:String) {
if (thedata == undefined) {
trace('資料載入失敗'); return;
}
/*以換行符號(\n)切割字串*/
var rows:Array = thedata.split("\n");
for(i=0; i<rows.length; i++){
/*以垂直符號(|)切割字串*/
rows[i]=rows[i].split(",");
}
trace(rows);/*顯示載入的資料*/
};
/*開始載入 load_vars.txt*/
loadVars_1.load("load_vars.txt");
<a name="fb_share" type="button_count" share_url="data:post.url" href="http://www.facebook.com/sharer.php">分享</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
<a name="fb_share" type="button_count" expr:share_url="data:post.url" href="http://www.facebook.com/sharer.php" title="分享至 Facebook">分享</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
-- 建立資料表
CREATE TABLE table_name(
column1 NUMBER,
column2 CHAR,
column3 VARCHAR2,
column4 DATE,
-- 主鍵(PRIMARY KEY)
CONSTRAINT pk_table_name PRIMARY KEY(column1,column2),
-- 唯一鍵(UNIQUE KEY)
CONSTRAINT unique_table_name UNIQUE(column1,column2),
-- 外來鍵(FOREIGN KEY)
CONSTRAINT fk_table_name_column1
FOREIGN KEY(column1, column2)
REFERENCES parent_table(column1, column2)
[ON DELETE [CASCADE|SET NULL]]
-- 當參考鍵刪除時,相對應做的處理:
-- 預設 UPDATE No Action & DELETE No Action
-- ON DELETE CASCADE: 刪除參考鍵時連同刪除
-- ON DELETE SET NULL: 刪除參考鍵時將外鍵設為 NULL
);
-- 為資料表標示註釋
COMMENT ON TABLE table_name IS '資料表註釋';
-- 為資料欄位標示註釋
COMMENT ON COLUMN table_name.column1 IS '資料欄位註釋';
-- 附加主鍵(PRIMARY KEY)
ALTER TABLE table_name
ADD CONSTRAINT pk_table_name PRIMARY KEY(column1,column2);
-- 附加唯一鍵(UNIQUE KEY)
ALTER TABLE table_name
ADD CONSTRAINT unique_table_name UNIQUE(column1,column2);
-- 附加外來鍵(FOREIGN KEY)
ALTER TABLE table_name
ADD CONSTRAINT fk_table_name_column1
FOREIGN KEY(column1, column2)
REFERENCES parent_table(column1, column2)
[ON DELETE [CASCADE|SET NULL]];
-- 建立索引(Index)
CREATE [UNIQUE] INDEX idx_table_name ON table_name(column1, column2);
CREATE USER user_name IDENTIFIED BY user_password; -- 建立使用者
GRANT dba TO user_name; -- 授與最大權力
vars=1|小明|2010-10-10
2|小王|2010-5-15
3|小白|2010-2-18
/*建立 Vars()*/
loadVars_1 = new LoadVars();
/*載入完成時所執行的程式*/
loadVars_1.onLoad = function() {
/*以換行符號(\n)切割字串*/
var rows = this.vars.split("\n");
for(i=0; i<rows.length; i++){
/*以垂直符號(|)切割字串*/
rows[i]=rows[i].split("|");
}
trace(rows);/*顯示載入的資料*/
};
/*開始載入 load_vars.txt*/
loadVars_1.load("load_vars.txt");
<!-- load_1.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<xmltest>
<parentnode>
<id>1</id>
<name>小明</name>
<date>2010-10-10</date>
</parentnode>
<parentnode>
<id>2</id>
<name>小王</name>
<date>2010-5-15</date>
</parentnode>
</xmltest>
/*建立 XML()*/
LoadXml_1 = new XML();
/*捨棄只包含空白字元的文字節點*/
LoadXml_1.ignoreWhite=true;
/*載入完成時所執行的程式*/
LoadXml_1.onLoad = function(){
articleList = this.firstChild.childNodes;
var txt = "";
for (i=0; i<articleList.length; i++) {
elementList = articleList[i].childNodes;
for (j=0; j<elementList.length; j++) {
elementTag = elementList[j];
switch(elementTag.nodeName){
case "id":
txt += elementTag.firstChild.nodeValue+',';
break;
case "name":
txt += elementTag.firstChild.nodeValue+',';
break;
case "date":
txt += elementTag.firstChild.nodeValue+',';
break;
}
}
txt += '\n';
}
trace(txt); /*顯示載入的資料*/
}
/*開始載入 load_1.xml*/
LoadXml_1.load("load_1.xml");
<!-- load_2.xml -->
<?xml version="1.0" encoding="utf-8"?>
<xmltest>
<parentnode id="1" name="小明" date="2010-10-10" />
<parentnode id="2" name="小王" date="2010-5-15" />
</xmltest>
/*建立 XML()*/
LoadXml_2 = new XML();
/*捨棄只包含空白字元的文字節點*/
LoadXml_2.ignoreWhite=true;
/*載入完成時所執行的程式*/
LoadXml_2.onLoad = function(success) {
var articleList = this.firstChild.childNodes;
var txt = "";
for (i=0; i<articleList.length; i++){
txt += articleList[i].attributes.id+','
+articleList[i].attributes.name+','
+articleList[i].attributes.call+','
+articleList[i].attributes.channel+"\n";
}
trace(txt);/*顯示載入的資料*/
};
/*開始載入 load_2.xml*/
LoadXml_2.load("load_2.xml");