跳到主要內容

發表文章

目前顯示的是 2009的文章

2010年網路趨勢--轉載

網路科技在二○一○年將有哪些變化?全球知名社群網絡資訊部落格Mashable創辦人暨執行長凱許摩爾(Pete Cashmore)鐵口直斷,網路即時互動仍將持續發燒,雲端運算發展突飛猛進,虛擬貨幣和虛擬交易可能成為生財妙方。他列舉出二○一○年十大網路趨勢: 一、網路即時互動風起雲湧 推特(Twitter)、臉書(Facebook)等社群網站帶動的網路即時互動風潮將繼續如日中天,Google Wave提供涵括即時通訊、電子郵件和維基百科等的整合服務平台,預料這類「即時滿足」服務將發揚光大。 擴增實境行動定位 它抓得住你 二、行動定位無往不利 藉由智慧型手機「無所不在」(ubiquity)運用的推波助瀾,Foursquare、Gowalla、Brightkite與Google Latitude等「行動定位資訊分享服務」蔚然成風。 三、擴增實境水到渠成 拜全球衛星定位系統之賜,加上能偵測動作方位的手機內建加速度感測器(accelerometer)日新月異,「擴增實境」(augmented reality)技術,已可將圖像與文字等虛擬資訊,與使用者感知的周遭實體環境相結合,並即時互動。 四、內容管理呼朋引伴 近年來網路遭逢的最大挑戰,莫過於資訊量大幅超越人們消化吸收的能力。臉書等提供網頁內容個人化管理服務的網站,有助於解決這項困擾。 看電影辦公不出門 手機功能多 五、雲端運算蒸蒸日上 雲端運算(cloud computing)讓網友將數位資訊儲存於網路伺服器,從任何地點都可以存取。微軟預定二○一○上半年推出免費的線上版辦公室應用程式集,Google也將推出以網路為核心的Chrome免費作業系統,雲端運算將突飛猛進。 六、電視電影風靡網路 我們觀賞的電視電影節目將有不少來自網路。目前Hulu視頻網、Boxee、Netflix的「熱酷盒子」(Roku box)、蘋果電視(Apple TV)與Epix,均已在這個市場占得一席之地。 七、聚合難題弔詭難測 智慧型手機等數位行動裝置,透過安裝應用程式與小工具,整合行車導航、電子書等諸多功能,以及衛星導航系統、電子書閱讀器等特定用途電子產品,但這類整合服務的市場前景尚不明朗。 付款遊戲網上搞定 私事全都露 八、社交遊戲欣欣向榮 臉書的「線上農場」(FarmVille)與美商藝電的「Playfish」系列等網路社交遊戲所衍生的虛擬貨幣及虛擬

[Java] HttpComponents Client (Http Client 4.0) Upload File

It use HttpClient-4.0.1, Httpmime4.0.1, HttpClient client = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://yourUploadUrl"); FileBody file = new FileBody(new File("YourLocalFile")); MultipartEntity reqEntity = new MultipartEntity(); reqEntity.addPart("image", file); httppost.setEntity(reqEntity); ResponseHandler responseHandler; responseHandler = new BasicResponseHandler(); System.out.println( client.execute(httppost,responseHandler)); it need the mime4j. you can download here .

[.Net]VB.net Code<--> C# Code

Find a useful web site. convert csharp to vb You can convert your VB.net code to C# code, Or C# code to VB.net code It's very useful for developer. Sometimes, you use VB.net to write the Application. By you find some reference code written by C# Code.. Now you will Need it.

[Flash]Color Wall : A timer sample

Use code in each Square. changeColor(); var myTimer:Timer = new Timer(1000, 0); myTimer.addEventListener(TimerEvent.TIMER, timerHandler); myTimer.start(); function timerHandler(event:TimerEvent):void { changeColor(); } function changeColor(){ var myColor:ColorTransform =square.transform.colorTransform; var r:uint=Math.random()*256; var g:uint=Math.random()*256; var b:uint=Math.random()*256; myColor.color =r*256*256+g*256+b; square.transform.colorTransform = myColor; }

[asp.net]使用ajax時發生javascript Sys未定義

在VS2005中如果使用AJAX Extensions的元件 可是卻發生java script出現 Sys未定義的錯誤 Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined. 可以在Web.Config中 下面加入以下Code: <httpHandlers>       <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&

