\n'); } function setFlash(){ var myFlshObj = document.myFlash; var photoAlbum=document.getElementById('photoAlbum'); if(photoAlbum&&myFlshObj){ var awidth=0; awidth=parseInt(photoAlbum.offsetWidth); if(awidth<260) myFlshObj.height='150px'; if(awidth>=260 && awidth<350) myFlshObj.height='240px'; if(awidth>=350 && awidth<370) myFlshObj.height='305px'; if(awidth>=370 && awidth<550) myFlshObj.height='320px'; if(awidth>=550 && awidth<730) myFlshObj.height='455px'; if(awidth>=730) myFlshObj.height='590px'; } } function setAlbumUrl(name){ albumTypename=name; setFlash(); myFlash_DoFSCommand(null,"test"); } function showLoginWindow(ev){ var obj = document.getElementById("pop-login"); if(document.all){ obj.style.top = ev.clientY +'px'; obj.style.left = ev.clientX - 272 +'px'; } else{ obj.style.top = ev.pageY +'px'; obj.style.left = ev.pageX - 272 +'px' } obj.style.display ="block"; document.getElementById("pop-user-name").focus(); } function hideLoginWindow(){ document.getElementById("pop-login").style.display ="none"; } var blogID=getBlogID(); var UserName = ""; if(blogID!=null){ var tmpUserName=blogID.split("."); UserName=tmpUserName[0]; } function resize(obj){ if(window.event.srcElement.tagName == 'A'){ return; } obj.parentNode.childNodes[1].style.display = obj.parentNode.childNodes[1].style.display=='none' ? 'block': 'none'; obj.parentNode.childNodes[2].style.display = obj.parentNode.childNodes[2].style.display=='none' ? 'block': 'none'; } function tab(event){ var evt = (document.all)?window.event:event; if(evt.keyCode == 9){ document.getElementById("pop-password").focus(); return false; } else{ return evt.keyCode; } } function tab1(event){ var evt = (document.all)?window.event:event; if(evt.keyCode == 9){ document.getElementById("save").focus(); return false; } else{ return evt.keyCode; } } function tabTrack(event) { var evt = (document.all)?window.event:event; if(evt.keyCode == 9){ document.getElementById("pop-password-track").focus(); return false; } else{ return evt.keyCode; } }
我学过人工智能
日历
最新评论
日志索引
统计
统计中,请等候...
统计中,请等候...
日志
http://www.google.com/press/new-approach-to-china/update.html
“Google及另外二十余家美国公司受到了来自中国的、复杂的网络攻击…… 这些攻击以及它们所暴露的网络审查问题,加上去年以来中国进一步限制网络言论自由,包括 对FaceBook、Twitter、YouTube、Google Docs 和 Blogger 等网站的持续屏蔽,使我们做出结论:我们不能继续在Google.cn搜索结果上进行自我审查。”orz
猫记是我养的猫。
猫记是我经常光顾的水果摊老板送的,她家的母猫生了小猫,太多了养不了,而猫记是其中唯一一只长得不一样的,所以被我看中了。
猫记小时侯只有一点点大,两个手指就可以拎起来,叫声又小又细,走路摇摇晃晃,很可爱,最喜欢的事情是喝牛奶和玩丝带。
猫记现在还没到一岁,已经是重达9斤的公猫,抱起来很累,叫起来嗷嗷的,很欠打,最喜欢的事情是吃放和睡觉。
有图为证:
小时候:http://picasaweb.google.com/cactus620/invmLI#
长大后:http://picasaweb.google.com/cactus620/UGnSeE#
以前仗着自己桌子够大,放了两台工作站一台笔记本还是一直坚持各用各的鼠标键盘。后来桌上东西越来越多,打翻了两次水杯之后,还是觉得找个共享鼠标键盘的工具来用了。
记得以前在学校用过一种硬件的转换器,把一套显示器、鼠标、键盘都接在转换器上,按一些切到电脑1,再按一下切到电脑2。这一次用软件解决,而且不需要切换显示器。
昨天试了一下synergy(http://synergy2.sourceforge.net/),开源的,还不错,基本满足我的需求。但是作为server的那台机器配置比较麻烦。需要配置两台显示器的名字和相关位置,配置了显示器1在显示器2的左边还不行,还是不能用,还要配显示器2在显示器1的右边。这个有点无语了……虽说确实我也可以配成显示器2在显示器1的左边(用起来怪怪的,鼠标乱飞),但是这样有实际意义吗?个人觉得是多余的自由度,添加了不必要的麻烦。
总的来说,节省了一套键盘鼠标的面积,世界宽敞多了~~~
Trouble will find you no matter where you go, oh oh
No matter if you're fast, no matter if you're slow, oh oh
The eye of the storm wanna cry in the morn, oh oh
You're fine for a while but you start to lose control
He's there in the dark, he's there in my heart
He waits in the wings, he's gotta play a part
Trouble is a friend, yeah trouble is a friend of mine
Ahh..
Trouble is a friend, but trouble is a foe, oh oh
And no matter what I feed him he always seems to grow, oh oh
He sees what I see and he knows what I know, oh oh
So don't forget as you ease on down my road
He's there in the dark, he's there in my heart
He waits in the wings, he's gotta play a part
Trouble is a friend, yeah trouble is a friend of mine
So don't be alarmed if he takes you by the arm
I roll down the window, I'm a sucker for his charm
Trouble is a friend, yeah trouble is a friend of mine
Ahh..
How I hate the way he makes me feel
And how I try to make him leave
I try, oh oh I try
关于std::map的erase方法,到底返回的下一个元素的iterator还是void?
msdn上查到的是 iterator,3种原型如下:
iterator erase(
iterator _Where
);
iterator erase(
iterator _First,
iterator _Last
);
size_type erase(
const key_type& _Key
);
但是在map文件中看到的确是void (怎么会这样?)
#if _HAS_STRICT_CONFORMANCE
void erase(const_iterator _Where)
{ // erase element at _Where
_Mybase::erase(_Where);
}
size_type erase(const key_type& _Keyval)
{ // erase and count all that match _Keyval
return (_Mybase::erase(_Keyval));
}
void erase(const_iterator _First, const_iterator _Last)
{ // erase [_First, _Last)
_Mybase::erase(_First, _Last);
}
…
到底哪一个是对的呢?应该说都是对的,取决于_HAS_STRICT_CONFORMANCE的定义。这个宏到底有什么用呢,查到一篇文章如下。我想基本上我们不会想要用它。
http://blogs.msdn.com/xiangfan/archive/2008/08/30/conformance-macros-in-vc-stl.aspx
那么接下来一个问题:在遍历std::map的循环中erase其中的item,到底用什么方法?关于这个问题基本上有两种说法。
说法一:
std::map oMap;
…
std::map::iterator itr
for (itr = oMap.begin(); itr != oMap.end();)
{
if (NeedDelete(*itr))
oMap.erase(itr );
else
itr;
}
说法二:
std::map oMap;
…
std::map::iterator itr
for (itr = oMap.begin(); itr != oMap.end();)
{
if (NeedDelete(*itr))
itr = oMap.erase(itr);
else
itr;
}
个人意见比较喜欢说法二,因为和其他的容器类比较一致。而且本人脑子反应比较慢,这种写法比较容易看懂。当然这个做法的前提是erase方法返回值是iterator。这就回到了第一个问题,在VS中的VC头文件yvals.h中可以查到如下定义:
#ifndef _HAS_STRICT_CONFORMANCE
#define _HAS_STRICT_CONFORMANCE 0
#endif /* _HAS_STRICT_CONFORMANCE */
所以map文件中的那段定义是没有起作用的,erase方法是调用的由_Tree继承而来的版本,返回值是iterator。这样的结果算是皆大欢喜吧:)
稻香
曲:周杰伦词:周杰伦
对这个世界如果你有太多的抱怨
跌倒了就不敢继续往前走
为什么人要这么的脆弱堕落
请你打开电视看看
多少人为生命在努力勇敢的走下去
我们是不是该知足
珍惜一切就算没有拥有
还记得你说家是唯一的城堡
随着稻香河流继续奔跑
微微笑小时候的梦我知道
不要哭让萤火虫带着你逃跑
乡间的歌谣永远的依靠
回家吧回到最初的美好
※music※
不要这么容易就想放弃就像我说的
追不到的梦想换个梦不就得了
为自己的人生鲜艳上色
先把爱涂上喜欢的颜色
笑一个吧功成名就不是目的
让自己快乐快乐这才叫做意义
童年的纸飞机
现在终于飞回我手里
所谓的那快乐
赤脚在田里追蜻蜓追到累了
偷摘水果被蜜蜂给叮到怕了
谁在偷笑呢
我靠着稻草人吹着风唱着歌睡着了
哦哦午后吉它在虫鸣中更清脆
哦哦阳光洒在路上就不怕心碎
珍惜一切就算没有拥有
还记得你说家是唯一的城堡
随着稻香河流继续奔跑
微微笑小时候的梦我知道
不要哭让萤火虫带着你逃跑
乡间的歌谣永远的依靠
回家吧回到最初的美好
昨天看了这部片子,很轻松搞笑,不过发现了很多bug。
1. 最大的问题:艾米莉娅最后开飞机走的时候没有带金牌,走到半路肯定变成蜡人摔得粉身碎骨。
2. 古埃及人算的圆周率并没有那么精确,他们一直是用 3.16做圆周率的,所以用这个做密码不大可能。古代最精确的圆周率是中国的祖冲之同学算出来的。
3. 诺大的华盛顿博物馆,晚上没有一个保安……这个真实绝对的剧情需要啊……
4. 华盛顿博物馆被人杂得乱七八糟,好像没有人觉得应该怎么处理一下……
5. 就算人可以变活,飞机可以变活,火箭也可以变活,但是燃料哪里来的呢?
6. 金属雕像和石头雕像变活后没有改变材质,但是蜡像变活后都成了肉质的了?
总之肯定还有很多bug,我看得时候光顾哈哈笑去了,没有认真找。其实从一开始,什么金牌让展品变活的设定就很没有根据,所以也不用太在意什么逻辑了,幸福的关键就是和自己喜欢人在一起嘛。
好久没有看自己的blog了,试了半天才想起来密码,差点以为这个帐号没了。
最近被校内和开心吸引走了注意力,开始觉得很有趣,不过玩久了发现都是些费时费力的插件,惦记着过了几分钟,赶紧去做那些不需要脑子的重复劳动,大概主要是为了让朋友们知道自己还活着吧。这种模式似乎不适合我这样的懒人,还是自己写写blog好了。
前一阵很忙,产品每年年初发版本,然后项目组的人又跳的跳槽,调的调走,只剩了我一个光杆。我也不是第一次当光杆,没有关系。接着又re-org,然后老大发话要继续cost down,危机感还是必须要有的。现在项目组的开发就我一个人,做的好不好都是自己的责任。而且现在的项目组也比较边缘,属于两个产品的中间地段,要获得两边的重视,而不能成为两不管地带,要不然死活都没人知道。
前一阵还有一些考试,这次总算通过了系分(第三次了,事不过三嘛:P),不过托业的成绩还不知道,感觉一般般吧,英语能力还有待进一步加强,特别是口语和听力~
最近终于闲下来一点了,月末准备去旅游(如果能顺利拿到护照的话)。没有出国过,感觉又紧张又期待~
最近在Vista系统装卸同一个软件好多次,搞得再次安装的时候出现注册表错误信息:
Could not open key: UNKNOWNComponentsXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
Access is Denied.
上网查了好多地方才终于找到解决方法:
This error is a permissions error in the registry. If you search the registry for the first GUID you will find the key is likely mapped to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInstallerUserData<user SID>Components<GUID>. Beneath this key is a sub key for the second GUID. However, selecting the subkey will result in an access denied message.
To correct the problem:
1. Verify that you are running RegEdit as administrator (to avoid UAC issues with Windows Vista and Windows 3008 ).
2. Edit the permission of the parent key(HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionInstallerUserData<user SID>Components) and click the Advanced button. (Optionally, you could edit the permissions on the parent GUID (CBFF54E0ED12B0946A1C52E5E82ABC38 in my example) but the same problem is likely to exist with other keys so you may as well deal with this in mass.)
3. From the Advanced dialog, select the Owner tab and check the Replace owner on subcontainers and objects check box. Also, verify that System is the owner (else add System and be sure to select it so it will become the owner).
4. Next click Apply.
4. You may be presented with an error dialog, "Registry Editor could not set owner on the key currently selected, or some of its subkeys." You can safely ignore this warning as long as you are then able to view the subkey. If not :(, you may have to follow the same process but in safe mode or download Process Explorer and search for any process that is holding onto the key so that you can shut it down. (The idea that a process is preventing you from viewing the key is a stretch in my mind but I have had heard the Platform team of Microsoft's product support group suggest this.)
5. Lastly, select the "Effective Permissions" tab and verify that both your own User Id and the System user have Full Control. If not, add both users via the Permissions tab.
If this still fails, consider resetting registry permissions back to the default settings using the following command:
Registry security: secedit /configure /cfg %windir%infdefltbase.inf /db defltbase.sdb /verbose /areas REGKEYS
最近好动荡,走了一批人,有些是自己走的,有些是被公司开了,总之除了少数自己有更好去处的人,对其他人来说不是什么好事。
另一方面,站在公司的立场,也可以理解。金融危机的影响肯定是有,也不排除公司借这个东风做一些本来就想做的事情,对公司来说,肯定是成本越低越好。往好的一方面看,现在中国site受影响最小,所以不出意料的话以后研发重心应该会逐渐转向这边。
作为个人来说,自己能做的就是尽量提高自己的价值,让自己可以有更多的选择。我这个人想法不多,本来个人能力所能控制的事情也不多,现在是能先看着,看下一步还会有什么动作。可以预见的是,我们team没有了有经验的研发力量,明年压力肯定很大。不过公司也好,个人也好,只有经历一些大的变化和危机,最后还能坚持下来的,才是真正的强者。