歡迎來到小豬圈!
2008-01-31
不用三腳架也能拍出完美不手震的影像
- 好像還滿方便的(至少夠便宜),有點像在用單腳架的感覺,只不過一個是住下壓、一個往上拉。原文沒有文字敘述,以下為簡記。
- 材料:一個用在相機腳架或雲台上的那種螺絲 (1/4 螺絲;有零賣)、一條細繩子(至少需同等於身高)和一個大型螺絲墊片。
- 螺絲與墊片挷在繩子兩端,螺絲鎖在相機上,拍照時一腳踩在墊片並把相機往上抬,以拉直繩子。
關於 PortableApps.com
- 立意不錯,但打包成安裝檔的點還滿詭異的(只針對可攜性,不考慮免安裝的部份?)。
- 跟各軟體的官方釋出的版本比起來,更新較慢(像 Firefox 2 剛出那陣子一直有安全性更新那種情況),語系較少(像 OpenOffice …等)。
- 有些軟體沒有必要用 PortableApps.com 的版本,如 Notepad++ 下載官方提供壓縮檔的版本即可。
- 而另外有一些軟體的設定值存取不順利,像我用 MPlayer Portable 1.0 RC1 時修改設定要重覆設定兩次才能成功。(也許是個案)
2008-01-28
關於 XDite 網站創業,你準備好了嗎?系列
- 簡單來分,成功的因素不外乎就是“運氣”跟“實力”,沒有實力的話,不就只能靠運氣了嗎。(囧)
- 在“實力”的項目之中,最能掌握的就是自身擁有的能力,至少比較不會受外在因素(像資金、人事)影響。
- 很多時候、很多的人、事、物,都還是得親自遇到了才知道。
2008-01-21
老哥買了 Wii + Fit
2008-01-16
InstallShield Error code: -6006
- 這次重灌中安裝驅動程式時遇到的問題,詳細原因並不清楚,只知道跟 Windows Installer 有關。我的情況是在 Windows Installer 設為 Manual 的狀態下,沒有自動啟動,手動打開就好了。
2008-01-12
關於國內大學要求微軟調降權利金相關新聞
- 若沒有表現出一副“沒有也沒關係,用別的也可以”的樣子,反而露出一臉“我就是只要買你的東西,你給我便宜點”的傻樣,怎麼跟人談殺價,這個不是菜市場阿婆都會的道理嗎。(囧)
- 我最後一次使用的微軟 Office 系列的經驗,大概是 OfficeXP 剛推出的版本,之後就開始改用 OpenOffice.org,不過,我覺得相形之下, OpenOffice.org 實在稱不上“好用”。
- 目前我個人主要使用的編輯器是 Notepad++ ,文件格式是 HTML 與文字檔,OpenOffice.org 常用的就僅有試算表,偶而用 Writer 和 Impress 開啟一些(大都是微軟 Office 格式的)文件而已。
- 使用 HTML 格式的好處之一是編輯與瀏覽的環境需求很低,只需要文字編輯器和瀏覽器而已(可說是僅次純文字)。字元編碼在支援 Unicode/UTF8 越來越完善的今日,也逐漸不成問題了。
- 似乎講偏了…
2008-01-10
從登錄檔修改服務啟動的類型
- 以下內容的測試環境是 WindowsXP SP3RC1(在 VirtualPC 2007 所建構的 VM 之中),提到的“服務”指的是 Windows 內建的 service,一種在背景執行的特殊程式。“登錄”指的是 Windows Registry,而“登錄檔”指的是副檔名為 reg 的文件。
- 一般情況下,透過執行 services.msc 這項管理工具來修改服務的啟動類型即可,編輯成登錄檔的形式僅便於重灌或大量套用。更動登錄有其風險,不建議冒然修改。
- 文末附上個人設定僅供參考,若需套用,請務必檢視、修改以符合實際需求,勿直接匯入。用 Notepad 存檔時編碼要選 Unicode (Notepad++ 即 UCS-2 little Endian),並將副檔名設為 reg。
- Start (DWORD) 一值即為設定啟動類型的項目,可用值如下:
- 0: Boot
- 1: System
- 2: Automatic
- 3: Manual
- 4: Disable
- 服務的詳細機碼內容,可執行 regedit.exe ,到 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ 中查看。
- 依更新進度不同,每個作業系統有的服務項目會有所增減,因為有些服務是在 Service Pack 才加入的。(像 Bluetooth Support Service, Extensible Authentication Protocol Service, Health Key and Certificate Management Service, Network Access Protection Agent, Network Provisioning Service, Wired AutoConfig …等)
- 目前測試結果(測試方法是先將所有服務設為 Manual,再逐項啟動),只有“Plug and Play”與“Remote Procedure Call (RPC)”兩項較有設為自動啟動的必要(否則大部份的服務無法正常的手動啟動)。
- 而在所有服務都停用的情況下,Windows 依然可以正常開機、登入,但不只工作列無法顯示,還有大部份的 MMC 管理頁面也都無法正常運作。此時只能用 Ctrl+Alt+Del 叫出工作管理員來執行程式。前述情況是在 VM 環境內測試的結果,實機測試有些出入(工作列有出現)。
- 有些服務從名稱、說明或依存性,都看不出有什麼大不了的,但實際上卻很重要。像是使用 PPPoE (台灣常見的 ADSL 撥接) 時, Telephony 服務是必要的(還有 Network Connections、Remote Access Connection Manager 兩項),但從說明看來卻像是 VoIP 之類的服務。
- 有些服務如 Print Spooler、Smart Card、UPS … 等,則應依個人設備需設定。
- Windows service - Wikipedia, the free encyclopedia
- Windows Registry - Wikipedia, the free encyclopedia
- CurrentControlSet\Services Subkey Entries Microsoft Help and Support
Windows Registry Editor Version 5.00 #Start (DWORD): 0x0 - Boot; 0x1 - System; 0x2 - Automatic; 0x3 - Manual; 0x4 - Disabled. #@See http://support.microsoft.com/kb/103000/en-us #Alerter [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Alerter] "Start"=dword:00000004 #Application Layer Gateway Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ALG] "Start"=dword:00000004 #Application Management [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AppMgmt] "Start"=dword:00000003 #Automatic Updates [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv] "Start"=dword:00000003 #Background Intelligent Transfer Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS] "Start"=dword:00000003 #Bluetooth Support Service #ClipBook [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ClipSrv] "Start"=dword:00000004 #COM+ Event System [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventSystem] "Start"=dword:00000002 #COM+ System Application [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\COMSysApp] "Start"=dword:00000003 #Computer Browser [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Browser] "Start"=dword:00000004 #Cryptographic Services #@See http://www.binbin.net/messages/qa_win_xp/0037.htm [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CryptSvc] "Start"=dword:00000003 #DCOM Server Process Launcher #Windows Firewall Network Connections service and the COM+ Event System service #@See http://support.microsoft.com/kb/892504/en-us [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DcomLaunch] "Start"=dword:00000003 #DHCP Client [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dhcp] "Start"=dword:00000004 #Distributed Link Tracking Client [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TrkWks] "Start"=dword:00000004 #Distributed Transaction Coordinator [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSDTC] "Start"=dword:00000004 #DNS Client [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache] "Start"=dword:00000002 #Error Reporting Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ERSvc] "Start"=dword:00000004 #Event Log [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog] "Start"=dword:00000002 #Extensible Authentication Protocol Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EapHost] "Start"=dword:00000004 #Fast User Switching Compatibility [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FastUserSwitchingCompatibility] "Start"=dword:00000004 #Health Key and Certificate Management Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\hkmsvc] "Start"=dword:00000004 #Help and Support [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\helpsvc] "Start"=dword:00000004 #HID Input Service, Human Interface Device Access [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HidServ] "Start"=dword:00000004 #HTTP SSL [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTPFilter] "Start"=dword:00000003 #IMAPI CD-Burning COM Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ImapiService] "Start"=dword:00000004 #Indexing Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CiSvc] "Start"=dword:00000004 #IPSEC Services [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent] "Start"=dword:00000004 #Logical Disk Manager [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmserver] "Start"=dword:00000003 #Logical Disk Manager Administrative Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dmadmin] "Start"=dword:00000003 #Messenger [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Messenger] "Start"=dword:00000004 #MS Software Shadow Copy Provider [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SwPrv] "Start"=dword:00000004 #Net Logon [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon] "Start"=dword:00000004 #NetMeeting Remote Desktop Sharing [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mnmsrvc] "Start"=dword:00000004 #Network Access Protection Agent [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\napagent] "Start"=dword:00000004 #Network Connections [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netman] "Start"=dword:00000002 #Network DDE [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetDDE] "Start"=dword:00000004 #Network DDE DSDM [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetDDEdsdm] "Start"=dword:00000004 #Network Location Awareness (NLA) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Nla] "Start"=dword:00000004 #Network Provisioning Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\xmlprov] "Start"=dword:00000004 #NT LM Security Support Provider [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NtLmSsp] "Start"=dword:00000004 #Performance Logs and Alerts [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysmonLog] "Start"=dword:00000004 #Plug and Play [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PlugPlay] "Start"=dword:00000002 #Portable Media Serial Number Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WmdmPmSN] "Start"=dword:00000004 #Print Spooler [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler] "Start"=dword:00000003 #Protected Storage [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ProtectedStorage] "Start"=dword:00000004 #QoS RSVP [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RSVP] "Start"=dword:00000004 #Remote Access Auto Connection Manager [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasAuto] "Start"=dword:00000004 #Remote Access Connection Manager [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan] "Start"=dword:00000003 #Remote Desktop Help Session Manager [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RDSessMgr] "Start"=dword:00000004 #Remote Procedure Call (RPC) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcSs] "Start"=dword:00000002 #Remote Procedure Call (RPC) Locator [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcLocator] "Start"=dword:00000004 #Remote Registry [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry] "Start"=dword:00000004 #Removable Storage [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NtmsSvc] "Start"=dword:00000003 #Routing and Remote Access [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteAccess] "Start"=dword:00000004 #Secondary Logon [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\seclogon] "Start"=dword:00000004 #Security Accounts Manager [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SamSs] "Start"=dword:00000003 #Security Center [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wscsvc] "Start"=dword:00000004 #Server [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver] "Start"=dword:00000004 #Shell Hardware Detection [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ShellHWDetection] "Start"=dword:00000004 #Smart Card [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SCardSvr] "Start"=dword:00000004 #SSDP Discovery Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SSDPSRV] "Start"=dword:00000004 #System Event Notification [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SENS] "Start"=dword:00000004 #System Restore Service [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srservice] "Start"=dword:00000004 #Task Scheduler [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule] "Start"=dword:00000004 #TCP/IP NetBIOS Helper [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LmHosts] "Start"=dword:00000004 #Telephony [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TapiSrv] "Start"=dword:00000003 #Telnet [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TlntSvr] "Start"=dword:00000004 #Terminal Services [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService] "Start"=dword:00000004 #Themes [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Themes] "Start"=dword:00000004 #Uninterruptible Power Supply [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UPS] "Start"=dword:00000004 #Universal Plug and Play Device Host [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\upnphost] "Start"=dword:00000004 #Volume Shadow Copy [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VSS] "Start"=dword:00000004 #Web Client [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient] "Start"=dword:00000004 #Windows Audio [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AudioSrv] "Start"=dword:00000002 #Windows Firewall/Internet Connection Sharing (ICS) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess] "Start"=dword:00000004 #Windows Image Acquisition (WIA) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stisvc] "Start"=dword:00000004 #Windows Installer [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer] "Start"=dword:00000003 #Windows Management Instrumentation [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\winmgmt] "Start"=dword:00000003 #Windows Management Instrumentation Driver Extensions [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wmi] "Start"=dword:00000004 #Wired AutoConfig [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dot3svc] "Start"=dword:00000004 #Windows Time [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time] "Start"=dword:00000004 #Windows User Mode Driver Framework [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UMWdf] "Start"=dword:00000004 #Wireless Zero Configuration [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WZCSVC] "Start"=dword:00000004 #WMI Performance Adapter [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WmiApSrv] "Start"=dword:00000004 #Workstation [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanworkstation] "Start"=dword:00000004
2008-01-07
原來 UNIX-like 的目錄結構有 FHS 這項標準啊
- 從以前剛接觸 linux 開始,就一直對目錄結構有很多的疑問,今天無意間找到 Filesystem Hierarchy Standard 這份文件著實解決了我不少疑惑。
- “user » usr”在那年代,省這一個字真的這麼開心嗎!?
2008-01-05
2008-01-02
關於 Virtual PC 2007
- 2008-01-15 更新:
- Virtual PC 2007 有預先配置硬碟空間的選項,不過不在“New Virtual Machine Wizard”裡,而是要在“Virtual Disk Wizard”中選擇“Fixed size”。
- 使用預先配置的硬碟空間後,明顯有加快作業系統的安裝速度,大約是從 30 進步到 25 分鐘,不過還是比 VMware Server 稍慢(前述兩者的時間差並沒有精確比較,僅記錄、不值參考)。
- 嘗試安裝 Linux 失敗 (試過 CentOS-5.1-i386-bin-DVD.iso 與 ubuntu-7.10-desktop-i386.iso 的 live-cd 模式),不過這也是在預料之中的事。一個意外的事是安裝 Linux 失敗後的 Virtual Disk ,拿去安裝別的作業系統會當機?
- 試用的環境與安裝的作業系統都是 Windows XP SP2 up to date。
- 半年前曾試用過 VMware Server 1.0.2-39867,比起來,Virtual PC 2007 安裝作業系統所需時間較久。
這應該與沒有預先配製硬碟空間有關(Virtual PC 沒有這項設定)。 - 在安裝 Guest OS 的過程中沒有提示讓滑鼠游標脫離 VM 的方法(按 Right Alt 鍵),而VMware Server 會在狀態列提示。
- 內建分享資料夾的功能,設定相當簡單。
- 切換全螢幕模式時會同時切換解析度,而且反應速度相當快。
- 在 Guest OS 運行時更改 VM 設定,會暫停所有 Guest OS (即使只更動其中之一)。
- 可以更動 VM 硬體設備與選項太少,像是最多只能有三個硬碟、一台光碟機和一台軟碟機,也不能新增清單上沒有的設備。
- Microsoft Virtual PC 2007官方網站,下載頁面 在此
2007-12-30
關於 php_curl (二)
- 以下的 $ch 指的是 php curl_init() 傳回的 resource(cURL handle) ,同等於 libcurl 的 easy-handle,$mh 以此類推。
- $ch 在加入 $mh 之後就不能重覆使用(意指僅用 curl_setopt() 重設 URL)了,得關掉後重新初始化再來。
- $ch 在加入 $mh 之後 curl_errno() 會失效(總是傳回 int(0),原因不明),而 curl_error() 則是有些錯誤抓不到(已知 CURLE_COULDNT_RESOLVE_HOST(6) 不行)。
- 承上, 改用 curl_multi_info_read() 替代。傳回值如下:
<?php $curlmsg = curl_multi_info_read($mh); var_dump( $curlmsg ); // 當沒有訊息時傳回 boolean(false) // 反之則傳回 array(3) { ["msg"]=> int(1) ["result"]=> int(0) ["handle"]=> resource(9) of type (curl) } ?> - $curlmsg["msg"] 目前只有定義 CURLMSG_DONE(1) 一值,暫時可以不用理它。
- $curlmsg["result"] 值為 CURLE_* 之一。
- $curlmsg["handle"] 訊息來源的 $ch。
- curl_multi_info_read() 較為明確的呼叫時機,是當執行 curl_multi_exec($mh, $rh) 之後, $rh 變動(減少)的時候。
- curl_multi_select() 並非必要的,呼叫的主要目地是為了先檢查開啟的 sockets 有無資料,再做對應的動作,以減少佔用的 CPU 資源。以下為 Unix Socket FAQ 摘錄:
2.9. What are the pros/cons of select(), non-blocking I/O and SIGIO? Using non-blocking I/O means that you have to poll sockets to see if there is data to be read from them. Polling should usually be avoided since it uses more CPU time than other techniques. Using SIGIO allows your application to do what it does and have the operating system tell it (with a signal) that there is data waiting for it on a socket. The only drawback to this soltion is that it can be confusing, and if you are dealing with multiple sockets you will have to do a select() anyway to find out which one(s) is ready to be read. Using select() is great if your application has to accept data from more than one socket at a time since it will block until any one of a number of sockets is ready with data. One other advantage to select() is that you can set a time-out value after which control will be returned to you whether any of the sockets have data for you or not.
- [comp.unix.programmer] Unix-socket-faq for network programming
2007-12-27
廣告插播? - HiNet 線上通知服務同意書
-
- 最近撥接上 HiNet 的連線,會遇到開啟的網頁被重導到“HiNet 通知服務同意書”一頁,一開始還以為是電腦中毒了咧。
- 這感覺就像被第四台插播廣告似的,ISP 做這種難到就沒有違法嗎?
- PCDVD數位科技討論區 - HiNet線上通知服務同意書 ?
2007-12-26
2007-12-25
關於 php_curl
- 最近開發 Stylet Reader 時,為了要抓取 feed 用上了 php_curl,但文件實在有夠少的。雖然 libcurl 官網有一份 C API 的文件,但命名有些出入,所以我自製了一份對照表(見文末,僅供參考)。
- 從原始碼看來 curl_multi_select() 僅是代為呼叫 curl_multi_fdset() 與 select() ,後者可參考socket_select()。
- 依照文字說明, curl_multi_info_read() 的第二個參數($msgs_in_queue)應該是 passing by reference 吧!?怎麼會是 passing by value 呢?真詭異。
- 承上,雖然可以手動傳址 curl_multi_info_read( $mh, &$msgs_in_queue),但得打開 allow_call_time_pass_reference = On (不建議)。
- select Function (Windows) MSDN。
| php_curl | libcurl |
|---|---|
| curl_close | curl_easy_cleanup |
| curl_copy_handle | curl_easy_duphandle |
| curl_errno | |
| curl_error | curl_easy_strerror |
| curl_exec | curl_easy_perform |
| curl_getinfo | curl_easy_getinfo |
| curl_init | curl_easy_init |
| curl_multi_add_handle | curl_multi_add_handle |
| curl_multi_close | curl_multi_cleanup |
| curl_multi_exec | curl_multi_perform |
| curl_multi_getcontent | |
| curl_multi_info_read | curl_multi_info_read |
| curl_multi_init | curl_multi_init |
| curl_multi_remove_handle | curl_multi_remove_handle |
| curl_multi_select | curl_multi_fdset + select |
| curl_setopt_array | |
| curl_setopt | curl_easy_setopt |
| curl_version | curl_version |
2007-12-21
關於 meeya
- 在 XDite 那看到關於 meeya 的“JS問題”,才知道有 meeya 這站(還在封測)。
- 抄襲 js 和 css 要被發現還真不容易咧(故意的?),我覺得最扯的是:至少關鍵字(facebook)要取代掉啊(囧)。
- 趕時間也不是這樣子趕的啊,出了這事除了砍掉重練,還能怎麼著?如果真的砍掉重練,那原本省下來的時間跟死掉的腦細胞,不就煙消雲散了嗎?
- 官方回應文末呼的那口號,Go 那幾家 N*U(國立開頭、大學結尾)學校是指他們的目標核心客戶嗎?很難理解咧。
- Blog.XDite.net » 網站目標相等,所以 JS 也相等?
- Blog.XDite.net » 不只是 JS 抄襲的問題
- meeya | 校園 社群 人脈
- meeya開發日記: 測試版後第二天,小米想跟大家說些心裡的話!
- Conscious Choices: meeya 在 JS 問題上,到底做錯了什麼?
監獄兔 ウサビッチ|USAVICH.TV
- 超好笑!尤其是老大往生的時候,一整個是笑到停不下來。
- ウサビッチ|USAVICH.TV 官方網站
- 爆笑の監獄兔 (ウサビッチ) @ Shih-Hsien's BLOG
關於 PHP Constants (常數)
- 關於 PHP 的常數:
- 在宣告時其值必需為已知、固定的值。
- 常數名稱在“慣例”上都是大寫,並且字詞間以底線分開。如:
define('FOO_BAR', 'something'); - 宣告該常數以後,在執行期間其值不能被改變。
- 不管在哪宣告,全域都能存取。
- 使用常數的目的之一是要決解“魔術數字”的問題,即程式碼中沒有註解或命名的數字,容易造成程式碼不易維護。
- 使用常數時,效能不該是考量的要素之一,因為在 PHP 使用常數“並沒有”比用變數快!(這倒是出乎我的預料)剛試了一下,用常數反而慢一點點(差距很小,不曉得是不是我測試方式的關係)。
- 以下為我測試的程式碼,註解的地方為可選的比較方式:
<pre> <?php define('VAR1' , 'a long long long long long long long long long long long long long text'); define('VAR2' , 'a long long long long long long long long long long long long long text'); $var1 = 'a long long long long long long long long long long long long long text'; $var2 = 'a long long long long long long long long long long long long long text'; $start = 0; $end = 0; for($i =0; $i < 20; $i++){ $tmp = null; $start = microtime(true); for($j =0; $j < 5000; $j++){ $tmp .= $var1; //$tmp = "Something here" . $var1; //$tmp = "Something here{$var1} Nothing here{$var2}"; //$tmp = "Something here{$GLOBALS['var1']} Nothing here{$GLOBALS['var2']}"; } $end = microtime(true); echo 'V: ' . ($end - $start); echo "\t"; $tmp = null; $start = microtime(true); for($j =0; $j < 5000; $j++){ $tmp .= VAR1; //$tmp = "Something here" . VAR1; //$tmp = 'Something here' . VAR1 . ' Nothing here' . VAR2 ; } $end = microtime(true); echo 'C: ' . ($end - $start); echo "\n"; } ?> </pre> - 自行定義的常數值,在宣告時必需為固定的值,如:
但一個實用的例外(來自 wordpress 的 wp-config-sample.php),是用 magic constants 來取得路徑:define('TEST_TXT', 'some string here');define('ABSPATH', dirname(__FILE__)); - PHP: Constants - Manual
- Magic number (programming) - Wikipedia, the free encyclopedia
2007-12-20
Yahoo UI 是好物
- 真的是易學易用,不過速度似乎有點慢…。
- 事件綁定時要去掉“on”(不知是否我眼挫,這件事我在文件上沒找到?),如:
window.onload = doSomething; // 上述改用 YUI 如下 YAHOO.util.Event.addListener(window, 'load', doSomething);
- YAHOO.util.Event.addListener 會自動附加(而不是覆蓋)綁定,以前要自已做到這功能的話得如下:
function addListener(newListener) { var oldListener = window.onload; if (typeof window.onload != 'function') { window.onload = newListener; } else { window.onload = function() { oldListener(); newListener(); } } } - 範例不錯,但文件不夠完備。像 API Doc 的部份,如果能每個 Method 附上簡短範例會更好(像 PHP Manual 那樣)。
Subscribe to:
Posts (Atom)
個人常用鏈結
Labels
- .NET (1)
- Accessibility (3)
- ADSL (1)
- Apache (9)
- ASP.NET (1)
- Babyer (1)
- Browser (1)
- Canon MX700 (1)
- CAPTCHA (1)
- CentOS (1)
- CSS (7)
- DB:SQL (1)
- DB:SQLite (2)
- DNS (3)
- English (1)
- EXIF (1)
- filename.ext (1)
- Firefox (4)
- Firewall (1)
- Flash (4)
- Game 遊戲 (28)
- Game:PC (6)
- Game:PS3 (4)
- Game:Xbox360 (3)
- GNU (1)
- Google (6)
- Google:Android (8)
- Google:Blogger (2)
- Google:Chrome (1)
- Google:Code (2)
- GoogleAppEngine (2)
- GoogleMaps (1)
- GPG (1)
- Hinet (1)
- HTML (2)
- HTTP (1)
- i18n (1)
- IE (3)
- Java (2)
- Javascript (2)
- Linux (1)
- Microsoft (2)
- MIME (1)
- MySQL (7)
- NexusOne (2)
- OAuth (1)
- Open source 開放原始碼 (1)
- OpenID (1)
- OS (1)
- OS:Windows (33)
- PHP (49)
- PHP:GTK (2)
- PHP:PEAR (1)
- PHP:PECL (3)
- PHP:ZendFramework (4)
- PostgreSQL (1)
- PPPoE (1)
- RegularExpressions (2)
- Security (11)
- Sphinx (2)
- SQLite (1)
- TCP (1)
- Ubuntu (1)
- UDP (1)
- Usability (2)
- Virtaul PC (1)
- Wii (2)
- XML (1)
- Yahoo (2)
- Yahoo:BBAuth (1)
- Yahoo:YUI (1)
- Youtube (1)
- 不如賣雞排 (2)
- 不願役 (33)
- 中文處理 (1)
- 圖 (5)
- 媒體 (2)
- 影片 (1)
- 影音 (19)
- 思 (8)
- 攝 (9)
- 政 (7)
- 敗 (2)
- 漫畫 (5)
- 生活 (34)
- 硬體設備 (13)
- 網站開發 (16)
- 網路 (8)
- 英文 (3)
- 貓 (2)
- 資安 (1)
- 趣 (29)
- 軟體 (12)
- 遊記 (8)
- 運動 (2)
- 關於我 (1)
- 電影 (10)