查詢MS SQL Server中Table space使用的狀況

一般用户或者DBA都會經常需要檢查所有的DB或Table的容量狀況 在MS SQL Server 中查詢的方法有有 方法1: select object_name(id) tablename,8*reserved/1024 reserved, rtrim(8*dpages/1024)+'Mb' used,8*(reserved-dpages)/1024 unused, 8*dpages/1024-rows/1024*minlen/1024 free,rows,* from sysindexes where indid=1 order by reserved desc 方法2: exec sp_MSforeachtable "exec sp_spaceused '?'" 註解 系统預存函數sp_MSforeachtable和sp_MSforeachdb,是Microsoft提供的兩個不公開的函數,從MS SQL Server 6.5開始存放在SQL Server的MASTER DB中 http://www.seekeep.com/html/computer/database/mssql/200802/628.html

[AS3] Loader vs URLLoader

Loader : use to load *.swf , all image (jpg,png,gif) URLLoader : use to load text-doc (xml,txt,php,jsp,asp) How to use: Loader: var _ldr:Loader = new Loader(); _ldr.load(new URLRequest(' $imagePaph ' )); _ldr.addEventListener(Event.COMPLETE,onURLLoaded); addChild(_ldr); function onURLLoaded (event:Event):void{ trace("URLLoader Complete"); } $imagePath: can be the file path in local or file url in Internet URLLoader: var _urlLdr:URLLoader =new URLLoader(); var request:URLRequest = new URLRequest(" $docPaph "); _urlLdr.addEventListener(Event.COMPLETE,onURLLoaded); _urlLdr.load(request) function onURLLoaded (event:Event):void{ var docData:String=event.target.data; trace("URLLoader Complete"); } $docPath: can be the file path in local or file url in Internet

Google Translate for web page

Google 提供了一個java Script 可以讓自己的網站用google翻譯成你要的語言 不只是可以用在blog上 也可以用在個人或公司的網站上 不過翻譯的好不好 見仁見智囉 詳情可以看這邊 google翻譯

Currency Convertor Web Service

http://www.webservicex.net/CurrencyConvertor.asmx In Visual Studio Web References import http://www.webservicex.net/CurrencyConvertor.asmx In Code Imports ProjectName.net.webservicex.www Dim a As CurrencyConvertor = New CurrencyConvertor Dim Rate as double= a.ConversionRate(Currency.USD, Currency.TWD)

[Oracle] ORA-01996 & ORA-01994

This error occurred when password file “entries” value is reached to maximum size. So we need to do: 1. Shutdown Oracle Server 2. Recreate PASSWORD FILE with MAXIMUM ENTRIES=N VALUE. In command line >ORAPWD file={Oracle DB system path}\DATABASE\[Password File Name].ORA password=[Password] entries=[Entries Number] [Password File Name]: oracle new password-file name. [Password] : oracle system password. [Entries Number] : Maxmium entries number. 3. Restart Oracle Service After recreate PWD file. ORA-01996 & ORA-01994

[.Net]Custom DateTime Format in VB.Net

VB.Net 中,如果要使用 FormatDate Time 自訂日期時間格式,有以下幾種方式。 Dim myDateTime As DateTime = Now FormatDateTime(myDateTime, DateFormat.GeneralDate) FormatDateTime(myDateTime, DateFormat.LongDate) FormatDateTime(myDateTime, DateFormat.LongTime) FormatDateTime(myDateTime, DateFormat.ShortDate) FormatDateTime(myDateTime, DateFormat.ShortTime) 如果遇到需要自訂日期時間格式的需求。例如:dd/MM/yyyy、MM/dd/yy... 等,這時候可以採用 ToString 方法自訂了,如下: Dim myDateTime As DateTime = Now.ToString("dd/MMM/yyyy") Dim myDateTime As DateTime = Now.ToString("MM/dd/yy") Dim myDateTime As DateTime = Now.ToString("dddd, dd MMMM yyyy") keith

[Oracle] Change NLS_CHARACTERSET

以SYSDBA身份進入SQLPlus* >SQLplus SYS/oracel@DEVCIMSDB as SYSDBA 連接上後 進入restricted 模式 alter system enable restricted session; 設定新的字元集 ALTER DATABASE CHARACTER SET AL16UTF16; 重起Oracel 之後可以用 select * from v$nls_parameters ; 查詢設定後的狀況 字元集名稱查詢方法 select * from V$NLS_VALID_VALUES where parameter='CHARACTERSET' 手工修改OracleXE的字符集 NLS_CHARACTERSET字符集的更改

