http://tech.meituan.com/DiveIntoCategory.html
一直理解错了的category和同名方法和方法查找
转载于:https://www.cnblogs.com/lihaiyin/articles/5808264.html
墨衍会员
·
AI 创作全网分发
墨衍智能分发
本文由作者通过墨衍一键同步至各平台
1分发平台
100+累计阅读
120平均单平台
已同步平台
CSDN
微信公众号
微博
知乎
掘金
百家号
博客园
抖音
小红书
你的文章也可以这样分发
墨衍会员 ¥399起/年,写一次发全网
我也要 →
码龄11年
http://tech.meituan.com/DiveIntoCategory.html
一直理解错了的category和同名方法和方法查找
转载于:https://www.cnblogs.com/lihaiyin/articles/5808264.html
当前文章被以下社区和专栏收录:
深入理解iOS Category基类扩展源码
在Objective-C中,Category提供了一种机制,允许开发者为现有的类添加新的方法,而无需访问到原始类的源代码。这在维护大型项目或者给第三方框架添加方法时显得尤其有用。Extension(也称为匿名Category)是在编译时创建的,它允许开发者在不修改原始头文件的情况下为类添加私有属性和方法。Extension在头文件中声明,但没有实现文件,它主要用于隐藏类的私有细节,从而在模块间保持封装性和信息隐藏。
启用wp-thumbnails插件后生成两张缩略图解决办法
原因是重复调用了插件,在后台,关掉插件的自动启用。 然后在需要实现缩略图的地方手动调用。代码如下: 先说明两个概念: 页面缩略图:在页面(英文叫page)显示的缩略图,包括首页、分类页、标签页、搜索页、你自己创建的页面等等。 文章缩略图:为文章(英文叫post)显示的缩略图,即一张缩略图片对应一篇文章,用缩略图显示最新文章、随机文章、相关文章、最热门文章等等。
Kettle入门指南:从安装到数据转换实战
本文提供Kettle(Pentaho Data Integration)的完整入门指南,涵盖从Java环境安装、软件配置到核心概念(转换与作业)的详细解析。通过实战案例,手把手教你如何将文本文件数据导出到Excel,并连接MySQL数据库进行数据导入,帮助你快速掌握这一强大ETL工具的基本使用,实现高效数据搬运与转换。
log4j 的Logger与Category的区别
log4j.logger.org.springframework=ERROR和log4j.Category.org.springframework=ERROR, rootLogger与rootCategory的区别
ADS 使用教程(一)Workspace, Library and Cell
简要介绍ADS的基本内容
SAP固定资产原值与净值取值逻辑全解析:从数据表到ABAP实战
在企业资源计划(ERP)系统中,固定资产的价值管理是财务会计的核心模块,其关键在于准确核算资产原值与净值。从技术原理上看,这涉及对资产全生命周期业务(如购置、折旧、转移、报废)的财务建模,以及底层数据表(如ANLC、ANEP)的精准关联与计算。掌握这一逻辑的技术价值在于,能够确保财务报表数据的准确性,满足合规性要求,并为管理决策提供可靠依据。在SAP ECC或S/4HANA系统的应用场景中,ABAP开发者与财务顾问常需通过编写报表程序,从复杂的数据结构中提取资产价值信息。本文聚焦于SAP资产会计模块,深入剖
Android中的category大全
说明 activity 是用户正在浏览的数据的一个可选操作 android.intent.category.ALTERNATIVE 能够被浏览器安全使用的 activities 必须支持这个类别 android.intent.category.BROWSABLE 如果 activity 是对数据执行确省动作(点击, center press)的一个选项,需要设置这个类别 a...
BurpSuite+安卓模拟器双保险:避开真机抓包限制的完整配置指南
本文详细介绍了如何通过BurpSuite与安卓模拟器(如雷电、夜神)协同工作,绕过真机抓包限制的完整配置指南。从环境准备、网络拓扑配置到证书部署和流量分析,提供了一套高效的解决方案,帮助安全测试人员稳定捕获手机数据包,提升测试效率。
android中的category
提供将要执行的action的额外信息,一般在隐式地启动activity时需要用到。常见的category如下: CATEGORY_ALTERNATIVE 设置这个activity是否可以被认为是用户正在浏览的数据的一个可选择的action CATEGORY_APP_BROWSER 和ACTION_MAIN一起使用,用来启动浏览器应用程序 CATEGORY_APP_CALCULATO
哈希拓展攻击CTF题做法
kali下载相关工具hash-ext-attack:hash拓展题目特征:2023楚慧杯upload_shell实验吧之让我进去:前言:具体怎么加密解密补位的原理我不懂,深入理解的部分我在文末挂了链接,以下也只是我做题的结论和通解,可能不准确(但是做题还挺准确),有错误欢迎指出:是在密码加密过程中引入的一个随机值,它与密码结合使用,目的是增加密码的复杂性和安全性。在密码加密中,常见的做法是将用户提供的密码进行哈希处理,然后存储哈希值而不是明文密码
开发具有情感分析能力的AI Agent
本文将深入探讨开发具有情感分析能力的AI Agent的各个方面。我们将首先介绍情感分析的基础知识,包括定义、背景和应用领域。接着,我们将详细讲解情感分析的核心概念、数据处理方法和算法原理。随后,文章将展示如何设计情感分析系统架构,并进行项目实战,包括环境安装、源代码实现和案例分析。最后,我们将总结最佳实践和注意事项,为读者提供进一步学习的资源。情感分析(Sentiment Analysis),也称为意见挖掘,是自然语言处理(NLP)的一个分支。
Category 的理解
Category 就是类别,实际就是对类的函数的扩展,它的属性如下: 1.类别可以讲类的实现,分散到多个文件 2.category 只能扩展类的函数,不能扩展类的方法 3.一个类可进行多次扩展 4.category 的函数名与类中的函数名完全相同的时候,则category的函数将取代类中的函数 5.当对一个类的多个扩展category中包含相同函数的时候,扩展是不稳定的,哪个函数被调用,
YOLOV26详解 从原理到部署
计算机视觉领域最具影响力的目标检测框架迎来重大里程碑。2026年1月,Ultralytics 正式发布 YOLOv26——这不是一次简单的版本迭代,而是一场面向边缘计算时代的架构重构。本专栏基于 Ultralytics 官方技术白皮书、YOLO Vision 2025 大会首发内容及国际前沿研究成果,系统拆解 YOLOv26 从算法原理到工程落地的全栈技术体系。与常规教程不同,我们聚焦与,帮助你在端侧 AI 部署的实战中掌握核心竞争力。
【Android】category的粗浅理解
我得理解 category 就相当于提供给框架的一个划分类型的的标识。这些标识在显示的Intent中并没有展示出多大价值(也可能是我学的不好)但是在隐式Intent时却体现了很大的作用。 其中系统提供的: 例如: <category android:name="android.intent.category.LAUNCHER" /> 他就是提供给系统的标识,提示系统这是主页面。 <category android:name="android.intent.categor.
基于YOLOv8的端面小目标计数解决方案: 多头检测器+小缺陷到大缺陷一网打尽的GiraffeDet+Wasserstein Distance Loss | 助力工业小目标缺陷检测
端面小目标计数部署解决方案 | 亲测在工业小目标缺陷涨点明显,原始mAP@0.5 0.936提升至0.955
华为的C语言编程规范.pdf
华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。
gstreamer之category
gstreamer的category,简单来说就是用于区分log信息的类别。
Camera2Demo
在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作
Objective-C:Category 深入理解
from: https://tech.meituan.com/DiveIntoCategory.html 1.category简介 category是Objective-C 2.0之后添加的语言特性,category的主要作用是为已经存在的类添加方法。除此之外,apple还推荐了category的另外两个使用场景: 可以把类的实现分开在几个不同的文件里面。这样做有几个显而易见的好处...
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
复分析 阿尔福斯(Ahlfors) 第三版答案 英文
答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案
深入理解Category
1、category简介 category的主要作用是为已经存在的类添加方法。除此之外,apple还推荐了category的另外两个使用场景 可以把类的实现分开在几个不同的文件里面。这样做有几个显而易见的好处,a)可以减少单个文件的体积 b)可以把不同的功能组织到不同的category里 c)可以由多个开发者共同完成一个类。 声明私有方法 不过除了apple推荐的使用场景,广...
Objective-C runtime机制(4)——深入理解Category
在平日编程中或阅读第三方代码时,category可以说是无处不在。category也可以说是OC作为一门动态语言的一大特色。category为我们动态扩展类的功能提供了可能,或者我们也可以把一个庞大的类进行功能分解,按照category进行组织。 关于category的使用无需多言,今天我们来深入了解一下,category是如何在runtime中实现的。 category的数据结构 cate...
Intent中的Action、Category
1、Action: 该标识用来说明这个activity可以执行哪些动作,所以当隐式intent传递过来action时,如果跟这里<intent-filter>所列出的任意一个匹配的话,就说明这个activity是可以完成这个intent的意图的,可以将它激活! 常用的Action如下所示: ACTION_CALLactivity启动一个电话. ACTION_EDITactivity显示用户编辑的数据. ACTION_MAINactivity作为Task中第一个Act...
Android启动Activity的标准Action和标准Category
Android内部提供了大量标准的Action和Category常量。 其中用于启动Activity的标准Aciton及对应的字符串如下表所示: 启动Activity的标准Aciton Action常量对应字符串简单说明 ACTION_MAIN android.intent.action.MAIN 应用程序入口 ACTION_VI...
iOS Extension Category Protrol 例子理解,前端组件开发
代码能力一定要注重,尤其是很多原理性的代码(之前两次让我写过Node中间件,Promise.all,双向绑定原理,被虐的怀疑人生)!// Copyright © 2017年 ZY. All rights reserved.// Copyright © 2017年 ZY. All rights reserved.读了很多大牛的博客之后写了解析,免费分享给大家,算是一个感恩回馈吧,有需要的朋友。尽量从面试官的问题中表现自己知识的深度与广度,让面试官发现你的闪光点!祝大家早日拿到自己心怡的工作!
深入理解Objective-C:Category
摘要 无论一个类设计的多么完美,在未来的需求演进中,都有可能会碰到一些无法预测的情况。那怎么扩展已有的类呢?一般而言,继承和组合是不错的选择。但是在Objective-C 2.0中,又提供了category这个语言特性,可以动态地为已有类添加新行为。如今category已经遍布于Objective-C代码的各个角落,从Apple官方的framework到各个开源框架,从功能繁复的大型APP到简单的应用,catagory无处不在。本文对category做了比较全面的整理,希望对读者有所裨益。 简介 ..
448

被折叠的 条评论
为什么被折叠?



