paulwong

          #

          Bash get filename from given path on Linux or Unix

          https://www.cyberciti.biz/faq/bash-get-filename-from-given-path-on-linux-or-unix/

          posted @ 2021-05-21 14:10 paulwong 閱讀(192) | 評(píng)論 (0)編輯 收藏

          Copying Files With Maven

          https://www.baeldung.com/maven-copy-files

          posted @ 2021-05-21 09:58 paulwong 閱讀(202) | 評(píng)論 (0)編輯 收藏

          軟件工程的最大難題


          http://www.ruanyifeng.com/blog/2021/05/scaling-problem.html

          posted @ 2021-05-20 16:31 paulwong 閱讀(208) | 評(píng)論 (0)編輯 收藏

          SPRING CLOUD ALIBABA

          https://mp.weixin.qq.com/mp/appmsgalbum?__biz=MzAwMTk4NjM1MA==&action=getalbum&album_id=1418244755364134912&scene=173&from_msgid=2247484698&from_itemidx=1&count=3&nolastread=1#wechat_redirect

          SpringCloud alibaba實(shí)戰(zhàn)系列文章匯總
          https://segmentfault.com/a/1190000023541535?utm_source=sf-similar-article

          posted @ 2021-05-11 14:04 paulwong 閱讀(210) | 評(píng)論 (0)編輯 收藏

          JSR-303 Bean Validation - @Size和@Max@Min的區(qū)別

          @Min and @Max are used for validating numeric fields which could be String(representing number), intshortbyte etc and their respective primitive wrappers.

          @Size is used to check the length constraints on the fields.

          As per documentation @Size supports StringCollectionMap and arrays while @Min and @Max supports primitives and their wrappers. See the documentation.

          posted @ 2021-04-29 09:55 paulwong 閱讀(448) | 評(píng)論 (0)編輯 收藏

          【DevOps】Jenkins任務(wù)基于Tag進(jìn)行構(gòu)建

          手動(dòng)觸發(fā):
          https://blog.csdn.net/justyman/article/details/89857577

          如果是自動(dòng)觸發(fā)BUILD時(shí),則可以以最新建立的TAG為基礎(chǔ)進(jìn)行BUILD,而無(wú)需人手選TAG進(jìn)行BUILD。
          配置,注意應(yīng)取消參數(shù)化配置工程:
          1. Add the following refspec to the Git plugin:
            +refs/tags/*:refs/remotes/origin/tags/*
          2. Add the following branch specifier:
            */tags/*
          3. Enable SCM polling, so that the job detects new tags.

          posted @ 2021-04-22 11:00 paulwong 閱讀(382) | 評(píng)論 (0)編輯 收藏

          SRPING自帶的事件監(jiān)聽機(jī)制

          定義一個(gè)事件,因SPRING中可以有不同的事件,需要定義一個(gè)類以作區(qū)分:
          import lombok.Getter;
          import org.springframework.context.ApplicationEvent;


          @Getter
          public class JavaStackEvent extends ApplicationEvent {

              /**
               * Create a new {
          @code ApplicationEvent}.
               *
               * 
          @param source the object on which the event initially occurred or with
               *               which the event is associated (never {
          @code null})
               
          */
              public JavaStackEvent(Object source) {
                  super(source);
              }


          }

          定義一個(gè)此事件觀察者,即感興趣者:
          import lombok.NonNull;
          import lombok.RequiredArgsConstructor;
          import org.springframework.context.ApplicationListener;
          import org.springframework.scheduling.annotation.Async;

          /**
           * 觀察者:讀者粉絲
           
          */
          @RequiredArgsConstructor
          public class ReaderListener implements ApplicationListener<JavaStackEvent> {

              @NonNull
              private String name;

              private String article;

              @Async
              @Override
              public void onApplicationEvent(JavaStackEvent event) {
                  // 更新文章
                  updateArticle(event);
              }

              private void updateArticle(JavaStackEvent event) {
                  this.article = (String) event.getSource();
                  System.out.printf("我是讀者:%s,文章已更新為:%s\n", this.name, this.article);
              }

          }

          注冊(cè)感興趣者(將自身注入SPRING容器則完成注冊(cè)),并制定發(fā)布機(jī)制(通過CONTEXT發(fā)布事件):
          import lombok.extern.slf4j.Slf4j;
          import org.springframework.boot.CommandLineRunner;
          import org.springframework.context.ApplicationContext;
          import org.springframework.context.annotation.Bean;
          import org.springframework.context.annotation.Configuration;

          @Slf4j
          @Configuration
          public class ObserverConfiguration {

              @Bean
              public CommandLineRunner commandLineRunner(ApplicationContext context) {
                  return (args) -> {
                      log.info("發(fā)布事件:什么是觀察者模式?");
                      context.publishEvent(new JavaStackEvent("什么是觀察者模式?"));
                  };
              }

              @Bean
              public ReaderListener readerListener1(){
                  return new ReaderListener("小明");
              }

              @Bean
              public ReaderListener readerListener2(){
                  return new ReaderListener("小張");
              }

              @Bean
              public ReaderListener readerListener3(){
                  return new ReaderListener("小愛");
              }

          }

          posted @ 2021-04-09 14:55 paulwong 閱讀(324) | 評(píng)論 (0)編輯 收藏

          MONGODB聚合資源

          MongoDB Projections and Aggregations in Spring Boot
          https://www.javaprogramto.com/2020/05/spring-boot-data-mongodb-projections-aggregations.html

          In spring data mongodb how to achieve pagination for aggregation
          https://stackoverflow.com/questions/34427241/in-spring-data-mongodb-how-to-achieve-pagination-for-aggregation

          Create a ProjectionOperation with Difference with spring mongodb
          https://stackoverflow.com/questions/46786577/create-a-projectionoperation-with-difference-with-spring-mongodb

          posted @ 2021-04-08 13:38 paulwong 閱讀(192) | 評(píng)論 (0)編輯 收藏

          !!深入了解ActiveMQ!

          https://my.oschina.net/u/1388595/blog/4545503

          posted @ 2021-04-01 16:36 paulwong 閱讀(220) | 評(píng)論 (0)編輯 收藏

          csv 文件打開亂碼,有哪些方法可以解決?

          Excel 在讀取 csv 的時(shí)候是通過讀取文件頭上的 bom 來(lái)識(shí)別編碼的,這導(dǎo)致如果我們生成 csv 文件的平臺(tái)輸出無(wú) bom 頭編碼的 csv 文件(例如 utf-8 ,在標(biāo)準(zhǔn)中默認(rèn)是可以沒有 bom 頭的),Excel 只能自動(dòng)按照默認(rèn)編碼讀取,不一致就會(huì)出現(xiàn)亂碼問題了。

          掌握了這點(diǎn)相信亂碼已經(jīng)無(wú)法阻擋我們前進(jìn)的步伐了:只需將不帶 bom 頭編碼的 csv 文件,用文本編輯器(工具隨意,推薦 notepad++ )打開并轉(zhuǎn)換為帶 bom 的編碼形式(具體編碼方式隨意),問題解決。

          當(dāng)然,如果你是像我一樣的碼農(nóng)哥哥,在生成 csv 文件的時(shí)候?qū)懭?bom 頭更直接點(diǎn),用戶會(huì)感謝你的。

          附錄:對(duì)于 utf-8 編碼,unicode 標(biāo)準(zhǔn)中是沒有 bom 定義的,微軟在自己的 utf-8 格式的文本文件之前加上了EF BB BF三個(gè)字節(jié)作為識(shí)別此編碼的 bom 頭,這也解釋了為啥大部分亂碼都是 utf-8 編碼導(dǎo)致的原因

          SPRING BATCH中生成CSV文件時(shí)的解決方案:
          new FlatFileItemWriterBuilder<T>()
                .name(itemWriterName)
                .resource(outputResource)
                .lineAggregator(lineAggregator)
                .headerCallback(
                h -> {
                         System.out.println(header);
                         h.write('\uFEFF');//只需加這一行
                         h.write(header);
                     }
                )
                .build();

          https://stackoverflow.com/questions/48952319/send-csv-file-encoded-in-utf-8-with-bom-in-java

          posted @ 2021-03-23 10:30 paulwong 閱讀(377) | 評(píng)論 (0)編輯 收藏

          僅列出標(biāo)題
          共115頁(yè): First 上一頁(yè) 9 10 11 12 13 14 15 16 17 下一頁(yè) Last 
          主站蜘蛛池模板: 洪湖市| 乌兰察布市| 武汉市| 宜良县| 阳朔县| 资阳市| 长丰县| 万源市| 拉孜县| 海安县| 三门峡市| 岳普湖县| 炎陵县| 盐津县| 库车县| 莎车县| 育儿| 乌审旗| 琼中| 沽源县| 肃北| 永靖县| 中江县| 富阳市| 莫力| 梓潼县| 邮箱| 普定县| 潞城市| 长寿区| 敦化市| 民丰县| 绍兴市| 城口县| 疏勒县| 元朗区| 化德县| 博客| 出国| 乌苏市| 东乡族自治县|