??xml version="1.0" encoding="utf-8" standalone="yes"?>
最q无意中发现Q作者TigerX原来pd球村中国ӞƧ耶?br>地址Qhttp://www.codeproject.com/KB/tree/ctreelistctrl.aspx
q以为codeproject上没其它中国土h呢,华h倒是知道有好几个?br>
Z在codeproject发了文章,讲xml序列化复杂对象模型的Q门可罗雀啊?br>http://www.codeproject.com/KB/cs/xmlable.aspx
嗯,很有差别?br>
]]>
]]>
]]>
]]>
http://www.visualwebgui.com/
how did they do that?
]]>
看了LQ没觉得哪里体现?#8220;高效”2字,只是他排错的环境实在是恶劣,其实试人员应该比开发h员牛逼才对,代码Zh会写Q排错不是h做的Q需要的知识储备比光写写代码需要的多得多了?br>L里D的工人分金条的例子题目是错的Q还看到一个错别字...但俺对这U授Z渔的写法很有好感?br>
]]>
]]>
http://www.sqlite.org/
Light, Free, Fast, Cross platform.
witten in C, and there are a lot of wrappers, find what you need here: http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers
http://www.codeproject.com/KB/cpp/SQLite_Server.aspx
Implementing Server/Client architecture for that great SQLite! with visual studio C++ 2005
http://www.codeproject.com/KB/cs/InterprocessCommunicator.aspx
Interprocess Communication Between .NET and MFC using WM_COPYDATA
http://www.codeproject.com/KB/cs/WindowsServicesInAction1.aspx
http://www.codeproject.com/KB/cs/WindowsServicesInAction2.aspx
Windows Services in Action
Windows Services Hand by Hand...
http://www.codeproject.com/KB/cs/OpenS-CAD.aspx
OpenS-CAD, a simple 2D CAD application. <-- just so so
http://www.codeproject.com/KB/cs/DiskAnalyzer.aspx
I don't care about disk, i do care about the pie chart and tree gird view.
]]>
]]>
]]>
http://codeguru.earthweb.com/cpp/i-n/ieprogram/displayinginformation/article.php/c7273/
HTML Editor for VC++ 6.0
]]>
http://www.cs.man.ac.uk/~toby/alan/software/
]]>
http://blog.csdn.net/cpu88/archive/2004/11/26/195315.aspx
步骤Q?
//得到拼音Q包括多韻I
A: 用输入法生成?win2000)"C:\Program Files\Windows NT\Accessories\Imegen.exe"
逆{换拼韌入法文gC:\WINNT\SYSTEM32\WINPY.MB
会生成一个C:\WINNT\SYSTEM32\WINPY.txt文g(U?WINPY.txt文g)
B: WINPY.txt文g里面是 ?汉字拼音列表5万多?除去词组 有汉?万多个(含多韻I
C: 汉字可以转换成某中编码可以自己构造编码方?保证一个汉字对应一个编?U编码方法)
?byte[] uniCode = new String(temp).getBytes(“GB2312?;
WINPY.txt里面所有的汉字变成~码。得到汉字编?拼音对应表(U汉字编码表Q?br /> XXXX0,a //XXXX0是某个汉字的~码
XXYX2,o //XXYX2是某个汉字的~码
D: 汉字~码表按~码排序Q编码表按编码大排序?br /> ~码表分l(方便查询 Q?而且得到分组的标志?br /> E: 查询汉字拼音 汉字进行编码(按自q~码ҎQ?br /> 用编码在~码表中查询可以得到拼韻I查询时在~码表中的某个分l中查询Q而不是在所有编码中查询。速度很快?br />//得到首字W??北京' 得到 'bj' '呆子'得到 'd[a]z ' //多音
//排序 有了拼音 可以按一些常见的排序Ҏ排序
如何在C++中集成Lua脚本(LuaPlus?:
http://ly4cn.teeta.com/blog/data/44939.html
据说无法调用虚函数。有Ҏ。有I再看看?br />http://luaplus.org/
字符串到其他格式的{?
CString timestr = "2000q?4?5?;
int a,b,c ;
sscanf(timestr.GetBuffer(timestr.GetLength()),"%dq?d?d?,&a,&b,&c);
CTime time(a,b,c,0,0,0);
ANSI兼容Q我太孤陋寡M...
RMI for c++?:
http://www.codeproject.com/threads/RMI_For_Cpp.asp
反正目前没这个需要?br />
声音引擎QaudiereQ支持跨q_:
gZ错?br />http://www.shnenglu.com/gogoplayer/archive/2006/11/29/15763.html
http://sourceforge.net/projects/audiere/
wxWidget的wxSound支持windows和unix?br />其它关于sound:
http://www.opensound.com/oss.html
http://www.libsdl.org/
Why You Should Turn Down That Job Offer
Peer-to-peer software applications are a network administrator's nightmare. In order to be able to exchange packets with their counterpart as directly as possible they use subtle tricks to punch holes in firewalls, which shouldn't actually be letting in packets from the outside world.
Increasingly, computers are positioned behind firewalls to protect systems from internet threats. Ideally, the firewall function will be performed by a router, which also translates the PC's local network address to the public IP address (Network Address Translation, or NAT). This means an attacker cannot directly adress the PC from the outside - connections have to be established from the inside.This is of course a problem when two computers behind NAT firewalls require to talk directly to each other - if, for example, their users want to call each other using Voice over IP (VoIP). The dilemma is clear - whichever party calls the other, the recipient's firewall will decline the apparent attack and will simply discard the data packets. The telephone call doesn't happen. Or at least that's what a network administrator would expect.
But anyone who has used the popular internet telephony software Skype knows that it works as smoothly behind a NAT firewall as it does if the PC is connected directly to the internet. The reason for this is that the inventors of Skype and similar software have come up with a solution.
Naturally every firewall must also let packets through into the local network - after all the user wants to view websites, read e-mails, etc. The firewall must therefore forward the relevant data packets from outside, to the workstation computer on the LAN. However it only does so, when it is convinced that a packet represents the response to an outgoing data packet. A NAT router therefore keeps tables of which internal computer has communicated with which external computer and which ports the two have used.
The trick used by VoIP software consists of persuading the firewall that a connection has been established, to which it should allocate subsequent incoming data packets. The fact that audio data for VoIP is sent using the connectionless UDP protocol acts to Skype's advantage. In contrast to TCP, which includes additional connection information in each packet, with UDP, a firewall sees only the addresses and ports of the source and destination systems. If, for an incoming UDP packet, these match an NAT table entry, it will pass the packet on to an internal computer with a clear conscience.
The switching server, with which both ends of a call are in constant contact, plays an important role when establishing a connection using Skype. This occurs via a TCP connection, which the clients themselves establish. The Skype server therefore always knows under what address a Skype user is currently available on the internet. Where possible the actual telephone connections do not run via the Skype server; rather, the clients exchange data directly.
Let's assume that Alice wants to call her friend
Bob. Her Skype client tells the Skype server that she
wants to do so. The Skype server already knows a bit
about Alice. From the incoming query it sees that Alice
is currently registered at the IP address 1.1.1.1 and a
quick test reveals that her audio data always comes
from UDP port 1414. The Skype server passes this
information on to Bob's Skype client, which, according
to its database, is currently registered at the IP
address 2.2.2.2 and which, by preference uses UDP port
2828.
Bob's Skype program then punches a hole in its own network firewall: It sends a UDP packet to 1.1.1.1 port 1414. This is discarded by Alice's firewall, but Bob's firewall doesn't know that. It now thinks that anything which comes from 1.1.1.1 port 1414 and is addressed to Bob's IP address 2.2.2.2 and port 2828 is legitimate - it must be the response to the query which has just been sent.
Now the Skype server passes Bob's coordinates on to Alice, whose Skype application attempts to contact Bob at 2.2.2.2:2828. Bob's firewall sees the recognised sender address and passes the apparent response on to Bob's PC - and his Skype phone rings.
This description is of course somewhat simplified - the details depend on the specific properties of the firewalls used. But it corresponds in principle to our observations of the process of establishing a connection between two Skype clients, each of which was behind a Linux firewall. The firewalls were configured with NAT for a LAN and permitted outgoing UDP traffic.
Linux' NAT functions have the VoIP friendly property of, at least initially, not changing the ports of outgoing packets. The NAT router merely replaces the private, local IP address with its own address - the UDP source port selected by Skype is retained. Only when multiple clients on the local network use the same source port does the NAT router stick its oar in and reset the port to a previously unused value. This is because each set of two IP addresses and ports must be able to be unambiguously assigned to a connection between two computers at all times. The router will subsequently have to reconstruct the internal IP address of the original sender from the response packet's destination port.
Other NAT routers will try to assign ports in a specific range, for example ports from 30,000 onwards, and translate UDP port 1414, if possible, to 31414. This is, of course, no problem for Skype - the procedure described above continues to work in a similar manner without limitations.
It becomes a little more complicated if a firewall
simply assigns ports in sequence, like Check Point's
FireWall-1: the first connection is assigned 30001,
the next 30002, etc. The Skype server knows that Bob is
talking to it from port 31234, but the connection to
Alice will run via a different port. But even here
Skype is able to outwit the firewall. It simply runs
through the ports above 31234 in sequence, hoping at
some point to stumble on the right one. But if this
doesn't work first go, Skype doesn't give up. Bob's
Skype opens a new connection to the Skype server, the
source port of which is then used for a further
sequence of probes.
Nevertheless, in very active networks Alice may not find the correct, open port. The same also applies for a particular type of firewall, which assigns every new connection to a random source port. The Skype server is then unable to tell Alice where to look for a suitable hole in Bob's firewall.
However, even then, Skype doesn't give up. In such cases a Skype server is then used as a relay. It accepts incoming connections from both Alice and Bob and relays the packets onwards. This solution is always possible, as long as the firewall permits outgoing UDP traffic. It involves, however, an additional load on the infrastructure, because all audio data has to run through Skype's servers. The extended packet transmission times can also result in an unpleasant delay.
Use of the procedure described above is not limited to Skype and is known as "UDP hole punching". Other network services such as the Hamachi gaming VPN application, which relies on peer-to-peer communication between computers behind firewalls, use similar procedures. A more developed form has even made it to the rank of a standard - RFC 3489 "Simple Traversal of UDP through NAT" (STUN) describes a protocol which with two STUN clients can get around the restrictions of NAT with the help of a STUN server in many cases. The draft Traversal Using Relay NAT (TURN) protocol describes a possible standard for relay servers.
With a few small utilities, you can try out UDP hole punching for yourself. The tools required, hping2 and netcat, can be found in most Linux distributions. Local is a computer behind a Linux firewall (local-fw) with a stateful firewall which only permits outgoing (UDP) connections. For simplicity, in our test the test computer remote was connected directly to the internet with no firewall.
Firstly start a UDP listener on UDP port 14141 on the local/1 console behind the firewall:
local/1# nc -u -l -p 14141
An external computer "remote" then attempts to contact it.
remote# echo "hello" | nc -p 53 -u local-fw 14141
However, as expected nothing is received on local/1 and, thanks to the firewall, nothing is returned to remote. Now on a second console, local/2, hping2, our universal tool for generating IP packets, punches a hole in the firewall:
local/2# hping2 -c 1 -2 -s 14141 -p 53 remote
As long as remote is behaving itself, it will send back a "port unreachable" response via ICMP - however this is of no consequence. On the second attempt
remote# echo "hello" | nc -p 53 -u local-fw 14141
the netcat listener on console local/1 then coughs up a "hello" - the UDP packet from outside has passed through the firewall and arrived at the computer behind it.
Network administrators who do not appreciate this sort of hole in their firewall and are worried about abuse, are left with only one option - they have to block outgoing UDP traffic, or limit it to essential individual cases. UDP is not required for normal internet communication anyway - the web, e-mail and suchlike all use TCP. Streaming protocols may, however, encounter problems, as they often use UDP because of the reduced overhead.
Astonishingly, hole punching also works with TCP. After an outgoing SYN packet the firewall / NAT router will forward incoming packets with suitable IP addresses and ports to the LAN even if they fail to confirm, or confirm the wrong sequence number (ACK). Linux firewalls at least, clearly fail to evaluate this information consistently. Establishing a TCP connection in this way is, however, not quite so simple, because Alice does not have the sequence number sent in Bob's first packet. The packet containing this information was discarded by her firewall.Z于理解和记忆Q先从一些概念入手,所有特D字W或字符l合有一个总表在后面,最后一些例子供理解相应的概c?/p>
字符 | 含义 |
\cx | 匚w由x指明的控制字W。例如, \cM 匚w一?Control-M 或回车符。x 的值必Mؓ A-Z ?a-z 之一。否则,?c 视ؓ一个原义的 'c' 字符?/td> |
\f | 匚w一个换늬。等价于 \x0c ?\cL?/td> |
\n | 匚w一个换行符。等价于 \x0a ?\cJ?/td> |
\r | 匚w一个回车符。等价于 \x0d ?\cM?/td> |
\s | 匚wMI白字符Q包括空根{制表符、换늬{等。等价于 [ \f\n\r\t\v]?/td> |
\S | 匚wM非空白字W。等价于 [^ \f\n\r\t\v]?/td> |
\t | 匚w一个制表符。等价于 \x09 ?\cI?/td> |
\v | 匚w一个垂直制表符。等价于 \x0b ?\cK?/td> |
特别字符 | 说明 |
$ | 匚w输入字符串的l尾位置。如果设|了 RegExp 对象?Multiline 属性,?$ 也匹?'\n' ?'\r'。要匚w $ 字符本nQ请使用 \$?/td> |
( ) | 标记一个子表达式的开始和l束位置。子表达式可以获取供以后使用。要匚wq些字符Q请使用 \( ?\)?/td> |
* | 匚w前面的子表达式零ơ或多次。要匚w * 字符Q请使用 \*?/td> |
+ | 匚w前面的子表达式一ơ或多次。要匚w + 字符Q请使用 \+?/td> |
. | 匚w除换行符 \n之外的Q何单字符。要匚w .Q请使用 \?/td> |
[ | 标记一个中括号表达式的开始。要匚w [Q请使用 \[?/td> |
? | 匚w前面的子表达式零ơ或一ơ,或指明一个非贪婪限定W。要匚w ? 字符Q请使用 \??/td> |
\ | |
^ | 匚w输入字符串的开始位|,除非在方括号表达式中使用Q此时它表示不接受该字符集合。要匚w ^ 字符本nQ请使用 \^?/td> |
{ | 标记限定W表辑ּ的开始。要匚w {Q请使用 \{?/td> |
| | 指明两项之间的一个选择。要匚w |Q请使用 \|?/td> |
构造正则表辑ּ的方法和创徏数学表达式的Ҏ一栗也是用多U元字符与操作符小的表辑ּl合在一h创徏更大的表辑ּ。正则表辑ּ的组件可以是单个的字W、字W集合、字W范围、字W间的选择或者所有这些组件的Ll合?/strong>
字符 | 描述 |
* | 匚w前面的子表达式零ơ或多次。例如,zo* 能匹?"z" 以及 "zoo"? {h于{0,}?/td> |
+ | |
? | |
{n} | n 是一个非负整数。匹配确定的 n ơ。例如,'o{2}' 不能匚w "Bob" 中的 'o'Q但是能匚w "food" 中的两个 o?/td> |
{n,} | n 是一个非负整数。至匹配n ơ。例如,'o{2,}' 不能匚w "Bob" 中的 'o'Q但能匹?"foooood" 中的所?o?o{1,}' {h?'o+'?o{0,}' 则等价于 'o*'?/td> |
{n,m} | m ?n 均ؓ非负整数Q其中n <= m。最匹?n ơ且最多匹?m ơ。例如,"o{1,3}" 匹?"fooooood" 中的前三?o?o{0,1}' {h?'o?'。请注意在逗号和两个数之间不能有空根{?/td> |
操作W? | 描述 |
\ | 转义W?/td> |
(), (?:), (?=), [] | 圆括号和Ҏ?/td> |
*, +, ?, {n}, {n,}, {n,m} | 限定W?/td> |
^, $, \anymetacharacter | 位置和顺?/td> |
| | “或”操?/td> |
字符 | 描述 |
\ | |
^ | 匚w输入字符串的开始位|。如果设|了 RegExp 对象?Multiline 属性,^ 也匹?'\n' ?'\r' 之后的位|?/td> |
$ | 匚w输入字符串的l束位置。如果设|了RegExp 对象?Multiline 属性,$ 也匹?'\n' ?'\r' 之前的位|?/td> |
* | 匚w前面的子表达式零ơ或多次。例如,zo* 能匹?"z" 以及 "zoo"? {h于{0,}?/td> |
+ | |
? | |
{n} | n 是一个非负整数。匹配确定的 n ơ。例如,'o{2}' 不能匚w "Bob" 中的 'o'Q但是能匚w "food" 中的两个 o?/td> |
{n,} | n 是一个非负整数。至匹配n ơ。例如,'o{2,}' 不能匚w "Bob" 中的 'o'Q但能匹?"foooood" 中的所?o?o{1,}' {h?'o+'?o{0,}' 则等价于 'o*'?/td> |
{n,m} | m ?n 均ؓ非负整数Q其中n <= m。最匹?n ơ且最多匹?m ơ。例如,"o{1,3}" 匹?"fooooood" 中的前三?o?o{0,1}' {h?'o?'。请注意在逗号和两个数之间不能有空根{?/td> |
? | ? 该字W紧跟在M一个其他限制符 (*, +, ?, {n}, {n,}, {n,m}) 后面Ӟ匚w模式是非贪婪的。非贪婪模式可能少的匹配所搜烦的字W串Q而默认的贪婪模式则尽可能多的匚w所搜烦的字W串。例如,对于字符? "oooo"Q?o+?' 匹配单?"o"Q?'o+' 匹配所?'o'?/td> |
. | |
(pattern) | 匚w pattern q获取这一匚w。所获取的匹配可以从产生?Matches 集合得到Q在VBScript 中?SubMatches 集合Q在JScript 中则使用 $0?9 属性。要匚w圆括号字W,请?'\(' ?'\)'?/td> |
(?:pattern) | ? ?pattern 但不获取匚wl果Q也是说这是一个非获取匚wQ不q行存储供以后用。这在?"? 字符 (|) 来组合一个模式的各个部分是很有用。例如, 'industr(?:y|ies) 是一个比 'industry|industries' 更简略的表达式?/td> |
(?=pattern) | ? 向预查,在Q何匹?pattern 的字W串开始处匚w查找字符丌Ӏ这是一个非获取匚wQ也是_该匹配不需要获取供以后使用。例如,'Windows (?=95|98|NT|2000)' 能匹?"Windows 2000" 中的 "Windows" Q但不能匚w "Windows 3.1" 中的 "Windows"。预查不消耗字W,也就是说Q在一个匹配发生后Q在最后一ơ匹配之后立卛_始下一ơ匹配的搜烦Q而不是从包含预查的字W之后开始?/td> |
(?!pattern) | ? 向预查,在Q何不匚w pattern 的字W串开始处匚w查找字符丌Ӏ这是一个非获取匚wQ也是_该匹配不需要获取供以后使用。例?Windows (?!95|98|NT|2000)' 能匹?"Windows 3.1" 中的 "Windows"Q但不能匚w "Windows 2000" 中的 "Windows"。预查不消耗字W,也就是说Q在一个匹配发生后Q在最后一ơ匹配之后立卛_始下一ơ匹配的搜烦Q而不是从包含预查的字W之后开?/td> |
x|y | 匚w x ?y。例如,'z|food' 能匹?"z" ?"food"?(z|f)ood' 则匹?"zood" ?"food"?/td> |
[xyz] | |
[^xyz] | |
[a-z] | |
[^a-z] | |
\b | |
\B | |
\cx | 匚w?x 指明的控制字W。例如, \cM 匚w一?Control-M 或回车符。x 的值必Mؓ A-Z ?a-z 之一。否则,?c 视ؓ一个原义的 'c' 字符?/td> |
\d | 匚w一个数字字W。等价于 [0-9]?/td> |
\D | 匚w一个非数字字符。等价于 [^0-9]?/td> |
\f | 匚w一个换늬。等价于 \x0c ?\cL?/td> |
\n | 匚w一个换行符。等价于 \x0a ?\cJ?/td> |
\r | 匚w一个回车符。等价于 \x0d ?\cM?/td> |
\s | 匚wMI白字符Q包括空根{制表符、换늬{等。等价于 [ \f\n\r\t\v]?/td> |
\S | 匚wM非空白字W。等价于 [^ \f\n\r\t\v]?/td> |
\t | 匚w一个制表符。等价于 \x09 ?\cI?/td> |
\v | 匚w一个垂直制表符。等价于 \x0b ?\cK?/td> |
\w | |
\W | |
\xn | 匚w nQ其?n 为十六进制{义倹{十六进制{义值必Mؓ定的两个数字长。例如,'\x41' 匚w "A"?\x041' 则等价于 '\x04' & "1"。正则表辑ּ中可以?ASCII ~码? |
\num | 匚w numQ其?num 是一个正整数。对所获取的匹配的引用。例如,'(.)\1' 匚w两个q箋的相同字W?/td> |
\n | 标识一个八q制转义值或一个向后引用。如?\n 之前臛_ n 个获取的子表辑ּQ则 n 为向后引用。否则,如果 n 为八q制数字 (0-7)Q则 n Z个八q制转义倹{?/td> |
\nm | ? 识一个八q制转义值或一个向后引用。如?\nm 之前臛_?nm 个获得子表达式,?nm 为向后引用。如?\nm 之前臛_?n 个获取,?n Z个后跟文?m 的向后引用。如果前面的条g都不满Q若 n ?m 均ؓ八进制数?(0-7)Q则 \nm 匹配八q制转义?nm?/td> |
\nml | 如果 n 为八q制数字 (0-3)Q且 m ?l 均ؓ八进制数?(0-7)Q则匚w八进制{义?nml?/td> |
\un | 匚w nQ其?n 是一个用四个十六q制数字表示?Unicode 字符。例如, \u00A9 匚w版权W号 (?)?/td> |
正则表达?/td> | 说明 |
/\b([a-z]+) \1\b/gi | 一个单词连l出现的位置 |
/(\w+):\/\/([^/:]+)(:\d*)?([^# ]*)/ | 一个URL解析为协议、域、端口及相对路径 |
/^(?:Chapter|Section) [1-9][0-9]{0,1}$/ | 定位章节的位|?/td> |
/[-a-z]/ | A至z?6个字母再加一?受?/td> |
/ter\b/ | 可匹配chapterQ而不能terminal |
/\Bapt/ | 可匹配chapterQ而不能aptitude |
/Windows(?=95 |98 |NT )/ | 可匹配Windows95或Windows98或WindowsNT,当找C个匹配后Q从Windows后面开始进行下一ơ的索匹配?/td> |