2022年10月18日 随笔档案 -凯发k8网页登录

2022年10月18日 #

reinstall mac os

@import ;@import url(/uploads/css/css/cuteeditor.css); 使用「磁碟工具程式」清除配備 apple 晶片的 mac


在 mac 清除所有內容和設定


為 macos 製作開機安裝程式


如何重新安裝 macos

posted @ 2022-11-11 22:44 paulwong 阅读(63) | 评论 (0)编辑 收藏

how to downgrade macos ventura to monterey, big sur, or earlier

@import ;@import url(/uploads/css/css/cuteeditor.css);



posted @ 2022-11-11 11:27 paulwong 阅读(64) | 评论 (0)编辑 收藏

difference between homebrew and homebrew cask

@import ;@import url(/uploads/css/css/cuteeditor.css); @import ;@import url(/uploads/css/css/cuteeditor.css);
install brew:

difference between homebrew and homebrew cask


install jdk11 on mac:




posted @ 2022-11-11 11:21 paulwong 阅读(89) | 评论 (0)编辑 收藏

install docker on mac

@import ;@import url(/uploads/css/css/cuteeditor.css);



posted @ 2022-11-11 11:07 paulwong 阅读(76) | 评论 (0)编辑 收藏

mongodb spring distinct

spring 框架下 如果要做去重,在数据量大的时候会爆error,可改用如下 写法:

    private boolean needreordercheck(string requestid) {
        boolean result = false;
//        try(mongocursor mongocursor = 
//                mongotemplate.getcollection(mongotemplate.getcollectionname(accountnumproductlineindex.class))
//                             .distinct(key, filters.eq(request_id, requestid), string.class)
//                             .iterator()
//                )
        try(mongocursor 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 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 阅读(110) | 评论 (0)编辑 收藏

网站地图