`
louisling
  • 浏览: 143865 次
  • 性别: Icon_minigender_1
  • 来自: ZhuHai
社区版块
存档分类
最新评论
文章列表

File Writer

    博客分类:
  • Java
public static void testWriter() throws FileNotFoundException { PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream("PrintWriter.txt", false))); for (int i = 0; i < 10; i++) pw.print("Hello Mike"); pw.println(); ...
public static void main(String[] args) throws Exception { String addr = getMachineNameFromIP("192.168.1.159"); System.out.println(addr); } static String getMachineNameFromIP(String ipAddr) { try { InetAddress i = InetAddress.getByName(ipAddr); return i.g ...

Credit Card

    博客分类:
  • Java
//e.g. (20, 20), (13, 26) static void prtCreditCardBill(int billDate, int payLimit) { Calendar c = Calendar.getInstance(); int year = c.get(Calendar.YEAR); c.set(year, 0, billDate); System.out.println("Bill Date Pay Date"); System.out.println("------ ...
/**<pre> Provides a simple high-level Http server API, which can be used to build embedded HTTP servers. Both "http" and "https" are supported. The API provides a partial implementation of RFC 2616 (HTTP 1.1) and RFC 2818 (HTTP over TLS). Any HTTP functionality not ...

File Size

    博客分类:
  • Java
public static void main(String[] args) throws IOException { File file = new File("F:"); if (file.exists()) { prt("Total:", file.getTotalSpace()); prt("Usable:", file.getUsableSpace()); prt("Free:", file.getFreeSpace()); ...

批处理 bat

set currPath=%~dp0
1) Download Axis    Put axis at C:\axis-1_4 2) cd/d c: java -cp C:\axis-1_4\lib\axis.jar;C:\axis-1_4\lib\jaxrpc.jar;C:\axis-1_4\lib\saaj.jar;C:\axis-1_4\lib\commons-logging-1.0.4.jar;C:\axis-1_4\lib\commons-discovery-0.2.jar;C:\axis-1_4\lib\wsdl4j-1.5.1.jar;C:\axis-1_4\lib\activation.jar; org.apache ...
TestApp.mxml <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()"> <mx:Script> <![CDATA[ import com.charts.ImageUtil; import mx. ...
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.mortbay.jetty.Connector; import org.mortbay.jetty.Handler; import org.mortbay.jetty.Server; import org.mortbay.jetty.handler.DefaultHandler; import org.mortbay.jetty.handler.Handl ...
JQuery + ExtJS Adobe Flex + BlazeDS + Java AMF(ActionScript Message Format) Adobe AIR (Needs Flash Player, AIR runtime) MS Silverlight Laszlo compiled to SWF, <<Laszlo in Action>> Flex: http://shigeru-nakagaki.com/index.cfm/2008/7/12/20080712-Google-Maps-for-Flash http://examples.a ...
Server -------------------------------------------------------------------------------- 1) Dependencies: Jersey import com.sun.jersey.api.container.httpserver.HttpServerFactory; import com.sun.net.httpserver.HttpServer; public class SimlpeServer { public static void main(String[] args) th ...
Build RESTful web service using Jersey Server side ----------------------------------------------------------- 1) Dependencies: jsr311.jar jersey-core.jar jersey-server.jar asm.jar 2) web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app id="W ...
1) Dependencies required: ------------------------------------------------- geronimo-servlet_2.5_spec-1.2.jar jetty-6.1.18.jar jetty-util-6.1.18.jar optional: ------------------------------------------------- slf4j-api-1.5.6.jar slf4j-jdk14-1.5.6.jar 2) import org.mortbay.jetty.Connector ...
Build Web Service by CXF CXF(http://cxf.apache.org/) Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a ...
1) xcopy /E /Y /Q /I META-INF web\WEB-INF\classes\META-INF jar cvf StockService.war *.* pause 2) GlassFish glassfish.properties ----------------------- # Path to your application server installation glassfish.home=D:/glassfish glassfish.host=my.test.domain.com glassfish.passwordfile=D:/glas ...
Global site tag (gtag.js) - Google Analytics