博文

SQL Server restore from backup file.

1.Check backup file  restore filelistonly from disk=' C:\Microsoft SQL Server\Backup\xxx.bak ' Result: LogicalName            PhysicalName ---------------  ------------------------------------------------------------------ OldDatabase_Data             d:\Program Files\Microsoft SQL Server\MSSQL$SQLA\data\xxx.mdf OldDatabase_log     d:\Program Files\Microsoft SQL Server\MSSQL$SQLA\data\ xxx_log.ldf 2. Restore to new database RESTORE DATABASE xxxNewName   FROM DISK = ' C:\Microsoft SQL Server\Backup\xxx.bak ' WITH MOVE ' OldDatabase_Data '  TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\ xxxNewName .mdf' , MOVE ' OldDatabase_log ' TO 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\ xxxNewName_log .ldf', replace;

Tips for Android

1.Window.FEATURE_NO_TITLE @Override public void onCreate(Bundle savedInstanceState) {     requestWindowFeature(Window.FEATURE_NO_TITLE);     super.onCreate(savedInstanceState);     setContentView(R.layout.main); } you must declar requestWindowFeature(Window.FEATURE_NO_TITLE); before super.onCreate(savedInstanceState); and this extends Activity. 2.Using Layout Resources Programmatically You inflate the layout file into a View object using the LayoutInflater class. LayoutInflater inflater = LayoutInflater .from(context); View exampleView = inflater. inflate (R.layout.example, container,false); Button myExampleButton = (Button) exampleView.findViewById(R.id.button); <include layout="@layout/basicHeader"/> 3.TextView,EditTest, Button, Spinner, AutoCompleteTextView, ProgressBars, SeekBars, AsyncTask, ImageViews. Button extended a TextView and ImageButton extended ImageView. ProgressBar(indeterminate, determinate); ShowP...

url encoding

Encode and Decode Encode Decode unEncode Unencode total encodeURIComponent :- >UTF-8 decodeURIComponent !, ‘,(,),*,-,.,_,~,0-9,a-z,A-Z 71 encodeURI :- > UTF-8 decodeURI !,#,$,&,’,(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z 82 escape :- > Unicode unescape  *,+,-,.,/,@,_,0-9,a-z,A-Z 69 javascript example :   encodeURIComponent in Javascript 1.5   alert(encodeURIComponent(" ö / ! * ( ) ' ")); Java example :        System.out.println("java.net.UrlEncoder(\"ö\",\"UTF8\"): =" +java.net.URLEncoder.encode("ö","UTF8"));       java.net.URLDecoder urlDecoder = new java.net.URLDecoder();        String s =  urlDecoder.decode("%D0%C5%CF%A2%CD%F8","gb2312");        System.out.println(s);        s =  urlDecoder.decode("D0%C5%CF%A2%CD%F8","utf8");        System.o...

wijmo and require.js

<!--RequireJs--> <script type="text/javascript" src="http://cdn.wijmo.com/external/require.js"></script> <script type="text/javascript">     requirejs.config({         baseUrl: "http://cdn.wijmo.com/amd-js/3.20142.45",             paths: {                 "jquery": "jquery-1.11.1.min",                 "jquery-ui": "jquery-ui-1.11.0.custom.min",                 "jquery.ui": "jquery-ui",                 "jquery.mousewheel": "jquery.mousewheel.min",                 "globalize"...

verbose parameter

1. For java java -verbose[:class|gc|jni] Java -verbose:gc    Note: GC is java Garbage Collection.      -verbose:go shows the information of GC.  2. For Glassfish CALL ./glassfish3/bin/asadmin.bat start-domain --verbose

Linear Algebra

MIT 18.06 Linear Algebra , Gilbert Strang http://web.mit.edu/18.06/www/videos.shtml ref: www.kunli.me

JAX-WS

The JAX-WS set of packages and classes is the successor to the Java API for XML-based RPC (JAX-RPC), a technology for making remote procedure calls from one Java object to another over the Internet. The following codes are  on JDK6 7 JDK8. ------------------------------------- //a Service Endpoint Interface package com.jaxws; import javax.jws.*; import javax.jws.soap.*; import javax.jws.soap.SOAPBinding.*; @WebService @SOAPBinding(style = Style.RPC) public interface TestServer {     @WebMethod double getTestValue(double input);     @WebMethod String getTime(); } ------------------------------------- //a Service Implemmentation Bean package com.jaxws; import java.util.*; import javax.jws.*; @WebService(endpointInterface = "com.jaxws.TestServer") public class TestServerImpl implements TestServer {     @Override     public double getTestValue(double input) {        ...