2009年8月31日 星期一

C# Bezier Curve


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CSharpBezierCurve
{
    public partial class Form1 : Form
    {
        private Point[] controlPoint = new Point[4];
        private int controlPointCount = 0;
        public Form1()
        {
            InitializeComponent();
        }


        private void drawControlLine(Graphics g) {
            Pen p = new Pen(Color.Green);
            if (!controlPoint[0].IsEmpty && !controlPoint[1].IsEmpty)
                g.DrawLine(p, controlPoint[0], controlPoint[1]);
            if (!controlPoint[1].IsEmpty && !controlPoint[2].IsEmpty)
                g.DrawLine(p, controlPoint[1], controlPoint[2]);
            if (!controlPoint[2].IsEmpty && !controlPoint[3].IsEmpty)
                g.DrawLine(p, controlPoint[2], controlPoint[3]);
        }

        private void drawBezierCurve(Graphics g) {
            Pen p = new Pen(Color.Aqua);
            g.DrawBezier(p, controlPoint[0], controlPoint[1], controlPoint[2], controlPoint[3]);
        }

        private void panel1_MouseDown(object sender, MouseEventArgs e)
        {
            if (controlPointCount == 4) return;
            controlPoint[controlPointCount++] = new Point(e.X, e.Y);
            Pen p = new Pen(Color.Red);
            Panel panel = (Panel)sender;
            Graphics g = panel.CreateGraphics();
            g.DrawRectangle(p, e.X, e.Y, 2, 2);
            drawControlLine(g);
            if (controlPointCount == 4) drawBezierCurve(g);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            controlPoint = null;
            controlPoint = new Point[4];
            controlPointCount = 0;
            panel1.Invalidate();

        }

    }
}

Java Queue Implement

雖然原本的Java就有這個東西了,但是還是實作一下。

class JElemrnt {
  public JElemrnt prev;
  public T value;
  public JElemrnt next;
    
  public JElemrnt(T t) {
    prev = null;
    next = null;
    value = t;
  }
}

public class JQueue {
  
  JElemrnt head;
  JElemrnt tail;

  int queueSize;
  public JQueue() {
    queueSize = 0;
    head = null;
    tail = null;
  }
  public void enqueue(T t) {
    JElemrnt tmp = new JElemrnt(t);
    if(queueSize == 0) {
      head = tmp;
      tail = tmp;
    } else {
      tmp.prev = tail;
      tail.next = tmp;
      tail = tmp;
    }
    ++queueSize;
    System.out.println("Enqueue Element: " + t.toString());
    System.out.println("Now queue size is: " + queueSize);
  }
  public T dequeue() {
    if(head == null || tail == null) {
      return null;
    }
    T retVal = tail.value;
    tail = tail.prev;
    //tail.next = null;
    --queueSize;
    System.out.println("Dequeue Element: " + retVal.toString());
    System.out.println("Now queue size is: " + queueSize);
    if(queueSize == 0) {
      head = null;
      tail = null;
    }
    return retVal;
  }
  public T query(int n) {
    if(n > queueSize) return null;
    return null;
  }
  public static void main(String[] argv) {
    System.out.println("Starting queue demo...");
    JQueue q = new JQueue();
    Integer i1 = new Integer(1);
    Integer i2 = new Integer(2);
    Integer i3 = new Integer(3);
    q.enqueue(i1);
    q.enqueue(i2);
    Integer de = q.dequeue();
    q.enqueue(i3);
    de = q.dequeue();
    de = q.dequeue();
    System.out.println("Ending queue demo...");
  }
}

How to Build Android USB Driver

 

  1. Please install Git
  2. Get the code from http://android.git.kernel.org/
  3. The site should be git://android.git.kernel.org/platform/development.git
  4. On your disk, you will find a folder named "\host\windows\usb\legacy\driver". This is the Android USB Driver.
  5. Please install WDK 6000, I have test to build the driver with WDK 7000, but there are some issues when building.
  6. Open the WDK build enviroment and Change the location into the folder, just press "build" will be ok!!

This is the picture after building.


If you try to build the driver with WDK 7000, You will find the error!! "link : error LNK1117: syntax error in option 'MAPINFO:LINES'"

I am sick of M$ to provide so suck WDK pack, so please build it with WDK 6000.



Windows 可執行程式

CMD部分

 

accwiz.exe      ------         輔助工具嚮導 

acsetups.exe    ------         acs setup dcom server executable 

actmovie.exe    ------         直接顯示安裝工具 

append.exe      ------         允許程式打開制定目錄中的資料 

arp.exe         ------         顯示和更改電腦的ip與硬體物理位址的對應列表 

asadmin.exe     ------         start the remote access admin service 啟動遠端存取服務 

at.exe          ------         計畫運行任務 

atmadm.exe      ------         調用管理器統計 

attrib.exe      ------         顯示和更改檔和檔夾屬性 

autochk.exe     ------         檢測修復檔系統 

autoconv.exe    ------         在啟動過程中自動轉化系統 

autofmt.exe     ------         在啟動過程中格式化進程 

autolfn.exe     ------         使用長檔案名格式 

bootok.exe      -----          boot acceptance application for registry 

bootvrfy.exe    ------         通報啟動成功 

cacls.exe       ------         顯示和編輯acl 

calc.exe        ------         計算器 

cdplayer.exe    ------         cd播放器 

change.exe      ------         與終端伺服器相關的查詢 

charmap.exe     ------         字元對應表 

chglogon.exe    ------         啟動或停用會話記錄 

