V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  git00ll  ›  全部回复第 10 页 / 共 11 页
回复总数  208
1 ... 2  3  4  5  6  7  8  9  10  11  
2021-10-20 12:16:45 +08:00
回复了 OiCkilL 创建的主题 Apple 传 送 门 3
猜 2
2021-09-19 14:28:14 +08:00
回复了 git00ll 创建的主题 Java h2database 最近一版还是 2019 年更新的,似乎热度也不怎么高
@kingfalse 可以满足
2021-09-17 21:44:01 +08:00
回复了 git00ll 创建的主题 Java springboot + tomcat 的自带 gzip 压缩功能,最小压缩阈值不生效
@unclebear 不会看错的,chrome 显示的。实际传输大小,原大小,而且对于大小稍大一点的,是有压缩效果的
2021-09-17 21:42:38 +08:00
回复了 git00ll 创建的主题 Java springboot + tomcat 的自带 gzip 压缩功能,最小压缩阈值不生效
@yin1999,前面负载均衡不支持压缩功能,也没权限弄前面的服务
2021-09-11 22:00:57 +08:00
回复了 AllenHua 创建的主题 随想 关于标题党,我有点新的想说。
微信的订阅号推荐里面一大堆
[8 月男宝长期接触此物,四肢瘫痪变成植物人,很多家庭都在用]
[龙口又有多人被刑拘,都是因为这件事]
[开学了,中小学推迟 2 小时放学,实时三天,新问题又来了]
2021-09-07 19:00:43 +08:00
回复了 RobertWu 创建的主题 推广 2021 陕西翠香猕猴桃 满 100 箱送 V 友 5 箱 满 200 箱送 V 友 10 箱
万一呢
2021-08-19 10:28:08 +08:00
回复了 wxlwsy 创建的主题 Java MyBatis Dynamic SQL 用起来有没有坑?
这个东西还是基于 mybatis 之上实现的,底层还是 mybatis
@clickhouse gitignore 就没办法参与到版本管理了,估计要向二楼说的那样再起一个 git 仓库
2021-07-31 21:45:40 +08:00
回复了 git00ll 创建的主题 问与答 poi 读取 excel 内存溢出
512m 堆内存是比文件解压后大的,但是其中有一个数组拷贝操作,导致同时会存在两个在内存里,就不够了。
所以内存要比文件解压大两倍。
2021-07-31 21:40:19 +08:00
回复了 git00ll 创建的主题 问与答 poi 读取 excel 内存溢出
首先 xlsx 文件本身是一个压缩包,即使是 event 模式,poi 也需要将压缩包内的文件全部加载在内存里,真实使用时再根据流式方式边解析边向外输出。
也就是说最低需要 xlsx 解压后的文件大小的内存才可以进行解析。
2021-07-26 18:18:49 +08:00
回复了 git00ll 创建的主题 MySQL 下面两种写法 not exist , 和 left join 哪个效率更优点
看了一下书,这两种写法是会被优化成同样的执行计划的,并且第二种写法的可读性更高一点,所以我选择第二种了
2021-07-21 15:16:27 +08:00
回复了 git00ll 创建的主题 问与答 idea 如何自定义点号 后面的提示
@AoEiuV020 你好,尝试过这个。这个是指在直接写 ‘for’,自动根据模板补全,不是在一个变量后面输入 ‘点号’ 弹出提示再补全
使用 jd 反编译出来的代码 return 上面一行,是不符合 java 语法的
todo 补充这里的注释
2021-02-09 16:43:48 +08:00
回复了 git00ll 创建的主题 Java 各位彦祖们,关于 spring 和 springmvc 不知道这样理解对不对
@huifer
以下代码来自于
org.springframework.web.servlet.FrameworkServlet#initWebApplicationContext
DispatcherServlet 继承此类。

下面是他初始化容器的地方,方法的第三行有一个 if 判断,他判断如果 webApplicationContext 不为空,就直接使用。如果为空会在下面创建一个。
那什么情况下非空呢?据我观察现在使用 springboot 启动时,就是非空的,而以前使用 xml 文件的方式就是空的。所以我认为,使用旧的方式,会产生两个容器,springmvc 容器和 spring 容器,他们是父子关系。而使用 springboot 的方式,是共享同一个容器。


protected WebApplicationContext initWebApplicationContext() {
WebApplicationContext rootContext =
WebApplicationContextUtils.getWebApplicationContext(getServletContext());
WebApplicationContext wac = null;
if (this.webApplicationContext != null) {
// A context instance was injected at construction time -> use it
wac = this.webApplicationContext;
if (wac instanceof ConfigurableWebApplicationContext) {
ConfigurableWebApplicationContext cwac = (ConfigurableWebApplicationContext) wac;
if (!cwac.isActive()) {
// The context has not yet been refreshed -> provide services such as
// setting the parent context, setting the application context id, etc
if (cwac.getParent() == null) {
// The context instance was injected without an explicit parent -> set
// the root application context (if any; may be null) as the parent
cwac.setParent(rootContext);
}
configureAndRefreshWebApplicationContext(cwac);
}
}
}
if (wac == null) {
// No context instance was injected at construction time -> see if one
// has been registered in the servlet context. If one exists, it is assumed
// that the parent context (if any) has already been set and that the
// user has performed any initialization such as setting the context id
wac = findWebApplicationContext();
}
if (wac == null) {
// No context instance is defined for this servlet -> create a local one
wac = createWebApplicationContext(rootContext);
}

if (!this.refreshEventReceived) {
// Either the context is not a ConfigurableApplicationContext with refresh
// support or the context injected at construction time had already been
// refreshed -> trigger initial onRefresh manually here.
onRefresh(wac);
}

if (this.publishContext) {
// Publish the context as a servlet context attribute.
String attrName = getServletContextAttributeName();
getServletContext().setAttribute(attrName, wac);
if (this.logger.isDebugEnabled()) {
this.logger.debug("Published WebApplicationContext of servlet '" + getServletName() +
"' as ServletContext attribute with name [" + attrName + "]");
}
}

return wac;
}
2021-02-05 12:41:00 +08:00
回复了 yayiji 创建的主题 问与答 ~和` 这两个符号一般什么用途?
git rebase HEAD~10
2021-01-15 17:36:47 +08:00
回复了 git00ll 创建的主题 MySQL mysql 一次更新大量数据,速度慢, cpu 占用高,有啥优化思路吗
@love
目前我们的做法是
update table set status = 1 where order_id = "xxxxx" and status = 2 limit 1000
然后定时执行,问题是,如果定时频率快了 cpu 扛不住,定时频率慢了,速度太慢,60w 要更新好几十分钟
2021-01-15 17:34:23 +08:00
回复了 git00ll 创建的主题 MySQL mysql 一次更新大量数据,速度慢, cpu 占用高,有啥优化思路吗
@owenliang 尝试过这样操作,其实效果也不好
下面是想要把 status 为 2 的改为 1

先选择一批数据
select id from table where order_id = "xxxxx" and status = 2 limit 1000
再更新这一批数据
update table set status = 1 where id in (上面 select 到的数据)

放在循环里更新,同样导致数据库压力
2020-10-26 16:19:29 +08:00
回复了 jamfer 创建的主题 推广 回馈 V2,送一把樱桃红轴的 71 键双模机械键盘
万一呢
1 ... 2  3  4  5  6  7  8  9  10  11  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2538 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 38ms · UTC 15:42 · PVG 23:42 · LAX 08:42 · JFK 11:42
Developed with CodeLauncher
♥ Do have faith in what you're doing.