自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

xinghua的专栏

live as if you were to die tomorrow. learn as if you were to live forever - ghandi

  • 博客(101)
  • 资源 (10)
  • 收藏
  • 关注

原创 java wildcards examples

Specifying upper bound with extends // drawAll() can draw a list of shapes as well as a list of subtype of // shapes public static void drawAll(Collection shapes) { for (Shape

2013-05-14 13:26:35 524

原创 Sort

Selection sort: int i, j; for( i = 0;i < size - 1; i++ ) { int minValIndex = i; for( j = i; j < size; j++ ) { if( constianer[minValIndex].value

2012-12-14 00:47:39 348

原创 C++ static variable initialization

Because static member variables are not part of the individual objects, you must explicitly define the static member.If you fail to initialize the static variable,Undefined Reference to staticVal

2012-10-15 04:07:52 770

原创 Saxon PE usage

To be honest, saxon PE documentation is super confusing. All I know is just a simple usage from Saxon PEBasic usage: java -cp saxon9pe.jar  net.sf.saxon.Transform -s:${source} -xsl:${xslt file

2012-10-12 07:12:44 484 1

原创 Java Reading XML using DOM parser

Document, Element and Attr Interface ALL extend from Node Interface.The Document interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides

2012-10-03 09:02:11 492

原创 Tomcat MVC example - FindCat

This program is developed in Tomcat7 Eclipse EEprogram purpose:  Find the cat by its nameindex.html - has a input box that requires the name of the catInsert title hereCat name:

2012-10-02 10:25:19 513

原创 Javascript Array

ReferenceFor...inFor...in loop does not guarantee to keep the original order of the array, Use traditional for loop instead.Deletearray.splice(index,howmany,item1,.....,itemX)index: th

2012-08-24 06:51:41 345

原创 C linkedList

One Way Linked List/* * File: OneWayList.c * Author: xinghuazhang * * Created on March 22, 2012, 9:41 PM */#include #include #include #include /* one way linked list*/struct Node{

2012-08-20 07:40:13 2050

原创 XSLT(19) document() Function to access external xml

node-set document(object,node-set?)object Required. Defines an URI to an external XML documentnode-set Optional. Used to resolve relative URIExample:NOTE: WHEN use this funct

2012-08-18 09:58:05 1837

原创 Graph

graphgraph is an abstract data type that is meant to implement the graph and hypergraph concepts from mathematics.EdgeAn edge represents a connection between nodes. Edges can be either directe

2012-08-18 01:04:38 408

原创 Tree structure

treea tree is a widely used data structure that simulates a hierarchical tree structure with a set of linked nodes. Tree is a subset of graphnodeA node is a structure which may contain a value o

2012-08-18 00:55:55 599

原创 BinarySearch

Type:  logarithmic algorithmPerformance: O(log N)Worse case: logN + 1Requirement - a is already sortedreturn index of the key from the array or -1 if not found public static int binaryS

2012-08-17 01:42:53 303

原创 Javascript Pattern Module pattern

The Module pattern encapsulates "privacy", state and organization using closures. It provides a way of wrapping a mix of public and private methods and variables, protecting pieces from leaking into

2012-08-13 12:03:45 321

原创 Javascript Closure

Simple example of closure:function sayHello(name) { var text = 'Hello ' + name; // local variable var sayAlert = function() { console.log(text); } return sayAlert;}var say = sayHello( "fef

2012-08-13 10:23:56 346

原创 Javascript OOP augmenting with prototype

prototype referenceAllows the addition of properties to all objects of type Object.we can extend the functionality of build-in types:// Add a method conditionally.Function.prototype.meth

2012-08-13 04:35:37 313

原创 Javascript Exception

The throw statement interrupts execution of the function. It should be given an exception object containing a name property that identifies the type of the exception, and a descriptive message propert

2012-08-13 03:23:47 459

原创 Javascript call and apply

Function.prototype.applyCalls a function with a given this value and arguments provided as an array.syntax:fun.apply(thisArg[, argsArray]).thisArgThe value of this provided for the call

2012-08-13 03:12:56 415

原创 Javascript Function

Functions are link to Function.prototype. Function.prototype is linked to Object.prototype.Since functions are object, they can have property, method, they can be passed to functions.The missing p

2012-08-13 02:33:10 340

原创 Dynamically add/remove class via Javascript

get classdocument.getElementById('id').classListdocument.getElementById('id').classNameadd/removedocument.getElementById('id').classList.add('class');document.getElementById('id').cl

2012-08-12 13:11:46 429

原创 Dynamically add/remove elements via JavaScript

Adding Elementsexample: appending an error span to formvar errSpan = document.createElement( "span");errSpan.style.display = "block"; // add styleerrSpan.classList.add( "error"); // add a class

2012-08-12 13:03:41 375

原创 Javascript Avoid global objects

Global objects are accessible through out the program. Wrapping global objects in a object that has the same name as the file name will decrease the number of global variablesmyapp.jsvar myap

2012-08-12 04:41:12 505

原创 Javascript validating form input using RE

Usually checking validity of form input involve regular expression.javascript RE is object it begins with / and ends with /syntax:var patt=/pattern/modifiers;modifiers:g: globali: case-i

2012-08-11 10:22:53 316

原创 Javascript OOP object literal

Everything in Javascript is object. Arrays, functions objects, regular expression are all objects. They are all passed by reference!Object in Javascript looks like HashMap in JavaObject Literal:

2012-08-11 06:22:47 785

原创 Node(25) sharing code between client and server

http://caolanmcmahon.com/posts/writing_for_node_and_the_browser/(function(exports){// your code goes hereexports.test = function(){return 'hello world'};})(typeof exports === 'undefined'

2012-08-11 04:07:30 1342

原创 Node(24) Express Project

make a express project using command promptexpress projectNamecd to the projectnpm installgo to localhost:3000 to see the project

2012-08-10 07:29:48 319

原创 Javascript Debug

Some of the best javascript debug tool is FIrebug in Firefox, developer tools in google chrome.make sure preserlog upon navigation, if not, the log will be disappear.make sure to check if ther

2012-08-09 06:13:53 424

原创 HTML5 - Form validation

validation should be done by Javascript before The form is submitted.JavascriptInput Elements has two most used propertiestype and valueexample : textbox( http://www.w3schools.com/js

2012-08-07 03:03:11 598

原创 Node(23) Express

Express is the most popular Node framework. Use Express to handle get and post are extremely simple.Hello Worldvar app = require('express').createServer();app.get( '/',function( req, res

2012-08-05 22:15:29 509

原创 Node(23) JSON

JSON example  profiles.jsmodule.exports = { Peter : { name: 'Peter Parker', age: '18', gender: 'M', grade: 'B' }, Alex : { name: 'Alex Giggersn', age: '23', gender: 'F', grade

2012-08-05 19:59:40 1195

原创 Node(22) Downloading

example with throttlevar http = require( 'http');var fs = require( 'fs');var options = {};options.file = 'pride.txt';options.fileSize = fs.statSync( options.file).size;options.kbps = 32;htt

2012-08-05 08:28:49 760

原创 Node(21) DNS- lookup and resolve

resolve IP address:example from node.js APIvar dns = require('dns');dns.resolve4('www.google.com', function (err, addresses) { if (err) throw err; console.log('addresses: ' + JSON.stringi

2012-08-05 05:51:52 997

原创 Node(20) File Upload with formidable module

handling file upload needs to include formidable module, writing raw code for file upload is tough.var http = require('http');var formidable = require('formidable');var form = require('fs').r

2012-08-04 23:36:03 684

原创 HTTP

The HTTP protocol enables web servers and browsers to exchange data over the InternetHTTP is connectionless - no connection is ever maintain.HTTP is media independent - any type of file can be s

2012-08-04 08:30:28 706

原创 Node(19) Global Objects

ReferenceA very important global object is process. process represent the current running node program.console is also a global object. console.log is the most common method to print debug c

2012-08-04 05:51:39 1446

原创 Javascript basics - types and variables

Javascript TutorialJavascript Core and HTML DOM ReferenceJavascript XML DOM ReferenceJavaScript OOP:http://phrogz.net/js/classes/OOPinJS.htmlhttp://phrogz.net/js/classes/OOPinJS2.html

2012-08-03 00:35:57 370

原创 CouchDB - Introduction

Reference  HTTP APICouchDB: The Definitive GuideNoSQL is a class of database management system identified by its non-adherence to the widely used relational database management system (RDBMS)

2012-08-02 21:13:51 471

原创 Node(18) child_process

child_process has stdin and stdout for input and outputchild_process.exec(command, [options], callback)execute a commanddefault options:var options = { encoding: 'utf8',

2012-08-01 11:17:43 1555

原创 Node(17) Debug

Debug with consoleconsole.log( objects );to see the details of a object use util.inspectutil.inspect(object, [showHidden], [depth], [colors])Debug with EclipseFirst, instal

2012-08-01 10:46:46 768

原创 Node(16) working with couchDB

Apache CouchDB™ is a database that uses JSON for documents, JavaScript for MapReduce queries, and regular HTTP for an API. It is a NoSQL database. It is not a relational database.Node example to

2012-07-31 10:06:25 576

原创 Node(15) vm

vm is similar to eval(), but eval() can change the surrounding context, whereas vm cannotvm is like creating a sandbox, the code will be executed in the different namespace instead of running in the

2012-07-31 00:21:29 600

Struts 2 in Action Struts2实战

Struts2 实战 Struts 2 in Action

2012-12-20

Computer Networking, A Top-Down Approach.pdf

Computer Networking, A Top-Down Approach.pdf

2012-12-19

struct实战

(Struts.2.in.Action).Don.Brown.&.Chad.Davis.&.Scott.Stanlick.文字版.pdf

2012-07-13

PHP高级程序设计_模式、框架与测试

PHP高级程序设计,模式、框架与测试.pdf

2012-07-12

Beginning xml

beginning xml from novice to professional 2005 英文版

2012-06-29

Python核心编程.(第二版)Core.Python.Programming

[Python核心编程.(第二版)英文原版].Core.Python.Programming,2nd.Edition

2011-01-23

Win32 API 教程

theForger's Win32 API教程 C语言

2010-08-13

API函数大全整理API

API函数大全,完整的。 API函数大全,完整的。

2010-08-08

Sams teach yourself C++ Builder in 14 days

Sams teach yourself C++ Builder in 14 days 英语 pdf版

2010-08-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除