V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  CodeCodeStudy  ›  全部回复第 2 页 / 共 44 页
回复总数  880
1  2  3  4  5  6  7  8  9  10 ... 44  
106 天前
回复了 echo0x000001 创建的主题 职场话题 应该向父母隐瞒自己的实际工资吗?
你弟上学,你帮一下是应当的,但是他结婚、买房,就不关你事了
106 天前
回复了 hgg12580 创建的主题 计算机 2024 年了,求推荐静音 Win 笔记本
等年中的 x elite 的笔记本吧
107 天前
回复了 baolinliu442k 创建的主题 Java 实际项目中如何使用线程池
底层类库用的,业务中谨慎使用
110 天前
回复了 zhenruyan 创建的主题 Visual Studio Code 做了个 vscode 的下载 mirror 站
110 天前
回复了 zhenruyan 创建的主题 Visual Studio Code 做了个 vscode 的下载 mirror 站
@zhenruyan 你怎么不更新了,现在是 1.85 了,你的镜像站还是 1.79
@rulerstorm #14 怎么会招不到年轻便宜的,只要 IT 岗位的工资比社会平均工资高一些,自然会有很多人涌进来的
112 天前
回复了 OrangeSinglee 创建的主题 问与答 第一次去女朋友家送什么比较好
橘子,香蕉,葡萄,苹果
今年我 35 岁,有 35 岁歧视,10 年后我 45 岁,不再有 35 岁歧视了,但是会有 45 岁歧视
@loginv2 #29 可以使用两步验证,也就是多一个动态口令,有效期只有 30 秒
119 天前
回复了 spitfireuptown 创建的主题 程序员 搞开源项目,收费卖文档有搞头吗
你这样子还不如把你的项目分成社区版和商业版,社区版的代码和文档完全免费,商业版付费。
@way2create #26 对,旧版本的一样的

https://www.php.net/manual/en/function.rand.php

As of PHP 7.1.0, rand() uses the same random number generator as mt_rand().
https://github.com/php/php-src/blob/master/ext/standard/string.c#L5630

```c
PHPAPI bool php_binary_string_shuffle(const php_random_algo *algo, php_random_status *status, char *str, zend_long len) /* {{{ */
{
int64_t n_elems, rnd_idx, n_left;
char temp;

/* The implementation is stolen from array_data_shuffle */
/* Thus the characteristics of the randomization are the same */
n_elems = len;

if (n_elems <= 1) {
return true;
}

n_left = n_elems;

while (--n_left) {
rnd_idx = algo->range(status, 0, n_left);
if (EG(exception)) {
return false;
}
if (rnd_idx != n_left) {
temp = str[n_left];
str[n_left] = str[rnd_idx];
str[rnd_idx] = temp;
}
}

return true;
}
```

https://github.com/php/php-src/blob/master/ext/random/random.c#L423

```c

PHPAPI zend_long php_mt_rand_range(zend_long min, zend_long max)
{
return php_random_algo_mt19937.range(php_random_default_status(), min, max);
}

```


可以看出,都是调用某个算法的 range 函数,所以 str_shuffle 和 mt_rand 的底层都是相似的,差别可能就是算法不一样
用 random_int 这个函数

random_int(int $min, int $max): int
@theprimone #10 大哥看来你不了解 TOTP 的原理啊,TOTP 本来就不依赖于网络的,是网站随机生成密码,然后发给用户(通常密码转成二维码,让用户扫二维码),用户通过密码和时间戳的一系列计算,得到 6 位数字。因为是对时间戳对 30 取余的,所以是每 30 秒变化一次。因为通过这 6 位数字,是反推不出原密码的,所以保证了密码的安全。
VSCode 的 Golang 的自动 import 很难用,有谁介绍一下吗
Swoole 可以将进程绑定到特定的 CPU 核上

https://wiki.swoole.com/#/process/process?id=setaffinity
为什么要把 16 寸 mac book 拿来拿去,是公司发不起电脑吗,还是你自己买不起电脑?
124 天前
回复了 unt 创建的主题 MySQL 为什么还有很多人不愿意放弃 mysql5.7
查询缓存没有了

https://dev.mysql.com/doc/refman/5.7/en/query-cache.html

The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0.
124 天前
回复了 unt 创建的主题 MySQL 为什么还有很多人不愿意放弃 mysql5.7
@unt #17 因为升高版本的话要经过测试的,不然容易踩到坑,比如 nodejs 在 centos7 上只能安装 16 ,安装不了 18

https://nodejs.org/en/blog/announcements/v18-release-announce/#toolchain-and-compiler-upgrades

Prebuilt binaries for Linux are now built on Red Hat Enterprise Linux (RHEL) 8 and are compatible with Linux distributions based on glibc 2.28 or later, for example, Debian 10, RHEL 8, Ubuntu 20.04.
1  2  3  4  5  6  7  8  9  10 ... 44  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5307 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 42ms · UTC 01:18 · PVG 09:18 · LAX 18:18 · JFK 21:18
Developed with CodeLauncher
♥ Do have faith in what you're doing.