V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  ipwx  ›  全部回复第 7 页 / 共 205 页
回复总数  4089
1 ... 3  4  5  6  7  8  9  10  11  12 ... 205  
2024-08-21 11:58:38 +08:00
回复了 ryanhui 创建的主题 问与答 女孩子们真的没有压力吗?
你作为一个准中产,看的是准中产的女生。
----

因为她们从小的家庭、教育北京让她们相信,父母/丈夫/单位/社会,会兜底。
2024-08-21 11:42:15 +08:00
回复了 chunkingName 创建的主题 问与答 新手求相机推荐,预算 1W 左右,上限 1W5
“女朋友说,手机拍的没有相机拍的好看,以及手机拍远景不行”
-----

@chunkingName 相机上限高下限低。相机上面推荐很多了,不过还是稍稍提一句,1w5 的预算真的尴尬,加到 2w 可以上全幅,而 apsc 不一定能满足你女友的需求。

我猜你女友想拍成这样: https://space.bilibili.com/430726

你可以看看这个 UP 主每个视频用的设备。虽然很多人说,设备不能决定你拍照成怎么样,大师用便宜器材也能排除好片,可是……

另外除了设备,你还得会后期。
----

总之就这样吧。
@citycai 黑群晖那些人基本不建博客啊……

讲个笑话,网站标题有 “博客” 字样是不能通过备案的。你得用其他名称。
因为 ansible 更好用啊( 你看我的武器库

admin.encrypted-backup dev.build-tools fs.mfs-server
admin.ssh-keys dev.docker-auth net.clash-proxy
auth.ldap-manager dev.docker-prune sys.config
auth.ldap-server dev.docker-registry sys.docker
cfg.xxxxxx dev.docker-sync sys.packages
cfg.yyyyyy dev.gitlab-ce sys.userdel-ccf
cron.prefect dev.gitlab-runner vpn.ovpn-client
cron.switch-day-jobs dev.push-to-forquant vpn.ovpn-server
db.clickhouse-single dev.pypi-server web.assets-http
db.mongodb-cluster dns.xxxxxx web.certbot-cloudflare
db.mysql-cluster dns.yyyyyy web.doc-server
db.postgres-cluster fs.mfs-common
db.timescaledb-single fs.mfs-mount

这些都是直接拿来就能用的自动部署脚本。然后要部署一个集群的时候,就填入变量然后执行,例如,部署 mysql 双节点集群:

# 双节点 mysql 集群
- hosts: db1
roles:
- role: db.mysql-cluster
tags: mysql
vars:
mysql_server_role: "master"
mysql_server_id: 1
mysql_root_password: "xxxx"
mysql_replication_password: "yyyy"

- hosts: db2
roles:
- role: db.mysql-cluster
tags: mysql
vars:
mysql_server_role: "slave"
mysql_server_id: 2
mysql_root_password: "xxxx"
mysql_replication_password: "yyyy"
mysql_master_ip: 192.168.x.x


再比如,添加一个每天定时更新 Let's Encrypt 证书的任务,然后将证书配置给 Docker Registry 和 Pypi

- hosts: docker-registry
roles:
- role: web.certbot-cloudflare
tags: certbot
vars:
certbot_instance: registry
certbot_email: [email protected]
certbot_domains:
- registry.example.com
- pypi.example.com
certbot_cloudflare_token: 'xxxxxx'
certbot_deploy_dirs:
- /etc/nginx/certs
certbot_cron_hour: '4'
certbot_cron_minute: '14'
- role: dev.docker-registry
tags: [prod, docker-registry]
vars:
registry_instance: prod
registry_port: 5000
registry_ui_port: 8000
registry_nginx_enable: true
registry_auth_enable: true
registry_nginx_hostname: registry.example.com
registry_nginx_ssl_cert: /etc/nginx/certs/fullchain.pem
registry_nginx_ssl_cert_key: /etc/nginx/certs/privkey.pem
registry_auth_users:
- username: xxxxxx
password: yyyyyy
- role: dev.pypi-server
tags: [prod, pypi]
vars:
pypi_http_port: 8080
pypi_fallback_url: https://pypi.tuna.tsinghua.edu.cn/simple
pypi_nginx_hostname: pypi.example.com
pypi_nginx_ssl_cert: /etc/nginx/certs/fullchain.pem
pypi_nginx_ssl_cert_key: /etc/nginx/certs/privkey.pem
我还以为你是想要访问家里拿点东西,没想到是博客站。

乖乖上阿里云 + 备案吧,要不就去国外。
建议给你的家庭服务器架个 vpn ,你的终端设备连上去
写 dsl 可以用 pyparsing
2024-08-14 17:50:05 +08:00
回复了 happydayandnight 创建的主题 投资 携百万资金,再次梭哈娜娜
@daodao 不知道为啥,国内都把价值投资等价于定投,更有甚者价值投资等于买了装死不动。

也不看看价值投资的巨擘,巴菲特,现在已经清仓了一堆股票了……
2024-08-14 17:03:50 +08:00
回复了 MrLonely 创建的主题 Kubernetes 学不会 k8s 怎么办?
@MrLonely Host 上有个数据目录太正常不过了。

你可以每天跑个定时任务,先关掉 docker compose ,然后把整个数据目录用 tar 打包(以为 tar 可以保存 owner 和权限信息),复制到备份目录,然后再打开 docker compose 。

docker compose down
BACKUP_NAME=$(date +%Y%m%d)
tar czvf ${BACKUP_NAME}.tgz 数据目录名称
rsync -avP ${BACKUP_NAME}.tgz 备份目录/
rm -f ${BACKUP_NAME}.tgz
docker compose up

备份目录可以选择 nas 的硬盘。然后你就可以愉快的使用它,而不用怕数据丢失了。所以我说 docker compose 太好用了。
2024-08-14 10:46:47 +08:00
回复了 HuberyPang 创建的主题 分享创造 两天时间写了个落地页,欢迎大佬点评
大佬,有没有开源的打算,跪求!
2024-08-13 11:32:12 +08:00
回复了 MrLonely 创建的主题 Kubernetes 学不会 k8s 怎么办?
然后,单节点部署我不觉得是麻烦事情。

推荐你学习一下 ansible ,配合 docker ,几十台机器随便你管理。


最后的最后,为啥你都用 docker 了还需要备份虚拟机状态?不是直接 docker compose down ,然后复制一整个 docker compose 目录,最后 docker compose up 就行了嘛?

或者你不知道 docker compose ?
2024-08-13 11:28:24 +08:00
回复了 MrLonely 创建的主题 Kubernetes 学不会 k8s 怎么办?
ummm 作为量化交易员你用这个干嘛。

另外 image 和 container 区别需要很久才能理解,你可能需要让你的学习能力进步一点(
2024-08-13 11:25:43 +08:00
回复了 shimheeyeon 创建的主题 问与答 Web 远程桌面方案求推荐
Linux 的远程桌面体验和 Windows 是比不上的,因为 Windows 内核有支持,RDP 是发送了控件绘制指令,所以很快;但 Linux 虽然 X11 有绘制指令,可乱七八糟的,所以 VNC 基本等于截图。
2024-08-09 14:38:32 +08:00
回复了 Betsy 创建的主题 C++ 求教个 C++ Get 函数怎么写的问题
@lovelylain 你确实 C++ 的细节比我掌握的好,你是个人才。

我只是不推荐楼主去陷入这种不适合工程开发的实践而已。
2024-08-09 12:06:55 +08:00
回复了 Betsy 创建的主题 C++ 求教个 C++ Get 函数怎么写的问题
@lovelylain 简单来说,我反对任何形式地依赖这种语义的写法,原因如下:


const A& a = F();


这句话到底会不会产生一个 BUG ,依赖于 F() 的实现。如果 F() 不符合规范中的情形,你这种写法可能会出错。

对于一个工程而言,如果不能在调用方确定上述用法对不对,那就是个灾难。比如

template <typename F>
void someFunction(F&& f) {
const A& a = F();
...
}

当别人复用你的 someFunction 的时候,它就是个隐藏炸弹。

====


@Betsy 27 楼的问题,人家想做的时候照样能够先把 const T& cast 到 const T* 然后 const cast 。。。

想用是拦不住的。
2024-08-09 12:02:41 +08:00
回复了 Betsy 创建的主题 C++ 求教个 C++ Get 函数怎么写的问题
@lovelylain “ 返回临时对象,用 const&接收返回值,符合 c++标准,没问题的,编译器会处理声明周期。”

嘿你可真是个人才,还真有这个规范:

https://en.cppreference.com/w/cpp/language/reference_initialization

Lifetime of a temporary

Whenever a reference is bound to a temporary or to a subobject thereof, the lifetime of the temporary is extended to match the lifetime of the reference, with the following exceptions:

a temporary bound to a return value of a function in a return statement is not extended: it is destroyed immediately at the end of the return expression. Such function always returns a dangling reference.
a temporary bound to a reference member in a constructor initializer list persists only until the constructor exits, not as long as the object exists. (note: such initialization is ill-formed as of DR 1696).
(until C++14)
a temporary bound to a reference parameter in a function call exists until the end of the full expression containing that function call: if the function returns a reference, which outlives the full expression, it becomes a dangling reference.
a temporary bound to a reference in the initializer used in a new-expression exists until the end of the full expression containing that new-expression, not as long as the initialized object. If the initialized object outlives the full expression, its reference member becomes a dangling reference.
a temporary bound to a reference in a reference element of an aggregate initialized using direct-initialization syntax (parentheses) as opposed to list-initialization syntax (braces) exists until the end of the full expression containing the initializer.

可是这规范又臭又长,而且 "with the following exceptions" 一不留神就用错。为啥不用肯定没问题、而且编译器会负责优化的返回值拷贝呢?
刚刚在隔壁帖子看到一个 OP 270 满融买 TSLA ,现在大概已经亏 60% 了。

我瞬间觉得 OP 其实亏得挺少的。
@hackyuan 260 满融不止损到现在的位置,你让他 230 懂得退出那也太难为 OP 了。
2024-08-08 11:40:59 +08:00
回复了 Betsy 创建的主题 C++ 求教个 C++ Get 函数怎么写的问题
这样,楼主你把 C++ 的引用看成 “指针” 的语法糖就行了。

引用基本就是指针。。。

=====

所以你的第一种,一般可以写成(没有过编译器,手写,不保真):


const Student* Get(const std::string& key) {
auto it = this->map_.find(key);
return (it != this->map_.end()) ? &(it.second) : std::nullptr;
}


然后用的时候

auto myStudent = table.Get("w1");
if (myStudent) {
...
}
1 ... 3  4  5  6  7  8  9  10  11  12 ... 205  
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5326 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 69ms · UTC 06:46 · PVG 14:46 · LAX 22:46 · JFK 01:46
♥ Do have faith in what you're doing.