2007年3月24日星期六

http://www.quirksmode.org/

http://www.quirksmode.org/

QuirksMode.org is the personal and professional site of Peter-Paul Koch, freelance web developer in Amsterdam, the Netherlands.

It contains about 120 pages with CSS and JavaScript tips and tricks, and is one of the best sources on the WWW for studying and defeating browser incompatibilities. It is free of charge and ads, and largely free of copyrights.

2007年3月23日星期五

How to convert double to string in C++(怎样在C++中将double型数据转化为string类型的数据)

t//first the headers
//必要的头文件
#include <sstream> //for stringstream
#include <string> // for string

// Then the codes :
//源代码如下
double aNumber=12.3866e5;
stringstream aStringstream;
aStringstream<<aNumber;
string aString=aStringstream.str();

实际上,上述方法可以用到任意类型到字符串型的转换。
下面是C++发明者的一个FAQ中的例子。
其实也可以回答很多类似的问题
How do I convert a double number to a string?
How do I convert a float number to a string?

How do I convert an integer to a string?

The simplest way is to use a stringstream:
 #include <iostream>
#include <string>
#include <sstream>
using namespace std;

string itos(int i) // convert int to string
{
stringstream s;
s << i;
return s.str();
}

int main()
{
int i = 127;
string ss = itos(i);
const char* p = ss.c_str();

cout << ss << " " <<p <<"\n";
}
Naturally, this technique works for converting any type that you can output using <<to a string.


下面使用模板来转换任意类型的数据为字符
template <class T>
string toString(T i) // convert i to string
{
stringstream s;
s << i;
return s.str();
}

另一种方法:
Make use of reading and parsing a string in memory. It will also allow data type conversion from a string to the type read.
http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html
#include <iostream>
#include <sstream>
#include <string>
using namespace std;

main()
{
string test="AAA 123 SSSSS 3.141592654";
istringstream totalSString( test );
string string1, string2;
int integer1;
double PI;

totalSString > string1 > integer1 > string2 > PI;

cout << "Individual parsed variables:" << endl;
cout << "First string: " << string1 << endl;
cout << "First integer: " << integer1 << endl;
cout << "Value of PI: " << PI << endl;
}

2007年3月22日星期四

DOS Command

Check DOS Command and brief explanation and examples,
see http://timisme1980.googlepages.com/DOS.pdf

2007年3月14日星期三

something about an internationalization tool - .PO and .mo files

A po file example is here: http://svn.automattic.com/wordpress-i18n/pot/trunk/wordpress.pot
The Tools for edit a po file under windows is poEditor, however the website seems not correct any more.
You can check here for detail.
http://poedit.sourceforge.net/
http://www.poedit.org
under Linux is http://gtranslator.sourceforge.net/ and KBabel for KDE.
Here is something for PHP
Internationalization (i18) in PHP/Quercus

ppLinear

Free C/C++ Linear Algebra Library with LU decomposition to solve linear systems and more!
English users can found it in www.pecos-place.com/ppLinear_intro.htm
这是一个线性代数计算的函数库,不是开源的,但是免费提供了Linux和Windows下的链接库文件和头文件。
包括了向量和矩阵两个大类 SVector, SMatrix;可以通过LU分解等方式求解线性代数方程组。

这个库本身是在Visual Stdio 6.0 下编辑的,所以在Windows下很容易操作。

有大量的测试代码可供参考。

可以从这里下载。http://timisme1980.googlepages.com/_ppLinear.rar

All about Google Maps API

You wanna know about Google Maps API, check the homepage of the Google Maps API at
http://www.google.com/apis/maps/

The Wiki of Google Maps API is MapKi at http://mapki.com/wiki/Main_Page
There are some basic examples there at http://www.google.com/apis/maps/documentation/index.html

The official Blog of Google Maps API is http://googlemapsapi.blogspot.com/


Need more, I think you should Google Google Maps API!

2007年3月11日星期日

C++的一些免费库

原文:C++的一些免费库
//整理 by RobinKin (王亮)

* Linear Algebra
o MTL, the Matrix Template Library. Dense and sparse matrices and vectors; banded, symmetric, triangular matrices; basic algorithms. C++.

