import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
public abstract class Scan {
public static List<String> getClassName(String packageName) {
List<String> classNames = new ArrayList<String>();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
//正则表达式表示匹配所有"."符号
String path = packageName.replaceAll("\\.", "/");
URL url = loader.getResource(path);
File urlFile = new File(url.toURI());
File[] files = urlFile.listFiles();
for (File file : files){
getClassName(packageName, file, classNames);
}
} catch (URISyntaxException e) {
e.printStackTrace();
}
return classNames;
}
private static void getClassName(String packageName, File file, List<String> list) {
if (file.isFile()) {
//把扩展名给去掉
list.add(packageName + "."+ file.getName().replace(".class", ""));
} else {
File[] files = file.listFiles();
String tmPackageName = packageName + "." + file.getName();
for (File f : files) {
//使用递归
getClassName(tmPackageName, f, list);
}
}
}
public static void main(String[] args) {
List<String> list = Scan.getClassName("test.springTimer");
for (String name : list) {
System.out.println(name);
}
}
}相关推荐
信号处理中的滤波器的阶数和谐波的理解
最近在读paper的时候,遇到了一些以前遗忘的问题,先重新查找,记录在这里,以备不时之查看。 我相信一定有小伙伴跟我有过一样的疑惑,那就是我们在使用滤波器的时候,总是遇到滤波器的阶数这个概念参数,我们很多都是根据别的paper里的设置,设置自己的科研参数,其实并不是很理解其中的含义: 其实我们常用的阶数N的意思是: 滤波器的阶数,就是指过滤谐波的次数,一般来讲,同样的滤波器,其阶
java扫描自定路径下类文件
1. 扫描类 Java代码 收藏代码 import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.net.JarURLConnection; import java.net.URL; import java.util.Enumeration...
FOC实战笔记:RC吸收电路的设计考量与参数调优
本文深入探讨了FOC驱动器中RC吸收电路的设计与调优。针对MOS管开关过程中的电压尖峰问题,详细阐述了RC电路的钳位与能量吸收原理,并提供了从参数计算、实验调试到布局布线的完整实战指南,旨在帮助工程师有效提升系统可靠性与稳定性。
Java扫描classpath指定包路径下所有class
在写框架时,经常需要扫描classpath指定包路径下带有 代码如下: import java.io.File; import java.io.IOException; import java.net.JarURLConnection; import java.net.URL; import java.net.URLDecoder; import java.util.*; import java.
ROS下UR+Realsense相机进行手眼标定
手眼标定主要是用来确定相机坐标系和机械臂坐标系之间的转换关系,从而实现后续的抓取等任务。
从JTAG到AS模式:一文搞懂EP4CE10E22C8N所有配置引脚(MSEL, nCONFIG, DATA0)的用法
本文深入解析EP4CE10E22C8N FPGA的配置引脚(MSEL, nCONFIG, DATA0)在不同模式下的使用方法,特别关注从JTAG到AS模式的切换要点。通过详细的配置模式对比、状态机分析和PCB布局建议,帮助开发者避免常见陷阱,提升FPGA配置成功率。
Java扫描包路径下的类文件
前言: 在写代码的时候,经常会遇到一些配置包路径的代码,然后框架根据提供的包路径进行扫描,比如Spring。所以这里自己去实现一下扫描包路径下类的代码。 在看资料的过程中,总结出了两个不同的扫描方式,第一种是在扫描src下的包,这时候使用文件系统就可以获取到包下面的类文件;第二种是扫描jar包中的包路径,这时候需要使用JarURLConnection类了,这个...
PDF与OFD电子发票解析技术实战:从格式转换到精准识别
本文深入探讨了PDF与OFD电子发票解析技术的实战应用,从格式转换到精准识别,提供了全面的解决方案。通过OFD转PDF技术、动态定位算法和多重校验机制,显著提升电子发票识别效率与准确率,助力企业财务数字化转型。
Java 类路径扫描
Java 中缺乏内建的类路径扫描机制。但是这个机制对于做框架的人来说很常用。下面的工具类从类路径下面的文件或者 JAR 路径中扫描包,可以实现我们需要的功能。实现是基于 Spring 3.1.11.RELEASE 版的 PathMatchingResourcePatternResolver 修改的。去掉了原版中 ANT * 号匹配的功能。依赖 Google Guava, Apache Common...
arcgis插件 批量出图 按地块批量出图工具(动态文本、动态节点坐标表)
arcgis插件 批量出图 按地块批量出图工具。
【tessy】软件环境配置:Keil C51 Keil uVision UVSC (Default)
本文详细说明了tessy软件如何配置【Keil C51 Keil uVision UVSC (Default)】环境,具体操作步骤和注意事项
java 扫描指定包下类(包括jar中的java类)
在很多的实际场景中,我们需要得到某个包名下面所有的类, 包括我们自己在src里写的java类和一些第三方提供的jar包里的类,那么怎么来实现呢? 今天带大家来完成这件事。 src下面的类如何获取: 首先,比较简单的是得到我们自己写的类,我们先来完成这个, 项目的结构图如下: 我故意创建了这么个比较复杂的项目结构,现在我们就来获取com.baibin包下所有的类,并且打印...
彻底讲透 SAP 中的 client-safe:从 CDS、AMDP 到 ABAP Cloud 的客户端隔离设计
SAP系统中的client-safe概念定义了技术边界:访问client-dependent数据的对象必须确保只看到单个client数据,而访问client-independent数据的对象则天然满足条件。这一原则直接影响CDS视图、AMDP等核心组件,并与ABAP Cloud开发模型紧密集成。在业务系统中,client isolation要求用户只能看到当前登录client的数据。SAP通过语言版本、对象规则和静态检查强制执行这一约束,特别是在ABAP Cloud开发中,AMDP方法和发布的API必须满足
C++扫描目录下的文件
C++扫描目录下文件,可以根据后缀名扫描,可以用通配符的方式扫描,可以显示文件属性(只读,隐藏,类型等)。 所用函数: long _findfirst( char *filespec, struct _finddata_t *fileinfo ); 代码示例: #include #include using namespace std; int ma
efm32 入门.pdf
本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。
深度学习工具包 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")
linux目录文件扫描程序,Linux目录扫描:打印指定目录下的所有文件及目录
一、目录扫描函数及其相关结构1. struct dirent *readdir(DIR *dp);2. DIR *opendir(const char *name);4. int closedir(DIR *dp);5. void rewinddir(DIR *dp);6. void seekdir(DIR *dp,long loc);7. long telldir(DIR *dp);8. int...
最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版
Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。
文件维护及扫描目录
文件和目录的维护 标准库和系统调用为文件和目录的创建与维护提供了全面的支持。 chmod系统调用 你可以通过chmod系统调用来改变文件或目录的访问权限。这构成了shell程序chmod的基础。该函数原型如下: #include <sys/stat.h> int chmod(const char *path,mode_t mode); path参数指定的文件被修改为具有mode参数给出的访问权限。 参数mode的定义与open系统调用中的一样,也是对所要求的访问权限进行按位OR操作。除非程序被
汉书HE8,好用的汇编代码编写工具
汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大
java实现指定文件扫描目录
package com.miss.time1230.io; import java.io.File; import java.util.Scanner; /** * @author MISS * 描述:扫描指定文件的目录 * 时间:2103/12/31 */ class FileTestScan { public FileTe...
python扫描目录下文件_Python实现扫描指定目录下的子目录及文件的方法
本文介绍了使用Python来扫描指定目录下的文件,或者匹配指定后缀和前缀的函数。步骤如下:如果要扫描指定目录下的文件,包括子目录,需要调用scan_files("/export/home/test/")如果要扫描指定目录下的特定后缀的文件(比如jar包),包括子目录,调用scan_files("/export/home/test/", postfix=".jar")如果要扫描指定目录下的特定前缀的...
文件和目录扫描
0x01漏洞原理: 程序在实现上没有充分过滤用户输入的/之类的目录跳转符,导致恶意用户可以通过提交目录跳转来遍历服务器上的任意文件。 0x02工具介绍 0x01御剑 在“域名框”输入你要扫描的域名,然后点击扫描。 根据自身电脑配置,调节线程。 集合DIR扫描各类数据库,包含所有网站脚本路径扫描。 默认探测200(也就是扫描的网站真实存在的路径文件) 0x02 DirBuster 0x03Pker 软件特点 支持ASP、PHP、ASPX、JSP、包括自定义扫描 软件.
Android扫描指定文件和目录
1.启动MediaScanner服务,扫描媒体文件: 程序通过发送下面的Intent启动MediaScanner服务扫描指定的文件或目录: Intent.ACTION_MEDIA_SCANNER_SCAN_FILE:扫描指定文件 1 2 3 4 5 public void scanFileAsync(Context ctx, String filePath)
python扫描目录下文件_Python扫描目录读取文件,不考虑子目录
这篇文章主要为大家详细介绍了Python扫描目录读取文件,不考虑子目录,具有一定的参考价值,可以用来参考一下。感兴趣Python扫描目录读取文件,不考虑子目录的小伙伴,下面一起跟随512笔记的小编罗X来看看吧。# *** 五一二笔记网 (www.512pic.com) ***try:source_dir = '/dir/source/'target_dir = '/dir/old/'for ro...
linux c 扫描文件目录
/* * printdir.c * * Created on: Apr 6, 2013 * Author: jwang */ #include #include #include #include #include #include void printdir(char *dir, int depth); int main(i
java扫描目录下的文件_Java扫描指定文件夹下所有文件
package xx.test;import java.io.File;import java.io.FileNotFoundException;import java.util.ArrayList;public class ScanPackage {private static ArrayList scanFiles = new ArrayList();private static int co...
java 扫描目录_Java扫描指定文件路径下的文件并且递归扫描其子目录下的所有文件...
1 packagecom.src.service.impl;23 importjava.io.File;4 importjava.net.InetAddress;5 importjava.net.NetworkInterface;6 importjava.net.SocketException;7 importjava.net.UnknownHostException;8 importjava.t...
python目录下的文件夹_Python实现扫描指定目录下的子目录及文件的方法
本文介绍了使用Python来扫描指定目录下的文件,或者匹配指定后缀和前缀的函数。步骤如下:如果要扫描指定目录下的文件,包括子目录,需要调用scan_files("/export/home/test/")如果要扫描指定目录下的特定后缀的文件(比如jar包),包括子目录,调用scan_files("/export/home/test/", postfix=".jar")如果要扫描指定目录下的特定前缀的...
2万+



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



