一佳一

记录像1+1一样简洁的代码

导航

上一页 1 2 3 4 5 6 ··· 39 下一页

2023年2月6日

摘要: 服务器的vpn重启后 无法上网了 原因是路由转发的问题 执行以下命令 sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADEcd /etc/init.d sudo iptables-save 阅读全文

posted @ 2023-02-06 14:52 一佳一 阅读(1) 评论(0) 推荐(0) 编辑

2023年1月17日

摘要: -1 例子postgres=# select 1/4;?column? 0(1 row) 在PG里如果想做除法并想保留小数,用上面的方法却行不通,因为"/" 运算结果为取整,并且会截掉小数部分。 --2 类型转换postgres=# select round(1::numeric/4::numeri 阅读全文

posted @ 2023-01-17 18:03 一佳一 阅读(663) 评论(0) 推荐(0) 编辑

2023年1月11日

摘要: 使用3310端口即可解决 docker run --name=my_container -dp 3310:3306 mysql/mysql-server 参考:https://stackoverflow.com/questions/66660829/error-2013-when-trying-to 阅读全文

posted @ 2023-01-11 14:19 一佳一 阅读(187) 评论(0) 推荐(0) 编辑

摘要: WSL Ubuntu 使用systemctl 报错时候 可以用sysvinit 语法代替 例如 systemctl start docker 需要替换成 service docker start 参考: https://linuxhandbook.com/system-has-not-been-bo 阅读全文

posted @ 2023-01-11 10:21 一佳一 阅读(2890) 评论(0) 推荐(1) 编辑

2022年11月25日

摘要: 1.WebApiConfig config.Formatters.JsonFormatter.SerializerSettings.Converters.Insert( 0, new JsonDateTimeConverter()); public static class WebApiConfig 阅读全文

posted @ 2022-11-25 14:53 一佳一 阅读(446) 评论(0) 推荐(0) 编辑

2022年11月10日

摘要: bill=# select 1/2::float8; ?column? 0.5 (1 row) bill=# select 1/2::numeric; ?column? 0.50000000000000000000 (1 row) bill=# select 1::money/2; ?column? 阅读全文

posted @ 2022-11-10 16:19 一佳一 阅读(321) 评论(0) 推荐(0) 编辑

2022年10月13日

摘要: 问题一:用户扣款的业务场景是怎样的? 用户购买商品的过程中,要对余额进行查询与修改,大致的业务流程如下: 第一步,从数据库查询用户现有余额:SELECT money FROM t_yue WHERE uid=$uid;不妨设查询出来的$old_money=100元。 第二步,业务层实施业务逻辑计算, 阅读全文

posted @ 2022-10-13 10:12 一佳一 阅读(55) 评论(0) 推荐(0) 编辑

2022年10月10日

摘要: using System.Text; namespace xxxxxx { public class CouponCodeUtilV2 { private static readonly char[] _codePool = { 'z', 'N', 'x', '5', 'h', 'g', 'W', 阅读全文

posted @ 2022-10-10 13:53 一佳一 阅读(77) 评论(0) 推荐(0) 编辑

摘要: #!/bin/bash host="oss-cn-hangzhou.aliyuncs.com" bucket="bucket" # BucketName id="id" # AccessKeyId key="key" # AccessKeySecret osshost=$bucket.$host e 阅读全文

posted @ 2022-10-10 13:51 一佳一 阅读(458) 评论(0) 推荐(0) 编辑

2022年8月25日

摘要: Open a database require 'rubygems' require 'sequel' DB = Sequel.sqlite('my_blog.db') DB = Sequel.connect('postgres://user:password@localhost/my_db') D 阅读全文

posted @ 2022-08-25 15:44 一佳一 阅读(122) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 39 下一页