How to use inline in C++

If you define your member function inside class declaration , they are implicitly inline.

The inline function is supposed to improve the performance by embedding the function body to calling place and so reduce calling cost. It has two disadvantages: add the size of the program and change of the inline function will make caller recompile.

Java Exception tutorial: understand try catch throw

Suppose we have a method DoSomething() will read user input and the input should be a number. If user did not input a number, the method fail to finish its job, so the other code rely on the job should not execute and program should do something about it like show a message to the user, in software programming .

How to set the expire time of session and cookie in PHP

The login information can store in session or cookie. When store in session, the default expire time is when browser is closed.

Change the default by set the session.cookie_lifetime option in php.ini.

What is NEXTVAL in Oracle

In MySQL, you can specify a column as auto_increment, the value will increment 1 at each insert. SQL Server also provide similar thing. Oracle using SEQUENCE and NEXTVAL to do the job.

Create a SEQUENCE:

PL/SQL packages introduction

Oracle provide PL/SQL packages let you extend the database functionality . You can write you own package or utilize the packages shipped with Oracle release.Oracle supplies all kinds of packages, familiar with these packages is a must-have skill of DBA.

Packages is a collection of different program objects include procedures, functions, variables, constants, cursors, exceptions etc.

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.

Previous Page 1 ... 67 68 69 Next Page