02 2012 档案

摘要:学习C语言可变参数时,发现#define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )乍一看,完全不明白该宏的作用是啥,仔细分析后发现,该宏是求类型n是整型int的多少倍(向上取整).在32位win中,siz... 阅读全文
posted @ 2012-02-26 03:08 庚武 阅读(930) 评论(0) 推荐(0) 编辑
摘要:ANSI ANSI编码 unicode和ansi都是字符代码的一种表示形式。 为使计算机支持更多语言,通常使用 0x80~0xFF 范围的 2 个字节来表示 1 个字符。比如:汉字 '中' 在 ANSI编码中文操作系统中,使用 [0xD6,0xD0] 这两个字节存储。 不同的国家和地区制定了不同的标准,由此产生了 GB2312, BIG5, JIS 等各自的编码标准。这些使用 2 个字节来代表一个字符的各种汉字延伸编码方式,称为 ANSI 编码。在简体中文系统下,ANSI 编码代表 GB2312 编码,在日文操作系统下,ANSI 编码代表 JIS 编码。 不同 ANSI 编码之 阅读全文
posted @ 2012-02-22 18:11 庚武 阅读(15324) 评论(0) 推荐(0) 编辑
摘要:#include <windef.h> //Basic Type Definitions#include <winnt.h> //Definitions for Unicode support#include <winbase.h> // Kernel functions#include <wingdi.h> //Graphic Device Interface functions#include <winuser.h> //User Interface functions 阅读全文
posted @ 2012-02-22 17:08 庚武 阅读(659) 评论(0) 推荐(0) 编辑
摘要:http://self-issued.info/docs/draft-jones-json-web-signature-01.html 阅读全文
posted @ 2012-02-21 17:46 庚武 阅读(510) 评论(0) 推荐(0) 编辑
摘要:在VC6中创建一个MFC Dialog工程,下面是创建Unicode版本的操作步骤:1.Build-->Configurations-->Add,添加一个Unicode Debug配置;2.Build-->Set Active Configuration,选择Win32 Unicode Debug作为当前活动配置;3.在Project-->Settings,在C/C++属性页中选择Preprocessor条目,在Preprocessor definitions中添加编译项 _UNICODE;如果此时就编译,就会立生错误:msvcrtd.lib(crtexew.obj) 阅读全文
posted @ 2012-02-21 11:58 庚武 阅读(821) 评论(0) 推荐(0) 编辑
摘要:1.在MFC中加入TRACE语句2.在TOOLS->MFC TRACER中选择 “ENABLE TRACING”点击OK3.进行调试运行,GO(F5)(特别注意:不是执行‘!’以前之所以不能看到TRACE内容,是因为不是调试执行,而是‘!’了,切记,切记)4.然后就会在OUTPUT中的DEBUG窗口中看到TRACE内容了,调试执行会自动从BUILD窗口跳到DEBUG窗口#include <iostream>#include <afxwin.h>using namespace std;int main(){ cout<<("Hello 中国&q 阅读全文
posted @ 2012-02-20 17:56 庚武 阅读(1680) 评论(0) 推荐(0) 编辑
摘要:This is not a new topic. But interestingly I could not find a good example on the web while I wanted to find one for some other investigation. So I decided to create a sample here to show the following scenario:A WCF service has the access to a ASP.NET session. Different WCF client proxies can conne 阅读全文
posted @ 2012-02-20 14:07 庚武 阅读(318) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Threading;namespace InterlockedExchange_Example{ class MyInterlockedExchangeExampleClass { //0 for false, 1 for true. private static int usingResource = 0; private const int numThreadIterations = 5; private const int numThreads = 10; ... 阅读全文
posted @ 2012-02-20 11:06 庚武 阅读(433) 评论(0) 推荐(0) 编辑
摘要:书名原文:Programming Windows With MFC, Second EditionISBN 978-7-302-15042-8作者:Jeff Prosise 阅读全文
posted @ 2012-02-19 11:36 庚武 阅读(258) 评论(0) 推荐(0) 编辑
摘要:http://msdn.microsoft.com/en-us/library/azz5wt61(v=vs.80).aspxA device context is a Windows data structure containing information about the drawing attributes of a device such as a display or a printer. All drawing calls are made through a device-context object, which encapsulates the Windows APIs f 阅读全文
posted @ 2012-02-18 20:35 庚武 阅读(728) 评论(0) 推荐(0) 编辑
摘要://filename:Hello.hclass CMyApp:public CWinApp{public: virtual BOOL InitInstance();};class CMainWindow:public CFrameWnd{public: CMainWindow();protected: afx_msg void OnPaint(); afx_msg void OnLButtonDown( UINT nFlags, CPoint point ); DECLARE_MESSAGE_MAP()};//filename:Hello.cpp#include <afxwin.h> 阅读全文
posted @ 2012-02-18 19:13 庚武 阅读(195) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>using namespace std;class P{public: P * m_p; P(){ this->m_p=this; } virtual void Intro(){ cout<<"this is P"<<endl; }};class S:public P{public : virtual void Intro(){ cout<<"this is S"<<endl; }};S s;int main(){ s.Intro(); s.m_p-& 阅读全文
posted @ 2012-02-18 13:44 庚武 阅读(191) 评论(0) 推荐(0) 编辑
摘要:#include <windows.h>#include <stdio.h>LONG WINAPI WndProc(HWND, UINT,WPARAM,LPARAM); //回调原型int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ){ WNDCLASS wc; HWND hwnd; MSG msg; //1.设计窗体 //wc... 阅读全文
posted @ 2012-02-16 01:50 庚武 阅读(193) 评论(0) 推荐(0) 编辑
摘要:#include <windows.h>LONG WINAPI WndProc(HWND, UINT,WPARAM,LPARAM); //回调原型int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ){ WNDCLASS wc; HWND hwnd; MSG msg; //1.设计窗体 wc.style = 0; wc.lpfnW... 阅读全文
posted @ 2012-02-16 00:48 庚武 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2012-02-15 14:46 庚武 阅读(146) 评论(0) 推荐(0) 编辑
摘要:from: http://wiki.answers.com/Q/What_are_the_differences_between_SSRAM(Static Random Assessable Memory)-where the wordstaticindicates that it, does not need to be periodically refreshed, as SRAM uses bistable latching circuitry (i.e.,flip-flops) to store each bit. Each bit is stored as a voltage.Eac 阅读全文
posted @ 2012-02-15 10:54 庚武 阅读(292) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include <typeinfo>using namespace std;template<class T1,class T2>auto product(T1 v1[],T2 v2[], size_t count) -> decltype(v1[0]* v2[0]){ decltype(v1[0] * v2[0]) sum(0); for(size_t i=0;i<count;i++) sum +=v1[i] * v2[i]; return sum;}int main(){ double x[] = {1 阅读全文
posted @ 2012-02-13 16:29 庚武 阅读(302) 评论(0) 推荐(0) 编辑
摘要:http://lzone.de/articles/memcached.htm1、启动Memcache 常用参数memcached 1.4.3-p <num> 设置端口号(默认不设置为: 11211)-U <num> UDP监听端口 (默认: 11211, 0 时关闭) -l <ip_addr> 绑定地址 (默认:所有都允许,无论内外网或者本机更换IP,有安全隐患,若设置为127.0.0.1就只能本机访问)-d 独立进程运行-u <username> 绑定使用指定用于运行进程 <username>-m <num> 允许最大内 阅读全文
posted @ 2012-02-13 12:08 庚武 阅读(389) 评论(0) 推荐(0) 编辑
摘要:http://msdn.microsoft.com/en-us/library/ff647790.aspx#scalenetchapt05_topic15Locking and synchronization provide a mechanism to grant exclusive access to data or code to avoid concurrent execution.This section summarizes steps to consider to help you approach locking and synchronization correctly:De 阅读全文
posted @ 2012-02-09 10:10 庚武 阅读(409) 评论(0) 推荐(1) 编辑
摘要:%comspec% /k ""d:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" amd64msbuild MPTSBKW.Test1.sln /p:Configuration=Debug /p:Platform="Any CPU" /consoleloggerparameters:ErrorsOnlyMicrosoft (R) Build Engine Version 4.0.30319.1[Microsoft .NET Framework, 阅读全文
posted @ 2012-02-07 15:39 庚武 阅读(533) 评论(0) 推荐(0) 编辑
摘要:主页:http://ironpython.net/下载地址:http://ironpython.codeplex.com/开发工具VS2010插件:http://pytools.codeplex.com/ 阅读全文
posted @ 2012-02-07 11:36 庚武 阅读(286) 评论(0) 推荐(0) 编辑
摘要:http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml 阅读全文
posted @ 2012-02-07 09:51 庚武 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Executable Object Statements and Built-in FunctionsBuilt-in Function or Statement Descriptioncallable(obj)Returns true if obj is callable and False otherwisecompile(string, file, type)Creates a code object from string of type type; fileis where the code originates from (usually set to "")e 阅读全文
posted @ 2012-02-06 11:32 庚武 阅读(482) 评论(0) 推荐(0) 编辑
摘要:#file name: Hello.py#coding:utf-8def hello(): print 'hello中国' add = lambda x,y:x+yclass FooClass(object): """ Foo Class doc """ version = 1.0 def __init__(self,age,nm='吴xx'): self.age=age self.name=nm def show(self): print 'name:',self.name,' 阅读全文
posted @ 2012-02-05 13:46 庚武 阅读(342) 评论(0) 推荐(0) 编辑
摘要:Core Python Programming Language : Page477Anonymous Functions and lambdaPython allows one to create anonymous functions using the lambda keyword. They are "anonymous"because they are not declared in the standard manner, i.e., using the def statement. (Unless assignedto a local variable, su 阅读全文
posted @ 2012-02-04 17:17 庚武 阅读(602) 评论(0) 推荐(0) 编辑
摘要:http://msdn.microsoft.com/en-us/library/e1f13641.aspxhttp://msdn.microsoft.com/en-us/library/h6bb9cz9.aspx<httpRuntime apartmentThreading = "[True|False]" appRequestQueueLimit = "number" delayNotificationTimeout = "number" enable = "[True|False]" enableHead 阅读全文
posted @ 2012-02-04 15:02 庚武 阅读(1399) 评论(0) 推荐(0) 编辑
摘要:转:http://stackoverflow.com/questions/1826657/page-generation-time-asp-net-mvcpublic class PerformanceMonitorModule : IHttpModule{ public void Init(HttpApplication context) { context.PreRequestHandlerExecute += delegate(object sender, EventArgs e) { //Set Page Timer Sta... 阅读全文
posted @ 2012-02-04 14:18 庚武 阅读(367) 评论(0) 推荐(0) 编辑
摘要:>>> clear =lambda: os.system('cls')>>> import os>>> clear()in windows 阅读全文
posted @ 2012-02-03 11:39 庚武 阅读(334) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2012-02-02 12:09 庚武 阅读(1) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示