chgport.exe     ------         改變埠(終端服務) 

chgusr.exe      ------         改變用戶(終端服務) 

chkdsk.exe      ------         磁片檢測程式 

chkntfs.exe     ------         磁片檢測程式 

cidaemon.exe    ------         組成ci文檔服務 

cipher.exe      ------         在ntfs上顯示或改變加密的檔或目錄 

cisvc.exe       ------         索引內容 

ckcnv.exe       ------         變換cookie 

cleanmgr.exe    ------         磁片清理 

cliconfg.exe    ------         sql客戶網路工具 

clipbrd.exe     ------         剪貼簿查看器 

clipsrv.exe     ------         運行clipboard服務 

clspack.exe     ------         建立系統檔列表清單 

cluster.exe     ------         顯示域的集群 

cmd             ------         顯示版本

cmdl32.exe      ------         自動下載連接管理 

cmmgr32.exe     ------         連接管理器 

cmmon32.exe     ------         連接管理器監視 

cmstp.exe       ------         連接管理器配置檔安裝程式 

comclust.exe    ------         集群 

comp.exe        ------         比較兩個檔和檔集的內容* 

compact.exe     ------         顯示或改變ntfs分區上檔的壓縮狀態 

conime.exe      ------         ime控制臺 

control.exe     ------         控制面板 

convert.exe     ------         轉換檔系統到ntfs 

convlog.exe     ------         轉換iis日誌檔格式到ncsa格式 

cprofile.exe    ------         轉換顯示模式 

cscript.exe     ------         較本宿主版本 

csrss.exe       ------         客戶伺服器runtime進程 

csvde.exe       ------         日至格式轉換程式 

dbgtrace.exe    ------         和terminal server相關 

dcomcnfg.exe    ------         dcom配置屬性 

dcphelp.exe     ------         

dcpromo.exe     ------         ad安裝嚮導 

ddeshare.exe    ------         dde共用 

ddmprxy.exe     ------         

debug.exe       ------         就是debug啦! 

dfrgfat.exe     ------         fat分區磁片碎片整理程式 

dfrgntfs.exe    ------         ntfs分區磁片碎片整理程式 

dfs_cmd_.exe    ------         配置一個dfs樹 

dfsinit.exe     ------         分散式檔系統初始化 

dfssvc.exe      ------         分散式檔系統伺服器 

diantz.exe      ------         製作cab文件 

diskperf.exe    ------         磁片性能計數器 

dllhost.exe     ------         所有com+應用軟體的主進程 

dllhst3g.exe    ------         

dmadmin.exe     ------         磁片管理服務 

dmremote.exe    ------         磁片管理服務的一部分 

dns.exe         ------         dns applications dns 

doskey.exe      ------         命令行創建宏 

dosx.exe        ------         dos擴展 

dplaysvr.exe    ------         直接運行幫助 

drwatson.exe    ------         華生醫生錯誤檢測 

drwtsn32.exe    ------         華生醫生顯示和配置管理 

dtcsetup.exe    ------         installs mdtc 

dvdplay.exe     ------         dvd播放 

dxdiag.exe      ------         direct-x診斷工具 

edlin.exe       ------         命令行的文本編輯器

edlin.exe       ------         命令行的文本編輯器

esentutl.exe    ------         ms資料庫工具 

eudcedit.exe    ------         type造字程式 

eventvwr.exe    ------         事件查看器 

evnt_cmd_.exe   ------         event to trap translator; configuration tool 

evntwin.exe     ------         event to trap translator setup 

exe2bin.exe     ------         轉換exe檔到二進位 

expand.exe      ------         解壓縮 

extrac32.exe    ------         解cab工具 

fastopen.exe    ------         快速訪問在記憶體中的硬碟檔 

faxcover.exe    ------         傳真封面編輯 

faxqueue.exe    ------         顯示傳真佇列 

faxsend.exe     ------         發送傳真嚮導 

faxsvc.exe      ------         啟動傳真服務 

fc.exe          ------         比較兩個檔的不同 

find.exe        ------         查找文件中的文本行 

findstr.exe     ------         查找文件中的行 

finger.exe      ------         一個用戶並顯示出統計結果 

fixmapi.exe     ------         修復mapi檔 

flattemp.exe    ------         允許或者禁用暫存檔案目錄 

fontview.exe    ------         顯示字體檔中的字體 

forcedos.exe    ------         forces a file to start in dos mode. 強制檔在dos模式下運行 

freecell.exe    ------         popular windows game 空當接龍 

ftp.exe         ------         file transfer protocol used to transfer files over a network connection 

gdi.exe         ------         graphic device interface 圖形介面驅動 

grovel.exe      ------         

grpconv.exe     ------         program manager group convertor 轉換程式管理員組 

help.exe        ------         displays help for windows 2000 commands 顯示幫助 

hostname.exe    ------         display hostname for machine. 顯示機器的hostname 

ie4uinit.exe    ------         ie5 user install tool ie5用戶安裝工具 

ieshwiz.exe     ------         customize folder wizard 自定義檔夾嚮導 

iexpress.exe    ------         create and setup packages for install 穿件安裝包 

iisreset.exe    ------         restart iis admin service 重啟iis服務 

internat.exe    ------         keyboard language indicator applet 鍵盤語言指示器 

ipconfig.exe    ------         windows 2000 ip configuration. 察看ip配置 

ipsecmon.exe    ------         ip security monitor ip安全監視器 

