C++ enum example and tutorial

enum(enumeration) is a user-defined type consisting of a set of enumerators( enumerator --- named integer constant)

Simple enum definition:

flex the unistd.h problem

When use generate lexer with flex and compile it as cplusplus file, you will get an error like this:

But when compile as c file it will be no problem, if you see the generated c file , you will see:

How to use Java BufferedReader

is not enough. The usual way to use is to construct BufferedReader with an InputStreamReader ... with no buffer. So the common way to tune performance is first use BufferedReader instead of Stream IO ... The IO streams are bytes based, they have no concept of characters or strings which in Java ... and readers just works on a different level of abstraction. BufferedReader, as its name

How the interface find its implementation in Java

I always have the question: How the interface find its implementation ? In the calling code we always declare object with the interface name, Never need to declare the implementation class. We never explicitly tell the compiler which implementation to use.

The answer is , compiler don't know which implementation to use. When you declare a interface , there is no instance created, you have to new something and assign that instance to the interface. And the instance can be anything that implement the interface.

The answer is , compiler don't know which implementation to use. When you declare a interface , there is no .

The question mark in extends declaration

In java extends declaration syntax we often see something like this:

The question mark also show up on other place, inside an angle bracket. It means any class, its a wildcard. Its the Generic of Java. It called bounded wildcard.

What is immutable object in Java?

An immutable object in Java is the objects that can not be changed. For example String object is immutable because you can not change String object's content. when you write str = "Hello"; and then str ="World"; you didn't erase the "Hello" String object, you create another object "World" and assign the address to str variable.

Oracle dual table

In Oracle, the dual table is a special kind of one-row and one-column database table. dual is a table which is created by oracle along with the data dictionary. It consists of exactly one column whose name is dummy and one record. The value of that record is X. Note that the outer query references the dummy table .

New Features of PLSQL in Oracle 11g

Oracle released its 11g Database, it introduced a number of new features and improvement for PL/SQL.

A new built-in function REGEXP_COUNT available in PLSQL of Oracle11g. It match a regular expression pattern and return the number of matches. Here is an example:

An Introduction of the C++ Standard Template Library

The C++ STL(Standard Template Library) is a carefully constructed library developed by Alexander Stepanov, Meng Lee and others at Hwelett Packard.

The core of STL include container which represent data structure and algorithm which apply on the data structure and iterator which is the bridge between container and algorightm.

FancyZoom startup example

FancyZoom is a nice image lightbox plugin. Here is the simplest way to use it.

First you should have a way to initialize it when DOM is loaded , here we use addDOMLoadEvent introduced in Compatible Javascript code addDOMLoadEvent . Its better than old IE's load event.

Previous Page 1 ... 61 62 63 Next Page