- 浏览: 695714 次
- 性别:
- 来自: 西安
-
最新评论
-
3482561:
Android 面试题目之 线程池 -
daojin:
直接布局。
安卓高手之路之图形系统(6)requestLayout的流程 -
hety163:
没明白楼主所说的最后两段。如果一个相对布局中有多个子view, ...
安卓高手之路之图形系统(6)requestLayout的流程 -
jackuhan:
100篇!!!膜拜
安卓高手之路之 图形系统之 图形框架(1) -
ritterliu:
不错,按照流程把关键代码都贴出来了。谢谢分享
Android输入输出系统之TouchEvent流程
文章列表
//Map.cpp
#include <StdAfx.h>
terrain.cpp:
// terrain.cpp : Defines the entry point for the application.
//
#include "StdAfx.h"
#include "Map.h"
#include "Console.h"
#include "IO.H"
#include <sstream>
#include <iostream>
#incl ...
- 2009-04-17 11:40
- 浏览 1839
- 评论(0)
如果HWND为NULL,
表明向当前线程发送Quit消息。。
大概是为了多任务的需要,Windows接管了所有的资源,以便于进行统一处理。 其中最××的就是接管了输入,并推出了消息队列的概念。 Windows为每个线程(包括主、辅、UI线程)维护一个消息队列,我们再从线程所属的消息队列中读取消息。这个消息...
[in] Handle to the window whose window procedure is to receive the message. The following values have special meanings.
HWND_B ...
- 2009-04-17 09:57
- 浏览 2332
- 评论(0)
一句话:
只有const的定义前面才可以有extern;别的则可有可无。
两种想法:
1.如果想在头文件中定义const:
const int a=10;
2.如果想在cpp文件中进行定义:
前面使用extern 将其扩大为全局变量。
头文件中写:
extern const int a;
在cpp文件中进行定义:
extern const int a=10;
这样的话,const变量的使用就和普通变量一样了,
3.只有const有这个“文 ...
- 2009-04-17 09:39
- 浏览 1165
- 评论(0)
#include "StdAfx.h"
#include "IO.H"
#include <locale>
using std::wstringstream;
wstringstream *pBuffer=new wstringstream();
bool MyWrite(std::wstring s)
{
static bool InitLocal=true;
if(InitLocal){
std::locale loc("chs");
pBuffer->imbue(loc); ...
- 2009-04-16 20:52
- 浏览 1304
- 评论(0)
// ffffffff.cpp : Defines the entry point for the console application.
//
#include "StdAfx.h"
#include "IO.H"
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <locale>
using namespace std;
wstringstream *pBuffer=new wstringstream( ...
- 2009-04-16 17:38
- 浏览 3945
- 评论(0)
int main(int argc,char*argv[])
{
string s;
ostringstream os;
istream is(os.rdbuf());
os<<"1000 "<<en;
os<<"1000 "<<endl;
os<<"1000 "<<endl;
is>>s;
cout<<s;
}
上面没有输出,原因是用了一个is关联了一个os的缓冲区!!因此失败.....解决办法 ...
- 2009-04-16 11:10
- 浏览 1433
- 评论(0)
rdbuf来重定向流 在SF的的collect.cpp中的collect函数中,使用了rdbuf来将标准输出重定向到日志文件。
// 重定向日志输出
ofstream file((LOG_PATH + "collect/" + fileName + ".log").c_str());
streambuf* buffer = ...
- 2009-04-16 10:27
- 浏览 2784
- 评论(0)
int main(int argc,char*argv[])
{
string s;
stringstream ssm;
//ssm.rdbuf();
//写到流的缓冲区,,但是并不刷新。
ssm<<"hello分隔符!";
//从流读,实际上是从缓冲区读。
//读完之后缓冲区数据没了。
cout<<(bool)(ssm>>s);
//这句话如果没有,那么将导致如下情况:
//如果缓冲区在输出没有刷新的情况下被读取了。。
//那么将会视为错误。
//当前缓冲区被 ...
- 2009-04-16 08:39
- 浏览 1485
- 评论(0)
// dffffffff.cpp : Defines the entry point for the console application.//#include <StdAfx.h>#include <iostream> #include <locale> #include <fstream>#include <string> #include <sstream>using namespace std;//创建全局对象。这些对象保存在全局区。
ofstream *pof=new ofstream(" ...
- 2009-04-15 21:42
- 浏览 1125
- 评论(0)
上篇文章讲述了如何创建自己的标准输入输出,但是如何将标准的输入输出流进行重定向呢:
下面是一个具体的方法:
fp = _fdopen( hConHandle, "w" ); *stdout = *fp; setvbuf( stdout, NULL, _IONBF, 0 );
我们可以完全仿照它的方法来做。
stdout
stdin
的指向。。重新赋值就可以了:
*stdout=ostream(ofs.rdbuf());
完毕。。代码附上:
- 2009-04-15 18:08
- 浏览 1129
- 评论(0)
// open and close a file using buffer members
#include <fstream>
using namespace std;
int main () {
char ch;
fstream filestr;
filebuf *pbuf;
pbuf=filestr.rdbuf();
pbuf->open ("test.txt", fstream::in | fstream::out);
// >> i/o operations here ...
- 2009-04-15 15:05
- 浏览 1297
- 评论(0)
wprintf 和 wcout
这篇文章应该是[netsin]的成果,我勤快,记下来。注:wprintf是C的标准库函数,但wcout不是C++的标准成员,C++中的 L"……" 是宽字符,却未必是unicode字符,这与编译器实现相关。[乾坤一笑]说:为什么 C/C++ 语 ...
- 2009-04-15 13:33
- 浏览 2316
- 评论(0)
#include <iostream.h>
#include <stdio.h>
class A{
private:
int i;
public:
//int i;
f(){
cout<<i<<endl;
}
};
class B:public A
{
};
class C:B{};
int main(){
C c;
c.f();
}
看下面的代码
:
#include <iostream.h>
#include <stdio.h>
class A{
priva ...
- 2009-04-14 17:33
- 浏览 1053
- 评论(0)
主要是想写一个类似控制台的东西,可以监视我程序里面的动作。。。
直接用控制台也行,但是那样太刻板!没创意。。。我想给用户以提示,告诉他程序在干什么!!!!!!非常良好的界面。。。。。。
先写一些想法,然后再去弄:
1.接口: 只有一个那就是print(string str);为简单期间,就这样了;
2.行为的载体: 暂时选,一个Windows窗口吧,当然也可以是文件。 模式选择: 作为一个窗口,应该使用监听者模式,也就是他应该去监听Print事件,一个事件其实就是 一个函数调用。 窗口作为一个监听者而存在。 真的么???????????有一个更加抽象的东西存在,那就 ...
L1 = max(abs(vertx - viewx), abs(verty - viewy), abs(vertz - viewz)); enabled = error * Threshold < L1;
第一个公式说的是距离,一个点的空间位置。
第二个公式说的是对于这个空间位置,如果error很大,超越了忍受程度,那么,就需要被enable 的。
第三个问题是什么时候该分解:
bc[x,y,z] == coordinates of box centerex[x,y,z] == extent of box from the center (i.e. 1/2 ...
- 2009-04-12 04:02
- 浏览 1044
- 评论(0)