ipxroute.exe    ------         ipx routing and source routing control program ipx路由和源路由控制程式 

irftp.exe       ------         setup ftp for wireless communication 無線連接 

ismserv.exe     ------         intersite messaging service 安裝或者刪除service control manager中的服務 

jdbgmgr.exe     ------         microsoft debugger for java 4 java4的調試器 

jetconv.exe     ------         convert a jet engine database 轉換jet engine資料庫 

jetpack.exe     ------         compact jet database. 壓縮jet資料庫 

jview.exe       ------         command-line loader for java java的命令行裝載者 

krnl386.exe     ------         core component for windows 2000 2000的核心組件 

label.exe       ------         change label for drives 改變驅動器的標籤 

lcwiz.exe       ------         license compliance wizard for local or remote systems. 許可證符合嚮導 

ldifde.exe      ------         ldif cmd line manager ldif目錄交換命令行管理 

licmgr.exe      ------         terminal server license manager 終端服務許可協定管理 

lights.exe      ------         display connection status lights 顯示連接狀況 

llsmgr.exe      ------         windows 2000 license manager 2000許可協議管理 

llssrv.exe      ------         start the license server 啟動許可協定伺服器 

lnkstub.exe     ------         

locator.exe     ------         rpc locator 遠端定位 

lodctr.exe      ------         load perfmon counters 調用性能計數 

logoff.exe      ------         log current user off. 註銷用戶 

lpq.exe         ------       " display status of a remote lpd queue 顯示遠端的lpd列印佇列的狀態,顯示被送到基於unix的伺服器的列印任務 "

lpr.exe         ------         send a print job to a network printer. 重定向列印任務到網路中的印表機。通常用於unix客戶印表機將列印任務發送給連接了列印設備的nt的印表機伺服器。 

lsass.exe       ------         lsa executable and server dll 運行lsa和server的dll 

lserver.exe     ------         specifies the new dns domain for the default server 指定默認server新的dns域 

macfile.exe     ------         Used for managing MACFILES 管理MACFILES 

magnify.exe     ------         Used to magnify the current screen 放大鏡 

makecab.exe     ------         MS Cabinet Maker 製作CAB文件 

mdm.exe         ------         Machine Debug Manager 機器調試管理 

mem.exe         ------         Display current Memory stats 顯示記憶體狀態 

migpwd.exe      ------         Migrate passwords. 遷移密碼 

mmc.exe         ------         Microsoft Management Console 控制臺 

mnmsrvc.exe     ------         Netmeeting Remote Desktop Sharing NetMeeting遠程桌面共用 

mobsync.exe     ------         Manage Synchronization. 同步目錄管理器 

mountvol.exe    ------       " Creates, deletes, or lists a volume mount point. 創建、刪除或列出卷的裝入點。 "

mplay32.exe     ------         MS Media Player 媒體播放器 

mpnotify.exe    ------         Multiple Provider Notification application 多提供者通知應用程式 

mq1sync.exe     ------         

mqbkup.exe      ------         MS Message Queue Backup and Restore Utility 資訊佇列備份和恢復工具 

mqexchng.exe    ------         MSMQ Exchange Connector Setup 資訊佇列交換連接設置 

mqmig.exe       ------         MSMQ Migration Utility 資訊佇列遷移工具 

mqsvc.exe       ------         ? 

mrinfo.exe      ------         Multicast routing using SNMP 使用SNMP多點傳送路由 

mscdexnt.exe    ------         Installs MSCD (MS CD Extensions) 安裝MSCD 

msdtc.exe       ------         Dynamic Transaction Controller Console 動態事務處理控制臺 

msg.exe         ------         Send a message to a user local or remote. 發送消息到本地或遠端客戶 

mshta.exe       ------         HTML Application HOST HTML應用程式主機 

msiexec.exe     ------         Starts Windows Installer Program 開始Windows安裝程式 

mspaint.exe     ------         Microsoft Paint 畫板 

msswchx.exe     ------         

mstask.exe      ------         Task Schedule Program 任務計畫表程式 

mstinit.exe     ------         Task scheduler setup 任務計畫表安裝 

narrator.exe    ------         Program will allow you to have a narrator for reading. Microsoft講述人 

nbtstat.exe     ------         Displays protocol stats and current TCP/IP connections using NBT 使用 NBT(TCP/IP 上的 NetBIOS)顯示協定統計和當前 TCP/IP 連接。 

nddeapir.exe    ------         NDDE API Server side NDDE API伺服器端 

net.exe         ------         Net Utility 詳細用法看/? 

net1.exe        ------         Net Utility updated version from MS Net的升級版 

netdde.exe      ------         Network DDE will install itself into the background 安裝自己到後臺 

netsh.exe       ------         Creates a shell for network information 用於配置和監控 Windows 2000 命令行腳本介面。 

netstat.exe     ------         Displays current connections. 顯示協定統計和當前的 TCP/IP 網路連接。 

nlsfunc.exe     ------         Loads country-specific information 載入特定國家(地區)的資訊。 Windows 2000 和 MS-DOS 子系統不使用該命令。接受該命令只是為了與 MS-DOS 文件相容。 

notepad.exe     ------         Opens Windows 2000 Notepad 記事本 

nslookup.exe    ------         Displays information for DNS 該診斷工具顯示來自功能變數名稱系統 (DNS)名稱伺服器的資訊。 

ntbackup.exe    ------         Opens the NT Backup Utility 備份和故障修復工具 

ntbooks.exe     ------         Starts Windows Help Utility ?明 

