博文

目前显示的是 2015的博文

System.exit()

Exit code is 0 when execution went fine; 1 , -1 , whatever != 0 when some error occurred, you can use different values for different kind of errors. If I'm correct exit codes used to be just positive numbers (I mean in UNIX) and according to range: 1-127 are user defined codes (so generated by calling exit(n) ) 128-255 are codes generated by termination due to different unix signals like SIGSEGV or SIGTERM The following codes are from http://www.opensource.apple.com/source/Libc/Libc-320/include/sysexits.h. Note Ref: http://stackoverflow.com/questions/2434592/difference-in-system-exit0-system-exit-1-system-exit1-in-java sysexits.h    [ plain text ] /* * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source

data-* in HTML5

Example: <article id="tu" data-category="Demo1" data-author="1"> ... </article> 1. In JavaScript :getAttribute() and dataset。   getAttribute     document.getElementById('tu').getAttribute('data-category');   setAttribute     document.getElementById('tu').setAttribute ( 'data-author' , '2' ) ;     var a = document.getElementById('tu');     a.dataset.category = "xxx";     a.setAttribute("data-category", "xxx");    dataset      var article = document.getElementById('tu');      var data = article.dataset;      alert(data.category);      alert(data.author); //1 2. jQuery   $("#tu").data('category');   $("#tu").data("category", "Uncategorized"); 3. CSS  attr    article::before {       content: attr(data-category);    }  article[data-author='1'] {     border-width: 1px;  }

List of Rundll32 commands for Windows 10/8/7

List of Rundll32 commands for Windows 10/8/7 This is from http://www.thewindowsclub.com/rundll32-shortcut-commands-windows  Thanks Anand Khanse aka HappyAndyK is an end-user Windows enthusiast, a Microsoft MVP in Windows, since 2006, and the Admin of TheWindowsClub.com. Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware. RECOMMENDED: Click here to fix Windows errors and optimize system performance I have compiled a list of Windows Rundll32 commands, which can be used for directly invoking the specified functions or to create shortcuts of those, which you use and require frequently. Rundll32 commands for Windows To Create Desktop Shortcuts : Right click on desktop > New > Shortcut. In the first box of the Create Shortcut Wizard, copy-paste the desired command. Then Click Next. Give the Shortcut a

Return JSON from a JSP

