<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    paulwong

    #

    How to Downgrade macOS Ventura to Monterey, Big Sur, or Earlier

    https://www.drbuho.com/how-to/downgrade-macos


    posted @ 2022-11-11 11:27 paulwong 閱讀(144) | 評論 (0)編輯 收藏

    difference between homebrew and homebrew cask

    https://brew.sh/index_zh-tw

    difference between homebrew and homebrew cask
    https://www.zhihu.com/question/22624898

    install jdk11 on Mac:
    https://medium.com/@kirebyte/using-homebrew-to-install-java-jdk11-on-macos-2021-4a90aa276f1c



    posted @ 2022-11-11 11:21 paulwong 閱讀(156) | 評論 (0)編輯 收藏

    install docker on Mac


    https://yeasy.gitbook.io/docker_practice/install/mac

    posted @ 2022-11-11 11:07 paulwong 閱讀(149) | 評論 (0)編輯 收藏

    MONGODB SPRING DISTINCT

    SPRING 框架下 如果要做去重,在數據量大的時候會爆ERROR,可改用如下 寫法:

        private boolean needReorderCheck(String requestId) {
            boolean result = false;
    //        try(MongoCursor<String> mongoCursor = 
    //                mongoTemplate.getCollection(mongoTemplate.getCollectionName(AccountNumProductLineIndex.class))
    //                             .distinct(KEY, Filters.eq(REQUEST_ID, requestId), String.class)
    //                             .iterator()
    //                )
            try(MongoCursor<Document> mongoCursor = 
                    mongoTemplate.getCollection(mongoTemplate.getCollectionName(AccountNumProductLineIndex.class))
                                 .aggregate(
                                     Arrays.asList(
                                        Aggregates.project(
                                                        Projections.fields(
                                                                        Projections.excludeId(),
                                                                       Projections.include(KEY),
                                                                       Projections.include(REQUEST_ID)
                                                                    )
                                                   ),
                                        Aggregates.match(Filters.eq(REQUEST_ID, requestId)),
                                        Aggregates.group("$" + KEY)
                                     )
                                  )
                                 .allowDiskUse(true)
                                 .iterator();
            )
            {
                String key = null;
                boolean breakMe = false;
                LOGGER.info("needReorderCheck.key --> start");
                while(mongoCursor.hasNext()) {
                    if(breakMe) {
                        mongoCursor.close();
                        break;
                    }
                    Document keyDocument = mongoCursor.next();
                    key = keyDocument.getString("_id");
    //                key = mongoCursor.next().getString(KEY);
    //                LOGGER.info("needReorderCheck.keyDocument --> {}, key --> {}", keyDocument, key);
                    try(MongoCursor<Document> indexMongoCursor = 
                            mongoTemplate.getCollection(AccountNumProductLineIndex.COLLECTION_NAME)
                                            .find(Filters.and(Filters.eq(REQUEST_ID, requestId), Filters.eq(KEY, key)))
                                            .iterator()
                    )
                    {
                        int preIndex = -1, currentIndex = -1;
                        Document preIndexDocument = null, currentIndexDocument;
                        while(indexMongoCursor.hasNext()) {
                            currentIndexDocument = indexMongoCursor.next();
    //                        System.out.println(currentIndexDocument.toJson());
                            if(preIndexDocument != null) {
                                 currentIndex = currentIndexDocument.getInteger(INDEX);
                                 preIndex = preIndexDocument.getInteger(INDEX);
                                 if(currentIndex - preIndex > 1) {
                                    indexMongoCursor.close();
                                    breakMe = true;
                                    result = true;
                                    break;
                                }
                            }
                            preIndexDocument = currentIndexDocument;
                        }
                    }
                }
            }
            
            return result;
        }

    posted @ 2022-10-18 10:22 paulwong 閱讀(205) | 評論 (0)編輯 收藏

    SPRING JSON TIMEZONE問題大匯總

    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="yyyy-MM-dd'T'HH:mm:ss.SSSZ", timezone="America/Phoenix")
    private Date date;

    posted @ 2022-09-22 13:18 paulwong 閱讀(203) | 評論 (0)編輯 收藏

    Downloading Large Files using Spring WebClient

    https://www.amitph.com/spring-webclient-large-file-download/

    https://github.com/amitrp/spring-examples/blob/main/spring-webflux-webclient/src/main/java/com/amitph/spring/webclients/service/FileDownloaderWebClientService.java

    import lombok.RequiredArgsConstructor;
    import org.springframework.core.io.buffer.DataBuffer;
    import org.springframework.core.io.buffer.DataBufferUtils;
    import org.springframework.stereotype.Service;
    import org.springframework.web.reactive.function.client.WebClient;
    import reactor.core.publisher.Flux;
    import reactor.core.publisher.Mono;

    import java.io.IOException;
    import java.nio.file.Files;
    import java.nio.file.Path;
    import java.nio.file.StandardOpenOption;
    import java.util.Objects;

    @Service
    @RequiredArgsConstructor
    public class FileDownloaderWebClientService {
        private final WebClient webClient;

        /**
         * Reads the complete file in-memory. Thus, only useful for very large file
         
    */
        public void downloadUsingByteArray(Path destination) throws IOException {
            Mono<byte[]> monoContents = webClient
                    .get()
                    .uri("/largefiles/1")
                    .retrieve()
                    .bodyToMono(byte[].class);

            Files.write(destination, Objects.requireNonNull(monoContents.share().block()),
                    StandardOpenOption.CREATE);
        }

        /**
         * Reading file using Mono will try to fit the entire file into the DataBuffer.
         * Results in exception when the file is larger than the DataBuffer capacity.
         
    */
        public void downloadUsingMono(Path destination) {
            Mono<DataBuffer> dataBuffer = webClient
                    .get()
                    .uri("/largefiles/1")
                    .retrieve()
                    .bodyToMono(DataBuffer.class);

            DataBufferUtils.write(dataBuffer, destination,
                    StandardOpenOption.CREATE)
                    .share().block();
        }

        /**
         * Having using Flux we can download files of any size safely.
         * Optionally, we can configure DataBuffer capacity for better memory utilization.
         
    */
        public void downloadUsingFlux(Path destination) {
            Flux<DataBuffer> dataBuffer = webClient
                    .get()
                    .uri("/largefiles/1")
                    .retrieve()
                    .bodyToFlux(DataBuffer.class);

            DataBufferUtils.write(dataBuffer, destination,
                    StandardOpenOption.CREATE)
                    .share().block();
        }
    }

    posted @ 2022-09-22 13:14 paulwong 閱讀(265) | 評論 (0)編輯 收藏

    JAVA-SECURITY資源

    加密與安全
    https://www.liaoxuefeng.com/wiki/1252599548343744/1255943717668160

    JAVA KEYSTORE 存儲在MONGODB
    默認情況下,證書是放保存在文件,如果要改成MONGODB做為存儲界質,則要做以下改動:
    https://github.com/jmkgreen/keystore-mongo/tree/master/keystore-mongo/src/main/java/com/github/jmkgreen/keystore/mongo

    關于證書,這里有你想知道的一切
    http://ifeve.com/%e5%85%b3%e4%ba%8e%e8%af%81%e4%b9%a6%e8%bf%99%e9%87%8c%e6%9c%89%e4%bd%a0%e6%83%b3%e7%9f%a5%e9%81%93%e7%9a%84%e4%b8%80%e5%88%87-md/#more-59405

    posted @ 2022-07-18 11:09 paulwong 閱讀(203) | 評論 (0)編輯 收藏

    REDHEAD 8 LINUX 軟件集合

    https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/deploying_different_types_of_servers/index


    posted @ 2022-06-23 17:27 paulwong 閱讀(133) | 評論 (0)編輯 收藏

    LINUX YUM

    列出某個軟件的所有版本號:
    yum module list nginx

    Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
    Name                                         Stream                                         Profiles                                         Summary
    nginx                                        1.14 [d]                                       common [d]                                       nginx webserver
    nginx                                        1.16                                           common [d]                                       nginx webserver
    nginx                                        1.18                                           common [d]                                       nginx webserver
    nginx                                        1.20 [e]                                       common [d]                                       nginx webserver

    Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled


    設定某個版本為默認版本
    yum module enable nginx:1.20


    安裝默認版本
    yum install nginx



    posted @ 2022-06-23 17:21 paulwong 閱讀(170) | 評論 (0)編輯 收藏

    openJDK無法進行jmap

    https://blog.csdn.net/qq_32447301/article/details/85109014

    posted @ 2022-05-19 13:53 paulwong 閱讀(197) | 評論 (0)編輯 收藏

    僅列出標題
    共115頁: First 上一頁 2 3 4 5 6 7 8 9 10 下一頁 Last 
    主站蜘蛛池模板: 国产综合激情在线亚洲第一页| 国产免费人成视频在线播放播| 高清国语自产拍免费视频国产| 日本亚洲高清乱码中文在线观看| av在线亚洲欧洲日产一区二区| 亚洲免费视频在线观看| 亚洲日本一线产区和二线| 亚洲综合无码AV一区二区| 免费人成网站在线观看10分钟| 免费大片av手机看片高清| 亚洲国产精品自在在线观看| 日韩免费观看一级毛片看看| 免费毛片在线看不用播放器| 亚洲国产精品嫩草影院| 水蜜桃亚洲一二三四在线| 国产成人高清精品免费软件| 日本在线免费观看| 黄色一级免费网站| 亚洲国产综合精品| 国产亚洲一区二区精品| 日韩精品免费电影| 日本免费一区二区在线观看| 亚洲免费日韩无码系列| 亚洲国产成人久久综合| 亚洲美女免费视频| 在线A亚洲老鸭窝天堂| 国产成人免费福利网站| 免费人成在线观看69式小视频| 一级日本高清视频免费观看 | 亚洲va在线va天堂va四虎| 国产免费久久精品久久久| 91香蕉国产线观看免费全集| 五月天婷婷免费视频| 一本色道久久88亚洲精品综合| 亚洲av网址在线观看| 区久久AAA片69亚洲| 国产亚洲精品免费| 成年女人午夜毛片免费看| 3344永久在线观看视频免费首页 | 亚洲自国产拍揄拍| 777亚洲精品乱码久久久久久|