| 选勇's profile诗、剑、酒、梅花PhotosBlogLists | Help |
|
July 26 The C10K problem ( part 2 )[copy from : http://www.kegel.com/c10k.html]
CommentsRichard Gooch has written a paper discussing I/O options. In 2001, Tim Brecht and MMichal Ostrowski measured various strategies for simple select-based servers. Their data is worth a look. In 2003, Tim Brecht posted source code for userver, a small web server put together from several servers written by Abhishek Chandra, David Mosberger, David Pariag, and Michal Ostrowski. It can use select(), poll(), epoll(), or sigio. Back in March 1999, Dean Gaudet posted: I keep getting asked "why don't you guys use a select/event based model like Zeus? It's clearly the fastest." ...His reasons boiled down to "it's really hard, and the payoff isn't clear". Within a few months, though, it became clear that people were willing to work on it. Mark Russinovich wrote an editorial and an article discussing I/O strategy issues in the 2.2 Linux kernel. Worth reading, even he seems misinformed on some points. In particular, he seems to think that Linux 2.2's asynchronous I/O (see F_SETSIG above) doesn't notify the user process when data is ready, only when new connections arrive. This seems like a bizarre misunderstanding. See also comments on an earlier draft, Ingo Molnar's rebuttal of 30 April 1999, Russinovich's comments of 2 May 1999, a rebuttal from Alan Cox, and various posts to linux-kernel. I suspect he was trying to say that Linux doesn't support asynchronous disk I/O, which used to be true, but now that SGI has implemented KAIO, it's not so true anymore. See these pages at sysinternals.com and MSDN for information on "completion ports", which he said were unique to NT; in a nutshell, win32's "overlapped I/O" turned out to be too low level to be convenient, and a "completion port" is a wrapper that provides a queue of completion events, plus scheduling magic that tries to keep the number of running threads constant by allowing more threads to pick up completion events if other threads that had picked up completion events from this port are sleeping (perhaps doing blocking I/O). See also OS/400's support for I/O completion ports. There was an interesting discussion on linux-kernel in September 1999 titled "> 15,000 Simultaneous Connections" (and the second week of the thread). Highlights:
Interesting reading!
Limits on open filehandles
"In OpenBSD, an additional tweak is required to increase the number of open filehandles available per process: the openfiles-cur parameter in /etc/login.conf needs to be increased. You can change kern.maxfiles either with sysctl -w or in sysctl.conf but it has no effect. This matters because as shipped, the login.conf limits are a quite low 64 for nonprivileged processes, 128 for privileged." echo 32768 > /proc/sys/fs/file-maxincreases the system limit on open files, and ulimit -n 32768increases the current process' limit. On 2.2.x kernels, echo 32768 > /proc/sys/fs/file-max echo 65536 > /proc/sys/fs/inode-maxincreases the system limit on open files, and ulimit -n 32768increases the current process' limit. I verified that a process on Red Hat 6.0 (2.2.5 or so plus patches) can open at least 31000 file descriptors this way. Another fellow has verified that a process on 2.2.12 can open at least 90000 file descriptors this way (with appropriate limits). The upper bound seems to be available memory. Limits on threadsOn any architecture, you may need to reduce the amount of stack space allocated for each thread to avoid running out of virtual memory. You can set this at runtime with pthread_attr_init() if you're using pthreads.
Java issuesUp through JDK 1.3, Java's standard networking libraries mostly offered the one-thread-per-client model. There was a way to do nonblocking reads, but no way to do nonblocking writes. In May 2001, JDK 1.4 introduced the package java.nio to provide full support for nonblocking I/O (and some other goodies). See the release notes for some caveats. Try it out and give Sun feedback! HP's java also includes a Thread Polling API. In 2000, Matt Welsh implemented nonblocking sockets for Java; his performance benchmarks show that they have advantages over blocking sockets in servers handling many (up to 10000) connections. His class library is called java-nbio; it's part of the Sandstorm project. Benchmarks showing performance with 10000 connections are available. See also Dean Gaudet's essay on the subject of Java, network I/O, and threads, and the paper by Matt Welsh on events vs. worker threads. Before NIO, there were several proposals for improving Java's networking APIs:
Other tips
A new socket option under Linux, TCP_CORK, tells the kernel to avoid sending partial frames, which helps a bit e.g. when there are lots of little write() calls you can't bundle together for some reason. Unsetting the option flushes the buffer. Better to use writev(), though... See LWN Jan 25 2001 for a summary of some very interesting discussions on linux-kernel about TCP_CORK and a possible alternative MSG_MORE. [Provos, Lever, and Tweedie 2000] notes that dropping incoming connections when the server is overloaded improved the shape of the performance curve, and reduced the overall error rate. They used a smoothed version of "number of clients with I/O ready" as a measure of overload. This technique should be easily applicable to servers written with select, poll, or any system call that returns a count of readiness events per call (e.g. /dev/poll or sigtimedwait4()). Not all threads are created equal. The clone() function in Linux (and its friends in other operating systems) lets you create a thread that has its own current working directory, for instance, which can be very helpful when implementing an ftp server. See Hoser FTPd for an example of the use of native threads rather than pthreads. "Re: fix for hybrid server problems" by Vivek Sadananda Pai (vivek@cs.rice.edu) on new-httpd, May 9th, states:
Other limits
Kernel IssuesFor Linux, it looks like kernel bottlenecks are being fixed constantly. See Linux Weekly News, Kernel Traffic, the Linux-Kernel mailing list, and my Mindcraft Redux page. In March 1999, Microsoft sponsored a benchmark comparing NT to Linux at serving large numbers of http and smb clients, in which they failed to see good results from Linux. See also my article on Mindcraft's April 1999 Benchmarks for more info. See also The Linux Scalability Project. They're doing interesting work, including Niels Provos' hinting poll patch, and some work on the thundering herd problem. See also Mike Jagdis' work on improving select() and poll(); here's Mike's post about it. Measuring Server PerformanceTwo tests in particular are simple, interesting, and hard:
Jef Poskanzer has published benchmarks comparing many web servers. See http://www.acme.com/software/thttpd/benchmarks.html for his results. I also have a few old notes about comparing thttpd to Apache that may be of interest to beginners. Chuck Lever keeps reminding us about Banga and Druschel's paper on web server benchmarking. It's worth a read. IBM has an excellent paper titled Java server benchmarks [Baylor et al, 2000]. It's worth a read. ExamplesInteresting select()-based servers
Interesting /dev/poll-based servers
Interesting kqueue()-based servers
Interesting realtime signal-based servers
Interesting thread-based servers
Interesting in-kernel servers
Other interesting links
Changelog$Log: c10k.html,v $ Revision 1.212 2006/09/02 14:52:13 dank added asio Revision 1.211 2006/07/27 10:28:58 dank Link to Cal Henderson's book. Revision 1.210 2006/07/27 10:18:58 dank Listify polyakov links, add Drepper's new proposal, note that FreeBSD 7 might move to 1:1 Revision 1.209 2006/07/13 15:07:03 dank link to Scale! library, updated Polyakov links Revision 1.208 2006/07/13 14:50:29 dank Link to Polyakov's patches Revision 1.207 2003/11/03 08:09:39 dank Link to Linus's message deprecating the idea of aio_open Revision 1.206 2003/11/03 07:44:34 dank link to userver Revision 1.205 2003/11/03 06:55:26 dank Link to Vivek Pei's new Flash paper, mention great specweb99 score Copyright 1999-2006 Dan Kegel The C10K problem ( part 1 )[copy from : http://www.kegel.com/c10k.html] It's time for web servers to handle ten thousand clients simultaneously, don't you think? After all, the web is a big place now. And computers are big, too. You can buy a 1000MHz machine with 2 gigabytes of RAM and an 1000Mbit/sec Ethernet card for $1200 or so. Let's see - at 20000 clients, that's 50KHz, 100Kbytes, and 50Kbits/sec per client. It shouldn't take any more horsepower than that to take four kilobytes from the disk and send them to the network once a second for each of twenty thousand clients. (That works out to $0.08 per client, by the way. Those $100/client licensing fees some operating systems charge are starting to look a little heavy!) So hardware is no longer the bottleneck. In 1999 one of the busiest ftp sites, cdrom.com, actually handled 10000 clients simultaneously through a Gigabit Ethernet pipe. As of 2001, that same speed is now being offered by several ISPs, who expect it to become increasingly popular with large business customers. And the thin client model of computing appears to be coming back in style -- this time with the server out on the Internet, serving thousands of clients. With that in mind, here are a few notes on how to configure operating systems and write code to support thousands of clients. The discussion centers around Unix-like operating systems, as that's my personal area of interest, but Windows is also covered a bit. Contents
Related SitesIn October 2003, Felix von Leitner put together an excellent web page and presentation about network scalability, complete with benchmarks comparing various networking system calls and operating systems. One of his observations is that the 2.6 Linux kernel really does beat the 2.4 kernel, but there are many, many good graphs that will give the OS developers food for thought for some time. (See also the Slashdot comments; it'll be interesting to see whether anyone does followup benchmarks improving on Felix's results.)Book to Read FirstIf you haven't read it already, go out and get a copy of Unix Network Programming : Networking Apis: Sockets and Xti (Volume 1) by the late W. Richard Stevens. It describes many of the I/O strategies and pitfalls related to writing high-performance servers. It even talks about the 'thundering herd' problem. And while you're at it, go read Jeff Darcy's notes on high-performance server design. (Another book which might be more helpful for those who are *using* rather than *writing* a web server is Building Scalable Web Sites by Cal Henderson.) I/O frameworksPrepackaged libraries are available that abstract some of the techniques presented below, insulating your code from the operating system and making it more portable.
I/O StrategiesDesigners of networking software have many options. Here are a few:
The following five combinations seem to be popular:
1. Serve many clients with each thread, and use nonblocking I/O and level-triggered readiness notification... set nonblocking mode on all network handles, and use select() or poll() to tell which network handle has data waiting. This is the traditional favorite. With this scheme, the kernel tells you whether a file descriptor is ready, whether or not you've done anything with that file descriptor since the last time the kernel told you about it. (The name 'level triggered' comes from computer hardware design; it's the opposite of 'edge triggered'. Jonathon Lemon introduced the terms in his BSDCON 2000 paper on kqueue().) Note: it's particularly important to remember that readiness notification from the kernel is only a hint; the file descriptor might not be ready anymore when you try to read from it. That's why it's important to use nonblocking mode when using readiness notification. An important bottleneck in this method is that read() or sendfile() from disk blocks if the page is not in core at the moment; setting nonblocking mode on a disk file handle has no effect. Same thing goes for memory-mapped disk files. The first time a server needs disk I/O, its process blocks, all clients must wait, and that raw nonthreaded performance goes to waste. But in November 2003 on the freebsd-hackers list, Vivek Pei et al reported very good results using system-wide profiling of their Flash web server to attack bottlenecks. One bottleneck they found was mincore (guess that wasn't such a good idea after all) Another was the fact that sendfile blocks on disk access; they improved performance by introducing a modified sendfile() that return something like EWOULDBLOCK when the disk page it's fetching is not yet in core. (Not sure how you tell the user the page is now resident... seems to me what's really needed here is aio_sendfile().) The end result of their optimizations is a SpecWeb99 score of about 800 on a 1GHZ/1GB FreeBSD box, which is better than anything on file at spec.org. There are several ways for a single thread to tell which of a set of nonblocking sockets are ready for I/O:
2. Serve many clients with each thread, and use nonblocking I/O and readiness change notificationReadiness change notification (or edge-triggered readiness notification) means you give the kernel a file descriptor, and later, when that descriptor transitions from not ready to ready, the kernel notifies you somehow. It then assumes you know the file descriptor is ready, and will not send any more readiness notifications of that type for that file descriptor until you do something that causes the file descriptor to no longer be ready (e.g. until you receive the EWOULDBLOCK error on a send, recv, or accept call, or a send or recv transfers less than the requested number of bytes).When you use readiness change notification, you must be prepared for spurious events, since one common implementation is to signal readiness whenever any packets are received, regardless of whether the file descriptor was already ready. This is the opposite of "level-triggered" readiness notification. It's a bit less forgiving of programming mistakes, since if you miss just one event, the connection that event was for gets stuck forever. Nevertheless, I have found that edge-triggered readiness notification made programming nonblocking clients with OpenSSL easier, so it's worth trying. [Banga, Mogul, Drusha '99] described this kind of scheme in 1999. There are several APIs which let the application retrieve 'file descriptor became ready' notifications:
This is the recommended edge-triggered poll replacement for the 2.6 Linux kernel. On 11 July 2001, Davide Libenzi proposed an alternative to realtime signals; his patch provides what he now calls /dev/epoll www.xmailserver.org/linux-patches/nio-improve.html. This is just like the realtime signal readiness notification, but it coalesces redundant events, and has a more efficient scheme for bulk event retrieval. Epoll was merged into the 2.5 kernel tree as of 2.5.46 after its interface was changed from a special file in /dev to a system call, sys_epoll. A patch for the older version of epoll is available for the 2.4 kernel. There was a lengthy debate about unifying epoll, aio, and other event sources on the linux-kernel mailing list around Halloween 2002. It may yet happen, but Davide is concentrating on firming up epoll in general first.
At OLS 2006, Ulrich Drepper proposed a new high-speed asynchronous networking API. See:
This is the recommended edge-triggered poll replacement for the 2.4 Linux kernel. The 2.4 linux kernel can deliver socket readiness events via a particular realtime signal. Here's how to turn this behavior on: /* Mask off SIGIO and the signal you want to use. */ sigemptyset(&sigset); sigaddset(&sigset, signum); sigaddset(&sigset, SIGIO); sigprocmask(SIG_BLOCK, &m_sigset, NULL); /* For each file descriptor, invoke F_SETOWN, F_SETSIG, and set O_ASYNC. */ fcntl(fd, F_SETOWN, (int) getpid()); fcntl(fd, F_SETSIG, signum); flags = fcntl(fd, F_GETFL); flags |= O_NONBLOCK|O_ASYNC; fcntl(fd, F_SETFL, flags);This sends that signal when a normal I/O function like read() or write() completes. To use this, write a normal poll() outer loop, and inside it, after you've handled all the fd's noticed by poll(), you loop calling sigwaitinfo(). If sigwaitinfo or sigtimedwait returns your realtime signal, siginfo.si_fd and siginfo.si_band give almost the same information as pollfd.fd and pollfd.revents would after a call to poll(), so you handle the i/o, and continue calling sigwaitinfo(). If sigwaitinfo returns a traditional SIGIO, the signal queue overflowed, so you flush the signal queue by temporarily changing the signal handler to SIG_DFL, and break back to the outer poll() loop. See Poller_sigio (cc, h) for an example of how to use rtsignals interchangeably with many other readiness notification schemes. See Zach Brown's phhttpd for example code that uses this feature directly. (Or don't; phhttpd is a bit hard to figure out...) [Provos, Lever, and Tweedie 2000] describes a recent benchmark of phhttpd using a variant of sigtimedwait(), sigtimedwait4(), that lets you retrieve multiple signals with one call. Interestingly, the chief benefit of sigtimedwait4() for them seemed to be it allowed the app to gauge system overload (so it could behave appropriately). (Note that poll() provides the same measure of system overload.)
Chandra and Mosberger proposed a modification to the realtime signal approach called "signal-per-fd" which reduces or eliminates realtime signal queue overflow by coalescing redundant events. It doesn't outperform epoll, though. Their paper ( www.hpl.hp.com/techreports/2000/HPL-2000-174.html) compares performance of this scheme with select() and /dev/poll. Vitaly Luban announced a patch implementing this scheme on 18 May 2001; his patch lives at www.luban.org/GPL/gpl.html. (Note: as of Sept 2001, there may still be stability problems with this patch under heavy load. dkftpbench at about 4500 users may be able to trigger an oops.) See Poller_sigfd (cc, h) for an example of how to use signal-per-fd interchangeably with many other readiness notification schemes. 3. Serve many clients with each server thread, and use asynchronous I/OThis has not yet become popular in Unix, probably because few operating systems support asynchronous I/O, also possibly because it (like nonblocking I/O) requires rethinking your application. Under standard Unix, asynchronous I/O is provided by the aio_ interface (scroll down from that link to "Asynchronous input and output"), which associates a signal and value with each I/O operation. Signals and their values are queued and delivered efficiently to the user process. This is from the POSIX 1003.1b realtime extensions, and is also in the Single Unix Specification, version 2. AIO is normally used with edge-triggered completion notification, i.e. a signal is queued when the operation is complete. (It can also be used with level triggered completion notification by calling aio_suspend(), though I suspect few people do this.) glibc 2.1 and later provide a generic implementation written for standards compliance rather than performance. Ben LaHaise's implementation for Linux AIO was merged into the main Linux kernel as of 2.5.32. It doesn't use kernel threads, and has a very efficient underlying api, but (as of 2.6.0-test2) doesn't yet support sockets. (There is also an AIO patch for the 2.4 kernels, but the 2.5/2.6 implementation is somewhat different.) More info:
Red Hat AS and Suse SLES both provide a high-performance implementation on the 2.4 kernel; it is related to, but not completely identical to, the 2.6 kernel implementation. In February 2006, a new attempt is being made to provide network AIO; see the note above about Evgeniy Polyakov's kevent-based AIO. In 1999, SGI implemented high-speed AIO for Linux. As of version 1.1, it's said to work well with both disk I/O and sockets. It seems to use kernel threads. It is still useful for people who can't wait for Ben's AIO to support sockets. The O'Reilly book POSIX.4: Programming for the Real World is said to include a good introduction to aio. A tutorial for the earlier, nonstandard, aio implementation on Solaris is online at Sunsite. It's probably worth a look, but keep in mind you'll need to mentally convert "aioread" to "aio_read", etc. Note that AIO doesn't provide a way to open files without blocking for disk I/O; if you care about the sleep caused by opening a disk file, Linus suggests you should simply do the open() in a different thread rather than wishing for an aio_open() system call. Under Windows, asynchronous I/O is associated with the terms "Overlapped I/O" and IOCP or "I/O Completion Port". Microsoft's IOCP combines techniques from the prior art like asynchronous I/O (like aio_write) and queued completion notification (like when using the aio_sigevent field with aio_write) with a new idea of holding back some requests to try to keep the number of running threads associated with a single IOCP constant. For more information, see Inside I/O Completion Ports by Mark Russinovich at sysinternals.com, Jeffrey Richter's book "Programming Server-Side Applications for Microsoft Windows 2000" (Amazon, MSPress), U.S. patent #06223207, or MSDN. 4. Serve one client with each server thread... and let read() and write() block. Has the disadvantage of using a whole stack frame for each client, which costs memory. Many OS's also have trouble handling more than a few hundred threads. If each thread gets a 2MB stack (not an uncommon default value), you run out of *virtual memory* at (2^30 / 2^21) = 512 threads on a 32 bit machine with 1GB user-accessible VM (like, say, Linux as normally shipped on x86). You can work around this by giving each thread a smaller stack, but since most thread libraries don't allow growing thread stacks once created, doing this means designing your program to minimize stack use. You can also work around this by moving to a 64 bit processor. The thread support in Linux, FreeBSD, and Solaris is improving, and 64 bit processors are just around the corner even for mainstream users. Perhaps in the not-too-distant future, those who prefer using one thread per client will be able to use that paradigm even for 10000 clients. Nevertheless, at the current time, if you actually want to support that many clients, you're probably better off using some other paradigm. For an unabashedly pro-thread viewpoint, see Why Events Are A Bad Idea (for High-concurrency Servers) by von Behren, Condit, and Brewer, UCB, presented at HotOS IX. Anyone from the anti-thread camp care to point out a paper that rebuts this one? :-) LinuxThreadsLinuxTheads is the name for the standard Linux thread library. It is integrated into glibc since glibc2.0, and is mostly Posix-compliant, but with less than stellar performance and signal support.NGPT: Next Generation Posix Threads for LinuxNGPT is a project started by IBM to bring good Posix-compliant thread support to Linux. It's at stable version 2.2 now, and works well... but the NGPT team has announced that they are putting the NGPT codebase into support-only mode because they feel it's "the best way to support the community for the long term". The NGPT team will continue working to improve Linux thread support, but now focused on improving NPTL. (Kudos to the NGPT team for their good work and the graceful way they conceded to NPTL.)NPTL: Native Posix Thread Library for LinuxNPTL is a project by Ulrich Drepper (the benevolent dict^H^H^H^Hmaintainer of glibc) and Ingo Molnar to bring world-class Posix threading support to Linux.As of 5 October 2003, NPTL is now merged into the glibc cvs tree as an add-on directory (just like linuxthreads), so it will almost certainly be released along with the next release of glibc. The first major distribution to include an early snapshot of NPTL was Red Hat 9. (This was a bit inconvenient for some users, but somebody had to break the ice...) NPTL links:
In March 2002, Bill Abt of the NGPT team, the glibc maintainer Ulrich Drepper, and others met to figure out what to do about LinuxThreads. One idea that came out of the meeting was to improve mutex performance; Rusty Russell et al subsequently implemented fast userspace mutexes (futexes)), which are now used by both NGPT and NPTL. Most of the attendees figured NGPT should be merged into glibc. Ulrich Drepper, though, didn't like NGPT, and figured he could do better. (For those who have ever tried to contribute a patch to glibc, this may not come as a big surprise :-) Over the next few months, Ulrich Drepper, Ingo Molnar, and others contributed glibc and kernel changes that make up something called the Native Posix Threads Library (NPTL). NPTL uses all the kernel enhancements designed for NGPT, and takes advantage of a few new ones. Ingo Molnar described the kernel enhancements as follows: While NPTL uses the three kernel features introduced by NGPT: getpid() returns PID, CLONE_THREAD and futexes; NPTL also uses (and relies on) a much wider set of new kernel features, developed as part of this project.One big difference between the two is that NPTL is a 1:1 threading model, whereas NGPT is an M:N threading model (see below). In spite of this, Ulrich's initial benchmarks seem to show that NPTL is indeed much faster than NGPT. (The NGPT team is looking forward to seeing Ulrich's benchmark code to verify the result.) FreeBSD threading supportFreeBSD supports both LinuxThreads and a userspace threading library. Also, a M:N implementation called KSE was introduced in FreeBSD 5.0. For one overview, see www.unobvious.com/bsd/freebsd-threads.html.On 25 Mar 2003, Jeff Roberson posted on freebsd-arch: ... Thanks to the foundation provided by Julian, David Xu, Mini, Dan Eischen, and everyone else who has participated with KSE and libpthread development Mini and I have developed a 1:1 threading implementation. This code works in parallel with KSE and does not break it in any way. It actually helps bring M:N threading closer by testing out shared bits. ...And in July 2006, Robert Watson proposed that the 1:1 threading implementation become the default in FreeBsd 7.x: I know this has been discussed in the past, but I figured with 7.x trundling forward, it was time to think about it again. In benchmarks for many common applications and scenarios, libthr demonstrates significantly better performance over libpthread... libthr is also implemented across a larger number of our platforms, and is already libpthread on several. The first recommendation we make to MySQL and other heavy thread users is "Switch to libthr", which is suggestive, also! ... So the strawman proposal is: make libthr the default threading library on 7.x. NetBSD threading supportAccording to a note from Noriyuki Soda:Kernel supported M:N thread library based on the Scheduler Activations model is merged into NetBSD-current on Jan 18 2003.For details, see An Implementation of Scheduler Activations on the NetBSD Operating System by Nathan J. Williams, Wasabi Systems, Inc., presented at FREENIX '02. Solaris threading supportThe thread support in Solaris is evolving... from Solaris 2 to Solaris 8, the default threading library used an M:N model, but Solaris 9 defaults to 1:1 model thread support. See Sun's multithreaded programming guide and Sun's note about Java and Solaris threading.Java threading support in JDK 1.3.x and earlierAs is well known, Java up to JDK1.3.x did not support any method of handling network connections other than one thread per client. Volanomark is a good microbenchmark which measures throughput in messsages per second at various numbers of simultaneous connections. As of May 2003, JDK 1.3 implementations from various vendors are in fact able to handle ten thousand simultaneous connections -- albeit with significant performance degradation. See Table 4 for an idea of which JVMs can handle 10000 connections, and how performance suffers as the number of connections increases.Note: 1:1 threading vs. M:N threadingThere is a choice when implementing a threading library: you can either put all the threading support in the kernel (this is called the 1:1 threading model), or you can move a fair bit of it into userspace (this is called the M:N threading model). At one point, M:N was thought to be higher performance, but it's so complex that it's hard to get right, and most people are moving away from it.
5. Build the server code into the kernelNovell and Microsoft are both said to have done this at various times, at least one NFS implementation does this, khttpd does this for Linux and static web pages, and "TUX" (Threaded linUX webserver) is a blindingly fast and flexible kernel-space HTTP server by Ingo Molnar for Linux. Ingo's September 1, 2000 announcement says an alpha version of TUX can be downloaded from ftp://ftp.redhat.com/pub/redhat/tux, and explains how to join a mailing list for more info. July 20 C++备忘录
在C++中,库的地位是非常高的。C++之父 Bjarne Stroustrup先生多次表示了设计库来扩充功能要好过设计更多的语法的言论。现实中,C++的库门类繁多,解决的问题也是极其广泛,库从轻量级到重量级的都有。不少都是让人眼界大开,亦或是望而生叹的思维杰作。由于库的数量非常庞大,而且限于笔者水平,其中很多并不了解。所以文中所提的一些库都是比较著名的大型库。 C++各大有名库的介绍之C++标准库 标准库中提供了C++程序的基本设施。虽然C++标准库随着C++标准折腾了许多年,直到标准的出台才正式定型,但是在标准库的实现上却很令人欣慰得看到多种实现,并且已被实践证明为有工业级别强度的佳作。 1、Dinkumware C++ Library 参考站点:http://www.dinkumware.com/ P.J. Plauger编写的高品质的标准库。P.J. Plauger博士是Dr. Dobb's程序设计杰出奖的获得者。其编写的库长期被Microsoft采用,并且最近Borland也取得了其OEM的license,在其C/C+ +的产品中采用Dinkumware的库。 2、RogueWave Standard C++ Library 参考站点:http://www.roguewave.com/ 这个库在Borland C++ Builder的早期版本中曾经被采用,后来被其他的库给替换了。笔者不推荐使用。 3、SGI STL 参考站点:http://www.roguewave.com/ SGI公司的C++标准模版库。 4、STLport SGI STL库的跨平台可移植版本。 C++各大有名库的介绍——准标准库Boost Boost库是一个经过千锤百炼、可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。 Boost库由C++标准委员会库工作组成员发起,在C++社区中影响甚大,其成员已近2000人。 Boost库为我们带来了最新、最酷、最实用的技术,是不折不扣的“准”标准库。 Boost中比较有名气的有这么几个库: Regex Spirit Graph Lambda concept check Mpl Thread Python Pool smart_ptr Smart Pointers in Boost,哦,这篇文章可以查到,CUJ是提供在线浏览的。中文版见笔者在《Dr.Dobb's Journal软件研发杂志》第7辑上的译文。 Boost总体来说是实用价值很高,质量很高的库。并且由于其对跨平台的强调,对标准C++的强调,是编写平台无关,现代C++的开发者必备的工具。但是Boost中也有很多是实验性质的东西,在实际的开发中实用需要谨慎。并且很多Boost中的库功能堪称对语言功能的扩展,其构造用尽精巧的手法,不要贸然的花费时间研读。Boost另外一面,比如Graph这样的库则是具有工业强度,结构良好,非常值得研读的精品代码,并且也可以放心的在产品代码中多多利用。 参考站点:http://www.boost.org (国内镜像:http://www.c-view.org/tech/lib/boost/index.htm) C++各大有名库的介绍——GUI 在众多C++的库中,GUI部分的库算是比较繁荣,也比较引人注目的。在实际开发中,GUI库的选择也是非常重要的一件事情,下面我们综述一下可选择的GUI库,各自的特点以及相关工具的支持。 1、MFC 大名鼎鼎的微软基础类库(Microsoft Foundation Class)。大凡学过VC++的人都应该知道这个库。虽然从技术角度讲,MFC是不大漂亮的,但是它构建于Windows API 之上,能够使程序员的工作更容易,编程效率高,减少了大量在建立 Windows 程序时必须编写的代码,同时它还提供了所有一般 C++ 编程的优点,例如继承和封装。MFC 编写的程序在各个版本的Windows操作系统上是可移植的,例如,在Windows 3.1下编写的代码可以很容易地移植到 Windows NT 或 Windows 95 上。但是在最近发展以及官方支持上日渐势微。 2、QT Qt是Trolltech公司的一个多平台的C++图形用户界面应用程序框架。它提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能。Qt是完全面向对象的很容易扩展,并且允许真正地组件编程。自从1996年早些时候,Qt进入商业领域,它已经成为全世界范围内数千种成功的应用程序的基础。 Qt也是流行的Linux桌面环境KDE 的基础,同时它还支持Windows、Macintosh、Unix/X11等多种平台。 3、WxWindows 跨平台的GUI库。因为其类层次极像MFC,所以有文章介绍从MFC到WxWindows的代码移植以实现跨平台的功能。通过多年的开发也是一个日趋完善的GUI库,支持同样不弱于前面两个库。并且是完全开放源代码的。新近的C++ Builder X的GUI设计器就是基于这个库的。 4、Fox 参考网站:http://www.fox-toolkit.org/ 开放源代码的GUI库。作者从自己亲身的开发经验中得出了一个理想的GUI库应该是什么样子的感受出发,从而开始了对这个库的开发。有兴趣的可以尝试一下。 5、WTL 基于ATL的一个库。因为使用了大量ATL的轻量级手法,模板等技术,在代码尺寸,以及速度优化方面做得非常到位。主要面向的使用群体是开发COM轻量级供网络下载的可视化控件的开发者。 6、GTK 参考网站:http://gtkmm.sourceforge.net/ GTK是一个大名鼎鼎的C的开源GUI库。在Linux世界中有Gnome这样的杀手应用。而Qt就是这个库的C++封装版本。 C++各大有名库的介绍——网络通信 1、ACE 参考网站:http://www.cs.wustl.edu/~schmidt/ACE.html C++库的代表,超重量级的网络通信开发框架。ACE自适配通信环境(Adaptive Communication Environment)是可以自由使用、开放源代码的面向对象框架,在其中实现了许多用于并发通信软件的核心模式。ACE提供了一组丰富的可复用C++ 包装外观(Wrapper Facade)和框架组件,可跨越多种平台完成通用的通信软件任务,其中包括:事件多路分离和事件处理器分派、信号处理、服务初始化、进程间通信、共享内存管理、消息路由、分布式服务动态(重)配置、并发执行和同步,等等。 2、StreamModule 参考网站:http://www.omnifarious.org/StrMod 设计用于简化编写分布式程序的库。尝试着使得编写处理异步行为的程序更容易,而不是用同步的外壳包起异步的本质。 3、SimpleSocket 参考网站:http://home.hetnet.nl/~lcbokkers/simsock.htm 这个类库让编写基于socket的客户/服务器程序更加容易。 4、A Stream Socket API for C++ 参考网站:http://www.pcs.cnu.edu/~dgame/sockets/socketsC++/sockets.html 又一个对Socket的封装库。 C++各大有名库的介绍——XML 1、Xerces 参考网站:http://xml.apache.org/xerces-c/ Xerces-C++ 是一个非常健壮的XML解析器,它提供了验证,以及SAX和DOM API。XML验证在文档类型定义(Document Type Definition,DTD)方面有很好的支持,并且在2001年12月增加了支持W3C XMLSchema 的基本完整的开放标准。 2、XMLBooster 参考网站:http://www.xmlbooster.com/ 这个库通过产生特制的parser的办法极大的提高了XML解析的速度,并且能够产生相应的GUI程序来修改这个parser。在DOM和SAX两大主流XML解析办法之外提供了另外一个可行的解决方案。 3、Pull Parser 参考网站:http://www.extreme.indiana.edu/xgws/xsoap/xpp 这个库采用pull方法的parser。在每个SAX的parser底层都有一个pull的parser,这个xpp把这层暴露出来直接给大家使用。在要充分考虑速度的时候值得尝试。 4、Xalan 参考网站:http://xml.apache.org/xalan-c/ Xalan是一个用于把XML文档转换为HTML,纯文本或者其他XML类型文档的XSLT处理器。 5、CMarkup 参考网站:http://www.firstobject.com/xml.htm 这是一种使用EDOM的XML解析器。在很多思路上面非常灵活实用。值得大家在DOM和SAX之外寻求一点灵感。 6、libxml++ http://libxmlplusplus.sourceforge.net/ libxml++是对著名的libxml XML解析器的C++封装版本。 C++各大有名库的介绍——科学计算 1、Blitz++ 参考网站:http://www.oonumerics.org/blitz Blitz++ 是一个高效率的数值计算函数库,它的设计目的是希望建立一套既具像C++ 一样方便,同时又比Fortran速度更快的数值计算环境。通常,用C++所写出的数值程序,比 Fortran慢20%左右,因此Blitz++正是要改掉这个缺点。方法是利用C++的template技术,程序执行甚至可以比Fortran更快。 Blitz++目前仍在发展中,对于常见的SVD,FFTs,QMRES等常见的线性代数方法并不提供,不过使用者可以很容易地利用Blitz++所提供的函数来构建。 2、POOMA 参考网站:http://www.codesourcery.com/pooma/pooma POOMA是一个免费的高性能的C++库,用于处理并行式科学计算。POOMA的面向对象设计方便了快速的程序开发,对并行机器进行了优化以达到最高的效率,方便在工业和研究环境中使用。 3、MTL 参考网站:http://www.osl.iu.edu/research/mtl Matrix Template Library(MTL)是一个高性能的泛型组件库,提供了各种格式矩阵的大量线性代数方面的功能。在某些应用使用高性能编译器的情况下,比如Intel的编译器,从产生的汇编代码可以看出其与手写几乎没有两样的效能。 4、CGAL 参考网站:www.cgal.org Computational Geometry Algorithms Library的目的是把在计算几何方面的大部分重要的解决方案和方法以C++库的形式提供给工业和学术界的用户。 C++各大有名库的介绍——游戏开发 1、Audio/Video 3D C++ Programming Library 参考网站:http://www.galacticasoftware.com/products/av/ 2、KlayGE 参考网站:http://home.g365.net/enginedev/ 国内游戏开发高手自己用C++开发的游戏引擎。KlayGE是一个开放源代码、跨平台的游戏引擎,并使用Python作脚本语言。KlayGE在LGPL协议下发行。感谢龚敏敏先生为中国游戏开发事业所做出的贡献。 3、OGRE OGRE(面向对象的图形渲染引擎)是用C++开发的,使用灵活的面向对象3D引擎。它的目的是让开发者能更方便和直接地开发基于3D硬件设备的应用程序或游戏。引擎中的类库对更底层的系统库(如:Direct3D和OpenGL)的全部使用细节进行了抽象,并提供了基于现实世界对象的接口和其它类。 C++各大有名库的介绍——线程 1、C++ Threads 参考网站:http://threads.sourceforge.net/ 这个库的目标是给程序员提供易于使用的类,这些类被继承以提供在Linux环境中很难看到的大量的线程方面的功能。 2、ZThreads 参考网站:http://zthread.sourceforge.net/ 一个先进的面向对象,跨平台的C++线程和同步库。 C++各大有名库的介绍——序列化 1、s11n 参考网站:http://s11n.net/ 一个基于STL的C++库,用于序列化POD,STL容器以及用户定义的类型。 2、Simple XML Persistence Library 参考网站:http://sxp.sourceforge.net/ 这是一个把对象序列化为XML的轻量级的C++库。 C++各大有名库的介绍——字符串 1、C++ Str Library 参考网站:http://www.utilitycode.com/str/ 操作字符串和字符的库,支持Windows和支持gcc的多种平台。提供高度优化的代码,并且支持多线程环境和Unicode,同时还有正则表达式的支持。 2、Common Text Transformation Library 参考网站:http://cttl.sourceforge.net/ 这是一个解析和修改STL字符串的库。CTTL substring类可以用来比较,插入,替换以及用EBNF的语法进行解析。 3、GRETA 参考网站:http://research.microsoft.com/projects/greta/ 这是由微软研究院的研究人员开发的处理正则表达式的库。在小型匹配的情况下有非常优秀的表现。 C++各大有名库的介绍——综合 1、P::Classes 参考网站:http://pclasses.com/ 一个高度可移植的C++应用程序框架。当前关注类型和线程安全的signal/slot机制,i/o系统包括基于插件的网络协议透明的i/o架构,基于插件的应用程序消息日志框架,访问sql数据库的类等等。 2、ACDK - Artefaktur Component Development Kit 参考网站:http://acdk.sourceforge.net/ 这是一个平台无关的C++组件框架,类似于Java或者.NET中的框架(反射机制,线程,Unicode,废料收集,I/O,网络,实用工具,XML,等等),以及对Java, Perl, Python, TCL, Lisp, COM 和 CORBA的集成。 3、dlib C++ library 参考网站:http://www.cis.ohio-state.edu/~kingd/dlib/ 各种各样的类的一个综合。大整数,Socket,线程,GUI,容器类,以及浏览目录的API等等。 4、Chilkat C++ Libraries 参考网站:http://www.chilkatsoft.com/cpp_libraries.asp 这是提供zip,e-mail,编码,S/MIME,XML等方面的库。 5、C++ Portable Types Library (PTypes) 参考网站:http://www.melikyan.com/ptypes/ 这是STL的比较简单的替代品,以及可移植的多线程和网络库。 6、LFC 参考网站:http://lfc.sourceforge.net/ 哦,这又是一个尝试提供一切的C++库 C++各大有名库的介绍——其他库 1、Loki 参考网站:http://www.moderncppdesign.com/ 哦,你可能抱怨我早该和Boost一起介绍它,一个实验性质的库。作者在loki中把C++模板的功能发挥到了极致。并且尝试把类似设计模式这样思想层面的东西通过库来提供。同时还提供了智能指针这样比较实用的功能。 2、ATL ATL(Active Template Library)是一组小巧、高效、灵活的类,这些类为创建可互操作的COM组件提供了基本的设施。 3、FC++: The Functional C++ Library 这个库提供了一些函数式语言中才有的要素。属于用库来扩充语言的一个代表作。如果想要在OOP之外寻找另一分的乐趣,可以去看看函数式程序设计的世界。大师Peter Norvig在 “Teach Yourself Programming in Ten Years”一文中就将函数式语言列为至少应当学习的6类编程语言之一。 4、FACT! 参考网站:http://www.kfa-juelich.de/zam/FACT/start/index.html 另外一个实现函数式语言特性的库 5、Crypto++ 提供处理密码,消息验证,单向hash,公匙加密系统等功能的免费库。 还有很多非常激动人心或者是极其实用的C++库,限于我们的水平以及文章的篇幅不能包括进来。在对于这些已经包含近来的库的介绍中,由于并不是每一个我们都使用过,所以难免有偏颇之处,请读者见谅。 1、Bjarne Stroustrup http://www.research.att.com/~bs/ 2、Stanley B. Lippman http://blogs.msdn.com/slippman/ (中文版) http://www.zengyihome.net/slippman/index.htm 3、Scott Meyers 4、David Musser http://www.cs.rpi.edu/~musser/ 5、Bruce Eckel http://blog.csdn.net/beckel Bruce Eckel 博客中文版 6、Nicolai M. Josuttis 7、Herb Sutter http://blog.csdn.net/hsutter/ Herb Sutter 中文博客 8、Andrei Alexandrescu http://www.moderncppdesign.com
9、 侯捷先生
在如下的库支持下,开发的系统可以很方便移植到当前大部分平台上运行而无需改动,只需在对应的平台下 用你喜欢的编译器重新编译即可。 经典的C++库: Boost---------准标准库, 功能强大 涉及能想的到的大部分非特别领域的算法,有一个大的C++社区支持。 WxWindows-----功能强大的跨平台GUI库 ,它的功能和结构都类似 MFC,故原则上可以通过WxWindows把现有MFC程序移植到非Win平台下。 Blitz---------高效率的数值计算函数库 ,你可以订制补充你需要的算法。 Log4cpp-------日志处理 ,功能类似java中的log4j。 ACE-----------自适应通讯环境, 重量级的通讯环境库。 Crypto++ -----加/解密算法库, 非常专业的C++ 密码学函式库。 CppUnit --- 一个c++的单元测试框架 类似 java 的JUnit。 Loki ------- 一个实验性质的库,尝试把类似设计模式这样思想层面的东西通过库来提供,他是C++的一个模板库,系C++"贵族", 它把C++模板的功能发挥到了极致。 学术性的C++库: FC++ --------The Functional C++ Library ,用库来扩充语言的一个代表作 ,模板库。 CGAL ------- Computational Geometry Algorithms Library计算几何方面的大部分重要的解决方案和方法以C++库的形式提供给工业和学术界的用户。 其它目前我感觉还不是很爽的C++库: Doxygen ----注释文档生成工具 ,可恨的是我找不到 windows版本。 QT ----------大名顶顶的一个多平台的C++图形用户界面应用程序框架(GUI库)可气的是他的 Windows版 是商业发布的要付费。 xml4c--------IBM开发的XML Parser,系超重量级的, 适用大型应用中, 其DLL有 12M,恐怖吧。 Xerces c++ --Apache的XML项目, 但 只支持少数的字符编码,如ASCII,UTF-8,UTF-16等,不能处理包含中文字符的XML文档。 XMLBooster ----- 也是一种 XML的 解析工具。 Fox -------又一种开放源代码(C++)的GUI库,功能不是很强。 C++开发环境(Win平台下除了 Visual C++ 和 Borland C++以外的): Cygwin --------Windows下的一个Unix仿真环境。 MinGW --------GCC的一个Windows移植版本。 Dev C++ -------- 一个C/C++ 的集成开发环境,在Windows上的C++编译器一直和标准有着一段距离的时候,GCC就是一个让Windows下开发者流口水的编译器。 Eclipse-CDT ----IMB 开发的一个集成开发环境,一般用来作为Java 开发环境,但由于Eclipse 是通过插件体系来扩展功能,这里我们 安装 CDT插件后,就可以用来作为C++ 的集成开发环境。 经典的C++库在VC++.net中应用的配置 1. STLport (SGI STL库的跨平台可移植版本。) vc71环境中编译安装 头文件在 %STLport_root%/include\stlport 头文件添加方法如: 2 WxWindows (跨平台的GUI库) 因为其类层次极像MFC,所以有文章介绍从MFC到WxWindows的代码移植以实现跨平台的功能。通过多年的开发也是一个日趋完善的GUI库,支持同样不弱于前面两个库。并且是完全开放源代码的。新近的C++ Builder X的GUI设计器就是基于这个库的。 vc71环境中编译安装 include头文件: include\wx 头文件在 %wxWidgets_root%/include\wx 头文件添加方法如: 3 boost (“准”标准库) Boost库是一个经过千锤百炼、可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的发动机之一。 Boost库由C++标准委员会库工作组成员发起,在C++社区中影响甚大,其成员已近2000人。 Boost库为我们带来了最新、最酷、最实用的技术,是不折不扣的“准”标准库。 vc71环境中编译安装 首先进入 tools\build\jam_src 运行 build.bat 得到一个工具: bjam.exe 头文件在 %boost_root%/boost 头文件添加方法如: Boost中比较有名气的有这么几个库: Boost总体来说是实用价值很高,质量很高的库。并且由于其对跨平台的强调,对标准C++的强调,是编写平台无关,现代C++的开发者必备的工具。但是Boost中也有很多是实验性质的东西,在实际的开发中实用需要谨慎。并且很多Boost中的库功能堪称对语言功能的扩展,其构造用尽精巧的手法,不要贸然的花费时间研读。Boost另外一面,比如Graph这样的库则是具有工业强度,结构良好,非常值得研读的精品代码,并且也可以放心的在产品代码中多多利用。 4 blitz (高效率的数值计算函数库) Blitz++ 是一个高效率的数值计算函数库,它的设计目的是希望建立一套既具像C++ 一样方便,同时又比Fortran速度更快的数值计算环境。通常,用C++所写出的数值程序,比 Fortran慢20%左右,因此Blitz++正是要改掉这个缺点。方法是利用C++的template技术,程序执行甚至可以比Fortran更快。 Blitz++目前仍在发展中,对于常见的SVD,FFTs,QMRES等常见的线性代数方法并不提供,不过使用者可以很容易地利用Blitz++所提供的函数来构建。 vc71环境中编译安装 将 blitz-0.8/Blitz-VS.NET.zip 解压到当前目录下 头文件在 %blitz_root%/blitz 头文件添加方法如: 5 log4cpp (日志处理) Log4cpp 是 Log4J 的 C++ 移植版本,开放源代码并且完全免费。与 Log4J 能够跨平台一样,Log4cpp也致力于写出跨平台的 C++ 程序。Log4cpp 主要是用于 C++ 程序中写 log 文件,与此同时,Log4cpp 中有很多有用的类库,对于写跨平台 C++ 程序的人来说,可以直接拿来用,或者作为自己写跨平台类的参考。 Log4cpp 中的跨平台类库有明显的 Java 痕迹,比如 Class、Object 、Loader、Locale 等类。 Log4cpp Log4cpp 中的跨平台类库主要有: 信号类:Condition(broadcast,signal,wait),CriticalSection (lock,unlock),WaitAccess, 网络类:InetAddress,Socket,ServerSocket,DatagramSocket,SocketInputStream, 日期类:DateFormat,DateTimeDateFormat,System(currentTimeMillis) 文件类:FileWatchdog(doOnChange) 内存操作类:基于引用计数机制的智能指针 ObjectPtrT 线程类:Thread(start,run,join) vc71环境中编译安装 打开 msvc6 编译即可 头文件在 %log4cpp_root%/include\log4cpp 头文件添加方法如: 6 Crypto++ 加/解密算法库 提供处理密码,消息验证,单向hash,公匙加密系统等功能的免费库。 Crypto++ 是一个非常专业的C++ 密码学函式库,几乎在密码学里头常见的演算法都可以在Crypto++ vc71环境中编译安装 直接通过 cryptest.dsw 相关的库 头文件在 %cryptopp_root% 头文件添加方法如: 7 ACE ------http://www.cs.wustl.edu/~schmidt/ACE.html C+ +库的代表,超重量级的网络通信开发框架。ACE自适配通信环境(Adaptive Communication Environment)是可以自由使用、开放源代码的面向对象框架,在其中实现了许多用于并发通信软件的核心模式。ACE提供了一组丰富的可复用C++ 包装外观(Wrapper Facade)和框架组件,可跨越多种平台完成通用的通信软件任务,其中包括: 事件多路分离和事件处理器分派、信号处理、服务初始化、进程间通信、共享内存管理、消息路由、分布式服务动态(重)配置、并发执行和同步,等等。 8. CppUnit 一个c++的单元测试框架,可以通过派生测试类的方式,定制具体的测试方案。xUnit家族的一员,从JUnit移植而来,JUnit是Java语言的单元测试框架。 vc71环境中编译安装 直接通过 CppUnitLibraries.dsw 编译相关的库 头文件在 %cppunit_root%/cppunit 头文件添加方法如: 9 Loki 其实可和Boost一起介绍它,一个实验性质的库。作者在loki中把C++模板的功能发挥到了极致。并且尝试把类似设计模式这样思想层面的东西通过库来提供。同时还提供了智能指针这样比较实用的功能。 该库系模板库,库本身无需编译,在你的工程文件中 引用头文件就可以使用,如果 你直接或间接使用了small object,那你需要在你的工程文件加上SmallObj.cpp;如果 你直接或间接使用了Singletons,那你需要在你的工程文件 加上 Singleton.cpp 学术性的C++库的详细介绍: 这个库提供了一些函数式语言中才有的要素。属于用库来扩充语言的一个代表作。如果想要在OOP之外寻找另一分的乐趣,可以去看看函数式程序设计的世界。大师Peter Norvig在 “Teach Yourself Programming in 当前版本:FC++.1.5.zip 2 CGAL Computational Geometry Algorithms Library的目的是把在计算几何方面的大部分重要的解决方案和方 当前版本:CGAL-3.1.zip 头文件在 %CGAL_root%/include/CGAL 头文件添加方法如: 其它目前我感觉还不是很爽的C++库的详细介绍: 注释文档生成工具,较之Doc++功能更为齐全,可以生成包括HTML、PDF、RTF在内的多种格式的文档,并有GUI界面,除了支持c/c++语言外,还支持IDL、java、PHP、c#等。 2、 QT(windows版要付钱) Qt是Trolltech公司的一个多平台的C++图形用户界面应用程序框架。它提供给应用程序开发者建立艺术级的图形用户界面所需的所用功能。Qt 是完全面向对象的很容易扩展,并且允许真正地组件编程。自从1996年早些时候,Qt进入商业领域,它已经成为全世界范围内数千种成功的应用程序的基础。 Qt也是流行的Linux桌面环境KDE 的基础,同时它还支持Windows、Macintosh、Unix/X11等多种平台。 3、Fox 开放源代码的GUI库。作者从自己亲身的开发经验中得出了一个理想的GUI库应该是什么样子的感受 4 xml4c IBM的XML Parser,用c++语言写就,功能超级强大。号称支持多达100种字符编码,能够支持中文,适合于大规模的xml应用。若只是很小范围的应用,则非最佳选择,毕竟,你需要“背负”约12M左右的dll的沉重负担。 5 Xerces c++ Apache的XML项目,同样是c++ 实现,来源于IBM的xml4c,因此编程接口也是和xml4c一致的。但是目前只支持少数的字符编码,如ASCII,UTF-8,UTF-16等,不能处理包含中文字符的XML文档。 Xerces-C++ 是一个非常健壮的XML解析器,它提供了验证,以及SAX和DOM API。XML验证在文档类型定义(Document Type Definition,DTD)方面有很好的支持,并且在2001年12月增加了支持W3C XML Schema的基本完整的开放标准。 6 XMLBooster 这个库通过产生特制的parser的办法极大的提高了XML解析的速度,并且能够产生相应的GUI程序来修改这个parser。在DOM和SAX两大主流XML解析办法之外提供了另外一个可行的解决方案。 C++开发环境(Win平台下除了 Visual C++ 和 Borland C++以外的): 1. Cygwin (Windows下的一个Unix仿真环境) 这个Cygwin的一部分是GCC的另外一个Windows移植版本,Cygwin是Windows下的一个Unix仿真环境。严格的说是模拟GNU的环境,这也就是"Gnu's Not Unix"要表达的意思。 至Cygwin的網站http://www.cygwin.com/下載安裝程式setup.exe,可直接點選執行或先行下載至個人電腦後再執行。目前我已经下载到本地了,直接安装即可。 2. MinGW (GCC的一个Windows移植版本) 1)http://sourceforge.net/projects/mingw 直接访问的,点击 Files,然后下载以下文件:MinGW-3.1.0-1.exe, mingw32-make-3.80.0-3.exe。 (以上的设置已经足够。不过为了求新,我是同时下载了 gcc-core-3.4.2-20040916-1.tar.gz,mingw-runtime-3.5.tar.gz 和 w32api-3.1.tar.gz,将它们直接解压到 C:/MinGW 下更新旧的文件。不过这对这篇文章本身没有任何影响。新旧两种配置我都测试过。) 安装次序: 3)准备MinGW 用户开发的命令行环境(一个批处理) @rem @set PATH=%MINGW_ROOT%\BIN;%PATH% 3. Dev C++ (一个C/C++ 的集成开发环境) GCC是一个很好的编译器。在Windows上的C++编译器一直和标准有着一段距离的时候,GCC就是一个让Windows下开发者流口水的编译器。Dev-C++就是能够让GCC跑在Windows下的工具,作为集成开发环境,还提供了同专业IDE相媲美的语法高亮,代码提示,调试等功能。由于使用Delphi开发,占用内存少,速度很快,比较适合轻量级的学习和使用。 可以使用 MinGW-GCC 作为它的编译器 4 Eclipse-CDT 游戏开发 Audio/Video 3D C++ Programming Library ------http://www.galacticasoftware.com/products/av/ AV3D是一个跨平台,高性能的C++库。主要的特性是提供3D图形,声效支持(SB,以及S3M),控制接口(键盘,鼠标和遥感),XMS。 KlayGE ------http://home.g365.net/enginedev/ 国内游戏开发高手自己用C++开发的一个开放源代码、跨平台的游戏引擎。KlayGE是一个开放源代码、跨平台的游戏引擎,并使用Python作脚本语言。KlayGE在LGPL协议下发行。感谢龚敏敏先生为中国游戏开发事业所做出的贡献。 OGRE ------http://www.ogre3d.org OGRE(面向对象的图形渲染引擎)是用C++开发的,使用灵活的面向对象3D引擎。它的目的是让开发者能更方便和直接地开发基于3D硬件设备的应用程序或游戏。引擎中的类库对更底层的系统库(如:Direct3D和OpenGL)的全部使用细节进行了抽象,并提供了基于现实世界对象的接口和其它类。 June 26 重温人生三重境界
古之成大事业者,成大学问者必经人生三重境界 第一重境界:昨夜西风凋碧树,独上高楼,望断天涯路. 第二重境界:衣带渐宽终不悔,为伊消得人憔悴 第三重境界:梦里寻他千百度,蓦然回首,那人确在,灯火阑珊处 -----王国维 November 22 borland -> CodeGearhttp://www.codegear.com/CodeGear := TCompany.Create();CodeGear = new TCompany();如果您今天沒到Borland的网站,請花点时间去看看。Delphi,C++Builder,JBuilder和InterBase等伟大的开发工具的所有者已经从borland变为CodeGear了,一个时代终于过去了。 到底是技术改变了市场?还是市场改变了技术? November 19 中国式创业最容易犯的100个错误生为商人没有错,但商旅途中一定会时常犯错。错而能知错而能改错,则善莫大焉,企业幸甚!
1、哥们式合伙,仇人式散伙 中国企业最常见的聚散模式——公司创办之初,合伙者们以感情和义气去处理相互关系,制度和股权或者没有确定,或者有而模糊。 企业做大后,制度变得重要,利益开始惹眼,于是"排座次、分金银、论荣辱",企业不是剑拔弩张内耗不止,便是梁山英雄流云四散。 2、盲目崇拜社会关系 关系推动生产力,因此社会关系的建立和运用是商人必要的能力;但关系不等于生产力,把社会关系当成解决企业发展所有问题的灵丹妙药,忘记了"打铁还须自身硬"的真理,则企业本末倒置,大患迟早降临。 3、迷信"空降兵" 都说"外来的和尚会念经"。正确的做法应该是:不可不用"空降兵",不可乱用"空降兵",不可全用"空降兵"。这方面中国企业的教训已经太多,可永远会有人情不自禁地做错:放弃身边的人才,迷信远方的大师。 4、企业支柱亲信化 一个靠人控制人,而不是靠制度控制人的中国式组织。起源于农民打江山的传统,泛滥于信任危机加重的当代商业社会,是中国以情感为纽带的企业走向规范治理的主要瓶颈。 5、面子大于真理 面子是:我已经这样定了,而且全世界的人都知道了;真理是:这个方向是一条曲曲折折的弯路,而且很可能此路不通。爱面子的老板说:他*的就这么去,谁不执行谁下课,玩也要玩到底。 6、商业式迷信 罗盘神签加卦相,诚惶诚恐,测风水测人才;香火缭绕进庙堂,顶礼膜拜,求机运求财富。商海无情,翻云覆雨,谁来保佑? 7、知人而不自知 看人头头是道,看己昏头昏脑。从来没有看清自己在行业中领先的关键因素,一段成功史,满脑糊涂账。也因此,从来没有清晰的战略规划:坚持什么,改进什么;如何创新,如何固守。 8、习惯性信用缺失 说话不算数、合同不算数、承诺不算数,这几乎是中国商人部落最常见的景观。对内,规则计划变幻无穷,今天立,明天改,后天再改,手下无所适从;对外,合同承诺一张废纸,视情况涂抹、打折甚至撕毁,合作者有去无回。 9、匪文化心态 民营企业老板如山寨大王,生于青萍之末,长于江湖之野,走的是匪文化路线:关上山寨大门,老子天下第一;冲出山寨掠财,碰壁拐弯,见缝就钻。图的是人生痛快,少一份使命精神;既没有经济上的长远目标,也没有文化上的成熟主张。 10、阶级斗争企业化 企业内部可以搞平衡,但不可以搞斗争。"文化大革命"告诉我们,"挑起群众斗群众"最后所失去的,是企业的效率和凝聚力。 11、沉湎酒色
有人因为无力控制欲望沉湎酒色;有人因为事业再无激情沉湎酒色;有人因为"过去吃了苦",怀着找补回来的心态沉湎酒色;有人因为"人生苦短",信奉找钱是为了享受的哲学沉湎酒色。
12、投资冒险主义
拿自己"吃稀饭"的钱去搞投资,或者借来甚至骗来别人"吃稀饭"的钱去搞投资,所谓成败荣辱在此一举,身家性命系于一线,战战兢兢,急功近利,举止失措,焉能不败?
13、投资经验主义
在另一个时间、另一个市场、另一个行业,面对另一群员工或消费者,以当年的感觉投资、布局、生产、销售。指挥还是昨天的指挥,音乐还是相同的音乐,可这一次为何起舞者寥寥数人?
14、投资极端主义
三月前兴奋地投下钱来,三月后沮丧地要抽身离去,前脚踩油门,后脚踩刹车,企业振荡,落英缤纷......投资者的常见毛病,主要原因是对产业投资纵深化及企业竞争复杂化的估计不足。
15、人力资源幻觉
一方面永远高估员工的高度,一方面永远低估员工的水平。
16、过度追求系统平衡
企业总是由各个系统各个部门组成,它们彼此之间需要有一种动态的平衡。但老板过分看重平衡,在奖惩政策、人员提升、部门权限、业绩考核等方面一味强调"一碗水端平",最后优者不奖、错者不罚,所有部门都吃大锅饭,企业所要的平衡反而荡然无存。
17、抬头批判潜规则,低头猛搞潜规则
从不认为自己对理想社会的到来负有身体力行的责任。
18、完美主义群众化
完美主义不是坏事,但若将其扩大化,就会给个人和企业带来无尽的烦恼与麻烦。
完美主义的老板总想达成最高的目标。他们对下属"高标准,严要求",因为求之深,所以责之切,总是有太高的眼光、太多的挑剔、太多的责备。
19、附庸风雅
一窝蜂登山,一窝蜂打高尔夫,一窝蜂EMBA,一窝蜂墙上挂艺术品......值得指出的是,这一切并不是因为爱好或需求,而是因为模仿及炫耀。
20、不学无术
老板每天要处理各种各样的情况,事情一多,就不愿意学习了。很多人不读书,不看报,不看电视,不上网,更不愿意专门花时间参加培训。在他们看来,市场是最好的老师,学习只是装点门面的过场罢了。由于长期沉溺于小圈子,信息封闭,知识结构老化,最终要么被市场淘汰,要么被主流遗忘。
21、公司小皇帝心态
人人三呼万岁,事事溜须拍马,恭顺者提拔,意见者遭殃,"我的地盘我作主"。
22、擦边球情结
总是在法律允许和禁止的边缘徘徊,总是希望利用政策的漏洞渔利。这些历史上打惯了擦边球的人们,在不用擦边更有胜算的新规则里,反而显得茫然失措,举手投足连连丢分。
23、强于战术弱于战略
这群商人的才华,几乎都表现在挽救一个错误的战略计划上了。
24、强于战略弱于战术
通俗地说,是想象力很够,行动力不够。当然按照他们自己的说法是,一个伟大的构想总是因为执行不到位而夭折。
25、强烈的政治情节
提到政治就兴奋,靠近政治就愉悦,企业里面玩政治,人生目标搞政治;经商只是为当官做准备——属中国传统价值观"当官才能光宗耀祖"的新时代折射。然而经验证明,政治是把双刃剑,一个优秀的企业家可以懂政治、学政治,但不可玩政治。
26、自我膨胀
这类商人的逻辑是:财富比别人多,所以才能就比别人够,见识就比别人广,基因就比别人好......以此逻辑推演,一个人的自信心会在很短的时间里爆棚,一个人的命运也常在同一时间转轨。
27、迷恋赌博
人皆有赌性,富于冒险精神的商人或许更甚。但敢冒风险和迷恋赌博是两回事。所谓小赌怡情,大赌乱性;赌性是一朵恶之花,一遇温床便奢靡开放,不加节制就可能毁掉一切。
28、生活习惯不健康
总是第二天开始锻炼,总是旅游的时候最累,总是一应酬就喝,一喝酒就醉,事业充满激情,身体充满疲惫......
29、法制观念淡薄
原因如下:一,有钱难道不能搞定一切?二,这事天知地知你知我知,怎会翻船?三,别人都这么干,我为什么不能?四,天啦,这点小事也算违法?
30、武大郎开店
不能容忍部下在某一方面比自己强,为了保持心理上的优越感和便于管理,喜欢招聘和使用不如自己的人。这类企业往往缺乏活力,在竞争中越来越难以胜出。
31、漠视社会公德
尊老爱幼,扶贫济困;遵守交通规则,维护公共秩序;不骄不躁不蛮横,节水节电节资源......今天,你忘记了吗?
32、提着裤子找厕所
做企业没有预见性,事到临头才忙找对策。具体表现在:不储备人才,不建立良好和谐的公共关系,不开发换代产品,不准备足够的现金流等。
33、重业务轻财务
民营企业老板大都是跑业务出身,或至少是很长时间战斗在企业营销第一线。这决定了他们的潜意识:市场是决定企业生存与发展的根本动力,当领导市场知识比财务知识更重要,搞管理销售报表比财务报表更诱人,做决策来自市场的调查数据比来自财务的预算核算更关键。
34、个人表现主义
在一个企业里,我才是红花,大家都是绿叶;在一个圈子里,我才是中心,大家都是配角——否则向内就会"怒从心中起,恶向胆边生";向外就会"全无兴趣,恕不奉陪"。其客观效果是,企业越做越难,圈子越扯越小。
35、集团综合症
据说现在全世界号称"集团"的公司加在一起,都没有中国多——几十上百万净资产的企业老板号称某某集团董事长的,在我们身边比比皆是。这是中国人虚张声势、不顾信用、好大喜功的企业化写照。
36、速度幻觉症
以个人的才能及工作绩效衡量所有人,以一个小团队的状态衡量全社会,从而误判投资回报周期,错估目标达成速度。
37、企业掌控神经质
很多老板常常疑神疑鬼,怀疑这个对他不忠,那个在干私活;怀疑这个在挖墙角,那个在磨洋工。一天到晚都认为他的下属总是向他隐瞒了什么东西。不信任副手,不信任合作伙伴,不信任财务,不信任采购人员,不信任基层员工。自己累,员工也累。
38、会议综合症
有事开会,无事也开会;大事开会,小事也开会。仿佛只有通过会议,老板和员工才能沟通,企业的控制才能实现,老板的意志才能贯彻。
然而在很多企业,无效而过多的会议,已经构成它们最大的成本浪费。
39、大企业形态小企业心态
规模已经够大,心态依然很小:没有战略,缺乏人才,对员工能省则省,科研费用能推就推。本来已有大资本,偏偏又是土财主。因为来不及知道怎么做大企业,于是往往在堂皇外表下面露出留着泥巴的脚。一旦有风吹草动,那颗小小的心脏就会被庞大的身躯累死。
40、营销唯一症
企业的生死成败、资源重心,全压在市场营销一个环节上,一荣俱荣一损俱损。经验证明,这类企业即便超速成长也多如"塑料大棚",抗风险能力极其脆弱,风光三年以上者寥寥无几。
41、制度管理教条主义
生搬硬套西方企业理论,忽略中国企业本土文化背景,企业管理全盘西化、制度化、文本化。其结果是企业形态不伦不类、企业文化不洋不土、企业命运不生不死。
42、管理幅度过大
一项研究证明,一个人最多管十几个人,多了就会乱套,所以事事抓在手上不如建立一套规则把权力放下去,要不然累垮了自己,也拖垮了企业。
43、形式主义借尸还魂
二十年前打破铁饭碗,冲破形式主义而成长起来的民营企业家,随着企业规模扩大年岁增长,论资排辈日趋固化,等级制度日趋习惯,企业理念日趋模糊,企业文化日趋空洞——"百年钟馗变钟鬼",形式主义又回来了。
44、缺乏民主
制定了一大堆政策、制度,要求员工绝对执行,到了自己面前却一推再推;大会小会上严厉禁止种种不轨行径,一转身自己就成了最大的破坏者。
45、野蛮管理
其中比较容易想到的现象是:粗暴、打骂、体罚、限制人生自由等。比较不容易想到的现象是:从生活、言行、习惯、价值观等方面对员工做过度要求,甚至盲目实行企业军事化管理。这其中隐藏着现代商人必须唾弃封建观念:主宰等于权力,独裁等于效率。
46、项目爱好癖
唰,老板的眼睛放光了!嚯,老板的脸色出彩了!瞧,老板又开始行动了——肯定又在谈项目了。唉,我们公司去年谈了76个项目,落实了一个,至今都还在亏损。
47、企业浮夸风
浮夸风害死人,国家如此,企业也如此。很多企业家喜欢到处吹牛,一些所谓的企业家高峰论坛往往成了数字吹嘘论坛。同时,四处招兵买马,动辄搞跨越式发展,超常规跃进,几年之内要进入世界500强行列。久而久之,形势一片大好,老子天下第一,精神面貌饱满,从上到下陷入自我吹嘘自我满足的陷阱。
48、合作伙伴同质化
中国企业合伙常见病。一群相同气质爱好、能力水平、资源范围的理想主义者共同创业,上路之后才发现,一艘大船的远航既需要舵手,也需要水手,既需要懂天气的,也需要懂水文的......于是结构性失败在所难免。
49、运动式管理
一种典型的头痛医头脚痛医脚式管理。比如纪律不严明了,质量下滑了,营销不得力了,总是靠发动一场企业内部运动来突击解决。企业老板成消防队员,随时扑向失火的角落。最大的好处在于立竿见影;最大的坏处在于扰乱了企业经营的正常轨迹,透支了企业的人力物力财力。
50、泛官僚化
企业内从老板到管理者,每一个人都像计划经济体制下的干部,讲究程序、等级,习惯摆谱、弄权。此类现象严重的企业多半服务心态缺乏,学习能力欠缺,僵化保守直至竞争力丧失。
51、主意太多,朝令夕改
企业三天一小震,五天一大震,再强烈的信心也会全部震散,再优秀的团队也会茫然失措,再结实的建筑也会最终倒塌。
52、忙而效率低下
一个合理的建议是,立即停下你陀螺一样旋转的身体,去海边的沙滩晒着太阳理清以下问题:你的管理链条在哪一个环节开始打滑?你的企业动力是哪一个环节推而不动?哪些事情是必须做的,哪些不是?哪些事情是你应该做的,哪些是你应该授权别人做的?
53、专家依赖症
很多企业家对专家很迷信,事事以专家为准。但专家不是万能,他不可能对所有的事情都了如指掌,难免有局限,特别是在市场经验方面。所以,一旦过于迷信专家,往往会陷入教条化陷阱。
54、好大喜功
1000万的资金要盖70层的高楼;10岁的公司提出5年赶超世界500强的目标;30万身价的老板幻想着激动人心的远景,小项目不愿做大项目做不了......人性的弱点放在商人身上,其结局就更显悲壮。
55、用胆而不用心
中国的企业家从来不缺冒险精神,而是缺精益求精的精神。因此中国的企业从来不缺项目,而是缺把一个项目做到全世界无人能敌的专业精神、境界和才能。
56、只追求有形利益
换句话说就是只追求看得见的投入和产出,绝对的功利主义、实用主义和利润至上心态,有时候令企业丧失的不仅仅是形象,还包括企业的安全、长远的生命力等等。
57、实事求是口头化
民营企业"效率优先"、"一切按市场规律办事"是最大的实事求是。但很多企业真实的情况是"平衡优先","私欲优先",是"一切按照老板的喜好办事","一切按照长官的意志办事"......有人说,这是中国企业滑向"坏的市场经济"之前奏。
58、外行管死内行
企业雪球越滚越大,公司开始分隔为越来越多的精细领域,而每一个领域都需要相应的专业人才去加以管理。此时,创业者已经从原来的内行变成外行,但他仍然保持着内行的心态,用一竿子插到底的方式管理企业。很多时候,企业活力就这样慢慢窒息。
59、习惯性摆阔
前些年脖子上的金项链一个赛一个的粗,这些年屁股下的坐驾一个赛一个的牛;动辄"周末去巴黎购物",聚会永远聊高尔夫球场见闻......殊不知,面子害人,刻意要面子害死人:太工于摆阔的心计,往往让经营瞻前顾后;太重于摆阔的场面,往往让人生如履薄冰。
60、形象即业务,豪华出效益
一种肤浅的创业心态,加浪漫主义的创业形态。主要表现为:办公场地选高档写字楼,员工工资向大公司看齐,出差住四星级宾馆,请客上希尔顿酒店......最终的结果是,别人还没搞懂你的企业是干什么的,你的流动资金已开始告急。
61、摸着石头过大江
中国的民营企业早年习惯"摸着石头过小河",而今天他们要过的是大江,左有国有企业,右有外资公司,它们共同需要的都是现代化的帆船或者快艇。但也有经验主义者,想要"摸着石头过大江",其悲惨结局不问可知。
62、用人才而藐视人才
对于知识型人才,很多老板往往"既爱之,又恨之"。不得不用,却又从内心深处瞧不起他们,"百无一用是书生"的观念根深蒂固。因此在很多中国企业里,人才没有归宿感,老板没有放松感。
63、朋友式管理
在不少企业中,很多中干甚至高管都是和老板一起打天下的元老,碍于情面,老板不好将朋友和下属两种角色截然分开。最后导致老板没有权威,管理层相互较劲,员工无所适从,企业一片混乱。
64、管而不理
管是控制,理是训练;管是压力,理是疏导;管是条条框框中规中矩,理是苦口婆心指引成长。只管不理,企业不是在沉默中爆发,就是在沉默中灭亡。
65、要么迷信媒体,要么藐视媒体
前者最好的例子是秦池酒,盲目追求标王的媒体聚光效应,而终致惨败;后者的代表是德隆,由于不重视和媒体的沟通,结果企业一出事,全国媒体纷纷口诛笔伐,从而让企业的信任危机愈演愈烈。
66、候鸟式投资
这类投资者往往不愿意在一个行业里深耕,只愿意剥取最表面的一层机会,浅尝辄止。尽管投资常有回报,但企业总是做不大,一直在二三流企业的行列徘徊。
67、碰壁拐弯习惯化
一遇到困难,不对问题进行全面的分析,而是马上停止投资,调转方向另寻出路。这类投资者就像含羞草,一有风吹草动马上就缩成一团。这种看似谨慎的做法,往往却因不善于坚持而错过了真正的商业机会。
68、假平等
能干的下属是每个老板都梦寐以求的,但真的出现了能力出众的下属,老板往往又不能正确对待。为了维护表面上的平等,老板常常有意识地将机会让给其他员工,而把能干的人晾在一边。假平等的后果是,既增加了老板的机会成本,又挫伤了那些能力出众者的积极性。
69、总是打精神牙祭
在一些人看来这是惠而不费笼络人心的手段,是企业家不可缺少的画馅饼的才能。但现在的员工们已经越来越不相信它了,尤其当明天已经到来,"精神"并没有变"物质",而老板又在许诺后天的精神牙祭之时。
70、企业激励货币化
初衷是为了将公司做得规范,于是把各种激励政策完全货币化:加班给钱,提出好的建议给钱,互相帮助给钱,节约开支给钱......最后员工养成了习惯,做什么事情都要钱,甚至明明是自己分内的事,不给钱也不去做。
71、以江湖气为荣
耿直、爽快、兄弟多、与某某老大称兄道弟......在很多商人的心中,江湖形象和江湖背景,是一件比阅历背景、学历背景还要重要的事情。
72、听喜不听忧
只喜欢听员工汇报公司的正面消息,而不愿意听公司的负面情况。这是一种微妙的心理,一方面老板不愿意也不相信自己的企业会运作不佳,另一方面又害怕真的出事。最终的结果是人人报喜不报忧,中干会上歌舞升平,企业根基渐渐糜烂。
73、创业情结挥之不去
一家资产过亿的家电企业老板,大到人员招聘,小到办公室购买传真纸都要亲自过问,结果自己一天到晚疲惫不堪,而企业的发展也十分缓慢。这些多为创业型老板。他们对公司上上下下各个环节十分熟悉,对每一个员工甚至管理层都放心不下,总要亲自动手才踏实。
74、盲目做全国市场
想当然地认为只要做全国市场,各地销售额加起来肯定比在一个地方好。他们没有想到本来有限的精力一旦分散,更加不能和对手抗衡;而开拓全国市场,所需要的成本也比做地方市场要高出许多。
75、强于演说而弱于倾听
由于长期处于强势和核心地位,老板通常掌握了更多的话语权。这很容易让他们习惯性地表达自己的主张,而不注意倾听下属乃至朋友的意见。其实,上帝给了我们两只耳朵,一张嘴巴,就是暗示我们多倾听少定论。
76、过分维护个人权威
在员工面前永远一副冰冷的面孔,从来不在大众场合露出笑脸,说话喜欢用祈使语气,从来不主动和员工打招呼,有意识地和员工保持距离。
77、装腔作势
哎呀,胡总啊,来不了啊,今晚赵市长要请我吃饭,吃饭后电视台记者要来采访......哎呀,胡总啊,谁叫我们是兄弟呢,一定来一定来!市长的饭?不吃了不吃了,电视台也让他们明天再来......
78、一利遮百丑
片面追求利润,把现实的利润当成企业惟一重要的事情,不注重长期战略;一味压缩企业成本、降低员工待遇;忽视科研,不投入或少投入研发经费。老板应该注意对企业各个经营要素充分进行协调和平衡,这样企业才能长期持续健康地发展。
79、盲目裁员
一遇到困难,老板马上想到通过裁减员工来降低成本。盲目裁员,不但会挫伤员工的积极性,削弱员工对企业的归宿感,还会因为人员的流失造成企业的结构性紊乱。这一点上,不妨向日本一些企业学习:宁可降低工资也不裁员。
80、一味模仿竞争对手
永无创新,永远跟随:对手上一个新产品,自己马上跟进;对手在繁华路段开一个店,自己也跟着在附近开店;对手策划一个大型的公益性活动,自己也搞公益活动;对手提出一个新理念,自己马上也推出一个相同的理念。一味模仿竞争对手,看似贴身肉搏,实则很容易被对手扰乱了阵脚,被对手玩得团团转。
81、自我反省能力差
我们永远也不要低估人类追求创新追求真理的勇气和能力;但对人类固执己见坚持错误的"勇气"和"能力",恐怕同样也不能低估。
82、权力控制欲
极尽政治家才能,牢控企业每一个角落的权力不被流失——每一分钱的开支、每一个人的进出、每单生意的决策、每场会议的主持......此类习惯对小老板而言是美德,对大老板而言则是危机和病态。
83、归罪于外
企业利润下滑或经营不善时,总是习惯性地把问题归罪于外部因素,要么是政策环境不好,要么是对手卑劣,要么是行业不景气,要么是人才不足,而不从自身寻找原因。其实,任何时候,任何行业,总有赚钱的企业,关键还在于企业自身是否具有足够强的赢利能力。
84、优柔寡断
遇事不果断,前怕狼后怕虎,老在潜意识里想"这样做可能会有风险",结果把本来是自己的机会白白放过了。对待下属有争议的事情,也是左右摇摆,不知道该听谁的,结果被员工认为是"和蔼可欺",威信荡然无存。
85、迷恋直觉
崇尚"跟着感觉走",藐视基于市场调查的数据分析,认为决策没有什么理性可言,最可靠的反而是长期做市场过程中培养起的直觉。对于抗风险能力还不强的企业,一旦决策出现失误,就会带来灭顶之灾。
86、产业投资步步高
今天做食品加工,明天做酒店连锁,后天做网络科技,大后天做文化传媒。总之什么高端时髦搞什么,感觉越来越好,利润越来越少。
87、假面认同
开会之前,老板心里已经有了答案,但还是要大家畅所欲言,结果凡是与老板相左的意见全部被否定掉。久而久之,员工都明白这只不过是走过场,于是全部按照老板的意思去说。到最后表面上看起来所有的议题都得到了一致同意,但实际上都是老板自己的意见而已。
88、零风险心态
只想收获,不愿付出,不愿担风险,把所有的风险都转嫁到合作伙伴身上。最后发觉自己成了孤家寡人,谁都不愿意和他做生意。
89、迷信高科技
以为越是高科技的产品越能赚钱,于是不顾企业自身实际情况,凡是和高科技沾上边的项目都跟着投钱,盲目将产业"升级"。
90、盲目进入资本市场
企业发展到一定程度,就想着上市,以为这样企业才能发展得更好。事实上,企业一旦成为公众性公司,财务和重大决策都要透明化,老板个人对企业的影响将随之受到很大制约。上市流通并不是所有企业都需要。
91、管理随意性
这样的公司也有制度,但绝大多数时候都是"一切看着办"——好一点的情况是"一切以老板心中的是非判定为准",坏一点的情况是"一切以老板此时此刻的情绪为准"。
92、节约到浪费
节约是美德,节约甚至是一种精神及信念,是中国企业最核心的竞争力所在。但万事万物过犹不及,节约过头,则企业内事事打折扣,处处差把火,人才留不住,留人不留心......最后是效果出不来,效率上不去,投资收不回,节约等于浪费。
93、以江湖手段解决企业竞争
自以为企业背后有靠山,面对竞争对手,便每每"拳打脚踢"。要么强行要求对方退出地方市场,要么背地里给竞争对手的产品下套破坏其市场形象,要么联合某些政府部门三天两头上门"服务"。对手知趣便罢,否则便拳脚相加、大打出手。
94、好了伤疤忘了痛
企业遭遇困难的时候,三省其身,痛定思痛,誓言必革除种种弊端;一旦危机过去,又恢复了老样子,想当然地以为天下哪有这么巧的事情,同样的劫数肯定不会再发生了。
95、有患难,无富贵
笃信"人多好干活,人少好吃馍",对创业的功臣,既怕其功高震主,更惧其伸手要财。企业走上平稳发展的快车道之日,就是上演过河拆桥、卸磨杀驴之时。这种看似聪明的做法,往往只会带来"财散人散"的结局。
96、同行之间妖魔化
在同行之间挑拨离间,以为可以渔翁得利,却被揭穿谎言,落得里外不是人;或为竞争需要,乱说同行是非,惹来同行鱼死网破的反击,致全行业受损。
97、独掌公司股权不放
公司是自己辛辛苦苦创立起来的,凭什么要"白白分给其他人"?以为守住了金元宝,其实掉进了大陷阱。随着企业的壮大和社会分工的越来越细密,管理者在企业中的作用越来越大,他们必然不会满足于永远打工的地位。吸引部分管理者入股是大势所趋,既是企业长期稳定发展的基础,又是当代社会企业社会化的必然要求。
98、人格分裂症
极端的高尚和极端的卑劣并存,极端的向善和极端的无耻共生;愿意承担责任却又不断逃避责任,热爱有真理的世界却又时时制造虚假;对抗自私,却每天都在镜子里看到它。
99、企业经营短期行为
短期行为和长期行为的根本区别,在于一个经营者大多数时候,是在放弃品牌建设、制度建设、人力资源建设、核心竞争力打造等以获得眼前利益,还是相反。
100、存小术,废大道
一个企业要获得持续成长,企业家必须具备两种能力,一是应付各种复杂局面的能力和技巧,是为小术;二是立身社会、凝聚人才的信仰及人格魅力,是为大道。存小术而废大道,企业终究只是获小利而失根基。
November 17 window live 照片上载控件下载解决方案photo Upload control的MSN照片上载控件点击无反应, 可是不装这个又没办法传照片... 郁闷之极我来为你解决,5分钟搞定. A: MSN Spaces上传控件[for IE6 or higher]一般是需要安装的 否则无法体验MSN Spaces和图片/相册等相关的内容 你也可以直接不选中Pop-up Blocker处的Block pop-ups, 但是这样不安全 不建议使用. 可按照以下方法:IE浏览器->Internet选项[Internet Options]->安全[Security]->Internet->自定义[Custom Level]->ActiveX控件和插件[ActiveX Controls and plug-ins]->下载签名的ActiveX控件[Download Signed ActiveX]选择可用[Enable]或提醒[Prompt]->下载未签名的ActiveX控件[Download Unsigned ActiveX]选择可用[Enable]或提醒[Prompt]->运行ActiveX控件以及插件[Run ActiveX Controls and plug-ins]选择可用[Enable]->点击确定[OK]->点击确定[OK] 公司终于成立了!!执著技术创新,构建智慧生活 公司介绍 西安安邦信息科技有限公司(Xi’an Secoact Technologies Ltd.)致力于提供无缝计算、智能计算、安全计算、大规模计算和下一代网络计算的研究、开发、应用、生产、销售、技术咨询与客户培训等全面的解决方案。 我们奉行“专业立身”的原则,我们的技术团队对所在领域拥有丰富的经验和深入的研究,从根本上保障了为用户提供有效、灵活、经济的应用方案的能力。 我们秉持“客户至上”的理念,建立了强大的服务团队,为用户提供完善的售前、售后服务,承诺7x24的全天候垂询和下24小时响应的服务保障。 公司理念 定位:立足长远发展,成长为全球领先的智慧计算解决方案提供商。 愿景:执著技术创新,构建智慧生活。 使命:聚焦客户关注的挑战和压力,提供有竞争力的智慧计算解决方案和服务,持续为客户创造最大价值。 战略:以客户为中心,努力创新、持续沟通、坚持诚信、实现共赢。 主营产品 My Internet®安全移动系列产品 MyInternet®安全移动IP技术 伴随着因特网和移动通信的迅猛发展,IP网络和移动式设备数量呈爆炸式增长,越来越多的移动用户都希望能够以更加灵活的方式接入到因特网中去,而不受到时、空、接入媒体的限制。 Internet工程任务组IETF(Internet Engineering Task Force)综合考虑的各种可选方案的优缺点后,在原有IP协议的基础上提出了移动IP协议标准,主要包括RFC2002、RFC2003、RFC2004、RFC2005和RFC2006等。 西安安邦信息科技有限公司经过深入研究和分析,对IETF移动IP技术标准进行了完善和发展,形成了自主创新的安全移动IP技术:MyInternet®,MyInternet® 安全移动IP技术对传统的移动IP技术进行了多方面的优化和完善,为移动用户远程接入和机构间网络互联互通提供了高安全、高稳定、高效率、易管理、低成本的解决方案。MyInternet® 安全移动IP技术适用于政府、企业、能源、医药、电信运营、教育、科研等机构和行业。 MyInternet®主要特点与性能: Ø 自由移动:移动终端不受时间、空间、接入媒体的限制,可在任意IP网络中移动; Ø 双向通信:移动终端移动到其他外地网络,总可以快速地被本地网络中的主机或其他移动终端找到,建立连接,实现真正的双向通信功能; Ø 应用透明:支持所有基于IP协议的网络应用,移动终端漫游到外地网络时,其网络应用的使用并不受到任何影响; Ø 拓扑透明:部署MyInternet®系统,对本地网络和外地网络没有特别的要求,部署后不会改变本地网络和外地网络的拓扑结构; Ø IP地址不变性:移动终端始终保持其本地网络的IP地址,并使用它与其他终端通信;这一点对通过IP地址进行管理的网络应用尤为重要; Ø 高安全性:MyInternet®系统采用了多重安全保证,可以有效防止传输数据遭遇窃听、篡改、攻击等恶意网络隐患; Ø 高稳定性:MyInternet®系统采用了卓越的设计方案、充分的规模测试,为用户提供了无障碍永续运行的移动服务; Ø 高效能:MyInternet®系统为移动终端提供了迅捷的移动接入、快速的移动数据传输、即时的终端间网络交互; Ø 快速部署:MyInternet®系统基于最简网络模型设计,最大的加速了网络的部署速度; Ø 零管理成本:MyInternet®系统的稳定性、产品简单性、易配置性、智能性解决了产品的运行的免维护性,从而最大程度的降低了移动服务的管理成本。 My Internet ® 产品与功能: Unicorn®系列 MyInternet®产品组成有:MyInternet®服务器、金虎符2006、安邦天翼2006、安邦控制台2006。
Unicorn®系列 MyInternet®系统网络拓扑 MyInternet®服务器:是与移动终端家乡链路相连的核心网络设备,为每个移动终端提供注册、鉴权、通信、管理等服务功能,是MyInternet®安全移动IP技术的核心组成部分。产品以高强度工业控制机为平台,自主研发的操作系统为核心,先进的移动IP设计方案为指导,提供了高安全、高稳定、高速度、易管理的移动IP服务。 金虎符2006:是一款集成MyInternet®安全移动IP技术的智能安全硬件产品,主要存储用户认证信息和移动IP的相关信息等,采用高强度加密算法,有效的保证了用户的接入安全。 安邦天翼2006:是一款基于MyInternet®安全移动IP技术的智能安全客户端软件产品,是移动终端用户使用移动IP服务的窗口。安邦天翼2006通过金虎符2006获得用户认证信息和移动IP的相关信息,接入MyInternet®服务器,进行鉴权,然后通过高强度加密信道进行通信。 安邦控制台2006:是一款移动IP服务的管理软件,主要用来完成金虎符2006的分发、授权以及MyInternet®服务器的系统管理等功能。 Unicorn®系列 MyInternet® 服务器规格
在传统网络中,移动用户如果希望访问企业内部的网络资源,可以通过远程电话拨号接入企业的“远程接入服务器(RAS)”,这种方式往往需要企业支付较高的长途电话费用,而且网络速度慢,通信数据没有安全保障,也无法支持大量移动用户同时访问。同时,出差人员无法访问企业内部资源,企业内部人员也无法及时找到移动主机进行通信,给员工工作带来极大的不便,严重影响了工作效率。安邦科技MyInternet®安全移动IP技术为解决这一问题提供良好的解决方案,其解决方案如下图:<图看不见 许多企业从国外或国内购买了一些昂贵的网络资源,比如电子期刊、专业数据库等,但这些资源企业内部利用率不是很高,多数资源处于闲置状态。那么,企业可以考虑把这些资源出租或者有偿共享给其他企业或个人,以降低成本或者达到盈利的目的;当然,企业自身有很多有价值的网络资源,也可以出租或者有偿共享给其他企业或个人,从而使企业成为独立的网络服务提供商,达到运营的目的。安邦科技MyInternet®安全移动IP技术为企业要运营网络资源提供了一个安全、有效的解决方案。通过在运营企业部署安邦的MyInternet®服务器设备,在需要资源的企业或个人安装安邦天翼2006软件和配发金虎符2006,从而构建性价比非常高的资源运营网络。其解决方案如下图:<图看不见 企业总部与分支机构之间网络互联的解决方案 许多大中型企业在全国各地都建有分支机构或者办事处,随着企业信息化程度的不断提高,一般在企业总部会部署如ERP 系统、OA 系统、邮件系统等应用软件,企业需要将分布在各地的分支机构和办事处与企业总部互联,达到安全地共享数据和软件资源的目的,采用传统的网络连接方式一般是租用专线,网络结构复杂和费用昂贵。MyInternet®安全移动IP技术为解决这一问题提供良好的解决方案,安邦科技为大中型企业设计了Unicorn®系列 MyInternet®解决方案见下图:<图还是看不见
公司联系方式: 地址:中国西安市高新三路高科花园一期8栋2501室 邮编:710075 电话:86-029-88316253 传真:86-029-88316253 网站:http://www.secoact.com <尚未开通 邮箱:market@secoact.com |
|
|