V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  zjsxwc  ›  全部回复第 57 页 / 共 213 页
回复总数  4250
1 ... 53  54  55  56  57  58  59  60  61  62 ... 213  
@JasonLaw #15

实际业务中 不怕数据多了,而是怕数据丢失,
comment 变 orphan 不可怕,甚至业务中你的 answer 也不是真删除而只是把 status 字段改成某个代表删除的值,于是对于这种业务来说外键约束级联删除都触发不了,这种伪删除的业务存在导致了数据库外键作用消失,外键只剩下 index 加速查询的作用。


忽然想到,

要用外键的一个 非常非常 重要的前提是你 真正的真实的 在删数据!!!!!!!而不是标记下伪删除。
不过也看业务,业务简单,后期不会修改业务,实体类关系是树状的用外键最爽。
@JasonLaw https://blog.csdn.net/aaaaaalll/article/details/80742064
这种已经是简化了的场景,实际情况更加复杂,会有各种花式依赖。
不是不想用,
而是业务复杂点,就碰到外键循环死锁依赖问题,
真 tm 吃 shit
2021-09-04 20:12:33 +08:00
回复了 onice 创建的主题 Linux 为什么你要用 Linux 当桌面呢?
因为不玩游戏,
因为我靠 linux 恰饭,
因为 win 下软件会流氓、会中毒、会各种广告恶心,
因为现在对 linux bash 等等比 powershell 更熟悉,

所以我在 linux 下更自在。
2021-09-04 10:20:40 +08:00
回复了 James369 创建的主题 程序员 js 的类有没有析构函数,如何进行资源释放??
上面 4 类语言中,只有 GC 语言存在 STW 卡顿现象。
2021-09-04 10:16:48 +08:00
回复了 James369 创建的主题 程序员 js 的类有没有析构函数,如何进行资源释放??
GC 语言( PHP\JAVA )的析构函数(__destruct/finalize ) != RAII 语言( C++)的析构函数 (~xx ) != ARC 语言( oc/swift )的析构函数( dealloc/deinit ) != 所有权语言( Rust )的析构函数( drop )
2021-09-03 16:43:13 +08:00
回复了 wh469012917 创建的主题 程序员 同事代码写的太烂了怎么办?
重构,有 ide 在 symbol 命名替换应该容易
2021-09-03 14:33:09 +08:00
回复了 James369 创建的主题 程序员 js 的类有没有析构函数,如何进行资源释放??
虽然 swift 没有 gc,也没有析构函数,但 swift 有 deinit 函数

In Swift, destructors are not required, as the memory deallocation is abstracted away and done automatically. However, they are available and known as “deinitializers”, to perform any cleanup that needs to be done just prior to actual deallocation of the object. Deinitializers are optional, and there can be one at most in a class.

In our car example, before we send it to the junkyard, we might want to un-register the vehicle’s license and cancel the insurance:

class Car {
//properties
init(model:String, color:String, vin:Int) {
// init code
}

deinit {
unRegisterLicense() // some function that un-registers the license
cancelInsurance() // some function that cancels the insurance policy
}
}
2021-09-01 10:28:47 +08:00
回复了 onice 创建的主题 信息安全 大家有杀软综合症吗?
manjaro 表示不用
2021-08-30 16:40:35 +08:00
回复了 CatCode 创建的主题 数据库 “微型业务”用啥数据库软件啊?
https://stackoverflow.com/questions/40189226/how-to-make-mysql-use-less-memory

这个帖子和楼主同样的问题,
第二个回帖把 performance_schema = off 关掉 mysql 的性能优化策略后,mysql 内存占用只有 37M
2021-08-30 16:35:01 +08:00
回复了 CatCode 创建的主题 数据库 “微型业务”用啥数据库软件啊?
@shyangs

innodb_buffer_pool_size 默认值就是 128M,你把它改小点不行吗
2021-08-30 16:29:48 +08:00
回复了 CatCode 创建的主题 数据库 “微型业务”用啥数据库软件啊?
问就是推荐 mariadb/mysql

楼主说什么空载运行内存 cpu 占用多之类的,问题都能通过修改默认配置参数解决

https://mariadb.com/kb/en/mariadb-memory-allocation/
2021-08-26 13:57:59 +08:00
回复了 20015jjw 创建的主题 汽车 各位觉得收入和车价应该是什么个比例
半年的可支配收入。
2021-08-26 08:56:32 +08:00
回复了 onice 创建的主题 新手求助 C/C++是两种不同的语言吗?
c++20 与 rust 哪个好用?
如果不能用数据库等存储(文件系统也算数据库)的话,

每 10 秒恒定就说明你这个随机数是由你当前时间确定的,于是你这个随机根本就不是随机数!

如果不是随机数,那么解决楼主需求的办法确实只有用 rsa 非对称加密办法了,最多就是密钥每天换一个新的。
2021-08-09 12:23:06 +08:00
回复了 wangbenjun5 创建的主题 程序员 Golang 写桌面 GUI 应用的体验
@wangbenjun5
https://doc.qt.io/qt-5/qmlfirststeps.html

用 qml js 写界面更简单了,声明式代码写 ui 、mvvm 数据绑定( Property Bindings ),组件自定义与复用。
对比之下,用 c++写 ui 简直噩梦。
2021-08-09 09:06:52 +08:00
回复了 wangbenjun5 创建的主题 程序员 Golang 写桌面 GUI 应用的体验
qt 都流行用 qml 写界面,也就是 js 。所以 qt 现在等于 js 。
1 ... 53  54  55  56  57  58  59  60  61  62 ... 213  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1971 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 43ms · UTC 07:32 · PVG 15:32 · LAX 00:32 · JFK 03:32
Developed with CodeLauncher
♥ Do have faith in what you're doing.