encodeURI与encodeURIComponent的区别 - JavaScript技巧

js 专栏收录该内容
¥59.90 ¥99.00
440篇文章

在JavaScript中,我们经常需要对URL进行编码,以便在网络传输或处理时能够正确处理特殊字符。JavaScript提供了两个用于URL编码的函数:encodeURI和encodeURIComponent。尽管它们的名称相似,但它们在处理特殊字符和编码方式上有一些重要的区别。

  1. encodeURI函数:
    encodeURI函数用于对整个URL进行编码,它将URL中的非字母数字字符进行编码,例如空格、冒号、斜杠等。但是,它不会对以下字符进行编码:字母、数字、标点符号以及一些特殊字符(如-、_、.和~)。

    下面是一个使用encodeURI函数的示例:

    const url = "https://www.example.com/my page.html";
    const encodedUrl = encodeURI(url
内容审核与文本安全技术综述:检测、过滤与对齐 检测质量高度依赖数据。毒性/仇恨/冒犯语言检测领域形成了一批经典数据集,但它们的标签体系差异很大:例如 OLID(OffensEval)强调“是否冒犯—冒犯类型—目标对象”三层结构;HateXplain 在“hate/offensive/normal”三分类之外,还提供目标群体与人类标注的 rationale span;RealToxicityPrompts 则不做离散标签,而是用毒性分数来研究“模型续写时的毒性退化”。ACL 汇编。 阅读详情

相关推荐

保姆级教程:在STM32H750VBT6上跑起来CMSIS-DSP库(基于CubeMX+Keil)

本文详细介绍了在STM32H750VBT6微控制器上配置和运行CMSIS-DSP库的全过程,包括开发环境搭建、CubeMX工程配置、Keil工程设置以及DSP库的实际应用示例。通过FFT频谱分析和音频均衡器等实战案例,展示了如何利用STM32H750VBT6的硬件FPU加速DSP运算,提升实时信号处理性能。

weixin_30236595的博客 462

一文了解向量数据库在RAG中扮演的角色

向量数据库:AI新纪元的基石。探索如何通过这一创新技术优化RAG,提高语言模型的信息处理能力

2401_82452722的博客 2456

Windows 24H2升级后eNSP AR_40报错40?VirtualBox虚拟化修复指南

虚拟化技术通过Hypervisor在操作系统与硬件间建立抽象层,使虚拟机能够共享物理资源。其核心原理依赖CPU的VT-x/AMD-V指令集,而Windows 24H2对内核隔离与驱动签名的强化会直接占用或拦截这些虚拟化资源。在工程实践中,VirtualBox作为Type-2型Hypervisor,常因内存完整性开启或版本过旧导致虚拟网卡创建失败,进而引发设备启动中断。典型场景包括网络仿真实验、多系统测试环境搭建等。当eNSP的AR_40路由器依赖VirtualBox引擎时,24H2的安全策略变更便会触发错误

weixin_34375251的博客 218

手把手教你用RK3568开发板实现FPGA与Linux的DMA通信(含完整代码解析)

本文详细介绍了如何在RK3568开发板上实现FPGA与Linux系统的DMA通信,包括硬件配置、软件环境搭建、DMA通信原理、驱动开发及性能优化。通过完整的代码解析和实战案例,帮助开发者快速掌握异构系统间的高效数据传输技术,适用于物联网和边缘计算等场景。

weixin_29174385的博客 202

iOS逆向实战:绕过SSL Pinning抓取ChatGPT设备令牌

在移动应用安全与网络协议分析领域,中间人攻击是一种核心的流量拦截与分析技术。其原理是在客户端与服务器之间插入一个代理节点,通过伪造数字证书来解密和窥探HTTPS加密流量。这项技术的工程价值在于,它使开发者能够调试API、分析通信协议以及实现自动化集成。然而,许多高安全要求的应用(如金融、社交类App)会采用SSL Pinning(证书绑定)技术来抵御此类攻击,这为逆向工程带来了挑战。本文聚焦于一个具体的应用场景:如何针对启用了SSL Pinning的ChatGPT iOS客户端,通过特定的工具链(如Trol

weixin_28235889的博客 979

突破Cloudflare 5秒盾:Python爬虫+GPT分析JS混淆,零基础也能爬

传统突破Cloudflare 5秒盾的门槛极高,需要精通JS逆向、浏览器指纹伪造、行为模拟,而本文的“Playwright+GPT”方案,彻底降低了门槛——无需懂逆向、无需手动改指纹、无需写复杂JS代码,只需3步就能突破大部分网站的防护。低门槛:新手1小时内就能上手,无需逆向工程知识;高成功率:覆盖80%+的普通防护网站,15%的中等防护网站;易扩展:适配不同类型网站,可结合代理、打码平台升级为高可用系统。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1165

大数据分析利器:Tableau实战教程从入门到精通

你有3家分店,每月收集1000条销售数据(日期、分店、口味、销售额、订单数);想用Excel分析“哪家分店最赚钱”,但要做透视表→改格式→画柱状图,耗时30分钟,还经常因为公式错误返工;想看看“草莓味奶茶的月度销量趋势”,得手动筛选数据、调整折线图轴范围,稍不注意就漏看关键节点;想把分析结果分享给合伙人,Excel表格太抽象,对方盯着数字问“你到底想告诉我什么?

AI架构师小马 1498

多模态对齐方案

本文中我们介绍了 13 中常见的大型多模态模型(Large Multimodal Models, LMM),包括 BLIP-2,LLaVA、MiniGPT、Qwen-VL 以及 Ferret 等。最全 LMM 模型结构(13种)综述。单层linear投影、两层mlp。

liguandong 2089

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

上一篇: 深入理解JavaScript中的DOM克隆操作
下一篇: 深入探究jQuery.data的实现方式
普通网友
博客等级 码龄3年 64粉丝 452原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值