日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

01-2021年6月

發布時間:2024/1/1 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 01-2021年6月 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2021年6月20日22:05:43

  • Spring源碼閱讀:
    1.1 wrapIfNecessary
    1.2 判斷是否為空: StringUtils.hasLength(beanName);
    1.3 使用布爾的包裝類: Boolean.FALSE.equals(this.advisedBeans.get(cacheKey))
    1.4 判斷Advice類是否是beanClass的父類: Advice.class.isAssignableFrom(beanClass)
    1.5 語法規則:
    父類.class.isAssignableFrom(子類.class)
    子類實例 instanceof 父類類型
    1.6 AOP原理: 動態代理
    createProxy(bean.getClass(), beanName, specificInterceptors, new SingletonTargetSource(bean));
  • 2021年6月23日07:02:09

  • 關于 Mybatis 批量更新
    使用 標簽的時候, 如果參數中有?特殊字符, 會發生參數錯位的情況, 最后使用批量update處理.
  • 中文官網:
    https://mybatis.org/mybatis-3/zh/dynamic-sql.html
  • 2021年6月27日09:58:16

  • @Configuration 沒有配置這個注解事務是沒有用的
  • 圖靈學院vip學院筆記
    1. JVM專題
    2. JavaSE專題
    3. 并發專題
    4. Spring專題
    4.1 Spring源碼編譯教程
    4.2 手寫模擬Spring框架核心邏輯
    4.3 Spring中核心概念詳解
    4.4 Spring中Bean的生命周期詳解
    4.5 Spring中依賴注入源碼解析
    4.6 ApplicationContext啟動過程
    4.7 Spring解析配置類
    4.8 Spring中的推斷構造方法
    4.9 Spring整合Mybatis核心原理
    4.10 Spring循環依賴源碼解析
    4.11 Spring中AOP底層原理分析
    4.12 Spring中事務的底層工作原理
    5. SpringMVC專題
    6. SpringBoot專題
    7. Mybatis專題

  • 2021年6月29日00:26:19

  • 馬士兵教育

  • Spring源碼常見問題:
    2.1 方法論: 如何高效的學習源碼
    2.2 SpringIOC源碼
    2.3 Spring程序的啟動
    2.4 Spring是如何加載配置文件到應用程序的?
    2.5 核心接口: BeanDefinitionReader
    2.6 核心接口: BeanFactory
    2.7 徹底搞懂Spring的refresh方法
    2.8 BeanPostProcessor 接口的作用及實現
    2.9 BeanFactoryPostProcessor接口的作用及實現
    2.10 Spring Bean有沒有必要實現Aware接口
    2.11 Spring Bean 實例化過程大揭秘
    2.12 Spring Bean 初始化到底干了什么
    2.13 徹底理解 FactoryBean 接口
    2.14 完美解釋Spring Bean的生命周期
    2.15 Spring的Environment接口有什么作用
    2.16 為什么會產生循環依賴問題
    2.17 循環依賴在Spring中是如何解決的
    2.18 Spring IOC面試題

  • Recent Files 這個是否可以啟用呢?
    3.1 默認快捷鍵: Ctrl + E 可以試試

  • https://zhuanlan.zhihu.com/p/366436588

    2021年7月1日22:55:53

  • 去哪里找IDEA的離線插件: 插件官網

  • 因為有幾個有用的插件版本不匹配

  • 創建對象幾種方式:
    3.1 構造方法
    3.2 反射
    3.3 克隆(意義不大)
    3.4 序列化(意義不大)

  • 反射:
    Class clazz = Class.forName();
    Class clazz = 類名.class;
    Class clazz = 對象名.getClass();
    Constructor ctor = clazz.getDeclareConstructor();
    Object obj = ctor.newInstance();

  • 2021年7月2日07:10:05

  • Mybatis-Log-Plugin:
  • 2021年7月4日17:22:11

  • 詞匯: 動詞
    處理: process

  • 詞匯: 名詞:
    候選者: Candidate

  • List排序:

  • configCandidates.sort((bd1, bd2) -> { int i1 = ConfigurationClassUtils.getOrder(bd1.getBeanDefinition()); int i2 = ConfigurationClassUtils.getOrder(bd2.getBeanDefinition()); return Integer.compare(i1, i2); });
  • 集合的容量這里這樣指定:
  • Set<ConfigurationClass> alreadyParsed = new HashSet<>(configCandidates.size());
  • 表達是否應該的含義:
  • 詞匯:

    是否應該: should

    if (this.conditionEvaluator.shouldSkip(configClass.getMetadata(), ConfigurationPhase.PARSE_CONFIGURATION)) {

    2021年7月5日05:56:12

  • 快捷鍵:
    翻譯: Alt + T 似乎更加順手一點.
  • 2021年7月6日07:22:15

  • 有空也要背一下面試題, 可能當時不理解, 其實后期還是很有用的.
  • 2021年7月7日08:10:14

  • http://plugins.jetbrains.com/

  • mybatis-log-plugin

  • 2021年7月9日07:59:32

  • 參考博客: 注釋掉的字體改成黃色:
    https://blog.csdn.net/weixin_41298572/article/details/89630972

  • Editor -> Color Scheme -> Language Defaults -> Comments -> Line comment

  • CodeSheep: 很厲害的博主
    https://github.com/rd2coding/Road2Coding

  • 2021年7月13日07:31:21

  • @SuppressWarnings(“serial”)
    參考博客: https://blog.csdn.net/csdn972356101/article/details/84249597

  • 看著就舒服:

  • Assert.notNull(other, "Other ProxyConfig object must not be null");
  • 兩個常用的動詞:
  • if (!proxyFactory.isProxyTargetClass()) {if (shouldProxyTargetClass(beanClass, beanName)) {proxyFactory.setProxyTargetClass(true);}else {evaluateProxyInterfaces(beanClass, proxyFactory);} }

    should: 是否應該呢?
    evaluate: 有評估的意思

  • @link 標簽的使用:
  • * Check the interfaces on the given bean class and apply them to the {@link ProxyFactory},* if appropriate.
  • IDEA:
  • Cc: Match Case: Alt + C
    Use Tab to focus on an option, and Space to toggle it

    Words: Alt + Words
    use Tab to focus on an option, and Space to toggle it

    Regex: Alt + X
    Use Tab to focus on an option, and Space to toggle it

    IDEA: Match Case, Words, Regex作用
    參考博客: https://localhost.blog.csdn.net/article/details/100052759

  • 定制: customize
  • customizeProxyFactory(proxyFactory);
  • frozen: 冰凍, 固化的含義
  • proxyFactory.setFrozen(this.freezeProxy);
  • @NotNull 和 @Nullable
  • 在寫程序的時候你可以定義是否可為空指針。通過使用像@NotNull和@Nullable之類的annotation來聲明一個方法是否是空指針安全的。現代的編譯器、IDE或者工具可以讀此annotation并幫你添加忘記的空指針檢查,或者向你提示出不必要的亂七八糟的空指針檢查。IntelliJ和findbugs已經支持了這些annotation。這些annotation同樣是JSR 305的一部分,但即便IDE或工具中沒有,這個annotation本身可以作為文檔。看到@NotNull和@Nullable,程序員自己可以決定是否做空指針檢查。順便說一句,這個技巧對Java程序員來說相對比較新,要采用需要一段時間。
    參考博客:
    https://blog.csdn.net/kuyuyingzi/article/details/16973429

  • toString(): 可以使用String.valueOf();
  • BigDecimal bd = getPrice(); System.out.println(String.valueOf(bd)); //不會拋出空指針異常 System.out.println(bd.toString()); //拋出 "Exception in thread "main" java.lang.NullPointerException"

    2021年7月14日07:27:49

  • 這里可以看到PDM/PLM:
  • 2021年7月16日08:20:29

  • 關于處理歷史數據的方案, 如果有Deme就更好了:
    參考博客: https://blog.csdn.net/KuaiLeShiFu/article/details/49388011

  • 可以看看是否適用:

  • package com.jzt.web;import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.TreeSet; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors;import javax.annotation.Resource;import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody;import com.jzt.dao.mapper.CampaignMapper; import com.jzt.domain.Campaign; import com.keyword.dao.mapper.KeywordMapper; import com.keyword.domain.Keyword; import com.keyword.domain.PagePackage;@RequestMapping("/keywordv2") @Controller public class KeywordV2Controller {private final static Logger logger = LoggerFactory.getLogger(ChangeDataController.class);private final static Integer PAGESIZE = 2000;private Integer threadSize = 20;private boolean flag = true;/*** 使用20個線程, 需要根據服務器的core決定, 否則資源被浪費在線程的競爭中*/private ExecutorService services = Executors.newFixedThreadPool(threadSize);/*** 阻塞隊列*/final BlockingQueue queue = new ArrayBlockingQueue(20000);@Resourceprivate KeywordMapper keywordMappper;@Resourceprivate CampaignMapper campaignMapper;@ResponseBody@RequestMapping("/go")public void handleAll(String table) {if (table != null) {String tableName = "ad_keyword_" + table;Keyword param = new Keyword();param.setTableName(tableName);Integer total = keywordMappper.queryCountByParam(param);final int pageCount = (int) Math.ceil((double) total / PAGESIZE);handleOneTable(tableName, total, pageCount);} else {BlockingQueue tables = new ArrayBlockingQueue(25);for (int i = 466; i <= 490; i++) {tables.add(i);}logger.info("進入while....466開始");while (tables.size() > 0) {if (new Date().getDay() == 2 && new Date().getHours() >= 1) { //晚上21點再次啟動flag = true;} else {flag = false;}while (flag) {flag = false;String tableName = null;try {tableName = "ad_keyword_" + tables.take();if (new Date().getHours() > 5 && new Date().getHours() < 21) {logger.info(">>>>>>>>>>>>>>>>>>>>" + tableName);flag = false;break;}} catch (InterruptedException e) {logger.info(e.toString());}Keyword param = new Keyword();param.setTableName(tableName);Integer total = keywordMappper.queryCountByParam(param);final int pageCount = (int) Math.ceil((double) total / PAGESIZE); //總頁數handleOneTable(tableName, total, pageCount);} //END flag} //END startUp}}private void handleOneTable(final String tableName, Integer total, final int pageCount) {logger.info("關鍵詞刷數據開始...");Keyword param = new Keyword();param.setTableName(tableName);logger.info(String.format("查詢關鍵詞表[%s]總數[%s]每頁[%s]共[%s]頁", tableName, total, PAGESIZE, pageCount));//取執行記錄起始點的idLong idIndex = 0L;List firstRecord = keywordMappper.queryFirstKeyword(param);if (firstRecord != null && firstRecord.size() == 1) {idIndex = firstRecord.get(0).getId() - 1;logger.info(tableName + "從id=" + idIndex + "開始執行");}param.setPageSize(PAGESIZE);PagePackage pagePackage = null;for (int page = 1; page <= pageCount; page++) {param.setId(idIndex);pagePackage = new PagePackage();// 分頁獲取關鍵詞final List keywordResult = keywordMappper.queryListByPage(param);if (keywordResult != null && keywordResult.size() > 0) {pagePackage.setTableName(tableName);pagePackage.setKeywords(keywordResult);pagePackage.setPageIndex(page);pagePackage.setPageSize(keywordResult.size());pagePackage.setPageCount(pageCount);queue.add(pagePackage); //向隊列中添加要處理的一頁數據對象idIndex = keywordResult.get(keywordResult.size() - 1).getId();}}for (int i = 0; iservices.execute(new Runnable() {@Overridepublic void run() {updateRunnable(tableName, queue);}});}while(queue.size()>0){flag = false;//主線程阻塞}flag=true;logger.info("關鍵詞刷數據結束...."); }private void updateRunnable(final String tableName, final BlockingQueue queue) {boolean flag2 = true;while (flag2) {try {PagePackage page = queue.take(); //如果隊列為空,就等待if (page != null) {updateOnePage(page);} else {flag2 = false;}} catch (InterruptedException e) {e.printStackTrace();}}}private void updateOnePage(PagePackage page) {List keywords = page.getKeywords();String tableName = page.getTableName();Integer pageIndex = page.getPageIndex();Integer pageCount = page.getPageCount();int hour = new Date().getHours();if (new Date().getDay() == 2 && hour >= 1 && hour < 6) { //0:星期日 1:星期一logger.info(String.format("關鍵詞表[%s]的第[%s]頁共[%s]頁數據處理start...", tableName, pageIndex, pageCount));//1.對這一頁關鍵詞統計所有的計劃IDList campaignIds = null;List ids = new ArrayList();for (Keyword k : keywords) {if (k.getCampaignId() != null) {ids.add(k.getCampaignId());} else {logger.info(String.format("【[%s]】表中關鍵詞[%s]沒有計劃id", tableName, k.getId()));}}campaignIds = new ArrayList(new TreeSet(ids));try {//2.根據計劃id查詢出所有計劃Campaign param = new Campaign();param.setIds(campaignIds);List campaigns = campaignMapper.queryListByParam(param);if (campaigns == null || campaigns.size() == 0) {logger.info(String.format("【[%s]】表中關鍵詞所屬計劃列表為空", tableName));return;}//3.填充待回改的關鍵詞信息,并觸發執行更新關鍵詞的SQLfor (Keyword keyword : keywords) {keyword.setYn(null);for (Campaign campaign : campaigns) {if (keyword.getCampaignId().compareTo(campaign.getId()) == 0) {if (campaign.getYn() != null && campaign.getYn() == 0) {keyword.setYn(campaign.getYn());}keyword.setCampaignType(campaign.getCampaignType());keyword.setBusinessType(campaign.getBusinessType());keyword.setPutType(campaign.getPutType());break;}}if (keyword.getCampaignType() != null || keyword.getBusinessType() != null || keyword.getPutType() != null) {keyword.setTableName(tableName);keywordMappper.updateKeyword(keyword);} else {logger.info(String.format("關鍵詞表[%s]中id=[%s]的數據沒有類型值", tableName, keyword.getId()));}}} catch (Exception ex) {logger.info(String.format("關鍵詞表[%s]刷數據異常", tableName), ex);}logger.info(String.format("關鍵詞表[%s]的第[%s]頁共[%s]頁數據處理end...", tableName, pageIndex, pageCount));} else {logger.info(String.format("在規定范圍外時間段暫停執行....", tableName, pageIndex, pageCount));}} }

    2021年7月17日16:39:44

  • 關于缺陷管理系統:
  • 免費平臺:
    https://mdly20210717080930523.pingcode.com/workspace/dashboards/60f2903a6519891e947890f7

    官網:
    https://pingcode.com/

    2021年7月18日14:34:53

  • PotPlayer 常用快捷鍵:
    參考博客:
    https://blog.csdn.net/acelit/article/details/102492493

  • 詞匯: 調用, 處理之意思
    invoke

  • invokeBeanFactoryPostProcessors(beanFactory);
  • 詞匯: 具有初始化的含義
    init
  • initPropertySources();
  • 詞匯: 有更新, 刷新的含義
    refresh
  • protected final void refreshBeanFactory() throws BeansException {if (hasBeanFactory()) {destroyBeans();closeBeanFactory();}try {DefaultListableBeanFactory beanFactory = createBeanFactory();beanFactory.setSerializationId(getId());customizeBeanFactory(beanFactory);loadBeanDefinitions(beanFactory);this.beanFactory = beanFactory;}catch (IOException ex) {throw new ApplicationContextException("I/O error parsing bean definition source for " + getDisplayName(), ex);}}
  • 這就僅僅是一個構造方法, 但是還是抽取了, 應為可能公用.
  • DefaultListableBeanFactory beanFactory = createBeanFactory();
  • 詞匯: 客制化, 定制的含義
    customize
  • customizeBeanFactory(beanFactory);

    2021年7月20日07:34:48

  • 轉義符:
  • ? %3F %3F

  • 或者轉碼存入時候: UrlEncode, 使用時候解碼使用.

  • Python是通過轉義實現的:

  • 更新spring-framwork項目

  • 總結

    以上是生活随笔為你收集整理的01-2021年6月的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。