V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  limhiaoing  ›  全部回复第 5 页 / 共 13 页
回复总数  246
1  2  3  4  5  6  7  8  9  10 ... 13  
2017 年 5 月 30 日
回复了 tianxiacangshen 创建的主题 PHP 有没有人怀疑过 rand()函数得到的随机数并不随机?
There are no guarantees as to the quality of the random sequence produced. In the past, some implementations of rand() have had serious shortcomings in the randomness, distribution and period of the sequence produced (in one well-known example, the low-order bit simply alternated between 1 and 0 between calls).
2017 年 5 月 30 日
回复了 tianxiacangshen 创建的主题 PHP 有没有人怀疑过 rand()函数得到的随机数并不随机?
楼主方便分享下代码吗?
虽然知道是 rand 是伪随机,
但结果中的 78--66--0.0247% 看起来还是很意外的。
@hjc4869
感谢推荐,不过我这个最早是 2013 年的时候开始实现的,当时可能还没有 SYEngine。
http://blog.poxiao.me/p/wp8-streaming-flv-h264-aac/
@hjc4869 你说的这个似乎依赖了 FFmpeg。
2017 年 5 月 26 日
回复了 liusd 创建的主题 Kotlin 我与 Kotlin 的爱恨情仇之浅谈 async/await
@james
你这个是 generator 吧? 感觉和 async 还是有些区别的。
2017 年 5 月 26 日
回复了 liusd 创建的主题 Kotlin 我与 Kotlin 的爱恨情仇之浅谈 async/await
当年也是因为 async/await 这个语法糖学的 C#。
2017 年 5 月 19 日
回复了 KillThunder 创建的主题 问与答 Windows 传文件到 Linux
我一般用 Win10 bash。
2017 年 5 月 14 日
回复了 q397064399 创建的主题 Go 编程语言 golang 的协程比线程轻量级 轻量级在哪里,谢谢
goroutine 现在的实现也不是严格的协程了,协程是非抢占的,goroutine 的调度是抢占的。
2017 年 5 月 14 日
回复了 q397064399 创建的主题 Go 编程语言 golang 的协程比线程轻量级 轻量级在哪里,谢谢
goroutine 运行时栈初始是 2kb,而线程一般是几 MB,当创建几千个得时候,goroutine 的内存开销远小于线程。
goroutine 的调度不需要进入内核,也比线程的开销要小。
2017 年 5 月 13 日
回复了 AirSc 创建的主题 问与答 选择什么杀毒软件 2017.05
只用了 Windows Defender。
@sbabybird
想探讨原因就不应该用这种标题!
这代码能编译通过?
2017 年 4 月 29 日
回复了 forcecharlie 创建的主题 C A bug in GCC that may cause memory leaks in valid C++ programs
@limhiaoing
说错了,是 std::vector::at 抛的异常。
2017 年 4 月 29 日
回复了 forcecharlie 创建的主题 C A bug in GCC that may cause memory leaks in valid C++ programs
@owt5008137
另外这个 bug 并不是构造函数抛异常导致的,bug 单里 Tomasz Kamiński 的例子是 std::basic_string::at 抛的异常。
2017 年 4 月 29 日
回复了 forcecharlie 创建的主题 C A bug in GCC that may cause memory leaks in valid C++ programs
15 年报告的 bug,但 gcc 似乎不着急解决。
bug 单里 Tomasz Kamiński 的例子的写法在 C++11 其实还是挺常见的。
在 gcc 解决前想继续使用 gcc 编译的话可以用代码静态分析扫描一遍,给 aggregate initialization 的匿名对象加个变量名就好了。
2017 年 4 月 29 日
回复了 forcecharlie 创建的主题 C A bug in GCC that may cause memory leaks in valid C++ programs
@owt5008137
C++引入异常的一个原因就是用于报告构造函数错误,所以构造函数抛异常是很合理的做法。
这个 bug 使用了 C++11 的特性,意味着老的代码不需要有这方面的顾虑。
2017 年 4 月 28 日
回复了 forcecharlie 创建的主题 C A bug in GCC that may cause memory leaks in valid C++ programs
@AngelCriss
都说是 bug 了
2017 年 4 月 24 日
回复了 banli 创建的主题 问与答 编程过程中, 你是习惯提前返回, 还是统一返回。
@geelaw
真不知道说你什么好,性能高必须用 malloc ?
高性能程序都是用内存池的好吗?
另外 vector 有性能问题是你不会用。
1  2  3  4  5  6  7  8  9  10 ... 13  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1040 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 19:07 · PVG 03:07 · LAX 12:07 · JFK 15:07
♥ Do have faith in what you're doing.