V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  phpfpm  ›  全部回复第 2 页 / 共 28 页
回复总数  552
1  2  3  4  5  6  7  8  9  10 ... 28  
2025 年 11 月 7 日
回复了 phpfpm 创建的主题 宽带症候群 现在北京联通的 IPTV 都走路由模式了吗
@shyrock 这个自己抓包
@Kinnice 因为有还有一个隐含的是首先要活着
@thomaspaine u2 也没有合适的笼子攒机用
@lixile 16 代 R260 也有超短 1u 的 solution

我现在对于价格不敏感了,尺寸+稳定性+功耗才是考虑核心
@xiangyuecn 第一遍查总得大概齐看下有没有余额吧,完成一些不需要写表的业务逻辑。

至于在事务里面要不要再次查或者 select for update 随你

(我就这么一说不要认真当伪代码了 hhh
最佳实践是别用 mysql 做算术题,你就当他是 kv 你 update 一个主键就行。

先查出来,加个锁,开个事务,提交数据

mysql 的 cpu 很值钱,你程序的 cpu 不值钱

否则你高频做整个事情 mysql 内部自己有悲观锁什么的不整死你才怪
@Justinyeager 上班了后续呢
2025 年 4 月 8 日
回复了 tenserG 创建的主题 算法 面试遇到怪题,大家有什么思路吗
1 先分保底
2 每一块钱 roll ,超过 30%的重新 roll
2025 年 3 月 2 日
回复了 phpfpm 创建的主题 Linux 我被 sntp 的输出困惑了好久,原来这玩意不是时区
@Belmode 哪里不认真了
自问自答:

关闭 webui 的

对话的


自动生成标题

自动生成对话标签

功能
2024 年 12 月 27 日
回复了 zhishi69 创建的主题 程序员 年会晚会抽奖系统项目求推荐
直接工号+随机盐排序就行,不用程序
现场生成盐,公平公开公正
2024 年 12 月 10 日
回复了 jxxxjdinfjdikjnf 创建的主题 程序员 拼多多买硬盘踩到坑了,大家谨慎。
1. 多少钱买的?不到 5 毛( 400 )别说价格香
2. 低于这个价格就当没保的觉悟吧
3. 不服就申请仅退款啊反正是拼夕夕
2024 年 7 月 31 日
回复了 atfeel 创建的主题 程序员 谁能推荐个适合个人用的短信验证码发送平台?
腾讯云个人就可以吧。。而且阿里的 sdk 也很简单直接调用就行
@MirageTurtle 绝无这种可能
买甄姬吧
您本来就是破解。。你说呢
@ZE3kr 但是为啥这个例子 php 和 go 没踩坑呢,js ,.net ,python 都挂了
@rrfeng php 石宪的应该是 pcre
@sunfall
@ghjh
感谢,get ,学习了。
例如,正则表达式模式或量词^(a+)+$由以下 NFA 表示

收。
@yumusb 主要是这个现象无法描述,搜索引擎对于*支持的很差

我试了搜索 star after capture group 也没找到合适的结果

但是至少 ff 给你说 too much 了 hhh
```
package main

import (
"fmt"
"regexp"
"strings"
"time"
)

func testRegexPerformance(repeatCount int) {
testString := strings.Repeat("a", repeatCount) + "#"
regex := regexp.MustCompile(`(\w*)*$`)

startTime := time.Now()
result := regex.MatchString(testString)
endTime := time.Now()
executionTime := endTime.Sub(startTime).Milliseconds()

fmt.Println("Repeat Count:", repeatCount)
fmt.Println("Execution Time:", executionTime, "milliseconds")
fmt.Println("-----------------------------------")
fmt.Println(result)
}

func main() {
// 测试从 1 到 50 的重复次数
for i := 1; i <= 50; i++ {
testRegexPerformance(i)
}
}
```

```
function testRegexPerformance(repeatCount) {
var testString = 'a'.repeat(repeatCount) + '#';
var regex = /(\w*)*$/;

var startTime = process.hrtime();
var result = regex.test(testString);
var endTime = process.hrtime(startTime);
var executionTime = endTime[0] * 1000 + endTime[1] / 1000000;

console.log("Repeat Count:", repeatCount);
console.log("Execution Time:", executionTime + " milliseconds");
console.log("-----------------------------------" + result);
}

// 测试从 1 到 50 的重复次数
for (var i = 1; i <= 50; i++) {
testRegexPerformance(i);
}
```
<?php

function testRegexPerformance($repeatCount) {
$testString = str_repeat('a', $repeatCount) . '#';
$regex = '/(\w*)*$/';

$startTime = microtime(true);
$result = preg_match($regex, $testString);
$endTime = microtime(true);
$executionTime = ($endTime - $startTime) * 1000;

echo "Repeat Count: $repeatCount\n";
echo "Execution Time: $executionTime milliseconds\n";
echo "-----------------------------------\n";
var_dump($result);
}

// 测试从 1 到 50 的重复次数
for ($i = 1; $i <= 50; $i++) {
testRegexPerformance($i);
}
```

```
import re
import time

def test_regex_performance(repeat_count):
test_string = 'a' * repeat_count + '#'
regex = r'(\w*)*$'

start_time = time.time()
result = re.match(regex, test_string)
end_time = time.time()
execution_time = (end_time - start_time) * 1000

print("Repeat Count:", repeat_count)
print("Execution Time:", execution_time, "milliseconds")
print("-----------------------------------")
print(result)

# 测试从 1 到 50 的重复次数
for i in range(1, 51):
test_regex_performance(i)
```
1  2  3  4  5  6  7  8  9  10 ... 28  
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1002 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 48ms · UTC 18:48 · PVG 02:48 · LAX 11:48 · JFK 14:48
♥ Do have faith in what you're doing.