在实际应用中,我们经常需要产生随机数,这些随机数的应用范围也是十分广泛的。但计算机只能依据一定算法产生伪随机数序列。c语言中最常用的产生伪随机数序列的函数是srand和rand
srand,rand函数在实现上利用TlsGetValue等一系列函数进行数据的存取,也就意味着srand,rand存取的数据是和线程相关的。
根据我使用经验,总结出以下几点注意事项:
1、rand函数初次使用之前必须调用srand函数初始化,才能保证产生不同的随机数序列。
2、在多线程程序中,如果每个线程都需要调用rand,那么必须在每个线程里单独进行初始化。
3、单进程的srand初始化,可以简单的采用time(0)即可,但是多线程中,如果每个线程的开始时间近乎相同,那么就不可采用time(0)进行初始化,因为time(0)实际精度只有s级,会导致每个线程产生相同的随机数序列,因此需要用每个线程各不相同的一个数去初始化srand,例如threadid等等
近期琢磨SSreader,包括其下载过程和整个相关参数的解码过程。
刚刚突然灵感出现,将所有已知的线索串联了起来。
我想我知道老鹰版ssreader为什么即使是能看不能下的书能下到300dpi的没加密的pdg了。无外乎利用超星服务器或者说超星软件在整个沟通过程中的一个很大漏洞,去绕掉下载限制,去下载能看不能下的书,至于没加密,那就更简单了,加密时在本地,回避即可。至于300dpi,也是利用前面那个漏洞,因为超星阅读器实际上在服务器有300dpi的时候,阅读时看到的是300dpi,但是下回来的是快速版。所以绕掉了下载限制也就绕掉了300dpi。
所以总之一句话:老鹰版ssreader并没那么神秘。
自己在原版ssreader上测试了下,的确如是。~
BoxedAppSdk 2.1.0.16破解,带X64版本。
链接——> 猛击下载
What is BoxedApp SDK?
BoxedApp SDK is a developer library that provides a set of functions for emulating a file system and a system registry for an application. Using these functions, you can create virtual files, fake registry entries, keys and values.
32-bit and x64 are supported.
Why and when is it useful?
- When an application must run properly even if it doesn’t have the right to write to the system registry and to the file system
- When an application uses DLL and files, which are to be kept secure, and because of that you can’t save them to disk
- When an application needs ActiveX but doesn’t have an installer because it must run instantly, without the installation (for example, when it’s a portable application that runs from a flash card)
Just a quick example: suppose, your application uses a Flash ActiveX player to display a Flash movie or video. The end users would need a Flash player ActiveX to allow your application work properly. Also, keep in mind that Flash player is not capable of loading files directly from memory. That exposes two major problems: first, you would have to install a Flash player ActiveX, and second, you would have to have the movie in a file. BoxedApp SDK solves these problems: you simply create a virtual file that contains the flash movie, another virtual file that contains the Flash player ActiveX DLL, and virtual registry entries that point to that virtual file. That’s it. Now the application “thinks” that that the Flash player ActiveX is actually installed, so the Flash player works just as if the movie file was actually there.
In other words, you can now embed all DLL and content files, all ActiveX and OCX components, which your application uses, into a single EXE file. BoxedApp SDK doesn’t unpack these files to disk; it doesn’t use temporary files either.
Would like to see BoxedApp SDK in action? Download the demo right now! It includes many examples:
- The basic example that explains how to create virtual files and registry keys
- Embedding Flash player and Flash movies
and more!
Features
近日,在求实看见一贴,题为“请不要叫我博士”
纵观全文,LZ大意无非是
国内博士是一群 灵魂扭曲、性格变态、精神失常、内分泌失调的动物。大街上,当你看到一个满身油垢,精神萎靡,远看像个民工,近看像个乞丐,偏又背着书包戴着眼睛举止斯文憨厚老实的,那恭喜你,你看到了传说中的博士了。传说中博士可以三天不吃不睡三个月不洗澡不刮胡子一年不说话三年不出校门,传说中博士都是智商偏高情商几乎为零,不会世俗的应酬,不懂幽默,不听音乐不看电影,吃饭只吃馒头米饭萝卜白菜。
作为一名准博士,对这个行当还算有些了解,我想唠叨几句。的确,有不少博士是从本科因为逃避,选择了硕士,硕士因为逃避,选择了博士,最终博士毕业,无从逃避,他们必然也就无所是从。但博士的大群体还是好的,他们因为自己的爱好,自己的理想乃至自己的报复,选择了PHD,选择了当外星人。就国家而言,我们的确需要博士,相信这点我不用去仔细论证。
但就当今国内这个学术和社会环境而言,博士,生活空间太小。学术腐败以及浮夸,浮躁充斥着学术界的每个角落,将博士比作零情商的外星人的人比比皆是。给本来压力就比较大的博士群体增加了更多负担。就大部分博士生而言,平均年龄都在25左右,读完PHD后平均都在27、8,这个年龄,正常情况下已然拖家甚至带口,但国内的博士生待遇几何?胡自己口无多。
因此,当你准备选择读博,你要明白读博不仅仅是学校,读博亦是一种心境,更是一种生活!
愿与国内所有PHD Candidate共勉!
最近看见一套QQ表情,和qq自带的很像,只是全是方方正正的,看起来不错,呵呵,原作者比较低调,没发现是谁:)

点击下载方块表情
一直就知道自己比较胖,但是各种减肥措施大都不能坚持下来(没恒心啊),外加一直坐在实验室比较多,于是乎。。。。。所幸那时还能每周打2~3次,每次2个小时左右的羽毛球,所以体重还算稳定,没增加。
自从boss回国后,每周打羽毛球的时间骤减至每周2小时,今天一称,GOD,又涨了2斤,看来现在的运动强度和摄食量不匹配了。本来我这身高配我这体重就大是失衡,现在更惨了。
为了以后的幸福生活,我决定了,十一开始跑步,每1~2天一次,争取将体重降为之前标准。当然减的肯定是多多益善。