# Daily more **Repository Path**: jxiaoming_admin/Daily-more ## Basic Information - **Project Name**: Daily more - **Description**: 每日一更知识点,涵盖Java,SQL,Web等方面 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-11-24 - **Last Updated**: 2021-07-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 2017-11-24 > 在Oracle中存在分组需求时取各个数据的最新一条 @(Oracle)[数据库|] ```sql SELECT c.NEWID, c.TITLE,c.CONTENT,c.CATEGORY FROM ( SELECT t.*, ROW_NUMBER() OVER(PARTITION BY t.CATEGORY ORDER BY t.NEWSTIME DESC) rn FROM T_NEWS t ) c WHERE rn = 1 ``` - 在HTML页面加载时,处理img标签的src因为网络或请求的资源不存在时的情况 ```javascript $("img").each(function() { if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { this.title="图片"+this.title+"找不到了"; this.src="nopic200.jpg"; } }); ``` ## 2017-11-28 > 负载均衡 建立在现有网络结构之上,它提供了一种廉价有效透明的方法扩展网络设备和服务器的带宽、增加吞吐量、加强网络数据处理能力、提高网络的灵活性和可用性。 -- [百度百科](https://baike.baidu.com/item/%E8%B4%9F%E8%BD%BD%E5%9D%87%E8%A1%A1/932451?fr=aladdin) @(负载均衡)[Load Balance|LB|Nginx] #### 负载均衡解决方案 ##### 硬件 - F5 - A10 ##### 软件 - LVS、 - Nginx - HAproxy ## 2017-12-10 > Maven项目转变Gradle项目 @(Maven)[Gradle] - 首先确保本地已经安装Gradle并已经成功配置环境变量 - 通过`gradle -v`验证gradle的版本 - 进入项目的根目录(注:根目录下存在`pom.xml`),根据gradle的版本执行不同命令 - <=1.7 `gradle setupBuild --type pom` - >1.7 `gradle init --type pom` 在执行完上述命令后,gradle会根据pom文件的依赖进行配置gradle,项目成功转变为gradle会出现`BUILD SUCCESSFUL in 22s`的字样。 ## 2017-12-11 > 禁用浏览器返回按钮,可以消除 后退的所有动作。包括 键盘、鼠标手势等产生的后退动作。 @(javascript)[js|浏览器|后退键] ```javascript history.pushState(null, null, document.URL); window.addEventListener('popstate', function () { history.pushState(null, null, document.URL); }); ``` ## 2017-12-19 > `SSM(Spring+SpringMVC+Mybaties)`下`CLOB`的操作 @(Spring)[SpringMVC|mybaties|ibaties|SSM|Oracle|CLOB] - `Spring`和`SpringMVC`版本为4.3.3.RELEASE,mybatis版本为3.3.0,`Oracle`为11g - 数据库字段类型为`CLOB`,实体(bean/entity/pojo/model)为`String`类型 - `XML`映射为以下格式: ```xml ``` - `jdbcType`为`CLOB` ## 2018-04-26 > `Windows`下查找某个进程并强制杀死 ``` netstat -ano|findstr 8088 taskkill /pid 8436 /f ``` > MySQL 5.7版本修改默认root密码 ```sql update user set authentication_string = password('root'), password_expired = 'N', password_last_changed = now() where user = 'root'; ```