如何具备阅读JAVA JDK虚拟机源码能力
源码位置https://github.com/openjdk/jdk
核心实现源码[部分截图]

/** Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.** This code is free software; you can redistribute it and/or modify it* under the terms of the GNU General Public License version 2 only, as* published by the Free Software Foundation. Oracle designates this* particular file as subject to the "Classpath" exception as provided* by Oracle in the LICENSE file that accompanied this code.** This code is distributed in the hope that it will be useful, but WITHOUT* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License* version 2 for more details (a copy is included in the LICENSE file that* accompanied this code).** You should have received a copy of the GNU General Public License version* 2 along with this work; if not, write to the Free Software Foundation,* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.** Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA* or visit www.oracle.com if you need additional information or have any* questions.*//** This file contains the main entry point into the launcher code* this is the only file which will be repeatedly compiled by other* tools. The rest of the files will be linked in.*/#include "defines.h"#include "jli_util.h"#include "jni.h"/** Entry point.*/#ifdef JAVAWchar **__initenv;int WINAPIWinMain(HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline, int cmdshow){int margc;char** margv;int jargc;char** jargv;const jboolean const_javaw = JNI_TRUE;__initenv = _environ;#else /* JAVAW */JNIEXPORT intmain(int argc, char **argv){int margc;char** margv;int jargc;char** jargv;const jboolean const_javaw = JNI_FALSE;#endif /* JAVAW */{int i, main_jargc, extra_jargc;JLI_List list;main_jargc = (sizeof(const_jargs) / sizeof(char *)) > 1? sizeof(const_jargs) / sizeof(char *): 0; // ignore the null terminator indexextra_jargc = (sizeof(const_extra_jargs) / sizeof(char *)) > 1? sizeof(const_extra_jargs) / sizeof(char *): 0; // ignore the null terminator indexif (main_jargc > 0 && extra_jargc > 0) { // combine extra java argsjargc = main_jargc + extra_jargc;list = JLI_List_new(jargc + 1);for (i = 0 ; i < extra_jargc; i++) {JLI_List_add(list, JLI_StringDup(const_extra_jargs[i]));}for (i = 0 ; i < main_jargc ; i++) {JLI_List_add(list, JLI_StringDup(const_jargs[i]));}// terminate the listJLI_List_add(list, NULL);jargv = list->elements;} else if (extra_jargc > 0) { // should never happenfprintf(stderr, "EXTRA_JAVA_ARGS defined without JAVA_ARGS");abort();} else { // no extra args, business as usualjargc = main_jargc;jargv = (char **) const_jargs;}}JLI_InitArgProcessing(jargc > 0, const_disable_argfile);#ifdef _WIN32{int i = 0;if (getenv(JLDEBUG_ENV_ENTRY) != NULL) {printf("Windows original main args:\n");for (i = 0 ; i < __argc ; i++) {printf("wwwd_args[%d] = %s\n", i, __argv[i]);}}}// Obtain the command line in UTF-16, then convert it to ANSI code page// without the "best-fit" optionLPWSTR wcCmdline = GetCommandLineW();int mbSize = WideCharToMultiByte(CP_ACP,WC_NO_BEST_FIT_CHARS | WC_COMPOSITECHECK | WC_DEFAULTCHAR,wcCmdline, -1, NULL, 0, NULL, NULL);// If the call to WideCharToMultiByte() fails, it returns 0, which// will then make the following JLI_MemAlloc() to issue exit(1)LPSTR mbCmdline = JLI_MemAlloc(mbSize);if (WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS | WC_COMPOSITECHECK | WC_DEFAULTCHAR,wcCmdline, -1, mbCmdline, mbSize, NULL, NULL) == 0) {perror("command line encoding conversion failure");exit(1);}JLI_CmdToArgs(mbCmdline);JLI_MemFree(mbCmdline);margc = JLI_GetStdArgc();// add one more to mark the endmargv = (char **)JLI_MemAlloc((margc + 1) * (sizeof(char *)));{int i = 0;StdArg *stdargs = JLI_GetStdArgs();for (i = 0 ; i < margc ; i++) {margv[i] = stdargs[i].arg;}margv[i] = NULL;}#else /* *NIXES */{// accommodate the NULL at the endJLI_List args = JLI_List_new(argc + 1);int i = 0;// Add first arg, which is the app nameJLI_List_add(args, JLI_StringDup(argv[0]));// Append JDK_JAVA_OPTIONSif (JLI_AddArgsFromEnvVar(args, JDK_JAVA_OPTIONS)) {// JLI_SetTraceLauncher is not called yet// Show _JAVA_OPTIONS content along with JDK_JAVA_OPTIONS to aid diagnosisif (getenv(JLDEBUG_ENV_ENTRY)) {char *tmp = getenv("_JAVA_OPTIONS");if (NULL != tmp) {JLI_ReportMessage(ARG_INFO_ENVVAR, "_JAVA_OPTIONS", tmp);}}}// Iterate the rest of command linefor (i = 1; i < argc; i++) {JLI_List argsInFile = JLI_PreprocessArg(argv[i], JNI_TRUE);if (NULL == argsInFile) {JLI_List_add(args, JLI_StringDup(argv[i]));} else {int cnt, idx;cnt = argsInFile->size;for (idx = 0; idx < cnt; idx++) {JLI_List_add(args, argsInFile->elements[idx]);}// Shallow free, we reuse the string to avoid copyJLI_MemFree(argsInFile->elements);JLI_MemFree(argsInFile);}}margc = args->size;// add the NULL pointer at argv[argc]JLI_List_add(args, NULL);margv = args->elements;}#endif /* WIN32 */return JLI_Launch(margc, margv,jargc, (const char**) jargv,0, NULL,VERSION_STRING,DOT_VERSION,(const_progname != NULL) ? const_progname : *margv,(const_launcher != NULL) ? const_launcher : *margv,jargc > 0,const_cpwildcard, const_javaw, 0);}

