首页 文章 新番
动漫 学习 生活 日记 书籍 服务器 Bing
  • C++一些错误

    ##死锁```terminatecalledafterthrowinganinstanceof'std::system_error'what():Resourcedeadlockavoided已中止(核心已转储)```这个问题在`Windows`上面是没问题的,但是`Linux`就是出现,最后发现原来是`std::async`执行需要释放完成才能结束线程。##CUDA```2024-12-2520:56:05.198288284[E:onnxruntime:face-feature,cuda_call.cc:123CudaCall]CUDAfailure700:anillegalmemoryaccesswasencountered;GPU=0;hostname=dmx-SYS-7048GR-TR;file=/onnxruntime_src/onnxruntime/core/providers/cuda/gpu_data_transfer.cc;line=63;expr=cudaMemcpyAsync(dst_data,src_data,bytes,cudaMemcpyHostToDevice,static_c...

    2024年12月25日 C++ ONNX CUDA
  • FFmpeg内存模式和文件模式

    不用写出文件直接读取编码数据```aliang::media::VideoEncoderencoder(1080,1080);//文件模式//AVFormatContext*outputCtx=avformat_alloc_context();//avformat_alloc_output_context2(&outputCtx,NULL,NULL,"D:/tmp/aliang1.mp4");//AVStream*video_stream=avformat_new_stream(outputCtx,NULL);//avcodec_parameters_from_context(video_stream->codecpar,encoder.codecCtx);//avio_open(&outputCtx->pb,"D:/tmp/aliang1.mp4",AVIO_FLAG_WRITE);//AVDictionary*options=nullptr;////frag_keyframe+empty_moov////frag_keyframe+empty_moov+default_base...

    2024年12月20日 FFmpeg
  • debian多语言

    ```#修改sudoaptinstalllocalessudodpkg-reconfigurelocales#查看所有locale-a#查看当前locale```

    2024年11月30日 debian
  • AI技术选型

    ##编程语言`python`没办法必须了解,几乎所有训练框架都是`python`。```c++python```##训练框架```pytorchlibtorchtensorflowPaddlePaddlescikit-learn```##部署环境```ggmltensorrtopenvinoonnxruntime```##其他框架```dlibfaissollamaopencvffmpeg```

    2024年11月19日 AI
  • H2数据库修复

    最近有些简单项目直接使用内嵌的`H2`数据库,但是单元测试跑着跑着文件损坏了,使用下面命令可以修复:```#原始JDBC链接:jdbc:h2:file:./hfx.db#导出SQL文件java-cp.\h2-2.2.224.jarorg.h2.tools.Recover-dbhfx.db#修改旧的文件名称hfx.db.mv.db->hfx.db.mv.db.backupjava-cp.\h2-2.2.224.jarorg.h2.tools.RunScript-urljdbc:h2:file:./hfx.db-script.\hfx.db.h2.sql```旧的文件建议保留,没有问题以后再删除。

    2024年10月09日 H2
  • Java通过FFmpeg实现rtp多路推流

    ```packagecom.acgist.stream;importjava.io.File;importjava.io.IOException;importjava.io.InputStream;importjava.io.OutputStream;importjava.net.DatagramPacket;importjava.net.DatagramSocket;importjava.net.InetAddress;importjava.net.InetSocketAddress;importjava.nio.ByteBuffer;importjava.security.cert.X509Certificate;importjava.util.ArrayList;importjava.util.List;importjava.util.Map;importjava.util.Properties;importjava.util.Timer;importjava.util.TimerTask;importjava.util.concurrent.TimeUnit;importjavax.net.ssl.H...

    2024年09月26日 Java FFmpeg RTP
  • Debian解决vim乱码

    ```vim/etc/vim/vimrc---setfileencodings=utf-8,gbk,gb2312settermencoding=utf-8setencoding=prc---```

    2024年09月23日 debian vim
  • Linux配置24小时制

    ```vim/etc/locale.conf---LANG=zh_CN.utf8LANGUAGE=zh_CN.utf8---source/etc/locale.confvim/etc/default/locale---LANG=zh_CN.utf8LANGUAGE=zh_CN.utf8---source/etc/default/locale```

    2024年09月23日 Linux
  • C++ STL ranges

    `C++20`在`STL`库里面提供`ranges`头文件,通过这个可以实现类似`Java`流一样的链式编程:```#include#include#includeintmain(){std::vectorv{1,2,3,4};autoc{v|std::ranges::views::filter([](constauto&i){returni%2==0;})|std::ranges::views::reverse|std::ranges::views::take(1)};for(constauto&x:v){std::cout<<x<<'\n';}std::cout<<"===="<<'\n';for(constauto&x:c){std::cout<<x<<'\n';}return0;}``````g++-std=c++20demo.cpp```

    2024年09月11日 C++ STL rnages views
  • Android使用termux模拟Linux环境

    最近研究怎么在`Android`上面运行`SpringBoot`项目,发现使用`termux`可以模拟`Linux`环境。参考地址:```https://github.com/termux/termux-app/releaseshttps://mirrors.tuna.tsinghua.edu.cn/help/termux/```##安装`SSH````#查看IPifconfig#安装服务pkginstallopenssh#查看账号whoami#设置密码passwd#启动服务sshd#查看端口(需要root权限)netstat-alt```>默认`ssh`端口`8022`##JDK11下载默认`JDK`版本`17`,其他版本下载:```https://github.com/Hax4us/javahttps://github.com/hfib/openjdk11-termuxhttps://github.com/xiliuya/openjdk11-termuxhttps://github.com/SHivnaTH13/Termux-OpenJDKhttps://github.com/Lzhiyong/te...

    2024年09月09日 termux Android
  • Git重置提交记录

    `Git`重置提交记录,删除旧的所有记录重新提交:```#创建空白分支gitcheckout--orphanresetgitadd.gitcommit-m"[+]init"#删除旧的分支gitbranch-Dmaster#修改新的分支gitbranch-mmaster#覆盖远程分支gitpush-foriginmaster```

    2024年08月15日 GIT
  • C++泛型

    ```/data/lifuren/core/src/source/config/Config.cpp:Inlambdafunction:/data/lifuren/core/src/source/config/Config.cpp:90:55:error:expectedprimary-expressionbefore‘>’token90|autox=client.as();|^/data/lifuren/core/src/source/config/Config.cpp:90:57:error:expectedprimary-expressionbefore‘)’token90|autox=client.as();|^/data/lifuren/core/src/source/config/Config.cpp:Inlambdafunction:/data/lifuren/core/src/source/config/Config.cpp:25:55:error:expectedprimary-expressionbefore‘>’token25|conststd::string&vk=...

    2024年08月08日 C++
  • SpringAI Ollama

    今天发现原来还有`SpringAI`这个东西,用来和`Ollama`对接非常方便。##ollama```mkdir-p/data/ollamacondacreate--nameollamapython=3.11condaactivateollamacurl-fsSLhttps://ollama.com/install.sh|shollamapullglm4ollamapullquentinz/bge-large-zh-v1.5condadeactivate```##添加依赖```io.springboot.aispring-ai-ollama-spring-boot-starter1.0.3```##测试代码```@TestpublicvoidtestApi(){finalOllamaApiapi=newOllamaApi("http://192.168.8.50:11434");finalOllamaChatClientclient=newOllamaChatClient(api,OllamaOptions.create().withModel("glm4"));finalScannerscanner=ne...

    2024年07月31日 ollama SpringAI
  • SpringBoot3.x学习

    `SpringBoot3.x`支持了很多新的特性:`native`/`JDK17`/`WebClient`/`RestClient`/`HTTPInterface`等等。总结一些问题:####`RestClient`乱码```finalRestClientclient=RestClient.builder().baseUrl("https://www.acgist.com").messageConverters((list)->{list.forEach(v->{if(vinstanceofStringHttpMessageConverterx){x.setDefaultCharset(StandardCharsets.UTF_8);}});}).build();```###`WebClient`/`RestClient`/`RestTemplate````@Bean@ConditionalOnMissingBeanRestClient.BuilderrestClientBuilder(RestClientBuilderConfigurerrestClientBuilderConfigurer){...

    2024年07月30日 SpringBoot
  • RNNOISE模型训练

    #RNNOISE模型训练##环境```sudoaptinstallvimparallelsudoaptinstallbuild-essentialsudoaptinstallpython3python3-pipsudoaptinstallffmpeglibtoolautoconfvim~/.pip/pip.conf---[global]index-url=https://pypi.tuna.tsinghua.edu.cn/simple---pip3installtqdmtorchnumpy```##数据```#提取ffmpeg.exe-i.\source.wav-ar48000-ac1-fs16le-c:apcm_s16lenoise.pcmffmpeg.exe-i.\source.ts-vn-ar48000-ac1-fs16le-c:apcm_s16lenoise.pcm#去掉超过0.4秒的静音ffmpeg-ar48000-ac1-fs16le-inoise.1.pcm-afsilenceremove=stop_periods=-1:stop_duration=0.4:stop_threshold=-60d...

    2024年07月23日 rnnoise
  • C++字面量前后缀

    ```#自动推导usingnamespacestd::string_literals;autoa="1234"s;#自动推导usingnamespacestd::string_view_literals;autoa="1234"sv;#多行文本R"(acgistacgist)"#u8、u、U、Lchar8_t、char16_t、char32_t、wchar_t```#LULLLULL

    2024年07月08日 C++
  • frp配置

    #frps```#本地监听bindAddr="0.0.0.0"bindPort=7000vhostHTTPPort=7080vhostHTTPSPort=7443#TLStransport.tls.certFile="/data/project/frp_0.58.1_linux_amd64/certs/server.crt"transport.tls.keyFile="/data/project/frp_0.58.1_linux_amd64/certs/server.key"transport.tls.trustedCaFile="/data/project/frp_0.58.1_linux_amd64/certs/ca.crt"#监控页面webServer.addr="0.0.0.0"webServer.port=7500webServer.user="admin"webServer.password="admin"webServer.tls.certFile="/data/project/frp_0.58.1_linux_amd64/certs/server.crt"webServer.tls.keyFi...

    2024年06月15日 frp
  • openssl命令生成证书

    #CA脚本```opensslgenrsa-outca.key2048opensslreq-new-x509-keyca.key-days3650-outca.crt-subj"/C=cn/ST=gd/L=gz/O=acgist/OU=acgist/CN=acgist"```#证书脚本```bashmkdir-p/tmp/servercd/tmp/serverecho"keyUsage=nonRepudiation,digitalSignature,keyEnciphermentextendedKeyUsage=serverAuth,clientAuthsubjectAltName=@SubjectAlternativeName[SubjectAlternativeName]IP.1=127.0.0.1IP.2=192.168.8.188DNS.1=*.acgist.com">server.extopensslgenrsa-outserver.key2048opensslreq-new-keyserver.key-outserver.csr-subj"/C=cn/ST=gd/L=gz/O=acgist/...

    2024年06月14日 openssl
  • JNI内存释放

    不要手动释放:jint、jlong、jchar需要手动释放:jstring、jobject、jobjectArray、jintArray、jclass、jmethodID```FindClassDeleteLocalRefNewStringDeleteLocalRefNewStringUTFDeleteLocalRefNewObjectDeleteLocalRefNewXXXXArrayDeleteLocalRefGetObjectFieldDeleteLocalRefGetObjectClassDeleteLocalRefGetObjectArrayElementDeleteLocalRefGetStringCharsReleaseStringCharsGetStringUTFCharsReleaseStringUTFCharsGetXXXXArrayElementsReleaseXXXXArrayElements``````#入参jstringjProducerIdconstchar*producerId=env->GetStringUTFChars(jProducerId,nullptr);......

    2024年04月25日 JNI
  • GraalVM加速启动

    ```https://github.com/graalvm/graalvm-ce-builds/releases?page=5./bin/guinstallnative-image./bin/guinstall-Lnative-image-installable-svm-java11-linux-amd64-20.2.0.jar./bin/native-image-Dspring.profiles.active=dev-jar./application-1.0.0.jarmvnspring-boot:build-imagemvnnative:compile```参考文章:*https://docs.oracle.com/zh-cn/learn/graalvm-native-image-quick-start/index.html*https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html

    2024年04月18日 GraalVM native-image
12345...31

关于 ACGIST

Copyright © 2013-2025 ACGIST.COM. All Rights Reserved.