博文

目前显示的是 2014的博文

SQL Server connection strings

1.  jdbc:sqlserver://192.168.10.220\ northstar ;databaseName=Northstar The server\instance name syntax used in the server option is the same for all SQL Server connection strings. northstar is a instance name. each instance match a port of TCP .  2.  jdbc:sqlserver://192.168.10.220: 1433 ;databaseName=Northstar (Provider=SQLOLEDB.1;Password=*;Persist Security Info=True;User ID=sa;Initial Catalog= Northstar ;Data Source=192.168.10.220 ,1433 ) 1433 is the default port for SQL Server, can be dynamically assigned, such as 1863, 1875... netstat -aon | findstr 1433 * A .udl file can be used to set connection string at client side. Creating and Configuring Universal Data Link (.udl) Files * svrnetcn.exe at server side sets port. * netstat command displays protocol statistics and current TCP/IP network connections. (netstat -an) Ref: https://www.connectionstrings.com/sql-server/  http://support2.microsoft.com/?id=832017 This article contains several references to the defau

prototyping - Axure

www.axure.com Axure RP gives you the wireframing, prototyping and documentation tools needed to make informed design choices, persuade any skeptics, and document your design.

系统保留分区简介

产生保留分区 一般来说,100MB的系统保留分区只有在以下两种情况都发生时才会产生: 1) 全新安装 Windows 7 ; 2) 使用Windows 7 分区 画面进行分区 格式化 不产生保留分区 以下任意一种情况发生,100MB的系统保留分区都不会产生: 1) 升级安装Windows 7; 2) 在全新安装之前使用其他工具(比如gdisk.exe)先对硬盘进行 分区 格式化 ; 3) 在全新安装过程中使用diskpart.exe对硬盘进行分区格式化; 要执行全新安装,而又不想使用这个100MB的系统保留分区,可以选择在执行全新安装之前使用其他分区工具比如gdisk.exe来对硬盘进行分区格式化,或者直接进行全新安装,但是在分区画面,使用diskpart.exe来进行分区。 Windows 7的100MB的保留 分区 是Windows 7的 活动分区 ,类似于Linux的/boot. 在Windows 7 beta版本的时候就在安装Windows 7过程中会分出一个100MB的小分区(早期版本的Win7是200MB),这是Windows 7的活动分区,启动 引导文件 存放的分区。 这其实有点类似 Linux 的做法,Linux在安装过程中可以专门分出一个100MB左右的分区作为它的 引导分区 (/boot),这个分区主要用来存放grub.exe,menu.lst, *fs_stage_1.5, initrd,以及 内核 文件vmlinuz的等Linux启动引导过程会用到的文件。 类似地,Windows 7的这个保留分区是它的 主分区 , 系统分区 , 活动分区 。Windows 7在启动过程中会从这个 分区 启动,然后再启动C盘目录。 Windows 7的启动过程 : BIOS--MBR-- Bootmgr--BCD--Winload.exe-- 内核 加载 开机后,BIOS进行开机 自检 (POST),然后选择从硬盘进行启动,加载硬盘的MBR并把控制权交给MBR(MBR是硬盘的第一个 扇区 ,它不在任何一个分区内); MBR会搜索64B大小的 分区表 ,找到4个主分区(可能没有4个)的活动分区并确认其他主分区都不是活动的,然后加载活动分区的第一个扇区(Bootmgr)到内存;

Oracle_Home in regedt32

图片
The subkey \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE in the Registry Editor window. For subsequent installations to different Oracle homes on the same computer, the path is \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ HOMEID where ID is the unique number identifying the Oracle home,such as "KEY_OraDb11g_home1", "KEY_OraDB12Home1"

MIT License

MIT License : free for use on commercial sites.

Unique Constraint of oracle (user_indexes and user_ind_columns )

The tables: user_indexes and user_ind_columns   desc user_indexes; desc user_ind_columns; select * from user_indexes where table_name=upper('table name'); select * from user_ind_columns where index_name=upper('&index_name');

setLevel of java.util.logging.Level

import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogManager; import java.util.logging.Logger; import java.util.logging.SimpleFormatter; import java.util.logging.StreamHandler; public class test{      public static void main(String[] args){                  Logger l = Logger.getLogger("com.test");      l.setLevel(Level.FINE);      Handler[] handlers1 = l.getLogger(""). getHandlers(); for (int index = 0; index < handlers1.length; index++) {    handlers1[index].setLevel(Level.FINE); }   l.severe("SEVERE ");   l.warning("WARNING ");   l.config("CONFIG");   l.info("INFO");   l.fine("FINE");   l.finer("FINER");   l.finest("FINEST");  } }

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); ShowProgressTask showTask = new ShowPro

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.out.println(s);       JSP : String sZ = java.net.URLEncoder.encode("中", "utf-8

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": "globalize.min",                 "bootstrap": "bootstrap.min", //Needed if you use Bootstrap.                 "knockout": "knockout-3.1.0" //Needed if you use Knockout.             }     }); </script> <script id="scriptInit" type="text/javascript">     requir

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) {         return Math.ceil(input);     }     @Override     public String getTime() {        

XOM & XML

http://www.xom.nu/ XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with Java that strives for correctness, simplicity, and performance, in that order .

NetBeans -J-Dfile.encoding=UTF-8

图片
1. Project Properties: 2. Consolas Output In  ../etc/netbeans.conf netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true --locale en_US -J-Dfile.encoding=UTF-8 "