矩阵模版库,紧密和稀疏矩阵、矢量,带状,对称、三角矩阵,基本算法(C++语言)
o uBLAS, BLAS in C++ with expression templates.

表达式模版形式的 C++中的BLAS ,
o tvmet, a C++ library for "tiny" vectors and matrices with expression templates.

小型矢量和矩阵的表达式模版
o GMM++, generic C++ template library for sparse, dense and skyline matrices, with solvers from ITL.
o MET, a C++ matrix library with expression templates, which eliminates the overhead of overloaded operators.
o SL++, the Scientific Library project. Will provide matrices, random numbers, complex, quaternions, plotting, and FFTs. C++.

科学计算库,提供矩阵、随机数、复数、四元数,快速复利叶变换(C++语言)
o Seldon, C++ library for linear algebra with BLAS interface. Many matrix types (sparse, symmetric, hermitian, etc.) are supported.

BLAS 线性代数接口,支持 稀疏,对称,共轭矩阵
o ALP, linear and polynomial algebra. Vectors, matrices, polynomials.
o SVMT: E. Robert Tisdale's proposal for a standard C++ Scalar, Vector, Matrix and Tensor Class Library (with implementation). Note: this is a proposal, not an official standard.
o GNUSSL [ftp only], the GNU Scientific Software Library. Linear algebra and arrays. C++.
o CPPLapack, C++ wrapper for BLAS and LAPACK.
o Lapack++, C++ wrapper for BLAS and LAPACK.
o IML++ A C++ template library for numerical iterative methods.
o MV++ Numerical Matrix/Vector Classes in C++
o SparseLib++ A library for sparse matrix computations, including the Sparse BLAS (Basic Linear Algebra Subprograms). C++.
o ISIS++, an object-oriented framework for solving sparse linear systems of equations. C++.
o ARPACK++, a C++ template library for solving large-scale standard and generalized eigenvalue problems.
o The Template Numerical Toolkit (TNT) for linear algebra is a successor to the Lapack++, Sparselib++, IML++, and MV++ packages. Its goal is to integrate these ideas into a generic algorithmic library, supporting generic user-defined data types, and increasing its functionality. C++.
o LinAlg, basic linear algebra and optimization classes. C++.
o CAM C++ Class Library (Matrix, vector, and graphics classes)
o Newmat, a C++ matrix library (docs, download)
o CLHEP includes matrix classes, random number generators for the High Energy Physics (HEP) community. C++.
o BPKIT, Block Preconditioning Toolkit for iterative solution of linear systems. Callable from C++, C, or FORTRAN.

* Arrays and Images
o POOMA II framework for scientific computing on sequential and parallel computers. Provides parallel arrays; fields, meshes, particles to come in version 2.1 (June 1999). C++.
o The Blitz++ class library: Array and Vector classes which rival Fortran's performance. C++.
o The AIPS++ Array and Image Classes (Astronomical Information Processing System). C++.
o Daixtrose, a general-purpose expression template engine.
o PETE, an expression templates library -- add expression templates to your own array class.
o SCTL (BlueSail), C++, arrays, matrics, vectors, sparse, rotations.
o VIGRA, generic computer vision/image processing library.
o CPPIMA A C++ image processing library
o LIMP, Large Image Manipulation Program
o Image Restoration and Inpainting, C++ library for image restoration.
o valarray [ftp only], approximation of the valarray class described in Ch. 26 of the ANSI/ISO C++ Standard. Uses expression templates for efficient evaluation.
o Image Understanding Environment (IUE), a DARPA project. C++.
o WAILI, a wavelet transform library in C++.