ntdsutil.exe    ------         Performs DB maintenance of the ADSI 完成ADSI的DB的維護 

ntfrs.exe       ------         NT File Replication Service NT檔複製服務 

ntfrsupg.exe    ------         

ntkrnlpa.exe    ------         Kernel patch 核心補丁 

ntoskrnl.exe    ------         Core NT Kernel KT的核心 

ntsd.exe        ------         

ntvdm.exe       ------         Simulates a 16-bit Windows environment 模擬16位Windows環境 

nw16.exe        ------         Netware Redirector NetWare轉向器 

nwscript.exe    ------         runs netware scripts 運行Netware腳本 

odbcad32.exe    ------         ODBC 32-bit Administrator 32位ODBC管理 

odbcconf.exe    ------         Configure ODBC driver's and data source's from command line 命令行配置ODBC驅動和資料源 

os2.exe         ------         an os/2 warp server (os2 /o) os/2 

os2srv.exe      ------         an os/2 warp server os/2 

os2ss.exe       ------         an os/2 warp server os/2 

osk.exe         ------         on screen keyboard 螢幕鍵盤 

packager.exe    ------         windows 2000 packager manager 物件包裝程式 

pathping.exe    ------         combination of ping and tracert 包含ping和tracert的程式 

pax.exe         ------         PAX is a posix program and path names used as arguments must be specified in posix format. use ""//c/users/default"" instead of ""c:\users\default."" 啟動可?式存檔互換 (pax) 實用程式 "

pentnt.exe      ------         used to check the pentium for the floating point division error. 檢查pentium的浮點錯誤 

perfmon.exe     ------         starts windows performance monitor 性能監視器 

ping.exe        ------         packet internet groper 驗證與遠端電腦的連接 

posix.exe       ------         used for backward compatibility with unix 用於相容unix 

print.exe       ------         cmd line used to print files 列印文字檔案或顯示列印佇列的內容。 

progman.exe     ------         program manager 程式管理器 

proquota.exe    ------         profile quota program 

psxss.exe       ------         posix subsystem application posix子系統應用程式 

qappsrv.exe     ------         displays the available application terminal servers on the net work 在網路上顯示終端伺服器可用的程式 

qprocess.exe    ------         display information about processes local or remote 在本地或遠端顯示進程的資訊(需終端服務) 

query.exe       ------         query termserver user process and sessions 查詢進程和對話 

quser.exe       ------         display information about a user logged on 顯示用戶登陸的資訊(需終端服務) 

qwinsta.exe     ------         display information about terminal sessions. 顯示終端服務的資訊 

ras.exe         ------         starts a ras connection 運行ras連接 

rasautou.exe    ------         creates a ras connection 建立一個ras連接 

rasdial.exe     ------         dial a connection 撥號連接 

rcp.exe         ------         copies a file from and to a rcp service. 在 windows 2000 電腦和運行遠端外殼埠監控程序 rshd 的系統之間複製檔 

rdpclip.exe     ------         rdpclip allows you to copy and paste files between a terminal session and client console session. 再終端和本地複製和粘貼檔 

recover.exe     ------         recovers readable information from a bad or defective disk 從壞的或有缺陷的磁片中恢復可讀取的資訊。 

redir.exe       ------         starts the redirector service 運行重定向服務 

regedt32.exe    ------         32-bit register service 32位元註冊服務 

regini.exe      ------         modify registry permissions from within a script 用腳本修改註冊許可 

register.exe    ------         register a program so it can have special execution character istics. 註冊包含特殊運行字元的程式 

regsvc.exe      ------         

regsvr32.exe    ------         registers and unregister's dll's. as to how and where it register's them i dont know. 註冊和反註冊dll  

regtrace.exe    ------         options to tune debug options for applications failing to dump trace statements trace 設置 

regwiz.exe      ------         registration wizard 註冊嚮導 

remrras.exe     ------         

replace.exe     ------         replace files 用原始目錄中的同名檔替換目標目錄中的檔。 

reset.exe       ------         reset an active section 重置活動部分 

rexec.exe       ------         runs commands on remote hosts running the rexec service. 在運行rexec 服務的遠端電腦上運行命令。rexec 命令在執行指定命令前,驗證遠端電腦上的用戶名,只有安裝了 tcp/ip 協定後才可以使用該命令。 

risetup.exe     ------         starts the remote installation service wizard. 運行遠端安裝嚮導服務 

route.exe       ------         display or edit the current routing tables. 控制網路路由表 

routemon.exe    ------         no longer supported 不再支持了! 

router.exe      ------         router software that runs either on a dedicated dos or on an os/2 system. route軟體在 dos或者是os/2系統 

rsh.exe         ------         runs commands on remote hosts running the rsh service 在運行 rsh 服務的遠端電腦上運行命令 

rsm.exe         ------         mounts and configures remote system media 配置遠端系統媒體 

rsnotify.exe    ------         remote storage notification recall 遠端存儲通知回顯 

rsvp.exe        ------         resource reservation protocol 源預約協議 

runas.exe       ------         run a program as another user 允許用戶用其他許可權運行指定的工具和程式 

rundll32.exe    ------         launches a 32-bit dll program 啟動32位元dll程式 

runonce.exe     ------         causes a program to run during startup 運行程式再開始功能表中 

rwinsta.exe     ------         reset the session subsystem hardware and software to known initial values 重置會話子系統硬體和軟體到最初的值  

savedump.exe    ------         does not write to e:\winnt\user.dmp 不寫入user.dmp中 

