[文件上传] => UPLOAD
[文件管理] => File Manager
[引力谜题] => Gravity Field
Welcome to Wonderland
置顶文章! 继续阅读?
New Home
=====9/14/2011=====
We have moved to our new home.
Plan to move all the old things too 🙂
源代码 的量子论解释
1 《源代码》的导演功力了得,电影的内涵远没有你想的这么简单。不是因为它涉及到了量子论,而是导演把这片子本身拍成了“量子电影” ,剧情的解释取决与你的思考模式,这点后面会解释。
2 既然用到量子论来解释,就得抛开一切常理的或着已经习惯的思维模式,否则你看到的只是导演给你看到的表象。想看到进一步的真相,就请格式化你常规世界的思路,进入量子世界的思路。
3 首先要打破的是你已习以为常的因果论世界观。比如先有宇宙,而后诞生人类。宇宙的自身演化(原因)最终诞生了我们人类这种有“意识”的智能生物(结果)。即原因造成结果。但在量子世界里,正统的哥本哈根派有一个著名的推论:“参与性宇宙模型”,简单的说就是观察者的观测行为本身参与了宇宙的构造过程。“意识”的存在反过来又创造了它自身的过去,这个推论叫“自激活”。没错,不是原因决定结果,而是结果创造原因。
[More]
随想
击鼓其镗,踊跃用兵。土国城漕,我独南行。
从孙子仲,平陈与宋。不我以归,忧心有忡。
爰居爰处?爰丧其马?于以求之?于林之下。
死生契阔,与子成说。执子之手,与子偕老。
于嗟阔兮,不我活兮。于嗟洵兮,不我信兮。
执子之手,与子共著.
执子之手,与子同眠.
执子之手,与子偕老.
执子之手,夫复何求?
律诗格律
五绝
注:⊙表示可平可仄
类型一
⊙平平仄仄,
⊙仄仄平平。(韵)
⊙仄平平仄,
平平仄仄平。(韵)
例诗:
山中
王勃
长江悲已滞,
万里念将归。
况属高秋晚,
山中黄叶飞。
类型二
平平仄仄平,(韵)
⊙仄仄平平。(韵)
⊙仄平平仄,
平平仄仄平。(韵)
例诗:
静夜思
李白
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。
VS bug
// assign_aTest.cpp : Defines the entry point for the console application.
//
#include “stdafx.h”
#include “boost/spirit.hpp”
#include “boost/spirit/actor/ref_actor.hpp”
using namespace boost;
using namespace boost::spirit;
#include
struct MyParser
: public grammar
{
mutable int m_i;
/// Constructor
MyParser()
{
}
/// Grammar definition
template
struct definition
{
definition(MyParser const& self)
{
test = (ch_p(L’@'))
[assign_a(self.m_i, 100)];
}
rule test;
// Start rule
rule const& start() const { return test; }
};
};
struct MyParser2
: public grammar
{
mutable int m_i;
static const int s_i = 100;
/// Constructor
MyParser2()
{
}
/// Grammar definition
template
struct definition
{
definition(MyParser2 const& self)
{
test = (ch_p(L’@'))
[assign_a(self.m_i, s_i)];
}
rule test;
// Start rule
rule const& start() const { return test; }
};
};
int _tmain(int argc, _TCHAR* argv[])
{
struct MyParser pa;
pa.m_i = 0;
parse(L”@”, pa);
struct MyParser2 pa2;
pa2.m_i = 0;
parse(L”@”, pa2);
std::cout<<"Parse1: "<<pa.m_i<<std::endl;
std::cout<<"Parse2: "<<pa2.m_i<<std::endl;
std::cin.get();
return 0;
}
VC在函数中将常数值赋给一个常引用,会导致出函数有效区域后此引用的无效,为一个不确定值。
更一般的测试例程:
// RefTst.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include
#include
using namespace std;
class A
{
private:
const int& m_i;
public:
A(const int& i)
: m_i(i)
{
}
void PrintI()
{
cout<<"I: "<<m_i<<endl;
const int* p = &m_i;
cout<<"P: "<<p<<endl;
}
};
A* GetA()
{
A* pA = new A(123456789);
pA->PrintI();
return pA;
}
void Print(A* pA)
{
int i = 54321;
__int64 j = 13328703583;
pA->PrintI();
}
int _tmain(int argc, _TCHAR* argv[])
{
A* pA = NULL;
pA = GetA();
pA->PrintI();
Print(pA);
delete pA;
cin.get();
return 0;
}
近期评论