图片
I need using a JSP returns JSON, so wrote the following codes for testing. Fortunately i t works. /*  This file name is json.jsp. It posts itself, then get JSON. */ <%response.setHeader("Cache-Control", "no-cache");%> <%response.setHeader("Pragma", "no-cache");%> <% String t = request.getParameter("t"); if(t==null){ %> <!DOCTYPE html> <% response.setHeader("contentType","text/html;charset=UTF-8"); %> <script type="text/javascript">   var XHR;   function requestJSON(){       if ( window.XMLHttpRequest )          XHR = new XMLHttpRequest();       else if ( window.ActiveXObject ) {          try {             XHR = new ActiveXObject('Msxml2.XMLHTTP');          }          catch(err) {             XHR = new ActiveXObject('Microsoft.XMLHTTP');          }       }       XHR.open( "POST", "json.jsp", true );       XHR.

Using setInfoWindowStyle("MVInfoWindowStyle2",...) in Oracle Mapviewer, setInfoWindowTitle() is invalid.

There is an issue in oraclemaps.js of Oracle Fusion Middleware MapViewer Version 11g ps6 (11.1.1.7.1). When the value of the parameter style is "MVInfoWindowStyle2" in the function MVThemeBasedFOI.setInfoWindowStyle(style, styleParameters), the function MVThemeBasedFOI.setInfoWindowTitle does not work. So must re-write the part of oraclemaps.js, the codes are the following MVThemeBasedFOI.prototype.setInfoWindowTitle = function (x90) {     this._f320 = x90;     MVInfoWindowStyle2.Title=x90; } MVInfoWindowStyle2.addContent = function (x5) {     try{     if(this.Title!=undefined){      x5.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[1].childNodes[0].childNodes[0].childNodes[0].innerHTML=this.Title;     }     }catch(e){       try{       x5.childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerHTML=this.Title;       }catch(e){}     }     x5.style.left = MVUtil._f26(55);     x5.style.top

JavaFX

The projects with JavaFX: Groovy FX: groovyfx.org ScalaFX: http://www.scalafx.org/                https://github.com/scalafx  https://github.com/scalafx/scalafx.github.io Visage: https://github.com/visage-lang Note: This tool has been renamed javapackager .exe. The javafxpackager.exe file may be removed in a future release. Please update your scripts to use javapackager . Ref: https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javafxpackager.html Commands You can specify one of the following commands. After the command, specify the options for it. -createbss Converts CSS files into binary form. -createjar Produces a JAR archive according to other parameters. -deploy Assembles the application package for redistribution. By default, the deploy task generates the base application package, but it can also generate a self-contained application package if requested. -makeall Performs compilation, createjar , and deploy steps as one call, with most arguments

Showing a XML

The following has 2 ways for indenting to show the xml. 1. using the class TransformerFactory's setAttribute("indent-number", new Integer(20)); 2. using the class Transformer's setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");  This way is higher priority than the first way. // Requires Java SE 1.7.0            TransformerFactory tf = TransformerFactory.newInstance(); //1. set the indented format of the additional whitespace when outputting the result tree;             tf.setAttribute("indent-number", new Integer(20));  // It works.             Transformer transformer = tf.newTransformer(); //2. set the indented format of the additional whitespace when outputting the result tree; This way is higher priority than the 1.             transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");        //OutputKeys.INDENT, indent specifies whether the Transformer may a

display xml with xslt and resx in the jsp file

This is a little test for displaying xml with xslt and rest in a jsp file. A test jsp file. <!DOCTYPE html> <%@ page contentType="text/html;charset=UTF-8"%> <%@ page import="java.io.File"%> <%@ page import="javax.xml.transform.stream.StreamSource"%> <%@ page import="javax.xml.transform.stream.StreamResult"%> <%@ page import="javax.xml.transform.TransformerFactory"%> <%@ page import="javax.xml.transform.Transformer"%> <%@ page import="org.w3c.dom.Document"%> <%@ page import="org.w3c.dom.Element"%> <%@ page import="javax.xml.parsers.DocumentBuilder"%> <%@ page import="javax.xml.transform.dom.DOMSource"%> <%@ page import="javax.xml.parsers.DocumentBuilderFactory"%> <% //Create a document in the memory.         Document doc=null;                 String root = "Query";         Doc

iconfinder

图片
https://www.iconfinder.com/search/?q=Address&price=free

XML, XSL, HTML

The code in this section is that an XSLT transform is used to translate XML input data to HTML output. Ref: https://docs.oracle.com/javase/tutorial/jaxp/xslt/transformingXML.html Note - The article1a.xsl , which is from in XSLT examples . The following code is for joy.  import java.awt.Desktop; import java.io.*; import java.net.URISyntaxException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; // For write operation import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.SAXException; public class Stylizer {    

JdbcRowSet & SQL Server(Sqljdbc4.jar)

Create a JdbcRowSet object in various ways: 1. By using the reference implementation constructor that takes a ResultSet object 2. By using the reference implementation constructor that takes a Connection object 3. By using the reference implementation default constructor 4. By using an instance of RowSetFactory , which is created from the class RowSetProvider Testing Environment : JDBC driver: Sqljdbc4.jar Java SE Version:1.7.0_51 Result: 1.Passing ResultSet Objects // It works. 2.Passing Connection Objects // It does not work 3.Using the Default Constructor // It does not work 4.Using the RowSetFactory Interface // It does not work import com.sun.rowset.JdbcRowSetImpl; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import javax.sql.rowset. JdbcRowSet ; import javax.sql.rowset.RowSetFactory; import javax.sql.rowset.RowSetProvider;     public static void main(String[] args) throws Except

How to Split a string by delimited char in SQL Server

It is from http://www.sqlservercentral.com/blogs/querying-microsoft-sql-server /2013/09/19/how-to-split-a-string-by-delimited-char-in-sql-server/ A Stored Procedures for testing this function. -- ============================================= SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF EXISTS (SELECT * FROM SYS.objects WHERE name = 'testfnSplitString' AND [TYPE] = 'P') DROP PROCEDURE dbo.testfnSplitString  GO CREATE PROCEDURE dbo.testfnSplitString (@IDs NVARCHAR(MAX)) AS SET NoCount ON SET Ansi_Warnings OFF  DECLARE @output TABLE(IDt NVARCHAR(MAX))  DECLARE @start INT, @end INT,@delimiter VARCHAR(2)=',' SELECT @start = 1, @end = CHARINDEX(@delimiter, @IDs) WHILE @start < LEN(@IDs) + 1 BEGIN IF @end = 0 SET @end = LEN(@IDs) + 1 INSERT INTO @output (IDt) VALUES(SUBSTRING(@IDs, @start, @end - @start)) SET @start = @end + 1 SET @end = CHARINDEX(@delimiter, @IDs, @

Why aren't more companies using AngularJS?

http://www.quora.com/Why-arent-more-companies-using-AngularJS http://www.quora.com/Should-I-learn-ReactJS-or-AngularJS https://docs.angularjs.org http://www.stridenyc.com/blog/2015/3/4/coming-to-react-from-angular http://reactjs.cn/

Blocked plug-ins & Chrome

Blocked plug-ins Google Chrome blocks plug-ins that are outdated or those that are not widely used because they can occasionally be a security risk. Plug-ins help browsers process special types of web content, like Flash or Windows Media files. Some plug-ins, such as Flash, are used by many websites on the Internet. Other plug-ins are only used by a small number of sites. Examples of plug-ins that Chrome blocks: Java RealPlayer QuickTime Shockwave Windows Media Player Adobe Reader prior to Adobe Reader X Unity Google Update VLC Run blocked plug-ins You can run some plug-ins even if they are blocked by Chrome. Chrome will ask you for permission to run a plug-in and you should only run plug-ins on sites that you trust. To let the plug-in run on the site, follow these steps: To run the plug-in just this once, click Run this time . The plug-in will run, but if you visit the site later, you'll be asked for permission to run the plug-in again. To always allow

Underscore.js Backbone.js

Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. It’s the answer to the question: “If I sit down in front of a blank HTML page, and want to start being productive immediately, what do I need?” … and the tie to go along with jQuery 's tux and Backbone 's suspenders.  http://underscorejs.org/ Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.  http://backbonejs.org http://www.quora.com/What-JavaScript-framework-does-Flow-use-for-its-web-frontend - jQuery for DOM manipulation - Underscore.js for awesome, rock solid, and progressive utility - A heavily modified Backbone.js for the model

.serialize() & .serializeArray() in jQuery

 .serialize() Description : Encode a set of form elements as a string for submission. Returns : String Ref : https://api.jquery.com/serialize/  .serializeArray() ; Description: Encode a set of form elements as an array of names and values. Returns : Array Ref : https://api.jquery.com/serializeArray/ .param(); Description: Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. In case a jQuery object is passed, it should contain input elements with name/value properties. Ref : https://api.jquery.com/jQuery.param/

64.233.167.165 209.85.228.22 is for google

array in javascript

Array 1. sort & reverse e.g. : var a2=[10,2,3,1,7]; a2.reverse();// 7,1,3,2,10 a2.sort();//1,10,2,3,7 function compare(value1,value2){   if(value1<value2){return -1;}   else if(value1>value2){return 1;}   else{return 0;} } a2.sort(compare);// 1,2,3,7,10 function getType(obj){   let type= typeof obj;   if(type!=='object'){return type;}   return Object.prototype.toString.call(obj).replace(/^\[object (\S+)\]$/,'$1');    // [object Number] } var x = 15 * 5; getType(x); // Number

Using JConsole

JConsole (Java™ Monitoring and Management Console) is a graphical tool which allows the user to monitor and manage the behavior of Java applications. JConsole is a Swing application. You might find that running JConsole on the same workstation as the Java application you want to monitor affects the performance of your Java application. You can use JConsole to connect to a JVM running on a remote workstation to reduce the affect of running JConsole on the application performance. http://www-01.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/com.ibm.java.zos.80.doc/diag/tools/JConsole.html

java I/O

图片
  Ref: cnblogs. com/ l anxuezaipiao/p/3371224.html

Double.NaN Float.NaN

Double.NaN  Float.NaN double i = 0.0/0.0; double i = Double.NaN; equals http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html public boolean equals( Object  obj) Compares this object against the specified object. The result is true if and only if the argument is not null and is a Double object that represents a double that has the same value as the double represented by this object. For this purpose, two double values are considered to be the same if and only if the method doubleToLongBits(double) returns the identical long value when applied to each. Note that in most cases, for two instances of class Double , d1 and d2 , the value of d1.equals(d2) is true if and only if d1.doubleValue() == d2.doubleValue() also has the value true . However, there are two exceptions: If d1 and d2 both represent Double.NaN , then the equals method returns true , even though Double.NaN==Double.NaN has the value false . If d1

the tips of the bar chart in wijmo 3

1. Hide the label on each bar  var _chartLabels = $("#wijbarchartPro").wijbarchart().data().fields.chartElements.chartLabels; $.each(_chartLabels, function (index, elem) {    if((index%2)==1){elem.attr('text', '');}  }); 2. rotation label on bar chartLabelStyle: {rotation: 90}, 3.  You can get the path element of the axis using the following properties : xaxis   = $(“#wijbarchart”).wijbarchart().data().wijbarchart.axisEles[0].attrs.path[0]; yaxis = $(“#wijbarchart”).wijbarchart().data().wijbarchart.axisEles[0].attrs.path[1]; 4. The chartLabels[index].attrs.x and chartLabels[index].attrs.y return the positiong of the label. For instance, to get the position of first label upi may use the following js : var x = $(“#wijbarchart”).wijbarchart().data().fields.chartElements.chartLabels[0].attrs.x; var y = $(“#wijbarchart”).wijbarchart().data().fields.chartElements.chartLabels[0].attrs.y; 5.Change Bar Color mou