blogjava-凯发k8网页登录

blogjava-凯发k8网页登录http://www.blogjava.net/paulwong/zh-cnsat, 08 apr 2023 20:36:20 gmtsat, 08 apr 2023 20:36:20 gmt60reinstall mac oshttp://www.blogjava.net/paulwong/archive/2022/11/11/450860.htmlpaulwongpaulwongfri, 11 nov 2022 14:44:00 gmthttp://www.blogjava.net/paulwong/archive/2022/11/11/450860.htmlhttp://www.blogjava.net/paulwong/comments/450860.htmlhttp://www.blogjava.net/paulwong/archive/2022/11/11/450860.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450860.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450860.html

在 mac 清除所有內容和設定


為 macos 製作開機安裝程式


如何重新安裝 macos



paulwong 2022-11-11 22:44 发表评论
]]>
how to downgrade macos ventura to monterey, big sur, or earlierhttp://www.blogjava.net/paulwong/archive/2022/11/11/450858.htmlpaulwongpaulwongfri, 11 nov 2022 03:27:00 gmthttp://www.blogjava.net/paulwong/archive/2022/11/11/450858.htmlhttp://www.blogjava.net/paulwong/comments/450858.htmlhttp://www.blogjava.net/paulwong/archive/2022/11/11/450858.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450858.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450858.html




paulwong 2022-11-11 11:27 发表评论
]]>
difference between homebrew and homebrew cask http://www.blogjava.net/paulwong/archive/2022/11/11/450857.htmlpaulwongpaulwongfri, 11 nov 2022 03:21:00 gmthttp://www.blogjava.net/paulwong/archive/2022/11/11/450857.htmlhttp://www.blogjava.net/paulwong/comments/450857.htmlhttp://www.blogjava.net/paulwong/archive/2022/11/11/450857.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450857.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450857.htmlinstall brew:

difference between homebrew and homebrew cask


install jdk11 on mac:






paulwong 2022-11-11 11:21 发表评论
]]>
install docker on machttp://www.blogjava.net/paulwong/archive/2022/11/11/450856.htmlpaulwongpaulwongfri, 11 nov 2022 03:07:00 gmthttp://www.blogjava.net/paulwong/archive/2022/11/11/450856.htmlhttp://www.blogjava.net/paulwong/comments/450856.htmlhttp://www.blogjava.net/paulwong/archive/2022/11/11/450856.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450856.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450856.html




paulwong 2022-11-11 11:07 发表评论
]]>
mongodb spring distincthttp://www.blogjava.net/paulwong/archive/2022/10/18/450835.htmlpaulwongpaulwongtue, 18 oct 2022 02:22:00 gmthttp://www.blogjava.net/paulwong/archive/2022/10/18/450835.htmlhttp://www.blogjava.net/paulwong/comments/450835.htmlhttp://www.blogjava.net/paulwong/archive/2022/10/18/450835.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450835.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450835.html
    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;
    }



paulwong 2022-10-18 10:22 发表评论
]]>
spring json timezone问题大汇总http://www.blogjava.net/paulwong/archive/2022/09/22/450823.htmlpaulwongpaulwongthu, 22 sep 2022 05:18:00 gmthttp://www.blogjava.net/paulwong/archive/2022/09/22/450823.htmlhttp://www.blogjava.net/paulwong/comments/450823.htmlhttp://www.blogjava.net/paulwong/archive/2022/09/22/450823.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450823.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450823.html@jsonformat(shape=jsonformat.shape.string, pattern="yyyy-mm-dd't'hh:mm:ss.sssz", timezone="america/phoenix")
private date date;


paulwong 2022-09-22 13:18 发表评论
]]>
downloading large files using spring webclienthttp://www.blogjava.net/paulwong/archive/2022/09/22/450822.htmlpaulwongpaulwongthu, 22 sep 2022 05:14:00 gmthttp://www.blogjava.net/paulwong/archive/2022/09/22/450822.htmlhttp://www.blogjava.net/paulwong/comments/450822.htmlhttp://www.blogjava.net/paulwong/archive/2022/09/22/450822.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450822.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450822.htmlhttps://www.amitph.com/spring-webclient-large-file-download/



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 = 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 = webclient
                .get()
                .uri("/largefiles/1")
                .retrieve()
                .bodytoflux(databuffer.class);

        databufferutils.write(databuffer, destination,
                standardopenoption.create)
                .share().block();
    }
}


paulwong 2022-09-22 13:14 发表评论
]]>
java-security资源http://www.blogjava.net/paulwong/archive/2022/07/18/450784.htmlpaulwongpaulwongmon, 18 jul 2022 03:09:00 gmthttp://www.blogjava.net/paulwong/archive/2022/07/18/450784.htmlhttp://www.blogjava.net/paulwong/comments/450784.htmlhttp://www.blogjava.net/paulwong/archive/2022/07/18/450784.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450784.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450784.html

java keystore 存储在mongodb
默认情况下,证书是放保存在文件,如果要改成mongodb做为存储界质,则要做以下改动:


关于证书,这里有你想知道的一切




paulwong 2022-07-18 11:09 发表评论
]]>
redhead 8 linux 软件集合http://www.blogjava.net/paulwong/archive/2022/06/23/450773.htmlpaulwongpaulwongthu, 23 jun 2022 09:27:00 gmthttp://www.blogjava.net/paulwong/archive/2022/06/23/450773.htmlhttp://www.blogjava.net/paulwong/comments/450773.htmlhttp://www.blogjava.net/paulwong/archive/2022/06/23/450773.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450773.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450773.html




paulwong 2022-06-23 17:27 发表评论
]]>
linux yumhttp://www.blogjava.net/paulwong/archive/2022/06/23/450772.htmlpaulwongpaulwongthu, 23 jun 2022 09:21:00 gmthttp://www.blogjava.net/paulwong/archive/2022/06/23/450772.htmlhttp://www.blogjava.net/paulwong/comments/450772.htmlhttp://www.blogjava.net/paulwong/archive/2022/06/23/450772.html#feedback0http://www.blogjava.net/paulwong/comments/commentrss/450772.htmlhttp://www.blogjava.net/paulwong/services/trackbacks/450772.html
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





paulwong 2022-06-23 17:21 发表评论
]]>
网站地图