[Flash] .swf ClassLoader

Flash 中很常用到loader 來讀取外部的swf檔案載入到畫面中, 但是載入進來的swf如果含還有一些函數,卻是沒辦法呼叫。 這常常會造成一些設計好的swf元件不能重複利用的問題 不過在 Adobe的官方網站 上有提供一個ClassLoader source Code 可以用來載入swf成class去呼叫swf的函數與方法 之後在網路查了一下有比較簡單的寫法大概如下 import flash.display.Sprite; import flash.display.Loader; import flash.system.ApplicationDomain; import flash.net.URLRequest; import flash.events.*; import flash.util.trace; public class Main extends Sprite { private var child1:Loader; public function Main() { var url1:URLRequest = new URLRequest('SWFName.swf'); url1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain); child1 = new Loader(); child1.addEventListener(EventType.COMPLETE, onChild1Complete); //設定載入完成的 handler child1.load(url1); //開始載入swf檔案 } private function onChild1Complete(e:Event):Void { var c:Class = child1.loadeeInfo.applicationDomain.getClass('ClassName'); //將swf中的class抓出來成為一個class var co:Object = new c(); /將swf中的class實作 co.method(); } } 基本上就是將檔案讀取進來 然後在讀

[.Net] log4net

如果開發過java程式的人大概都知道log4j是個很好用的日誌工具, 而同樣的apache project也為.net開發的log4net的元件相當的好用也很容易設定 1.首先到 log4net 網頁下載 目前最新的是log4net 1.2.10 版本 2.解壓縮後會在\bin資料夾內,發現很多版本 基本的使用可以用net\release\下的log4net.dll, log4net.xml 3.將上述的兩個檔案複製到你的專案資料夾中 (其實不複製也可以 只是放在一起比較好管理) 4.將log4net.dll 加入參考 5.設定 A. 如果是開發win 或console APP a. 先在專案中加入一個app.config 並打開檔案 在 內加入以下內容 <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> </configSections> <log4net> <root> <level value="ALL" /> 'output level <appender-ref ref="rollingFile" /> <appender-ref ref="consoleApp" /> </root> <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" > <param name="File" value="C:\log.txt" /> '檔案位置 <param name="AppendToFile" value="True" /> <param name="RollingStyle" val

[Windows]C槽空間不足?

常常遇過很多電腦C槽空間不夠的狀況 尤其是windows用久了之後會發生這樣的問題 那提供幾的解決方法清除一些不用的東西 1.temp檔的處理 通常用清理磁碟 可以清掉一些temp檔 但是有時候還是清不乾淨, 所以我會用search去搜尋.tmp 或是.Bak檔案然後將其刪除 通常這類的檔案 都是暫存或是備份檔 一般是不會影響到系統的 不過如果是自己重要的檔案 就要注意一下 2.清除winodws installer的檔案 windows會不斷地做更新 但是每次更新後都會把更新的執行檔放在電腦裡 所以電腦中windows會越來越大 這個時候可以考慮用WICleanup來清除 可以到這邊下載 < KZTechs.COM> 3. 清掉你不常用的軟體吧 通常我們會用「新增移除程式」來處理 可以它總是清不乾淨 MS有提供一個不錯的清除軟體 Windows Installer CleanUp 可以試試看 下載頁面 4.另外我遇過Norton在自動更新後也會把更新的病毒碼都保留在電腦中 如果你是用Norton 作防毒軟體 那這些更新檔也可以砍掉了 不過這些檔案比較頑固 ,要進到安全模式才有辦法移除

[Java]StringEscapeUtils

java web String --> Html String StringEscapeUtils.escapeHtml( String text); 可以將text轉為html格式,把一些特殊符號處理掉, 也可以作為SQL injection的防範作法之一 參考網址 Apache document

[Windows]XP新增連線精靈沒有撥號數據機或 PPPoE 選項

徵狀 如果您使用「新增連線精靈」來建立新的撥號數據機或 PPP over Ethernet (PPPoE) 連線,可能會發生下列一或多個問題: • 「新增連線精靈」的 [使用撥號數據機來連線] 選項無法使用 (呈現暗灰色)。 • 「新增連線精靈」的 [使用需要使用者名稱和密碼的寬頻連線來連線] 選項無法使用 。 因此,您無法與網際網路建立撥號數據機或 PPPoE 連線。 發生的原因 當下列情況皆成立時,就會發生這個問題: • 您將電腦從 Microsoft Windows 98 Second Edition 或 Microsoft Windows 98 升級到 Microsoft Windows XP。 • 下列 Windows 登錄項目發生損毀或設定不正確: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Telephony\Cards\NextID HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Telephony • [電話和數據機選項] 對話方塊中沒有 [我的位置] 如需有關這個問題其他原因的詳細資訊,請按一下下面的文件編號,檢視「Microsoft 知識庫」中的文件: 329441 ( http://support.microsoft.com/kb/329441/ ) 還原 Windows XP 之後,無法建立網路連線 解決方案 警告 不當使用「登錄編輯程式」可能會導致嚴重的問題,甚至必須重新安裝作業系統。Microsoft 並不保證可以解決您不當使用「登錄編輯程式」所導致的問題。請自行承擔使用「登錄編輯程式」的一切風險。 如果要解決這個問題,請依照順序使用下列方法。 方法 1 刪除登錄中的 NextID 值。如果要執行這項操作,請依照下列步驟執行: 1. 按一下 [開始],再按一下 [執行]。 2. 在 [開啟] 方塊中,鍵入 regedit,再按一下 [確定]。 3. 找到並按一下下列登錄機碼: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Telephony\Cards HKEY_CURRENT_USER\Software\M

[Oracle]Oracle SQL String Function

ASCII Get The ASCII Value Of A Character ASCII(ch VARCHAR2 CHARACTER SET ANY_CS) RETURN PLS_INTEGER; SELECT ASCII ('A') FROM dual; SELECT ASCII ('Z') FROM dual; SELECT ASCII ('a') FROM dual; SELECT ASCII ('z') FROM dual; SELECT ASCII (' ') FROM dual; CASE Related Functions Upper Case UPPER(ch VARCHAR2 CHARACTER SET ANY_CS) RETURN VARCHAR2 CHARACTER SET ch%CHARSET; SELECT UPPER ('Dan Morgan') FROM dual; Lower Case LOWER(ch VARCHAR2 CHARACTER SET ANY_CS) RETURN VARCHAR2 CHARACTER SET ch%CHARSET; SELECT LOWER ('Dan Morgan') FROM dual; Initial Letter Upper Case INITCAP(ch VARCHAR2 CHARACTER SET ANY_CS) RETURN VARCHAR2 CHARACTER SET ch%CHARSET; SELECT INITCAP (&#

[.Net] String Formatting in C# VB.net

The text inside the curly braces is { index [, alignment ][: formatString ]} . If alignment is positive, the text is right-aligned in a field the given number of spaces; if it’s negative, it’s left-aligned. Strings There really isn’t any formatting within a string, beyond it’s alignment. Alignment works for any argument being printed in a String.Format call. Sample Generates String.Format(”->{1,10}<-”, “Hello”); -> Hello<- String.Format(”->{1,-10}<-”, “Hello”); ->Hello <- Numbers Basic number formatting specifiers: Specifier Type Format Output (Passed Double 1.42) Output (Passed Int -12400) c Currency {0:c} $1.42 -$12,400 d Decimal (Whole number) {0:d} System.FormatException -12400 e Scientific {0:e} 1.420000e+000 -1.240000e+004 f Fixed point {0:f} 1.42 -12400.00 g General {0:g} 1.42 -12400 n Number with commas for thousands {0:n} 1.42 -12,400 r Round trippable {0:r} 1.42 Sy

[Struts2] iterator TextField -- Stirng[] object

jsp <s:iterator value="values" id="id"> <s:textfield name="values" value="%{id}"> </s:textfield> action.java private String values[]={"","",""}; public String[] getValues() { return values; } public void setValues(String s[]){ this.values=s; } 說明:在java要先宣告出 String[]的大小,然後才能在jsp中順利產生多個textfield input. 不過這樣做法沒辦法動態不同數量的textfield. reference: [Struts2] 內建的 OGNL Type Converter

[Oracle]JPA: How to Configure Primary Key Generation in Oracle

Using Sequence Objects When using a database that supports sequence objects (such as Oracle Database), you can configure JPA to use a database sequence object to automatically generate identifiers for your persistent objects. Using A Default Sequence TopLink JPA can produce a default sequence during schema generation. If you use schema generation, then specify that your identifier should be generated and that the SEQUENCE strategy be used to perform the generation. In the following example, the @GeneratedValue annotation indicates that the identifier value should be automatically generated; a strategy of SEQUENCE indicates that a database sequence should be used to generate the identifier. TopLink will create a default sequence object during schema generation. This object will be used by TopLink at run time. @Entity public class Inventory implements Serializable { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) private long id; Specifying a

[JavaScript]HTML DOM Select Object

--Collections |--[collection] options[] Returns an array of all the options in a dropdown list --Properties |--disabled Sets or returns whether or not a dropdown list should be disabled |--form Returns a reference to the form that contains the dropdown list |--id Sets or returns the id of a dropdown list |--length Returns the number of options in a dropdown list |--multiple Sets or returns whether or not multiple items can be selected |--name Sets or returns the name of a dropdown list |--selectedIndex Sets or returns the index of the selected option in a dropdown list |--size Sets or returns the number of visible rows in a dropdown list |--tabIndex Sets or returns the tab order for a dropdown list |--type Returns the type of form element a dropdown list is --Standard Properties |--className Sets or returns the class attribute of an element |--dir Sets or returns the direction of text |--lang Sets or returns the language code for an element |--title Sets or returns an elem

[Javascript]用IE執行window.location.href 無效解決方案

在html(包含jsp.asp)檔案中某些時候用IE瀏覽頁面 如果有這段Javascript window.location.href="http://www.yahoo.com.tw"; 有些時候並無法正常把頁面導到 http://www.yahoo.com.tw 需要改寫成 var newUrl = url; setTimeout(function(){ window.location = newUrl;}, 0); 這樣才會正常執行

[Javascript]Javascript Countdown / setTimeout

Javascript <script type="text/javascript"> <!-- function CountDown(OffsetTime,DivName){ if(OffsetTime<=0){ document.getElementById(DivName).innerHTML = "時間到..."; } else{ mySec=(OffsetTime%60); if (mySec<10) mySec="0"+mySec; Other=Math.floor(OffsetTime/60); myMin=(Other%60); if (myMin<10) myMin="0"+myMin; expireTime=myMin+":"+mySec; document.getElementById(DivName).innerHTML =expireTime; OffsetTime--; setTimeout("CountDown('"+OffsetTime+"','"+DivName+"')",1000); } } //--> </script>< <body onload="CountDown('900','TimeDiv')"> <div id="TimeDiv""></div"> </body> </html> -- 2012-03-26 補充 如何停止setTimeout 可用以下的clearTimeout來停止 使用方法如下 meter1=setTimeout("delaySubmit()", 1000 ); clearTimeout(meter1);

[Web]fckeditor

FCKeditor 是個web介面視覺化的文字編輯器 有點像是web介面的word吧 支援多國語系也支援各種程式碼 支援程式碼包括:adobeAir,Active-FoxPro (afp) ,asp ,asp.net ,cfm , html, Java, lasso,perl ,php,py 使用設定很簡單 以asp為例 先宣告路徑 <!-- #INCLUDE file="fckeditor.asp" --> 再宣告物件 Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = $[FCKeditor資料夾路徑] oFCKeditor.Value = $[載入時的內容] oFCKeditor.Create $[html物件的名稱] 其中 $[載入時的內容] 通常就是預先設定的資料或是從資料庫抓出來要編輯的資料 而 $[html物件的名稱] 就是之後form送出時的的參數名稱。 例如如果設定如下 oFCKeditor.Create "INPUT01" 那之後接收的action asp就要這去收資料 input01=request.form("INPUT01") 另外請在注意,如果宣告html物件的名稱已經在asp的程式碼中有了 雖然這樣會可以執行 但是送出的資料或多了"," 例如 asp原始碼這樣寫: <input type="hidden" name="hiddenField" id="hiddenField" /> <%Dim oFCKeditor Set oFCKeditor = New FCKeditor oFCKeditor.BasePath = $[FCKeditor資料夾路徑] oFCKeditor.Value = $[載入時的內容] oFCKeditor.Create "AAA" %> 這樣送出後的結果會變成 AAA , 所以要注意一下 詳細內容參考 fckeditor官方網站