scardsvr.exe    ------         smart card resource management server 子能卡資源管理伺服器 

schupgr.exe     ------         it will read the schema update files (.ldf files) and upgrade the schema. (part of adsi) 讀取計畫更新檔和更新計畫 

secedit.exe     ------         starts security editor help 自動安全性配置管理 

services.exe    ------         controls all the services 控制所有服務 

sethc.exe       ------         set high contrast - changes colours and display mode logoff to set it back to normal 設置高對比 

setreg.exe      ------         shows the software publishing state key values 顯示軟體發佈的國家語言 

setup.exe       ------         gui box prompts you to goto control panel to configure system components 安裝程式(轉到控制面板)

setver.exe      ------         set version for files 設置 ms-dos 子系統向程式報告的 ms-dos 版本號 

sfc.exe         ------         system file checker test and check system files for integrity 系統檔檢查 

sfmprint.exe    ------         print services for macintosh 列印macintosh服務 

sfmpsexe.exe    ------         

sfmsvc.exe      ------         

shadow.exe      ------         monitor another terminal services session. 監控另外一台中端伺服器會話 

share.exe       ------         windows 2000 和 ms-dos 子系統不使用該命令。接受該命令只是為了與 ms-dos 文件相容 

shmgrate.exe    ------         

shrpubw.exe     ------         create and share folders 建立和共用文件夾 

sigverif.exe    ------         file signature verification 文件簽名驗證 

skeys.exe       ------         serial keys utility 序列號製作工具 

smlogsvc.exe    ------         performance logs and alerts 性能日誌和警報 

smss.exe        ------         

sndrec32.exe    ------         starts the windows sound recorder 答錄機 

sndvol32.exe    ------         display the current volume information 顯示聲音控制資訊 

snmp.exe        ------         simple network management protocol used for network mangement 簡單網路管理協定 

snmptrap.exe    ------         utility used with snmp snmp工具 

sol.exe         ------         windows solitaire game 紙牌 

sort.exe        ------         compares files and folders 讀取輸入、排序資料並將結果寫到螢幕、檔和其他設備上 

SPOOLSV.EXE     ------         Part of the spooler service for printing 列印池服務的一部分 

sprestrt.exe    ------         

srvmgr.exe      ------         Starts the Windows Server Manager 伺服器管理器 

stimon.exe      ------         WDM StillImage- Monitor  

stisvc.exe      ------         WDM StillImage-  Service 

subst.exe       ------         Associates a path with a drive letter 將路徑與驅動器盤符關聯 

svchost.exe     ------         Svchost.exe is a generic host process name for services that are run from dynamic-link libraries (DLLs). DLL得主進程 

syncapp.exe     ------         Creates Windows Briefcase. 創建Windows文件包 

sysedit.exe     ------         Opens Editor for 4 system files 系統組態編輯程式 

syskey.exe      ------         Encrypt and secure system database NT帳號資料庫按群工具 

sysocmgr.exe    ------         Windows 2000 Setup 2000安裝程式 

systray.exe     ------         Starts the systray in the lower right corner. 在低許可權運行systray 

taskman.exe     ------         Task Manager 任務管理器 

taskmgr.exe     ------         Starts the Windows 2000 Task Manager 任務管理器 

tcmsetup.exe    ------         telephony client wizard 電話服務客戶安裝 

tcpsvcs.exe     ------         TCP Services TCP服務 

tftp.exe        ------         Trivial FTP 將檔傳輸到正在運行 TFTP 服務的遠端電腦或從正在運行TFTP 服務的遠端電腦傳輸檔 

tftpd.exe       ------         Trivial FTP Daemon 

themes.exe      ------         Change Windows Themes 桌面主題 

tlntadmn.exe    ------         Telnet Server Administrator Telnet服務管理 

tlntsess.exe    ------         Display the current Telnet Sessions 顯示目前的Telnet會話 

tlntsvr.exe     ------         Start the Telnet Server 開始Telnet服務 

tracert.exe     ------         Trace a route to display paths 該診斷實用程式將包含不同生存時間 (TTL) 值的 Internet 控制消息協定 (ICMP) 回顯資料包發送到目標,以決定到達目標採用的路由 

tsadmin.exe     ------         Terminal Server Administrator 終端服務管理器 

tscon.exe       ------         Attaches a user session to a terminal session. 粘貼用戶會話到終端對話 

tsdiscon.exe    ------         Disconnect a user from a terminal session 斷開終端服務的用戶 

tskill.exe      ------         Kill a Terminal server process 殺掉終端服務 

tsprof.exe      ------         Used with Terminal Server to query results. 用終端服務得出查詢結果 

tsshutdn.exe    ------         Shutdown the system 關閉系統 

unlodctr.exe    ------         Part of performance monitoring 性能監視器的一部分 

upg351db.exe    ------         Upgrade a jet database 升級Jet資料庫 

ups.exe         ------         UPS service UPS服務 

user.exe        ------         Core Windows Service Windows核心服務 

userinit.exe    ------         Part of the winlogon process Winlogon進程的一部分 

usrmgr.exe      ------         Start the windows user manager for domains 域用戶管理器 

utilman.exe     ------         This tool enables an administrator to designate which computers automatically open accessibility tools when Windows 2000 starts. 指定2000啟動時自動打開那台機器 

verifier.exe    ------         Driver Verifier Manager Driver Verifier Manager 

vwipxspx.exe    ------         Loads IPX/SPX VDM 調用IPX/SPX VDM 

