Dim pathstring As String = "f:/" & name & num.ToString & ".txt"
If File.Exists(pathstring) Then
num += 1
Return getname(name, num)
Else
File.Create(pathstring)
Return pathstring
End If
End Function
墨衍会员
·
AI 创作全网分发
墨衍智能分发
本文由作者通过墨衍一键同步至各平台
1分发平台
900+累计阅读
959平均单平台
已同步平台
优快云
微信公众号
微博
知乎
掘金
百家号
博客园
抖音
小红书
你的文章也可以这样分发
墨衍会员 ¥399起/年,写一次发全网
我也要 →
码龄23年
完整IC设计流程解析&Makefile学习
本文介绍了decorder38项目的文件结构、自动化综合流程和Makefile使用方法。项目包含RTL到GDSII全流程文件,重点关注syn目录中的综合脚本。通过make dc命令运行综合流程,生成网表、约束和时序文件。关键报告如qor.rpt、area.rpt和min_vio.rpt用于分析综合质量、面积和时序。Makefile部分解释了其基本语法、IC设计中的典型结构,包括目标定义、命令执行和特殊声明,强调了其在自动化构建和依赖管理中的重要性。
c++常用工具类函数
/ 如果创建失败,并且不是因为目录已存在。// 如果目录不存在,则创建它。// 递归调用以处理子目录。// 跳过非目录部分。// 用于分割路径的函数。// 递归创建目录的函数。
电阻应变式力传感器
电阻应变式力传感器
Java中递归的实际应用
本文主要介绍了几个递归的实际应用场景,修改子层级信息,新建不重复的文件名,创建树层级结构等。
SAP-MM-采购申请字段解析
采购申请抬头以及行项目字段解析
360可视门铃双摄版数据恢复实战:BIN文件解析与视频重组
本文详细解析了360可视门铃双摄版BIN文件的数据恢复过程,包括文件结构分析、双摄像头数据存储机制及视频重组技术。通过Python开发环境和FFmpeg工具链,成功实现了H.265视频流的解析与重组,为智能家居设备数据恢复提供了实用解决方案。
python创建同名文件_Python 创建新文件时避免覆盖已有的同名文件的解决方法
思路:创建文件时,先检查是否有同名文件(使用os.path.isfile),如果有,则在文件名后加上编号n来创建。关键点:1. 使用os.path.isfile判断文件是否存在2. 使用递归函数判断2. 添加编号时, 使用可变list 传值n=[0]完整代码如下:import osdef check_filename_available(filename):n=[0]def check_meta(...
AI工具赋能日常工作的实践指南:以产品经理与程序员为例
AI工具赋能日常工作的实践指南:以产品经理与程序员为例
文件遍历~递归
一、File类 1.概念:将操作系统中文件(目录)路径,封装成File类对象 2.构造方法 //File(string pathName) File file=new File("e:\\a.txt"); System.out.println(file); //File(string parent,string ch
从 ST22 到根因定位:ABAP Dumps 全景排查指南(含典型 Dump 案例、修复套路与云时代实践)
本文系统介绍了SAP系统中ABAP短转储(Dump)的分析方法。首先指出短转储是程序运行时无法处理的错误导致系统强制终止执行。文章详细解析了短转储报告各区块的作用:从概述性的Short Text和What happened,到核心的Error Analysis和Source Code Extract,再到关键的系统字段Contents of system fields和调用栈Active Calls/Events。针对不同场景提供了排查建议:客户代码应建立可控边界,标准对象优先查阅SAP Notes。最后推
C#上位机性能优化全攻略:彻底解决界面卡顿+多线程死锁+PLC数据延迟,产线实测稳定运行2年
一开始我们用的是网上找的零散优化代码,根本满足不了要求,后来花了2个月的时间,把之前27条产线的代码整理、重构、优化,做了一套这套方案上线后,连续稳定运行2年零3个月:界面响应时间稳定在50ms以内,多线程死锁率持续为0,PLC数据延迟稳定在150ms以内,系统可用率≥99.99%,帮客户一年省下了超过480万的停线损失、罚款损失和人工成本,客户第二年就把剩下的22条产线也全部交给我们做了,还介绍了3家同行。
[linux] mkdir 创建文件夹/目录
mkdir [选项] 目录 通过 mkdir 命令可以实现在指定位置创建以 DirName(指定的文件名)命名的文件夹或目录。 要创建文件夹或目录的用户必须对所创建的文件夹的父文件夹具有写权限。 并且,所创建的文件夹(目录)不能与其父目录(即父文件夹)中的文件名重名, 即同一个目录下不能有同名的(区分大小写)。 命令参数: -m, --mode=模式,设定权限<模式> (...
计算机网络基础:揭开网络世界的神秘面纱
计算机网络基础:揭开网络世界的神秘面纱,计算机网络已深度融入现代生活,这篇文章对其基础内容展开全面阐述。开篇介绍计算机网络的定义,说明其由计算机设备、网络设备和传输介质构成。接着从地域范围和拓扑结构两个维度对计算机网络进行分类,并详细讲解 OSI 和 TCP/IP 参考模型,明晰各层功能与联系。随后阐述网络通信协议的定义及常见协议,如 TCP/IP、HTTP 等。最后聚焦网络安全,涵盖定义、重要性以及防火墙、加密技术等常用安全技术。文章旨在帮助读者构建计算机网络基础知识体系,理解其在生活和工作中的应用与价值
创建、删除、复制文件夹及其子文件;找出某个目录下的所有文件名 .NET
创建、删除、复制文件夹及其子文件;找出某个目录下的所有文件名 .NET using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.I...
Devexpress16.2.6破解工具
Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具
深度学习工具包 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")
javaIO流应用——递归统计某目录下的所有文件名
递归统计某目录下的所有文件名 1.输出案例 C:\Users\DELL\Desktop\12\23\cutcamera.png C:\Users\DELL\Desktop\12\IO流.docx 2.代码实现 package RecurrenceFile; import java.io.File; import java.util.ArrayList; import java.util.Lis...
Probability and Statistics - 4th edition
Probability and Statistics - 4th edition
Java进阶基础-递归算法遍历一个文件夹中所有文件名
/* 给出电脑上一个文件,求这个文件下的所有文件名 思路:递归算法 出口:当为文件名时,打印该文件名 原则:当为目录时,继续调用此方法 */ 上代码… public class FileIteratorDome { public static void main(String[] args) { //创建文件对象 File f = new File(...
华为的C语言编程规范.pdf
华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。
java io经典代码
package IO; import java.io.*; public class FileDirectoryDemo { public static void main(String[] args) { // 如果没有指定参数,则缺省为当前目录。 if (args.length == 0) { args = new String[] { "." }; try {
c++ 创建文件夹_如何用VBA提取多层文件夹内文件名?
之前我们分享了如何提取指定文件夹下工作簿名称的小代码,戳链接:【Excel VBA】批量提取文件夹下文件名这期我们分享下,如何提取多层文件夹下文件名的小代码……什么意思呢?比如说,A文件下有B文件夹,B文件夹下有C文件夹,C文件夹下又有D文件夹……也就是传说中的子又生孙,孙又生子;子又有子,子又有孙;子子孙孙无穷匮也…………想什么呢 这是赤果果的愚公移山……此时如何提取每个文件夹下的文...
批量修改文件名SaveFileUtil
File file = new File(“D:\知识”);
SQL里,怎样通过递归得到某个文件目录下的全部文件名[含子目录]?
SQL里,怎样通过递归得到某个文件目录下的全部文件名[含子目录]?DECLARE@Pathnvarchar(260)SET@Path='C:\Downloads'IFRIGHT(@Path,1)<>'\'SET@Path=@Path+'\'IFOBJECT_ID('tempdb..#')ISNOTNULLDROPTABLE...
boost-filesystem-删除复制文件-设置文件权限-递归创建删除复制文件夹-解析文件名-C++
boost::filesystem是Boost C++ Libraries中的一个模块,主要作用是处理文件(Files)和目录(Directories)。该模块提供的类boost::filesystem::path专门用来处理路径。而且,该模块中还有很多独立的函数能够用来执行创建目录、检查文件是否存在等任务。
java创建唯一的文件名_java利用时间格式生成唯一文件名的方法
前言有时候我们需要截图,在要截图时,有人用到了时间格式,但是时间格式中的:在文件名称中是不被允许的字符,所以就会报错,如何生成唯一的时间文件名:示例代码package com.demo;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Calendar;import java.uti...
c#文件名去掉后缀_C# 怎么去掉文件名后缀
public class test {private static List getData(String path) {List list = new ArrayList<>();try {File f = new File(path);File[] fs = f.listFiles();int i = 0;while (iif (fs[i].isDirectory())getDat...
python目录与文件_python目录与文件名操作
1、操作目录与文件名#!/usr/bin/env python#-*- coding: utf-8 -*-import os,reimport shutilimport time用listdir搜索def search_OFD_old(my_pattern, diretory):try:names = os.listdir(diretory)except os.error:print "error...
python 保存文件 递增_自动递增文件名Python - python
我试图编写一个函数,该函数将路径名和文件名分配给基于文件名(而不是文件夹中存在)的变量。然后,如果文件名已经存在,则文件名将自动递增。我已经看到了一些使用while循环的帖子,但是我对此一无所知,想将其包装在一个递归函数中。这是我到目前为止所拥有的。使用打印语句进行测试时,每个方法都可以正常工作。但是它不会将新名称返回给主程序。def checkfile(ii, new_name,old_name...
python创建文件夹 覆盖_Python 创建新文件时避免覆盖已有的同名文件的解决方法...
思路:创建文件时,先检查是否有同名文件(使用os.path.isfile),如果有,则在文件名后加上编号n来创建。关键点:1. 使用os.path.isfile判断文件是否存在2. 使用递归函数判断2. 添加编号时, 使用可变list 传值n=[0]完整代码如下:import osdef check_filename_available(filename):n=[0]def check_meta(...
5073
7305

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



