js补环境工具使用技巧、补环境实例、重点环境检测点详解
什么是补环境,模拟浏览器环境让浏览器js运行,为什么需要补环境,因为浏览器和本地nodejs环境有差异,网站开发者为了检测用户是否是本地环境运行
主要补的环境Document,Window,Navigator,Location,Element
这是内置原始类型,需要将其实例化并补齐使用的方法,由于本身是函数所以方法只能赋值在原型链,补环境要和扣代码相配合要不然仅凭调试台返回信息,无法补全缺失环境。
一般来说补环境的基本流程是:先补基础环境,添加代理,在加密代码运行报错的地方去源代码处打断点分析具体缺少什么环境,代码整个运行不报错后再用打印环境工具分析或者去代码中进行插桩进行调试。
补环境前准备:
本地代码与浏览器联调
运行此代码即可在浏览器调试台运行本地代码,省去了vscode繁琐的配置,非常方便调试和打印。
node --inspect-brk .\补环境代码文件.js
打印浏览器环境工具
这里用的是大佬无私分享的工具,具体使用方式和作用这里都有,这里就不在重复。爬虫利器SpiderTools谷歌插件教程v1.0.0!!!web端JavaScript环境检测!!!_爬虫谷歌插件-CSDN博客
补环境代理
代理的重要不用多说,这里分享一个代理。
function watch(obj, name) {return new Proxy(obj, {get: function (target, property) {const value = target[property];const type = typeof value;if (type === "symbol") {// 获取 Symbol 的描述,如果没有描述则显示 'no description'const symbolDescription = property.description || 'no description';console.log(`对象=>${name},读取属性:${symbolDescription},这是一个 Symbol 类型的值`);} else if (type === "function") {// 对于函数,我们可以打印函数名,如果有的话const functionName = value.name || 'anonymous';console.log(`对象=>${name},读取属性:${property.toString()},这是一个名为 ${functionName} 的函数`);} else {// if(name==='window' && String(property)==='Symbol(Symbol.toPrimitive)' ){// debugger//// }console.log(`对象=>${name},读取属性:${String(property)},值为:${value},类型为:${type}`);}return value;},set: (target, property, newValue, receiver) => {const valueType = typeof newValue;if (valueType === "symbol") {// 获取新设置的 Symbol 的描述const symbolDescription = newValue.description || 'no description';console.log(`对象=>${name},设置属性:${String(property)},这是一个 Symbol 类型的新值, 描述为: ${symbolDescription}`);} else {console.log(`对象=>${name},设置属性:${String(property)},值为:${newValue},类型为:${valueType}`);}return Reflect.set(target, property, newValue, receiver);}});
}//第一个参数是要代理的对象,第二个是打印的时候的表示哪个参数
window = watch(window, 'window')
location = watch(new Location(), 'location')
批量赋值对象属性代码
可以把对象中的值都复制到内存中
function copyObj(obj) {var newObject = {};for (var key in obj) {var result = obj[key];if (['string', 'boolean', 'number'].indexOf(typeof result) !== -1 || Object.prototype.toString.call(result) === '[object Array]') {newObject[key] = result;}}copy(newObject);
};copyObj(location)
copyObj(navigator)
常用补环境方法
设置原型链
//原型链直接设置函数,一般无检测函数直接等于即可
Document.prototype.getElementsByTagName = function getElementsByTagName(tagName) {console.log('docuemnt.getElementsByTagName=>', {tagName});const tag = {i: [], script: [script1,script2],base:[]}console.log(tag[tagName])return tag[tagName]
}//给对象设置内置属性[Symbol.toStringTag]
Object.defineProperties(window, {[Symbol.toStringTag]: {value: "Window",configurabble: true,},[Symbol.toPrimitive]: function (a1) {console.log("Symbol.toPrimitive==>a1", a1);}
})//设置一个函数的原型链是另一个函数的原型链
HTMLDocument = function HTMLDocument() {}
Object.setPrototypeOf(HTMLDocument.prototype, Document.prototype)//修改一个对象中值的不可修改属性
const obj = {_name: 'John'
};Object.defineProperty(obj, 'name', {get() {return this._name;},set(value) {this._name = value;},enumerable: true,configurable: true
});
//查询对象属性不可修改值
console.log(Object.getOwnPropertyDescriptor(obj,'name'))
补环境示例
补上window、location、document、navigator,并删除__filename、__dirname、global、(浏览器中没有这两个环境),navigator也要删除,因为nodejs会内置一个navigator属性,在自己补充环境时可能会造成一些错误,同时对一些常用检测环境针对性还原。
delete __filename
delete __dirname
delete navigatorconst locationInfo = {};
const navigatorInfo = {};//使用箭头函数把locationInfo的属性添加到Location函数的this中
function Location() {Object.keys(locationInfo).forEach(key => {this[key] = locationInfo[key];})
}function Navigator() {
}Object.keys(navigatorInfo).forEach(key => {Navigator.prototype[key] = navigatorInfo[key];
})function Document() {
}function Window() {
}location = new Location()
navigator = new Navigator()
document = new Document()window = global
//删除global检测
delete global
window.__proto__ = new Window()
window.top = window;
window.self = window
重点属性检测
以下是一些经常用到的环境检测,也是补环境中的重点难点。
✅ document.all
的 IE 兼容检测
✅ navigator.webdriver
反自动化检测
✅ window.chrome
存在性检测
✅ MutationObserver
DOM 变化检测
✅ WebSocket
连接检测
✅ getBattery
设备信息检测
✅ localStorage
/ sessionStorage
访问检测
✅ indexedDB
可用性检测
✅ CanvasRenderingContext2D
指纹检测
✅ setTimeout
和 setInterval
时间检测
✅ fetch
和 XMLHttpRequest
API 访问检测
✅ visibilityState
页面可见性检测
✅ window.top
/ window.self
反 iframe 检测
通过补环境实例解决这些环境检测
delete __dirname;
delete __filename;window = global;delete global;Object.defineProperties(window, {[Symbol.toStringTag]: {value: 'Window',configurable: true}
});l_obj = {};l_input = {};l2_input = {};l3_input = {};var form = {
};form_action = '';Object.defineProperty(form, 'action',{get() {console.log('form->action.get--------->', l_input)return l_input;},set(v) {console.log('form->action.set--------->', v)form_action = v;}
});form_textContent = {};Object.defineProperty(form, 'textContent',{get() {console.log('form->textContent.get--------->', l2_input)return l2_input;},set(v) {console.log('form->textContent.set--------->', v)form_action = v;}
});form_id = '';Object.defineProperty(form, 'id',{get() {console.log('form->id.get--------->', l3_input)return l3_input;},set(v) {console.log('form->id.set--------->', v)form_id = v;}
});form_innerText = '';Object.defineProperty(form, 'innerText',{get() {console.log('form->innerText.get--------->', l3_input)return l3_input;},set(v) {console.log('form->innerText.set--------->', v)form_innerText = v;}
});a_labl = {//去浏览器里拿href: 'xxxxxxxxxxxxxx',protocol: 'https:',port: '',//去浏览器里拿hostname: 'xxxxxxxxxxxxxxx',//去浏览器里拿pathname: 'xxxxxxxxxxxxxxx'
}window.HTMLAnchorElement = function (){};scripts = [{type: "text/javascript",r: 'm',parentElement: {getAttribute: function(args) {console.log('head1->parentElement->getAttribute: ', args)console.log(arguments)debugger;if (args == 'r'){return 'm';}},getElementsByTagName: function(args) {console.log('head1->getElementsByTagName: ', args)console.log(arguments)debugger},removeChild: function (args) {console.log('head1->parentElement->removeChild', args);console.log(arguments);debugger;},},getAttribute: function(args) {console.log('script1->getAttribute: ', args)console.log(arguments)debugger;if (args == 'r'){return 'm';}}},{type: "text/javascript",r: 'm',parentElement: {getAttribute: function(args) {console.log('head2->parentElement->getAttribute: ', args);console.log(arguments);debugger;},getElementsByTagName: function(args) {console.log('head2->getElementsByTagName: ', args);console.log(arguments);debugger},removeChild: function (args) {console.log('head2->parentElement->removeChild', args);console.log(arguments);debugger;},},getAttribute: function(args) {console.log('script2->getAttribute: ', args);console.log(arguments);debugger;if (args == 'r'){return 'm';}},//去浏览器里拿src: "xxxxxxxxxx",}]var input_count = 0;var l_meta = {id: 'FbkwzLN5XOx0',content: 'tyGGg5AdQlANmSX9z3xbpGEoEKVuG9rmj_VCz71ozkpQ9tph9oDZE2RjIwQz8iL5oWgiCSPtU67jWlcPgf7DyTWP8X_.29Z5B0y9OtqwW4e6THU9dqdapsjx4a81rlUo',r: 'm',getAttribute: function(args){console.log('meta->getAttribute: ', args);console.log(arguments);debugger;if (args == 'r'){return 'm';}},parentNode: {removeChild: function (args) {console.log('meta->parentNode->removeChild', args)debugger;return {};},}
}div_i = [];div = {getElementsByTagName:function (args){console.log('document->div->getElementsByTagName', args)console.log(arguments)debugger;if(args === "i"){return div_i;}}
}doc_base = []Document = function Document(){}Object.defineProperty(Document.prototype,'createElement',{configurable: true,enumerable: true,value: function createElement(args) {console.log('document->createElement', args)console.log(arguments);debugger;if (args == 'div'){return div;}else if (args == 'form'){return form;}else if (args == 'input'){if (input_count == 0){input_count++;return l_input;}else if (input_count == 1){input_count++;return l2_input;}else if (input_count == 2){return l3_input;}}else if (args == 'a'){return a_labl;}else{return l_obj;}},writable: true,
})const v8 =require('v8');
const vm= require('vm');
v8.setFlagsFromString('--allow-natives-syntax');
let undetectable = vm.runInThisContext("%GetUndetectable()");
v8.setFlagsFromString('--no-allow-natives-syntax');Object.defineProperty(Document.prototype,'all',{configurable: true,enumerable: true,value: undetectable,writable: true,
})Object.defineProperty(Document.prototype,'body',{configurable: true,enumerable: true,value: null,writable: true,
})Object.defineProperty(Document.prototype,'visibilityState',{configurable: true,enumerable: true,value: 'hidden',writable: true,
})Object.defineProperty(Document.prototype,'toString',{configurable: true,enumerable: true,value: function toString() {return '[object HTMLDocument]';},writable: true,
})Object.defineProperty(Document.prototype,'addEventListener',{configurable: true,enumerable: true,value: function addEventListener(args) {console.log('document->addEventListener', args)console.log(arguments);debugger;return {};},writable: true,
})documentElement = {};
Object.defineProperty(Document.prototype,'documentElement',{configurable: true,enumerable: true,// value: function documentElement(args) {// console.log('document->documentElement', args)// console.log(arguments);// debugger;// return {};// },value:documentElement,writable: true,
})Object.defineProperty(Document.prototype,'appendChild',{configurable: true,enumerable: true,value: function appendChild(args) {console.log('document->appendChild', args)console.log(this)console.log(arguments);debugger;return {};},writable: true,
})Object.defineProperty(Document.prototype,'removeChild',{configurable: true,enumerable: true,value: function removeChild(args) {console.log('document->removeChild', args)console.log(arguments);debugger;return {};},writable: true,
})frist_get_script = 1;
Object.defineProperty(Document.prototype,'getElementsByTagName',{configurable: true,enumerable: true,value: function getElementsByTagName(args) {console.log('document->getElementsByTagName: ', args);console.log(arguments)debuggerif (args == 'script'){if (frist_get_script == 1){frist_get_script = 0;return scripts;}return [];}if (args === 'base') {debugger;return doc_base;}return [];},writable: true,
})Object.defineProperty(Document.prototype,'getElementById',{configurable: true,enumerable: true,value: function getElementById(args) {console.log('document->getElementById', args)console.log(arguments);debugger;return l_meta;},writable: true,
})HTMLDocument = function HTMLDocument(){}Object.setPrototypeOf(HTMLDocument.prototype,Document.prototype)
document = new HTMLDocument()
// console.log(document.createElement('script'));Object.defineProperty(document.all,'length',{get : function (){console.log('document.all.length ------------------------------------->')return Object.keys(document.all).length}
})document.all[0] = null;
document.all[1] = null;
document.all[2] = null;
document.all[3] = null;
document.all[4] = null;
document.all[5] = null;// document.all = [{},{},{},{},{},{}];function Window(){};window.Window = Window;window.__proto__ = Window.prototype;_null = function (){debugger;console.log(arguments)return {};
}_mutationObserver = {observe:function(args){console.log('_mutationObserver->observe', args)console.log(arguments);return {};}
};window.innerHeight = 945;
window.innerWidth = 1920;
window.outerHeight = 1022;
window.outerWidth = 1910;
window.TEMPORARY = 0;window.MutationObserver = function(args)
{console.log('window->mutationObserver', args)console.log(arguments);return _mutationObserver;
}CanvasRenderingContext2D = function () {};getImageData = {toString() {console.log('getImageData');return 'function getImageData() { [native code] }'}
}Object.defineProperty(CanvasRenderingContext2D.prototype,'getImageData',{get : function (){return getImageData;}
})HTMLCanvasElement = function () {};toBlob = {toString() {console.log('toBlob');return 'function toBlob() { [native code] }'}
}toDataURL = {toString() {console.log('toDataURL');return 'function toDataURL() { [native code] }'}
}Object.defineProperty(HTMLCanvasElement.prototype,'toBlob',{get : function (){return toBlob;}
})Object.defineProperty(HTMLCanvasElement.prototype,'toDataURL',{get : function (){return toDataURL;}
})window.CanvasRenderingContext2D = CanvasRenderingContext2D;
window.HTMLCanvasElement = HTMLCanvasElement;WebSocket = function(args)
{console.log('WebSocket ----------------------->', args);return {};
}window.WebSocket = WebSocket;webkitRequestFileSystem = _null;window.webkitRequestFileSystem = webkitRequestFileSystem;chrome = {};
window.chrome = chrome;//去浏览器里拿
location = {"ancestorOrigins": {},"href": "xxxxxxxx","origin": "xxxxxxxx","protocol": "https:","host": "xxxxxxxx","hostname": "xxxxxxxx","port": "","pathname": "xxxxxxxx","search": "xxxxxxxx","hash": ""
}window.top = window;
window.self = window;navigator = {appCodeName: "Mozilla",appName: "Netscape",appVersion: "5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",connection: {downlink: 2.4,effectiveType: "4g",onchange: null,rtt: 50,saveData: false},cookieEnabled: true,deprecatedRunAdAuctionEnforcesKAnonymity: true,deviceMemory: 8,doNotTrack: null,hardwareConcurrency: 22,languages: ["zh-CN", "en", "zh"],language: "zh-CN",onLine: true,platform: "Win32",product: "Gecko",productSub: '20030107',userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",vendor: "Google Inc.",vendorSub: "",// webdriver: false,webkitPersistentStorage: {},getBattery: function() {return {then(){}}}
};function Naviator(){};Object.defineProperties(Naviator.prototype,{})function webdriver()
{console.log("webdriver--------------------->");return false;
}webdriver.toString = function () {return 'false'}Object.defineProperty(Naviator.prototype, 'webdriver',{[Symbol.toStringTag]: {value: 'webdriver',configurable: true},configurable:true,enumerable: true,get: webdriver
});navigator.__proto__ = Naviator.prototype;Object.defineProperties(navigator, {[Symbol.toStringTag]: {value: 'webdriver',configurable: true}
})window.navigator = navigator;window["clientInformation"] = navigator;window.location = location;window.history = {length: 2,state: null,scrollRestoration: "auto",replaceState: _null,
}screen = {availHeight: 1392,availLeft: 1536,availTop: 0,availWidth: 2560,colorDepth: 24,height: 1440,isExtended: true,onchange: null,orientation: {angle: 0, type: 'landscape-primary', onchange: null},pixelDepth: 24,width: 2560
}window.screen = screen;window.DOMParser = function ()
{debugger;return {};
}window.XMLHttpRequest = function () {debugger;return {}
}localStorage = {length: 0,removeItem: function () {console.log('localStorage->removeItem')console.log(arguments);},setItem: function () {console.log('localStorage->setItem');console.log(arguments);this[arguments[0]] = arguments[1];console.log(this);},getItem: function (args) {console.log('localStorage->getItem')console.log(arguments);return this[args];},
}
sessionStorage = {length: 0,removeItem: function () {console.log('localStorage->removeItem')console.log(arguments);},setItem: function () {console.log('localStorage->setItem');console.log(arguments);this[arguments[0]] = arguments[1];console.log(this);},getItem: function (args) {console.log('localStorage->getItem')console.log(arguments);console.log(this[args]);return this[args];},
}window.localStorage = localStorage;
window.sessionStorage = sessionStorage;
window.name = '$_YWTU=7nXC8M_ZRylQDpM8YlUdxPdHlh7M_t8lWHF71cWe4Q7&$_YVTX=Js3&vdFm='indexedDB = {open: function (args) {console.log('indexedDB->open---------------->');// return {};return indexedDB;}
}window.indexedDB = indexedDB;window.addEventListener = function (args)
{console.log('window->addEventListener: ', args)debugger;return {};
}window.attachEvent = undefined;window.Request = function (args)
{console.log('window->Request: ', args)debugger;return {};
}window.fetch = function (args)
{console.log('window->fetch: ', args)debugger;return {};
}window.setInterval = _null;
window.setTimeout = _null;window.document = document;//$_ts=window['$_ts']内容
require('./ts')//外链js内容
require('./link')function get_cookie()
{return document.cookie;
}
相关文章:
js补环境工具使用技巧、补环境实例、重点环境检测点详解
什么是补环境,模拟浏览器环境让浏览器js运行,为什么需要补环境,因为浏览器和本地nodejs环境有差异,网站开发者为了检测用户是否是本地环境运行 主要补的环境Document,Window,Navigator,Location,Element 这是内置原始类型&#…...
TF_LOG 配置及级别详解
以下是Terraform中TF_LOG配置及级别的详解: 配置方法 设置日志级别 通过设置TF_LOG环境变量来启用Terraform的日志功能,并指定日志级别。可以将该变量设置为以下值之一:TRACE、DEBUG、INFO、WARN、ERROR。其中,TRACE级别最为详…...
vue3使其另一台服务器上的x.html,实现x.html调用中的函数,并向其传递数据。
vue3例子 <template><div><iframeload"loadIFreamSite"id"loadIframeSite":src"iframeSrc1"frameborder"0"scrolling"no"allowtransparency"true"style"width: 100%"></iframe&g…...
英语五大基本句型
文章目录 一、主谓二、主谓宾三、主系表什么是什么什么怎么样系动词感官动词 一、主谓 构成:动作的发出者 动作 例句:I run.(我跑步。) 二、主谓宾 构成:动作的发出者 动作 动作的接受者 构成:主语&a…...
什么是 DDoS 攻击?高防 IP 如何有效防护?2025全面解析与方案推荐
一、DDoS 攻击:互联网时代的 “数字核武器” 1. DDoS 攻击的本质与原理 ** 分布式拒绝服务攻击(DDoS)** 通过操控海量僵尸设备,向目标服务器发送洪水般请求,耗尽带宽、连接或计算资源,导致合法用户无法访…...
论文速报《Enhancing Autonomous Driving Systems...:LLM-MPC混合架构增强自动驾驶》
论文链接:https://arxiv.org/pdf/2504.11514 代码链接:https://github.com/ForzaETH/LLMxRobot 0. 简介 自动驾驶领域的传统方法多依赖于数据驱动模型,通过大量标注数据训练实现路径规划和控制。然而,现实世界中道路临时施工、突…...
Nacos 3.0 上线 MCP Registry,支持 MCP 服务注册到发现全流程管理
Nacos 3.0 正式版本发布啦!升级 MCP Registry,围绕着 MCP(Model Context Protocol) 服务管理,MCP 多种类型注册,包含 MCP Server 注册、编排、动态调试和管理,并且提供 Nacos-MCP-Router 可以进…...
一文解析大语言模型量化技术
目录 一、为什么需要量化技术 1、数据规模 2、32位浮点数(FP32) 3、16位浮点数(FP16) 4、Bfloat16(BF16) 5.INT8(8位整数)和INT4(4位整数) 总结&#…...
使用python实现自动化拉取压缩包并处理流程
使用python实现自动化拉取压缩包并处理流程 实现成果展示使用说明 实现成果展示 使用说明 执行./run.sh 脚本中的内容主要功能是: 1、从远程服务器上下拉制定时间更新的数据 2、将数据中的zip拷贝到指定文件夹内 3、解压后删除所有除了lcm之外的文件 4、新建一个ou…...
解构编程语言的基因密码:论数据类型如何被语言系统定义与重塑
摘要 本文从理论与实践层面系统探讨编程语言中数据类型的定义、实现与演化。通过静态与动态类型系统的差异分析,结合案例、流程图和表格,全面呈现主流语言数据类型设计特点及其对内存管理、错误防范与性能优化的影响。文章旨在为语言设计者和开发者提供…...
GRPO vs SFT:强化学习提升大模型多模态推理泛化能力的原因研究
GRPO vs SFT:强化学习提升大模型多模态推理泛化能力的原因研究 作者:吴宇斌 原文地址:https://zhuanlan.zhihu.com/p/1892362859628963761 训练目标与优化方式差异对比 监督微调(SFT)的目标: SFT使用带标注…...
从千兆到40G:飞速(FS)助力制造企业构建高可靠智能生产网络
案例亮点 部署S5850-24S2Q交换机,启用MLAG跨设备链路聚合,构建高性能冗余架构,消除单点故障风险,将网络可用性提升至99.99%,保障生产系统与全球业务连续性。采用40G光模块与US Conec MTP连接头多模跳线实现数据中心间…...
WHAT - 《成为技术领导者》思考题(第三章)
文章目录 涉及内容理解问题管理想法的交流保证质量 思考题思路和示例框架1. 观察一个你认为是领导者的人,列出他的行为,分类,并思考自己未采用的行为2. 观察一个不太像领导者的人,列出错过的简单机会,并反思3. 让别人注…...
Go 语言入门:(一) 环境安装
一、前言 这里不同于其他人的 Go 语言入门,环境安装我向来注重配置,比如依赖包、缓存的默认目录。因为前期不弄好,后面要整理又影响这影响那的,所以就干脆写成文章,方便后期捡起。 二、安装 1. 安装包 https://go.…...
GTC2025全球流量大会:领驭科技以AI云端之力,助力中国企业出海破浪前行
在全球化与数字化浪潮下,AI技术正成为中国企业出海的重要驱动力。一方面,AI通过语言处理、数据分析等能力显著提升出海企业的运营效率与市场适应性,尤其在东南亚等新兴市场展现出"高性价比场景适配"的竞争优势;另一方面…...
013几何数学——算法备赛
几何数学 平面切分 蓝桥杯2020年省赛题 问题描述 平面上有N条直线,其中第i条直线为yAxB.请计算这些直线将平面分成了几个部分? 输入 第一行输入一个N,接下来N行输入两个整数代表Ai和Bi。 1<N<10^5. 思路分析 初始时一条直线将…...
VUE3:封装一个评论回复组件
之前用React封装的评论回复组件,里面有三个主要部分:CommentComponent作为主组件,CommentItem处理单个评论项,CommentInput负责输入框。现在需要将这些转换为Vue3的组件。 Vue3和React在状态管理上有所不同,Vue3使用r…...
DELL R740服务器闪黄灯不开机故障案例
1:DELL R740服务器 2:东莞长安客户工厂晚上十一二点电路跳闸多次,导致R740 ERP服务器无法开机。 3:故障现象为:主机能正常通电,开机按钮无通电迹象,正常情况会闪绿灯慢闪,通电一会后…...
记录一下QA(from deepseek)
Q1:__init__.py文件 在 Python 中,当你在一个目录下创建 __init__.py 文件时,这个目录会被视为一个 包(Package)。包的存在使得 Python 能够通过点号(.)层级式地组织模块(.py 文件)&…...
码蹄集——进制输出、求最大公约数、最小公倍数
进制乱炖 本题考查输出的进制转换,可以直接使用c里的format格式输出 #include<iostream> #include<algorithm> #include<string> using namespace std;int main() {int x;cin>>x;printf("%d %o %x %u\n",x,x,x,x);//十进制 八进…...
从技术走向管理:带来哪些角色转变与挑战
文章目录 一、从技术到管理1、从技术转到管理的优劣势(1)优势(2)劣势 2、刚转岗容易犯的几个问题3、最大的变化:不再是一个人单打独斗4、警惕:一开始不要把“人”过早的介入到“事”5、如何完成角色的转变&…...
C语言-指针(一)
目录 指针 内存 概念 指针变量 取地址操作符(&) 操作符“ * ” 指针变量的大小 注意 指针类型的意义 作用 void * 指针 const修饰指针变量 const放在*前 const放在*后 双重const修饰 指针的运算 1.指针 - 整数 2.指针 - 指针 3.指…...
Python面试问题
一、Python 基础 1. Python 的特点 动态类型:变量无需声明类型。解释型语言:逐行解释执行。支持多种编程范式(面向对象、函数式、过程式)。 2. 列表(List)与元组(Tuple)的区别 特…...
RAG工程-基于LangChain 实现 Advanced RAG(预检索优化)
Advanced RAG 概述 Advanced RAG 被誉为 RAG 的第二范式,它是在 Naive RAG 基础上发展起来的检索增强生成架构,旨在解决 Naive RAG 存在的一些问题,如召回率低、组装 prompt 时的冗余和重复以及灵活性不足等。它重点聚焦在检索增强࿰…...
【时时三省】(C语言基础)循环结构程序设计习题1
山不在高,有仙则名。水不在深,有龙则灵。 ----CSDN 时时三省 习题1 输入两个正整数m和n,求其最大公约数和最小公倍数。 解题思路: 求两个正整数 m 和 n 的最大公约数通常使用辗转相除法(欧几里得算法ÿ…...
[密码学实战]SDF之设备管理类函数(一)
[密码学实战]SDF之设备管理类函数(一) 一、标准解读:GM/T 0018-2023核心要求 1.1 SDF接口定位 安全边界:硬件密码设备与应用系统间的标准交互层功能范畴: #mermaid-svg-s3JXUdtH4erONmq9 {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16p…...
CDGP|如何建立高效的数据治理团队?
近年来,数据治理行业迅速发展,越来越多的企业开始重视并投入大量资源来建立和完善数据治理体系。数据治理体系不仅能够帮助企业更好地管理和利用数据资源,提升数据质量和数据价值,还能够为企业带来竞争优势和可持续发展能力。 然…...
如何评价 DeepSeek 的 DeepSeek-V3 模型?
DeepSeek-V3 是由杭州 DeepSeek 公司于 2024 年 12 月 26 日发布的一款开源大语言模型,其性能和创新技术在国内外引起了广泛关注。从多个方面来看,DeepSeek-V3 的表现令人印象深刻,具体评价如下: 性能卓越 DeepSeek-V3 拥有 6710 …...
【基础篇】prometheus命令行参数详解
文章目录 本篇内容讲解命令行参数详解 本篇内容讲解 prometheus高频修改命令行参数详解 命令行参数详解 在页面的/页面上能看到所有的命令行参数,如图所示: 使用shell命令查看 # ./prometheus --help usage: prometheus [<flags>]The Promethe…...
SpringBoot实现接口防刷的5种高效方案详解
目录 前言:接口防刷的重要性 方案一:基于注解的访问频率限制 实现原理 核心代码实现 使用示例 优缺点分析 方案二:令牌桶算法实现限流 算法原理 核心实现 配置使用 适用场景分析 方案三:分布式限流(Redis …...
DeepSearch复现篇:QwQ-32B ToolCall功能初探,以Agentic RAG为例
DeepSearch复现篇:QwQ-32B ToolCall功能初探,以Agentic RAG为例 作者:CyPaul Space 原文地址:https://zhuanlan.zhihu.com/p/30289363967 全文阅读约3分钟~ 背景 今天看到 论文:Search-R1: Training LLMs to Reason …...
项目实战-贪吃蛇大作战【补档】
这其实算是一个补档,因为这个项目是我在大一完成的,但是当时没有存档的习惯,今天翻以前代码的时候翻到了,于是乎补个档,以此怀念和志同道合的网友一起做项目的日子 ₍ᐢ ›̥̥̥ ༝ ‹̥̥̥ ᐢ₎♡ 这里面我主要负责…...
power bi获取局域网内共享文件
power bi获取局域网内共享文件 需求: 数据源并不一定都是在本地,有可能在云端,也有可能在其他服务器,今天分享如果数据源在另外一台服务器,如何获取数据源的方法。 明确需求:需要通过PowerBI获取局域网中的…...
100%提升信号完整性:阻抗匹配在高速SerDes中的实践与影响
一个高速信号SerDes通道(例如PCIe、112G/224G-PAM4)包含了这些片段: 传输线连通孔(PTH or B/B via)连接器高速Cable锡球(Ball and Bump) 我们会希望所有的片段都可以有一致的阻抗,…...
第六章:Tool and LLM Integration
Chapter 6: Tool and LLM Integration 从执行流到工具集成:如何让AI“调用真实世界的技能”? 在上一章的执行流框架中,我们已经能让多个代理协作完成复杂任务。但你是否想过:如果用户要求“查询实时天气”或“打开网页搜索”&…...
prompt提示词编写技巧
为什么学习prompt编写 目的:通过prompt的编写,提升LLM输出相关性、准确性和多样性,并对模型输出的格式进行限制,满足我们的业务需求。 学过提示词工程的人:像“专业导演”,通过精准指令控制 AI 输出&#…...
Nginx配置SSL详解
文章目录 Nginx配置SSL详解1. SSL/TLS 基础知识2. 准备工作3. 获取SSL证书4. Nginx SSL配置步骤4.1 基础配置4.2 配置说明 5. 常见配置示例5.1 双向认证配置5.2 多域名SSL配置 6. 安全优化建议7. 故障排查总结参考资源下载验证的完整实例 Nginx配置SSL详解 1. SSL/TLS 基础知识…...
网络安全之红队LLM的大模型自动化越狱
前言 大型语言模型(LLMs)已成为现代机器学习的重要支柱,广泛应用于各个领域。通过对大规模数据的训练,这些模型掌握了多样化的技能,展现出强大的生成与理解能力。然而,由于训练数据中难以完全剔除有毒内容&…...
【技术笔记】通过Cadence Allegro创建一个PCB封装(以SOT23为例)
【技术笔记】通过Cadence Allegro创建一个PCB封装(以SOT23为例) 一、焊盘创建二、PCB封装设计三、丝印位号及标识添加 更多内容见专栏:【硬件设计遇到了不少问题】、【Cadence从原理图到PCB设计】 一、焊盘创建 首先要找到元器件的相关手册&…...
新环境注册为Jupyter 内核
1. 确认环境是否已注册为内核 在终端运行以下命令,查看所有已注册的内核: jupyter kernelspec list2. 为自定义环境注册内核 步骤 1:激活目标虚拟环境 conda activate your_env_name # 替换为你的环境名步骤 2:安装…...
[Spring] Seata详解
🌸个人主页:https://blog.csdn.net/2301_80050796?spm1000.2115.3001.5343 🏵️热门专栏: 🧊 Java基本语法(97平均质量分)https://blog.csdn.net/2301_80050796/category_12615970.html?spm1001.2014.3001.5482 🍕 Collection与…...
使用JDK的数据校验和Spring的自定义注解校验前端传递参数的两种方法
第一种:JDK的数据校验注解 PostMapping("/test")public String test(QueryParam param, RequestHeader(value "App_key") String App_key,RequestHeader(value "App_secret") String App_secret) throws IOException {param.setApp…...
JS错误处理的新方案 (不使用try-catch)
错误处理一直是JavaScript开发者需要认真对待的问题,传统的try-catch语法虽然简单直观,但在异步代码中使用时存在诸多限制。 try-catch的局限性 传统try-catch模式在现代JavaScript开发中面临的问题: 1. 异步错误捕获的缺陷 try-catch无法…...
前端实现商品放大镜效果(Vue3完整实现)
前端实现商品放大镜效果(Vue3完整实现) 前言 在电商类项目中,商品图片的细节展示至关重要。放大镜效果能显著提升用户体验,允许用户在不跳转页面的情况下查看高清细节。本文将基于Vue3实现一个高性能的放大镜组件,完整…...
redis未授权访问漏洞学习
一、Redis常见用途 1. Redis介绍 全称与起源: Redis全称Remote Dictionary Service(远程字典服务),最初由antirez在2009年开发,用于解决网站访问记录统计的性能问题。发展历程: 从最初仅支持列表功能的内存数据库,经过十余年发展已支持多种…...
阿里qiankun微服务搭建
主服务 chat vue3 ts vite 子服务 ppt react 18 vite 子服务 agent 主服务 npm i vite-plugin-qiankun mian.ts import ./style/base.scss import virtual:svg-icons-register import { createApp } from vue import { createPinia } from piniaimport App from ./App.vue im…...
【CodeSprint】第二章-2.1 简单模拟
第二章 2.1 简单模拟 ✏️ 关于专栏:专栏用于记录 prepare for the coding test。 1. 简单模拟 简单模拟题目不需要复杂算法,直接按照题意一步步模拟即可。 1.1 促销计算 题目描述 某百货公司为了促销,采用购物打折的优惠方法:…...
Golang实现函数默认参数
golang原生不支持默认参数 在日常开发中,我们有时候需要使用默认设置,但有时候需要提供自定义设置 结构体/类,在Java我们可以使用无参、有参构造函数来实现,在PHP中我们也可以实现(如 public function xxx($isCName false, $sec…...
【Python Web开发】03-HTTP协议
文章目录 1. HTTP协议基础1.1 请求-响应模型1.2 请求方法1.3 请求和响应结构1.4 状态码 2. Python 发送 HTTP 请求2.1 urllib库2.2 requests 库 3. Python 构建 HTTP 服务器3.1 http.server模块3.2 Flask 框架 4. HTTP 协议的安全问题5. 缓存和性能优化 HTTP(Hypert…...
提高营销活动ROI:大数据驱动的精准决策
提高营销活动ROI:大数据驱动的精准决策 大家好,我是Echo_Wish。今天我们来聊聊如何通过大数据来提高营销活动的ROI(投资回报率)。我们都知道,随着市场的日益竞争,营销的成本不断增加,如何在这片红海中脱颖而出,不仅需要精准的营销策略,还需要依靠先进的技术,尤其是大…...