w32tm.exe       ------         Windows Time Server 時間伺服器 

wextract.exe    ------         Used to extract windows files 解壓縮Windows檔 

winchat.exe     ------         Opens Windows Chat 打開Windows聊天 

winhlp32.exe    ------         Starts the Windows Help System 運行幫助系統 

winlogon.exe    ------         Used as part of the logon process. Logon進程的一部分 

winmine.exe     ------         windows Game 挖地雷 

winmsd.exe      ------         Windows Diagnostic utility 系統資訊 

wins.exe        ------         Wins Service Wins服務 

winspool.exe    ------         Print Routing 列印路由 

winver.exe      ------         Displays the current version of Windows 顯示Windows版本 

wizmgr.exe      ------         Starts Windows Administration Wizards Windows管理嚮導 

wjview.exe      ------         Command line loader for Java 命令行調用Java 

wowdeb.exe      ------         " . For starters, the 32-bit APIs require that the WOWDEB.EXE task runs in the target debugee's VM 啟動時,32位元API需要 "

wowexec.exe     ------         For running Windows over Windows Applications 在Windows應用程式上運行Windows 

wpnpinst.exe    ------         ? 

write.exe       ------         Starts MS Write Program 寫字板 

wscript.exe     ------         Windows Scripting Utility 腳本工具 

wupdmgr.exe     ------         Starts the Windows update Wizard (Internet) 運行Windows升級嚮導 

xcopy.exe       ------         複製檔和目錄,包括子目錄Win XP控制臺命令詳解 

正多面體座標產生器



public class 正多面體 {
  private static double r = 50;
  
  public static void main(String argv[]) {
    正四面體();
    正六面體();
    正八面體();
    正十二面體();
    正二十面體();
  }

  public static void printPoints(String s, Point3D[] v) {
    System.out.println(s);
    for(int i = 0; i < v.length; ++i) {
      System.out.println("p" + (i+1) + " " + v[i].x + " " + v[i].y + " " + v[i].z);
    }
  }
  
  public static void printLines(String s, int[][] o) {
    System.out.println(s);
    if(o == null) return;
    int c = 0;
    for(int i = 0; i < o.length; ++i) {
      for(int j = 0; j < o[i].length - 1; ++j) {
        System.out.println("l" + (c+1) + " p" + (o[i][j]+1) + " p" + (o[i][j+1]+1));
        c++;
      }
      System.out.println("l" + (c+1) + " p" + (o[i][o[i].length-1]+1) + " p" + (o[i][0]+1));
      c++;
    }
  }
  
  private static Point3D minus(Point3D p) {
    // TODO Auto-generated method stub
    return new Point3D(-p.x, -p.y, -p.z);
  }
  
  private static void 正四面體() {
    // TODO Auto-generated method stub
    double sq2 = Math.sqrt(2.0), sq3 = Math.sqrt(3.0); 
    Point3D[] Vt = new Point3D[4];
    Vt[0] = new Point3D(0, r, 0); 
    Vt[1] = new Point3D(0, -r/3, r*2*sq2/3); 
    Vt[2] = new Point3D(r*sq2/sq3, -r/3, -r*sq2/3); 
    Vt[3] = new Point3D(-r*sq2/sq3, -r/3, -r*sq2/3); 
     
    int[][] ord = {{0, 1, 2}, {0, 2, 3}, {0, 3, 1}, {1, 3, 2}};
    printPoints("正四面體", Vt);
    printLines("正四面體", ord);
  }

  
  
  private static void 正六面體() {
    // TODO Auto-generated method stub
    double sq2 = Math.sqrt(2.0), sq3 = Math.sqrt(3.0); 
    Point3D[] Vt = new Point3D[8];
    Vt[0] = new Point3D(0, r, 0); 
    Vt[1] = new Point3D(0, r/3, r*2*sq2/3); 
    Vt[2] = new Point3D(r*sq2/sq3, r/3, -r*sq2/3); 
    Vt[3] = new Point3D(-r*sq2/sq3, r/3, -r*sq2/3); 
     
    for(int i = 4; i < Vt.length; i++) 
        Vt[i] = minus(Vt[i-4]); 

    int[][] ord = {{0, 1, 7, 2}, {0, 2, 5, 3}, {0, 3, 6, 1}, 
                   {4, 6, 3, 5}, {4, 7, 1, 6}, {4, 5, 2, 7}}; 

    printPoints("正六面體", Vt);
    printLines("正六面體", ord);
  }

  private static void 正八面體() {
    // TODO Auto-generated method stub
    Point3D[] Vt = new Point3D[6];
    Vt[0] = new Point3D(0, r, 0); 
    Vt[1] = new Point3D(0, 0, r); 
    Vt[2] = new Point3D(r, 0, 0); 
     
    for(int i = 3; i < Vt.length; i++) 
        Vt[i] = minus(Vt[i-3]); 
     
    int[][] ord = {{0, 1, 2}, {0, 2, 4}, {0, 4, 5}, {0, 5, 1}, 
                   {3, 5, 4}, {3, 1, 5}, {3, 2, 1}, {3, 4, 2}};
    printPoints("正八面體", Vt);
    printLines("正八面體", ord);

  }