intCallJavaMainInNewThread(jlong stack_size, void* args) {int rslt;pthread_t tid;pthread_attr_t attr;pthread_attr_init(&attr);pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);size_t adjusted_stack_size;if (stack_size > 0) {if (pthread_attr_setstacksize(&attr, stack_size) == EINVAL) {// System may require stack size to be multiple of page size// Retry with adjusted valueadjusted_stack_size = adjustStackSize(stack_size);if (adjusted_stack_size != (size_t) stack_size) {pthread_attr_setstacksize(&attr, adjusted_stack_size);}}}pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threadsif (pthread_create(&tid, &attr, ThreadJavaMain, args) == 0) {void* tmp;pthread_join(tid, &tmp);rslt = (int)(intptr_t)tmp;} else {/** Continue execution in current thread if for some reason (e.g. out of* memory/LWP) a new thread can't be created. This will likely fail* later in JavaMain as JNI_CreateJavaVM needs to create quite a* few new threads, anyway, just give it a try..*/rslt = JavaMain(args);}pthread_attr_destroy(&attr);return rslt;}
## Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.## This code is free software; you can redistribute it and/or modify it# under the terms of the GNU General Public License version 2 only, as# published by the Free Software Foundation.## This code is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License# version 2 for more details (a copy is included in the LICENSE file that# accompanied this code).## You should have received a copy of the GNU General Public License version# 2 along with this work; if not, write to the Free Software Foundation,# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.## Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA# or visit www.oracle.com if you need additional information or have any# questions.##include "defs.S.inc"# NOTE WELL! The _Copy functions are called directly# from server-compiler-generated code via CallLeafNoFP,# which means that they *must* either not use floating# point or use it in the same manner as does the server# compiler..text.align 16DECLARE_FUNC(SpinPause):repnopmovq $1, %raxret# Support for void Copy::arrayof_conjoint_bytes(void* from,# void* to,# size_t count)# rdi - from# rsi - to# rdx - count, treated as ssize_t#.p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_bytes):movq %rdx,%r8 # byte countshrq $3,%rdx # qword countcmpq %rdi,%rsileaq -1(%rdi,%r8,1),%rax # from + bcount*1 - 1jbe acb_CopyRightcmpq %rax,%rsijbe acb_CopyLeftacb_CopyRight:leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8negq %rdxjmp 7f.p2align 4,,151: movq 8(%rax,%rdx,8),%rsimovq %rsi,8(%rcx,%rdx,8)addq $1,%rdxjnz 1b2: testq $4,%r8 # check for trailing dwordjz 3fmovl 8(%rax),%esi # copy trailing dwordmovl %esi,8(%rcx)addq $4,%raxaddq $4,%rcx # original %rsi is trashed, so we# can't use it as a base register3: testq $2,%r8 # check for trailing wordjz 4fmovw 8(%rax),%si # copy trailing wordmovw %si,8(%rcx)addq $2,%rcx4: testq $1,%r8 # check for trailing bytejz 5fmovb -1(%rdi,%r8,1),%al # copy trailing bytemovb %al,8(%rcx)5: ret.p2align 4,,156: movq -24(%rax,%rdx,8),%rsimovq %rsi,-24(%rcx,%rdx,8)movq -16(%rax,%rdx,8),%rsimovq %rsi,-16(%rcx,%rdx,8)movq -8(%rax,%rdx,8),%rsimovq %rsi,-8(%rcx,%rdx,8)movq (%rax,%rdx,8),%rsimovq %rsi,(%rcx,%rdx,8)7: addq $4,%rdxjle 6bsubq $4,%rdxjl 1bjmp 2bacb_CopyLeft:testq $1,%r8 # check for trailing bytejz 1fmovb -1(%rdi,%r8,1),%cl # copy trailing bytemovb %cl,-1(%rsi,%r8,1)subq $1,%r8 # adjust for possible trailing word1: testq $2,%r8 # check for trailing wordjz 2fmovw -2(%rdi,%r8,1),%cx # copy trailing wordmovw %cx,-2(%rsi,%r8,1)2: testq $4,%r8 # check for trailing dwordjz 5fmovl (%rdi,%rdx,8),%ecx # copy trailing dwordmovl %ecx,(%rsi,%rdx,8)jmp 5f.p2align 4,,153: movq -8(%rdi,%rdx,8),%rcxmovq %rcx,-8(%rsi,%rdx,8)subq $1,%rdxjnz 3bret.p2align 4,,154: movq 24(%rdi,%rdx,8),%rcxmovq %rcx,24(%rsi,%rdx,8)movq 16(%rdi,%rdx,8),%rcxmovq %rcx,16(%rsi,%rdx,8)movq 8(%rdi,%rdx,8),%rcxmovq %rcx,8(%rsi,%rdx,8)movq (%rdi,%rdx,8),%rcxmovq %rcx,(%rsi,%rdx,8)5: subq $4,%rdxjge 4baddq $4,%rdxjg 3bret# Support for void Copy::arrayof_conjoint_jshorts(void* from,# void* to,# size_t count)# Equivalent to# conjoint_jshorts_atomic## If 'from' and/or 'to' are aligned on 4- or 2-byte boundaries, we# let the hardware handle it. The tow or four words within dwords# or qwords that span cache line boundaries will still be loaded# and stored atomically.## rdi - from# rsi - to# rdx - count, treated as ssize_t#.p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_jshorts):DECLARE_FUNC(_Copy_conjoint_jshorts_atomic):movq %rdx,%r8 # word countshrq $2,%rdx # qword countcmpq %rdi,%rsileaq -2(%rdi,%r8,2),%rax # from + wcount*2 - 2jbe acs_CopyRightcmpq %rax,%rsijbe acs_CopyLeftacs_CopyRight:leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8negq %rdxjmp 6f1: movq 8(%rax,%rdx,8),%rsimovq %rsi,8(%rcx,%rdx,8)addq $1,%rdxjnz 1b2: testq $2,%r8 # check for trailing dwordjz 3fmovl 8(%rax),%esi # copy trailing dwordmovl %esi,8(%rcx)addq $4,%rcx # original %rsi is trashed, so we# can't use it as a base register3: testq $1,%r8 # check for trailing wordjz 4fmovw -2(%rdi,%r8,2),%si # copy trailing wordmovw %si,8(%rcx)4: ret.p2align 4,,155: movq -24(%rax,%rdx,8),%rsimovq %rsi,-24(%rcx,%rdx,8)movq -16(%rax,%rdx,8),%rsimovq %rsi,-16(%rcx,%rdx,8)movq -8(%rax,%rdx,8),%rsimovq %rsi,-8(%rcx,%rdx,8)movq (%rax,%rdx,8),%rsimovq %rsi,(%rcx,%rdx,8)6: addq $4,%rdxjle 5bsubq $4,%rdxjl 1bjmp 2bacs_CopyLeft:testq $1,%r8 # check for trailing wordjz 1fmovw -2(%rdi,%r8,2),%cx # copy trailing wordmovw %cx,-2(%rsi,%r8,2)1: testq $2,%r8 # check for trailing dwordjz 4fmovl (%rdi,%rdx,8),%ecx # copy trailing dwordmovl %ecx,(%rsi,%rdx,8)jmp 4f2: movq -8(%rdi,%rdx,8),%rcxmovq %rcx,-8(%rsi,%rdx,8)subq $1,%rdxjnz 2bret.p2align 4,,153: movq 24(%rdi,%rdx,8),%rcxmovq %rcx,24(%rsi,%rdx,8)movq 16(%rdi,%rdx,8),%rcxmovq %rcx,16(%rsi,%rdx,8)movq 8(%rdi,%rdx,8),%rcxmovq %rcx,8(%rsi,%rdx,8)movq (%rdi,%rdx,8),%rcxmovq %rcx,(%rsi,%rdx,8)4: subq $4,%rdxjge 3baddq $4,%rdxjg 2bret# Support for void Copy::arrayof_conjoint_jints(jint* from,# jint* to,# size_t count)# Equivalent to# conjoint_jints_atomic## If 'from' and/or 'to' are aligned on 4-byte boundaries, we let# the hardware handle it. The two dwords within qwords that span# cache line boundaries will still be loaded and stored atomically.## rdi - from# rsi - to# rdx - count, treated as ssize_t#.p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_jints):DECLARE_FUNC(_Copy_conjoint_jints_atomic):movq %rdx,%r8 # dword countshrq %rdx # qword countcmpq %rdi,%rsileaq -4(%rdi,%r8,4),%rax # from + dcount*4 - 4jbe aci_CopyRightcmpq %rax,%rsijbe aci_CopyLeftaci_CopyRight:leaq -8(%rdi,%rdx,8),%rax # from + qcount*8 - 8leaq -8(%rsi,%rdx,8),%rcx # to + qcount*8 - 8negq %rdxjmp 5f.p2align 4,,151: movq 8(%rax,%rdx,8),%rsimovq %rsi,8(%rcx,%rdx,8)addq $1,%rdxjnz 1b2: testq $1,%r8 # check for trailing dwordjz 3fmovl 8(%rax),%esi # copy trailing dwordmovl %esi,8(%rcx)3: ret.p2align 4,,154: movq -24(%rax,%rdx,8),%rsimovq %rsi,-24(%rcx,%rdx,8)movq -16(%rax,%rdx,8),%rsimovq %rsi,-16(%rcx,%rdx,8)movq -8(%rax,%rdx,8),%rsimovq %rsi,-8(%rcx,%rdx,8)movq (%rax,%rdx,8),%rsimovq %rsi,(%rcx,%rdx,8)5: addq $4,%rdxjle 4bsubq $4,%rdxjl 1bjmp 2baci_CopyLeft:testq $1,%r8 # check for trailing dwordjz 3fmovl -4(%rdi,%r8,4),%ecx # copy trailing dwordmovl %ecx,-4(%rsi,%r8,4)jmp 3f1: movq -8(%rdi,%rdx,8),%rcxmovq %rcx,-8(%rsi,%rdx,8)subq $1,%rdxjnz 1bret.p2align 4,,152: movq 24(%rdi,%rdx,8),%rcxmovq %rcx,24(%rsi,%rdx,8)movq 16(%rdi,%rdx,8),%rcxmovq %rcx,16(%rsi,%rdx,8)movq 8(%rdi,%rdx,8),%rcxmovq %rcx,8(%rsi,%rdx,8)movq (%rdi,%rdx,8),%rcxmovq %rcx,(%rsi,%rdx,8)3: subq $4,%rdxjge 2baddq $4,%rdxjg 1bret# Support for void Copy::arrayof_conjoint_jlongs(jlong* from,# jlong* to,# size_t count)# Equivalent to# conjoint_jlongs_atomic# arrayof_conjoint_oops# conjoint_oops_atomic## rdi - from# rsi - to# rdx - count, treated as ssize_t#.p2align 4,,15DECLARE_FUNC(_Copy_arrayof_conjoint_jlongs):DECLARE_FUNC(_Copy_conjoint_jlongs_atomic):cmpq %rdi,%rsileaq -8(%rdi,%rdx,8),%rax # from + count*8 - 8jbe acl_CopyRightcmpq %rax,%rsijbe acl_CopyLeftacl_CopyRight:leaq -8(%rsi,%rdx,8),%rcx # to + count*8 - 8negq %rdxjmp 3f1: movq 8(%rax,%rdx,8),%rsimovq %rsi,8(%rcx,%rdx,8)addq $1,%rdxjnz 1bret.p2align 4,,152: movq -24(%rax,%rdx,8),%rsimovq %rsi,-24(%rcx,%rdx,8)movq -16(%rax,%rdx,8),%rsimovq %rsi,-16(%rcx,%rdx,8)movq -8(%rax,%rdx,8),%rsimovq %rsi,-8(%rcx,%rdx,8)movq (%rax,%rdx,8),%rsimovq %rsi,(%rcx,%rdx,8)3: addq $4,%rdxjle 2bsubq $4,%rdxjl 1bret4: movq -8(%rdi,%rdx,8),%rcxmovq %rcx,-8(%rsi,%rdx,8)subq $1,%rdxjnz 4bret.p2align 4,,155: movq 24(%rdi,%rdx,8),%rcxmovq %rcx,24(%rsi,%rdx,8)movq 16(%rdi,%rdx,8),%rcxmovq %rcx,16(%rsi,%rdx,8)movq 8(%rdi,%rdx,8),%rcxmovq %rcx,8(%rsi,%rdx,8)movq (%rdi,%rdx,8),%rcxmovq %rcx,(%rsi,%rdx,8)acl_CopyLeft:subq $4,%rdxjge 5baddq $4,%rdxjg 4bret


JAVA JDK的源码是C,C++,ASM实现,其中编译原理,算法,数据结构,JIT等技术点知识已经融入到代码里。




通过学习《程序员内功修炼》《编译器实现》《github c语言大型开源项目源码吸收转化实践》这3门课程足以。


https://beifengisnil.github.io/
talk is cheap, show me the code
这个code里面欧美程序员已经将编译原理,算法,数据结构,操作系统,数学,工程,AI等不计其数的知识体系已经融入实现到代码里,并且持续用了几十年,这些code是面向全球用户市场的,且具有强大的技术经济价值,创新能力,市场开发能力,这几十年的编译原理,算法,数学,工程,AI等知识早就code等着你去吸收转化。
code已经给你show了,就看你有没有一套系统的方法去吸收,这3门课程主要传授的是一套系统的方法去获取和运用各种技术知识,而不是教你一门技术,技术是会过时的。
相关文章:
如何具备阅读JAVA JDK虚拟机源码能力
源码位置https://github.com/openjdk/jdk 核心实现源码[部分截图] /* * Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistr…...
Python | Leetcode Python题解之第514题自由之路
题目: 题解: Test "godding" target "d"i 0left i lc 0 right i rc 0while Test[left] ! target:left - 1lc 1if left -1:left len(Test) - 1while Test[right] ! target:right 1rc 1if right len(Test):right 0prin…...
Docker 镜像下载问题及解决办法
Docker 镜像下载问题及解决办法 我在杂乱的、破旧的村庄寂寞地走过漫长的雨季,将我年少的眼光从晦暗的日子里打捞出来的是一棵棵开花的树,它们以一串串卓然不俗的花擦明了我的眼睛,也洗净了我的灵魂。 引言 在使用 Docker 时,用户…...
2分钟搞定 HarmonyOs Next创建模拟器
官方文档参考链接: 创建模拟器-管理模拟器-使用模拟器运行应用/服务-应用/服务运行-DevEco Studio - 华为HarmonyOS开发者https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-emulator-create-V5 1. 首先打开Device Manager 2. 进入这个界面后…...
方形件排样优化与订单组批问题探析
方形件排样优化与订单组批问题是计算复杂度很高的组合优化问题,在工业工程中有很广泛的应用背景。为实现个性化定制生产模式,企业会选择订单组批的方式,继而通过排样优化实现批量切割,加工完成后再按照不同客户需求进行分拣&#…...
vue3组件通信--自定义事件
自定义事件是典型的子传父的方法。 为什么叫自定义事件呢?是因为我们用sendToy"getToy"这种格式写,很显然,在DOM中,没有叫sendToy的事件。 父组件FatherComponent.vue: <script setup> import ChildComponent fr…...
ubuntu 安装k3s
配置hostname的方法为 hostnamectl set-hostname k3sserver hostnamectlsudo apt-get update && sudo apt-get upgrade -y sudo apt-get install -y curl#手动下载v1.31.1k3s1 https://github.com/k3s-io/k3s/releases/tag/v1.31.1%2Bk3s1 #将k3s-airgap-images-amd64…...
SQL CHECK 约束:确保数据完整性的关键
SQL CHECK 约束:确保数据完整性的关键 在数据库管理中,确保数据的完整性和准确性是至关重要的。SQL(Structured Query Language)提供了多种约束条件来帮助实现这一目标,其中之一就是 CHECK 约束。本文将深入探讨 SQL CHECK 约束的概念、用法和优势,并展示如何在不同的数…...
C++ | Leetcode C++题解之第502题IPO
题目: 题解: typedef pair<int,int> pii;class Solution { public:int findMaximizedCapital(int k, int w, vector<int>& profits, vector<int>& capital) {int n profits.size();int curr 0;priority_queue<int, vect…...
《虚拟现实的边界:探索虚拟世界的未来可能》
内容概要 在虚拟现实(VR)技术的浪潮中,我们见证了其从实验室的奇想逐渐走向日常生活的非凡旅程。技术发展的背后是不断突破的创新,早期的设备虽然笨重,但如今却趋向精致、轻巧,用户体验显著提升。想象一下…...
Rust教程
2024 Rust现代实用教程:1.1Rust简介与安装更新––2024 Rust现代实用教程:1.2编译器与包管理工具以及开发环境–––––––––––...
测试代理IP的有效性和可用性
使用代理IP的有效性和可用性直接关系到用户的工作效率,尤其是在进行数据抓取、网络爬虫和保护个人隐私等场景中。 一、测试代理IP的必要性 代理IP的可用性测试是确保代理服务正常运行的重要步骤。测试代理IP的必要性主要体现在以下几个方面: 提升工作…...
散列表:为什么经常把散列表和链表放在一起使用?
散列表:为什么经常把散列表和链表放在一起使用? 在计算机科学中,散列表(哈希表)和链表是两种常见的数据结构。你可能会好奇,为什么它们经常被放在一起使用呢?让我们一起来深入探讨这个问题。 一、散列表的特点 散列表是一种根据关键码值(Key value)而直接进行访问的…...
计算机网络:网络层 —— IPv4 地址与 MAC 地址 | ARP 协议
文章目录 IPv4地址与MAC地址的封装位置IPv4地址与MAC地址的关系地址解析协议ARP工作原理ARP高速缓存表 IPv4地址与MAC地址的封装位置 在数据传输过程中,每一层都会添加自己的头部信息,最终形成完整的数据包。具体来说: 应用层生成的应用程序…...
PMP--一、二、三模、冲刺、必刷--分类--10.沟通管理--技巧--文化意识
文章目录 技巧一模10.沟通管理--1.规划沟通管理--文化意识--军事背景和非军事背景人员有文化差异文化意识:题干关键词 “两拨人的背景不同、文化差异、风格差异”。5、 [单选] 项目团队由前军事和非军事小组成员组成。没有军事背景的团队成员认为前军事团队成员在他…...
FileReader和FileWriter
FileReader 使用read()方法读取单个字符,下面是如何修改使程序性能更好的过程。 第一种:处理异常方式为throws Testpublic void test() throws IOException {//读取hello.txt,并显示内容// 创建文件对象File file new File("hello.txt…...
【UE5】将2D切片图渲染为体积纹理,最终实现使用RT实时绘制体积纹理【第六篇-阶段总结篇】
因为马上就要进入下一个阶段,制作动态编辑体积纹理的模块。 但在这之前,要在这一章做最后一些整理。 首先,我们完成没完成的部分。其次,最后整理一下图表。最后,本文附上正在用的贴图 完善Shader 还记得我们之前注…...
地球村上一些可能有助于赚钱的20个思维方式
地球村上一些可能有助于赚钱的20个思维方式: 1. 目标导向思维:明确自己的财务目标,并制定详细、可执行的计划来逐步实现。 2. 创新思维:不断寻求新的商业机会和独特的解决方案,以在竞争激烈的市场中脱颖而出。 3. 价值…...
0基础入门matlab
目录 一、命令 二、变量命名 三、数据类型 数字 字符和字符串 矩阵 rand、randi和randn的区别? 元胞数组和结构体 MAGIC 结构体 四、矩阵构造、四则运算、矩阵下标 五、MATLAB逻辑与流程控制 六、MATLAB绘图 二维平面绘图 三维平面绘图 导出图片 内…...
【前端】实操tips集合
1. 关闭vue中组件名字的多词校验 (1) package.json文件中修改eslint配置 "eslintConfig": {"rules": {"vue/multi-word-component-names":"off" }}, (2).eslintrc.js或者.eslintrc配置文件中进行配置 modu…...
RocketMQ延迟消息机制
两种延迟消息 RocketMQ中提供了两种延迟消息机制 指定固定的延迟级别 通过在Message中设定一个MessageDelayLevel参数,对应18个预设的延迟级别指定时间点的延迟级别 通过在Message中设定一个DeliverTimeMS指定一个Long类型表示的具体时间点。到了时间点后…...
【入坑系列】TiDB 强制索引在不同库下不生效问题
文章目录 背景SQL 优化情况线上SQL运行情况分析怀疑1:执行计划绑定问题?尝试:SHOW WARNINGS 查看警告探索 TiDB 的 USE_INDEX 写法Hint 不生效问题排查解决参考背景 项目中使用 TiDB 数据库,并对 SQL 进行优化了,添加了强制索引。 UAT 环境已经生效,但 PROD 环境强制索…...
【HarmonyOS 5.0】DevEco Testing:鸿蒙应用质量保障的终极武器
——全方位测试解决方案与代码实战 一、工具定位与核心能力 DevEco Testing是HarmonyOS官方推出的一体化测试平台,覆盖应用全生命周期测试需求,主要提供五大核心能力: 测试类型检测目标关键指标功能体验基…...
Go 语言接口详解
Go 语言接口详解 核心概念 接口定义 在 Go 语言中,接口是一种抽象类型,它定义了一组方法的集合: // 定义接口 type Shape interface {Area() float64Perimeter() float64 } 接口实现 Go 接口的实现是隐式的: // 矩形结构体…...
Auto-Coder使用GPT-4o完成:在用TabPFN这个模型构建一个预测未来3天涨跌的分类任务
通过akshare库,获取股票数据,并生成TabPFN这个模型 可以识别、处理的格式,写一个完整的预处理示例,并构建一个预测未来 3 天股价涨跌的分类任务 用TabPFN这个模型构建一个预测未来 3 天股价涨跌的分类任务,进行预测并输…...
postgresql|数据库|只读用户的创建和删除(备忘)
CREATE USER read_only WITH PASSWORD 密码 -- 连接到xxx数据库 \c xxx -- 授予对xxx数据库的只读权限 GRANT CONNECT ON DATABASE xxx TO read_only; GRANT USAGE ON SCHEMA public TO read_only; GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; GRANT EXECUTE O…...
linux 下常用变更-8
1、删除普通用户 查询用户初始UID和GIDls -l /home/ ###家目录中查看UID cat /etc/group ###此文件查看GID删除用户1.编辑文件 /etc/passwd 找到对应的行,YW343:x:0:0::/home/YW343:/bin/bash 2.将标红的位置修改为用户对应初始UID和GID: YW3…...
AI,如何重构理解、匹配与决策?
AI 时代,我们如何理解消费? 作者|王彬 封面|Unplash 人们通过信息理解世界。 曾几何时,PC 与移动互联网重塑了人们的购物路径:信息变得唾手可得,商品决策变得高度依赖内容。 但 AI 时代的来…...
sipsak:SIP瑞士军刀!全参数详细教程!Kali Linux教程!
简介 sipsak 是一个面向会话初始协议 (SIP) 应用程序开发人员和管理员的小型命令行工具。它可以用于对 SIP 应用程序和设备进行一些简单的测试。 sipsak 是一款 SIP 压力和诊断实用程序。它通过 sip-uri 向服务器发送 SIP 请求,并检查收到的响应。它以以下模式之一…...
STM32HAL库USART源代码解析及应用
STM32HAL库USART源代码解析 前言STM32CubeIDE配置串口USART和UART的选择使用模式参数设置GPIO配置DMA配置中断配置硬件流控制使能生成代码解析和使用方法串口初始化__UART_HandleTypeDef结构体浅析HAL库代码实际使用方法使用轮询方式发送使用轮询方式接收使用中断方式发送使用中…...