* Neural Networks, genetic algorithms, machine learning, data mining
o PDP++, a neural-network simulation system written in C++
o EO -- Evolutionary Computation Framework
o CONICAL, C++ classes for building Neural Networks
o GALib, a C++ library for genetic algorithms
o Xelopes data mining library (Java, C++, C#)
o MLC++, Machine learning algorithms and data mining.

* High-Energy Physics and Quantum Chemistry
o QC++, quantum chemistry software in C++, supporting MNDO, AM1 and PM3 models.
o FTensor, C++ class library for tensors.
o GluCat, Clifford algebra template library.
o Computational Thermodynamics Library
o Tech-X has made available C++ libraries related to particle accelerator design.

* Multiprecision, arbitrary precision data types
o NTL, arbitrary length integers, vectors/matrices/polynomials over integers and over finite fields.
o php">EXTNUM, version of double which has the same number of mantissa bits as IEEE 754, but extends the exponent to have range from 10^-646456993 to 10^646456992.
o CLN, an extensive number library. Arbitrary precision integer, float, rational, polynomials, complex, modular integers, transcendental functions, assembly language kernels for some CPUs.
o MUNTL, Multiprecision unsigned number template library (C++).
o MPFUN++, a multiple precision floating point computation package in C++.
o LiDIA, A library for computational number theory. Provides a collection of highly optimized implementations of various multiprecision data types and time-intensive algorithms.
o Apfloat, a C++ High Performance Arbitrary Precision Arithmetic Package
o hfloat, An arbitrary precision package, optimized for very large (> 1000) (decimal) digit numbers.
o fPoint, a C++ class which helps convert floating-point arithmetic to fixed-point arithmetic by recommending range and precision requirements.
o doubledouble, a quad-precision (approximately 30 decimal place) floating point arithmetic class.

* Differential Equations
o Rheoolef, finite element environment in C++.
o EXPDE, a C++ library for solving partial differential equations on semi-unstructured grids. Parallel.
o PZ, a C++ library for finite elements. 1-3 dimensions with hp-adaptivity, continuous or discontinuous, variety of matrix formats.
o MBDyn, multibody dynamics analysis in C++. Built-in parallelization via MPI/Metis.
o P2MESH, 2D finite volume/finite elements, C++ library designed for fast prototyping of high-performance PDE solvers.
o Femlisp, a Common Lisp framework for Finite Element Methods.
o GETFEM++, a C++ finite element library, generic, arbitrary dimensions.
o MOUSE, a C++ library for finite volume computations on unstructured grids.
o DEAL, a C++ library for adaptive finite elements and error estimation. Supports SMPs.
o ODE++, a class library for ordinary differential equations. Explicit and linear-implicit ODE systems, IVP and BVP parameters, various solvers (Runge-Kutta, multistep, BDF). [English] [Deutsch]
o PETSc, object-oriented software for partial differential equations (programmed in C)
o Diffpack, partial differential equations in C++. ($)
o TIDE: Classes for Ordinary Differential Equations. Provides vectors and matrices, extrapolation integrator for ODEs, sparse matrix classes, eigenvalues, shooting for two point BVPs, nonlinear solver, continuation
o BoxLib/CCSE Applications Suite (docs), a class library supporting adaptive mesh refinement (AMR) schemes for computational fluid dynamics.
o OVERTURE, a C++ class library for solving PDEs in complicated domains. Includes adaptive mesh refinement and overlapping grids.
o FEMLIB (ftp, www) A Finite Element package [ftp only] by Michael Tiller (BROKEN LINK, no longer supported)

* Automatic differentiation and interval arithmetic
o Gaol, C++ library for interval arithmetic. Includes methods for interval constraint solvers.
o FADBAD-TADIFF, a C++ package for automatic differentiation using any arithmetic (double or interval) by operator overloading.
o PROFIL/BIAS [English] [Deutsch], a C++ interval arithmetic class library.

* Visualization
o The Visualization Toolkit (vtk), an extensive, free C++ library for scientific visualization.
o VisAD, a Java library for interactive and collaborative visualization and analysis of numerical data
o Java 2D Graph package. Includes contour plots, animation.
o java/ptplot/">Ptplot, a 2D data plotter in Java

* Graph Theory/Combinatorics
o Boost Graph Library, a general purpose, generic C++ library for graph data structures and graph algorithms.
o GTL, the Graph Template Library (C++).
o LEDA, a C++ library for graph theory and combinatorial computing.

* Language interoperability/scripting
o CPPF77 (cppf77.zip), a utility for interfacing C++ and Fortran 77 programs.
o Paul Dubois's code for interfacing Python and C++
o SWIG, generates Perl, Python, Tcl, Java, Eiffel and Guile wrappers for C++ libraries.
o SILOON (Scripting Interface Languages for Object-Oriented Numerics), toolkits and run-time support for building scripting interfaces to existing numerical codes in C, C++, and Fortran. Generates script bindings for Perl, Tcl, and Python.
o Matwrap, a tool which generates C++ wrapper code for matrix-oriented scripting languages such as Matlab 5, Octave, and tela.

* Transforms
o FFTPACK++, a C++ wrapper for FFTPACK complex routines using LAPACK++ Matrix and Vector classes.
o The FXT library of transforms. FFTs, Hartley, Number theoretic, Walsh, others coded in C++.

* Optimization
o COOOL, an object-oriented optimization library
o OptSolve++, a C++ optimization library from Tech-X. (commercial)
o StarFLIP, optimization library for combinatorial problems with fuzzy constraints (C++)
o Javanumeric/index.html">LM (Levenberg-Marquardt) implementation in Java for nonlinear least squares problems.

* Miscellaneous
o GOOSE, GNU Object-Oriented Statistics Environment (C++).
o Borneo, a dialect of the Java language designed to have true support for the IEEE 754 floating point standard.
o SDTS++, a library for manipulating SDTS datasets (geographical information systems)
o Newran, C++ library for generating streams of random numbers.
o Multivariate polynomial interpolation library in C++
o MPI-2 C++ bindings (message passing library for parallel computers)
o CNCL, Communication networks simulation/analysis library (C++).
o OOMF, Object Oriented MicroMagnetic computing Framework at ITL/NIST
o CPPF77, a utility for interfacing C++ and Fortran 77 programs.
o The Standard Template Library (STL)
o The Bench++ Benchmark Suite
o EFLIB: Extended Function Library for Object-Pascal. Generalized arithmetics, equation solvers, more.

* Tools
o TAU (Tuning and Analysis Utilities), explicit instrumentation of C++ libraries for profiling and tracing. For both serial and parallel codes.



Compilers

* Compilers
o KAI C++, an optimizing compiler from Kuck & Associates (now a division of Intel). Unfortunately, this product has been discontinued.
o The free GCC (Gnu Compiler Collection) has a good C++ compiler which can be used under unix or windows (with CygWin).
o Intel's C++ compiler.
o The Portland Group C++ compiler
o The MPC++, a massively parallel, message passing, meta-level processing C++.
o Titanium (free), a dialect of Java for large-scale scientific computing.


Commercial software
o Diffpack, a development framework for multi-physics simulations (C++).
o VectorSpace provides vs.lib (integrable/differentiable objects in C++) and fe.lib (an object-oriented finite element library).
o php">NMath provides vector, matrix, complex numbers and math functions for the .NET platform (e.g. C#)
o macstl, std::valarray implementation using SIMD opcodes (Altivec on PowerPC, SSE/SSE2 on Intel)
o ExacMath library (quad and double-quad precision floating point math), from Floating Point Software.
o Math.h++ and LAPACK.h++ from Rogue Wave Software, Inc (LAPACK.h++ is not the same package as Roldan Pozo's LAPACK++ listed above)
o MtxVec, linear algebra/numerical library for Delphi and C++ Builder.
o Extreme Optimization Library, numerical library for .NET
o MAT (Matlab compatible C++ Matrix Class Library)
o C-XSC: A C++ Class Library for Extended Scientific Computing (A C++ interval methods class library)
o Siscat, C++ software for scattered data approximation
o JNL, A numerical language/library proposal for Java from Visual Numerics.
o LIA,GIA,ICE libraries for interval methods in C++ from Delisoft Ltd. Includes interval arithmetic, global optimization, and solving nonlinear equations.
o AMRES, a C++ library for financial analysis.
Diffpack, a development framework for multi-physics simulations (C++).
* VectorSpace provides vs.lib (integrable/differentiable objects in C++) and fe.lib (an object-oriented finite element library).
* php">NMath provides vector, matrix, complex numbers and math functions for the .NET platform (e.g. C#)
* macstl, std::valarray implementation using SIMD opcodes (Altivec on PowerPC, SSE/SSE2 on Intel)
* ExacMath library (quad and double-quad precision floating point math), from Floating Point Software.
* Math.h++ and LAPACK.h++ from Rogue Wave Software, Inc (LAPACK.h++ is not the same package as Roldan Pozo's LAPACK++ listed above)
* MtxVec, linear algebra/numerical library for Delphi and C++ Builder.
* Extreme Optimization Library, numerical library for .NET
* MAT (Matlab compatible C++ Matrix Class Library)
* C-XSC: A C++ Class Library for Extended Scientific Computing (A C++ interval methods class library)
* Siscat, C++ software for scattered data approximation
* JNL, A numerical language/library proposal for Java from Visual Numerics.
* LIA,GIA,ICE libraries for interval methods in C++ from Delisoft Ltd. Includes interval arithmetic, global optimization, and solving nonlinear equations.
* AMRES, a C++ library for financial analysis.

# KAI C++, an optimizing compiler from Kuck & Associates (now a division of Intel). Unfortunately, this product has been discontinued. The free GCC (Gnu Compiler Collection) has a good C++ compiler which can be used under unix or windows (with CygWin).
# Intel's C++ compiler.
# The Portland Group C++ compiler
# The MPC++, a massively parallel, message passing, meta-level processing C++.
# Titanium (free), a dialect of Java for large-scale scientific computing.


Commercial software

* Diffpack, a development framework for multi-physics simulations (C++).
* VectorSpace provides vs.lib (integrable/differentiable objects in C++) and fe.lib (an object-oriented finite element library).
* php">NMath provides vector, matrix, complex numbers and math functions for the .NET platform (e.g. C#)
* macstl, std::valarray implementation using SIMD opcodes (Altivec on PowerPC, SSE/SSE2 on Intel)
* ExacMath library (quad and double-quad precision floating point math), from Floating Point Software.
* Math.h++ and LAPACK.h++ from Rogue Wave Software, Inc (LAPACK.h++ is not the same package as Roldan Pozo's LAPACK++ listed above)
* MtxVec, linear algebra/numerical library for Delphi and C++ Builder.
* Extreme Optimization Library, numerical library for .NET
* MAT (Matlab compatible C++ Matrix Class Library)
* C-XSC: A C++ Class Library for Extended Scientific Computing (A C++ interval methods class library)
* Siscat, C++ software for scattered data approximation
* JNL, A numerical language/library proposal for Java from Visual Numerics.
* LIA,GIA,ICE libraries for interval methods in C++ from Delisoft Ltd. Includes interval arithmetic, global optimization, and solving nonlinear equations.
* AMRES, a C++ library for financial analysis.

# Diffpack, a development framework for multi-physics simulations (C++). VectorSpace provides vs.lib (integrable/differentiable objects in C++) and fe.lib (an object-oriented finite element library).
# php">NMath provides vector, matrix, complex numbers and math functions for the .NET platform (e.g. C#)
# macstl, std::valarray implementation using SIMD opcodes (Altivec on PowerPC, SSE/SSE2 on Intel)
# ExacMath library (quad and double-quad precision floating point math), from Floating Point Software.
# Math.h++ and LAPACK.h++ from Rogue Wave Software, Inc (LAPACK.h++ is not the same package as Roldan Pozo's LAPACK++ listed above)
# MtxVec, linear algebra/numerical library for Delphi and C++ Builder.
# Extreme Optimization Library, numerical library for .NET
# MAT (Matlab compatible C++ Matrix Class Library)
# C-XSC: A C++ Class Library for Extended Scientific Computing (A C++ interval methods class library)
# Siscat, C++ software for scattered data approximation
# JNL, A numerical language/library proposal for Java from Visual Numerics.
# LIA,GIA,ICE libraries for interval methods in C++ from Delisoft Ltd. Includes interval arithmetic, global optimization, and solving nonlinear equations.
# AMRES, a C++ library for financial analysis.