  private static void 正十二面體() {
    // TODO Auto-generated method stub
    double sq3=Math.sqrt(3.0),sq5=Math.sqrt(5.0);
    double t1 = (sq5+1)/2, t2 = (sq5-1)/2; 

    Point3D[] Vt = new Point3D[20];
    Vt[0] = new Point3D(0,r,0); 
    Vt[1] = new Point3D(0,r*sq5/3,r*2/3); 
    Vt[2] = new Point3D(r*sq3/3,r*sq5/3,-r/3); 
    Vt[3] = new Point3D(-r*sq3/3,r*sq5/3,-r/3); 
    Vt[4] = new Point3D(r*sq3/3,r/3,r*sq5/3); 
    Vt[5] = new Point3D(r*t1*sq3/3,r/3,r*t2*t2/3); 
    Vt[6] = new Point3D(r*t2*sq3/3,r/3,-r*t1*t1/3); 
    Vt[7] = new Point3D(-r*t2*sq3/3,r/3,-r*t1*t1/3); 
    Vt[8] = new Point3D(-r*t1*sq3/3,r/3,r*t2*t2/3); 
    Vt[9] = new Point3D(-r*sq3/3,r/3,r*sq5/3); 
    for(int i = 10; i < Vt.length; i++) 
        Vt[i] = minus(Vt[i-10]);
    
    
    int[][]ord = 
            {{ 0, 1, 4, 5, 2},{ 0, 2, 6, 7, 3},{ 0, 3, 8, 9, 1}, 
            { 1, 9,16,17, 4},{ 2, 5,18,19, 6},{ 3, 7,14,15, 8}, 
            {10,12,15,14,11},{10,13,17,16,12},{10,11,19,18,13}, 
            {11,14, 7, 6,19},{12,16, 9, 8,15},{13,18, 5, 4,17}};
    printPoints("正十二面體", Vt);
    printLines("正十二面體", ord);

  }

  private static void 正二十面體() {
    // TODO Auto-generated method stub
     double sq5=Math.sqrt(5.0); 
     double t1 = (sq5+1)/2, t2 = (sq5-1)/2; 
     Point3D[] Vt = new Point3D[12];
     Vt[0] = new Point3D(0,r,0); 
     Vt[1] = new Point3D(0,r/sq5,r*2/sq5); 
     Vt[2] = new Point3D(r*Math.sqrt(t1/sq5),r/sq5,r*t2/sq5); 
     Vt[3] = new Point3D(r*Math.sqrt(t2/sq5),r/sq5,-r*t1/sq5); 
     Vt[4] = new Point3D(-r*Math.sqrt(t2/sq5),r/sq5,-r*t1/sq5); 
     Vt[5] = new Point3D(-r*Math.sqrt(t1/sq5),r/sq5,r*t2/sq5); 
     for(int i = 6; i < Vt.length; i++) 
        Vt[i] = minus(Vt[i-6]); 
     
     int[][]ord = 
              {{0, 1,2},{0, 2,3},{0, 3,4},{ 0, 4, 5},{ 0,5, 1}, 
               {1,10,2},{2,11,3},{3, 7,4},{ 4, 8, 5},{ 5,9, 1}, 
               {6, 8,7},{6, 9,8},{6,10,9},{ 6,11,10},{ 6,7,11}, 
               {7, 8,4},{8, 9,5},{9,10,1},{10,11, 2},{11,7, 3}};
     printPoints("正二十面體", Vt);
     printLines("正二十面體", ord);

  }
  
  static class Point3D {
    public double x, y, z;
    public Point3D() {
      this.x = 0;
      this.y = 0;
      this.z = 0;
    }
    public Point3D(double x, double y, double z) {
      this.x = x;
      this.y = y;
      this.z = z;
    }
  }
}

2009年8月30日 星期日

Java Bézier Cubic Curve

import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

public class CubicBezierCurve extends JFrame {

    private Point[] controlPoint = new Point[4];
    private Point[] curve = new Point[1024];
    private PaintPael paintPanel = null;
    private JLabel location = new JLabel("x: 0  y: 0");
    private static CubicBezierCurve cbc = null;
    private int controlPointCount = 0;
    public CubicBezierCurve() {
        for(int i = 0; i < controlPoint.length; ++i)
            controlPoint[i] = new Point(0, 0);
        InitComponent();
        setBackground(Color.WHITE);
        setSize(640, 480);
        setVisible(true);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    }
    private void InitComponent() {
        setLayout(new BorderLayout());
        
        paintPanel = new PaintPael();
        
        add(paintPanel, BorderLayout.CENTER);
        
        Panel eastPanel = new Panel();
        eastPanel.setBackground(Color.BLACK);
        eastPanel.setLayout(new FlowLayout());
        Button restart = new Button("Restart");
        restart.addActionListener(new ButtonListener());
        
        
        eastPanel.add(restart);
        add(eastPanel, BorderLayout.EAST);
        location.setForeground(Color.RED);
        location.setBackground(Color.BLACK);
        add(location, BorderLayout.NORTH);
    }
    
    public Point BezierFunction(double t) {
      
      double tsqure = t * t;
      double tcubic = tsqure * t * t;

      double t1      = (1.0 - t);
      double t1square = t1 * t1; 
      double t1cubic = t1square * t1;
      
        double x = controlPoint[0].x * tcubic +
        3 * controlPoint[1].x * tsqure * t1 +
        3 * controlPoint[2].x * t * t1square+
        controlPoint[3].x * t1cubic;
        
        double y = controlPoint[0].y * t * t * t +
        3 * controlPoint[1].y * tsqure * t1 +
        3 * controlPoint[2].y * t * t1square+
        controlPoint[3].y * t1cubic;
            
        return new Point((int)x, (int)y);
    }
    public void ComputeCurve() {
        double t = 1.0 / 1024.0;
        for(int i = 0; i < curve.length; ++i) {
            curve[i] = BezierFunction(t * i);
        }
    }

