跳到主要內容

發表文章

[.net]IComparable Interface

Sorting Example Imports System.Collections Public Class Temperature Implements IComparable ' The temperature value Protected temperatureF As Double Public Overloads Function CompareTo( ByVal obj As Object ) As Integer _ Implements IComparable.CompareTo Dim otherTemperature As Temperature = TryCast(obj, Temperature) If otherTemperature IsNot Nothing Then Return Me .temperatureF.CompareTo(otherTemperature.temperatureF) Else Throw New ArgumentException( "Object is not a Temperature" ) End If End Function Public Property Fahrenheit() As Double Get Return temperatureF End Get Set ( ByVal Value As Double ) Me .temperatureF = Value End Set End Property Public Property Celsius() As Double Get Return (temperatureF - 32) * (5/9) End Get Set ( ByVal Value As Double ) Me .temperatureF = (Value * 9/5...

[.Net] List(Of T).Find (Predicate(Of T))

Find Object in List Method 1 Function PredicatFunction( ByVal tempProduct As Product) as boolean Return tempProduct.ProductID='MyID' End Function Dim MyList As List(Of Product)=new List(Of Product) Dim tmpProduct as Product=MyList.Find(AddressOf PredicatFunction ) Mothod 2 Dim ProductID as String='MyID' Dim MyList As List(Of product)=new List(Of product) Dim tmpProduct as Product=MyList.Find(Function(n) n.ProductID=productID )

[Oracel] ORA-01654 unable to extend index

When ORA-01654 happened, It is due to the tablespace is not enough. So, you can set the tablespace to autoextensibe, and create a new datafile for the tablespace. 1.check your tablespace autoextensible Select tablespace_name , autoextensible from dba_data_files; 2. Alter database datafile autoextend Alter database datafile ' ' autoextend on maxsize 10000M; 3.Alter tablespace to add a new datafile Alter tablespace add datafile ' ' size 1000M ; Size unit is MB

[Asp.net] asp.net MVC 2.0 in Old Version IIS

when you deploye asp.net MVC 2.0 to old version IIS (5.0,6.0) WebSite , you may meet some troubles. 1.IIS don't run on .Net Framework 3.5!! After you FTP / deploye your file to Website, You should copy the all .Net Framework 3.5 DLL file into the "bin" folder in your website. the .Net Framework 3.5 DLL files are in this path C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5 2. Website didn't install asp.net MVC 2.o You can copy the "System.Web.Mvc.dll" to the "bin" folder System.Web.Mvc.dll in C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies\System.Web.Mvc.dll 3. Can't not find the VB/VC Complier ,because the Complier version is too old. Because there is a setting in web.config <system.codedom> <compilers> <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture...

[Java]eclipse 無法啟動

Eclipse 無法啟動 出現 JVM terminated. Exit code=-1 的錯誤訊息 打開eclipse根目錄下 eclipse.ini檔 -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256M -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m 將 -Xms40m 改成 -Xms128m -Xmx512m 改成 -Xms256m 即可 參考資料

[8051]Introduction

1.Inner structure

[J2ME] Hello World

Create a form with "Hello World" and add a Exit Command to exit the process. import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloWorld extends MIDlet implements CommandListener { private Display display; private Command exitCommand; private Form form; public HelloWorld() { display=Display.getDisplay(this); exitCommand = new Command("Exit", Command.EXIT,1); form=new Form("My J2ME Hello World!"); form.append("Welcome to J2ME!"); form.addCommand(exitCommand); form.setCommandListener(this); } protected void destroyApp(boolean arg0) throws MIDletStateChangeException { } protected void pauseApp() { } public void commandAction(Command cmd, Displayable disp) { if (cmd == exitCommand) { try{ destroyApp(false); } catch(MIDletStateChangeException ex ){ System.out.println(ex.getMessage()); ...