    public static void main(String[] argv) {
        cbc = new CubicBezierCurve();
    }
   
    class PaintPael extends JPanel {

        public PaintPael() {
            PanelListener pl = new PanelListener();
            addMouseListener(pl);
            addMouseMotionListener(pl);
            setBackground(Color.BLACK);
        }
        public void paint(Graphics g) {
          super.paint(g);
            g.setClip(0, 0, getWidth(), getHeight());
            PaintControlPoint(g);
            PaintControlLine(g);
            PaintCurve(g);
        }
        private void PaintControlLine(Graphics g) {
            g.setColor(Color.green);
            if(controlPoint[0].x != 0 && controlPoint[0].y != 0 && controlPoint[1].x != 0 && controlPoint[1].y != 0)
                g.drawLine(controlPoint[0].x, controlPoint[0].y, controlPoint[1].x, controlPoint[1].y);
            if(controlPoint[1].x != 0 && controlPoint[1].y != 0 && controlPoint[2].x != 0 && controlPoint[2].y != 0)
                g.drawLine(controlPoint[1].x, controlPoint[1].y, controlPoint[2].x, controlPoint[2].y);
            if(controlPoint[2].x != 0 && controlPoint[2].y != 0 && controlPoint[3].x != 0 && controlPoint[3].y != 0)
                g.drawLine(controlPoint[2].x, controlPoint[2].y, controlPoint[3].x, controlPoint[3].y);
        }
        private void PaintControlPoint(Graphics g) {
            g.setColor(Color.BLUE);
            for(int i = 0; i < controlPoint.length; ++i) {
                if(controlPoint[i] != null && controlPoint[i].x != 0 && controlPoint[i].y != 0) {
                    g.fillOval(controlPoint[i].x - 2, controlPoint[i].y - 2, 4, 4);
                }
            }
        }
        private void PaintCurve(Graphics g) {
            if(curve[0] != null) {
                g.setColor(Color.RED);
                for(int i = 0; i < curve.length; ++i) {
                    g.fillOval(curve[i].x, curve[i].y, 2, 2);
                }
            }
        }
    }
    
    class ButtonListener implements ActionListener {
        @Override
        public void actionPerformed(ActionEvent e) {
            for(int i = 0; i < controlPoint.length; ++i) {
                if(controlPoint[i] != null) {
                    controlPoint[i].setLocation(0, 0);
                }
            }
            curve = null;
            curve = new Point[1024];
            //paintPanel.paintImmediately(0, 0, paintPanel.getWidth(), paintPanel.getHeight());
            controlPointCount = 0;
            cbc.repaint();
        }
    }
    
    class PanelListener extends MouseAdapter implements MouseMotionListener {
        @Override
        public void mouseClicked(MouseEvent arg0) {
            for(int i = 0; i < controlPoint.length; ++i) {
                if(controlPoint[i] != null && controlPoint[i].x == 0 && controlPoint[i].y == 0) {
                    controlPoint[i].x = arg0.getX();
                    controlPoint[i].y = arg0.getY();
                    break;
                }
            }
            if(controlPoint[3].x != 0 && controlPoint[3].y != 0 && curve[0] == null) {
                cbc.ComputeCurve();
            }
            controlPointCount ++;
            cbc.repaint();

        }
        @Override
        public void mouseDragged(MouseEvent arg0) {
        }

        @Override
        public void mouseMoved(MouseEvent arg0) {
            location.setText("x: " + arg0.getX() + "  y: " + arg0.getX());
        }
    }
}

Java Quick Sort


public class JQuickSort {

  public static void main(String[] argv) {
    // JQuickSort qs = new JQuickSort(Integer.parseInt(argv[0]));
    JQuickSort qs = new JQuickSort(20);
    qs.start();
  }

  int[] a = null;

  public JQuickSort(int num) {
    a = new int[num];
    for (int i = 0; i < num; ++i) {
      int n = (int) (Math.random() 9999);
      a[i= n;
    }
  }

  int partition(int number[]int left, int right) {
    int i, j, s;
    s = number[right];
    i = left - 1;
    for (j = left; j < right; j++) {
      if (number[j<= s) {
        i++;
        int tmp = number[i];
        number[i= number[j];
        number[j= tmp;
      }
    }
    int tmp = number[i + 1];
    number[i + 1= number[right];
    number[right= tmp;
    return i + 1;
  }

  private void printArray() {
    System.out.print("Array: ");
    for (int i = 0; i < a.length; ++i) {
      System.out.print(a[i" ");
    }
    System.out.println();
  }

  void quicksort(int number[]int left, int right) {
    int q;

    if (left < right) {
      q = partition(number, left, right);
      quicksort(number, left, q - 1);
      quicksort(number, q + 1, right);
    }
  }

  private void start() {
    printArray();
    quicksort(a, 0, a.length - 1);
    printArray();
  }

}

Java Quick Sort


2009年8月27日 星期四

SMS PDU Decoder and Encoder

Now you can use these 2 programs to encode and decode SMS PDU. SMS is the Sort Message Service for the mobile user equipment. Please use the encoder to encode the message that you want to send. And use the decoder to decode the message that you just encoded.

source code:

This is the screenshot of encoder.

This is the screenshot of decoder.

If there is any problem, please leave you message to me.