VB自定义文件COPY的类.

ReportX实例(3)VB 本例子下载地址:http://download.csdn.net/source/334323 使用步骤:1、注册控件ReportX.ocx(本压缩包内不包含ReportX.ocx,如果需要请到http://download.csdn.net/source/275430下载)代码:Private Sub AppendCol_Click()  ReportX1.AppendCol 1End S 阅读详情
 

 

 

原代码地址:http://d.download.csdn.net/down/681014/MSTOP

 
  1. '//================================
  2. '//MSTOP(陈建华)
  3. '//         2001/03/16
  4. '//================================
  5. Option Explicit
  6. Dim M_BkColor As Long
  7. Dim M_BlockSize As Long
  8. '
  9. Private Sub UserControl_Initialize()
  10.         Shape1.ZOrder 0
  11.         M_BkColor = 
  12.         Picture1.Move 0, 0, UserControl.Width, UserControl.Height
  13.         Shape1.Move -Picture1.Width, 0, Picture1.Width, UserControl.Height
  14.         LabPer.Move (Picture1.Width - LabPer.Width) / 2, (Picture1.ScaleHeight - LabPer.Height) / 2
  15.         LabPer.Caption = "0%"
  16.         Picture1.BackColor = M_BkColor
  17. End Sub
  18. Private Sub UserControl_Resize()
  19.         Picture1.Move 0, 0, UserControl.Width, UserControl.Height
  20.         Shape1.Move -Picture1.Width, 0, Picture1.Width, UserControl.Height
  21.         LabPer.Move (Picture1.Width - LabPer.Width) / 2, (Picture1.ScaleHeight - LabPer.Height) / 2
  22. End Sub
  23. ''
  24. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  25.     BackColor = PropBag.ReadProperty("BackColor", &H80FFFF)
  26.     Picture1.Appearance = PropBag.ReadProperty("Appearance", 0)
  27.     Set LabPer.Font = PropBag.ReadProperty("Font", Ambient.Font)
  28.     LabPer.FontSize = PropBag.ReadProperty("FontSize", LabPer.FontSize)
  29.     LabPer.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
  30.     BlockSize = PropBag.ReadProperty("BlockSize", 2)
  31. End Sub
  32. Private Sub UserControl_Show()
  33.         Shape1.ZOrder 0
  34.         Picture1.BackColor = M_BkColor
  35. End Sub
  36. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  37.     Call PropBag.WriteProperty("BackColor", BackColor, &H80FFFF)
  38.     Call PropBag.WriteProperty("Appearance", Picture1.Appearance, 0)
  39.     Call PropBag.WriteProperty("Font", LabPer.Font, Ambient.Font)
  40.     Call PropBag.WriteProperty("FontSize", LabPer.FontSize, 9)
  41.     Call PropBag.WriteProperty("ForeColor", LabPer.ForeColor, &H80000012)
  42.     Call PropBag.WriteProperty("BlockSize", BlockSize, 2)
  43.     
  44. End Sub
  45. '
  46. '=====================================================================
  47. '=====================================================================
  48. Public Function Copy(SourFile As String, _
  49.                      ObjFile As String, _
  50.                      Optional MsgTitle As String = "文件复制", _
  51.                      Optional ReplaceFile As Boolean = True) As Boolean
  52.                      
  53.         Dim Buf() As Byte
  54.         Dim BTest As Variant, FSize As Variant
  55.         Dim Chunk As Long, F1 As Long, F2 As Long
  56.         Dim Response As Long
  57.         Dim PrgVal As Long
  58.         Dim OleVal As Long
  59.         Dim DltW As Double
  60.         Dim PBar As Control
  61.         Dim BufSize As Long
  62.         
  63.         If M_BlockSize < 1 Then M_BlockSize = 1
  64.         BufSize = M_BlockSize * 1024
  65.         BTest = CDec(BTest): FSize = CDec(FSize)
  66.         
  67.         If Len(Dir(ObjFile)) > 0 Then
  68.            If Not ReplaceFile Then  '//不替换文件
  69.                 Response = MsgBox(ObjFile + Chr(13) + Chr(10) + "文件已存在.是否替换该文件?", vbYesNo + vbQuestion, MsgTitle)
  70.                 If Response = vbNo Then
  71.                    Copy = False
  72.                    Exit Function
  73.                 Else
  74.                    Kill ObjFile
  75.                    If Err.Number <> 0 Then Copy = False: Exit Function
  76.                 End If
  77.            Else  '//可以替换该文件
  78.                Kill ObjFile
  79.                If Err.Number <> 0 Then Copy = False: Exit Function
  80.            End If
  81.         End If
  82.          
  83.         On Error GoTo FileCopyError
  84.         
  85.         Shape1.Left = -Shape1.Width
  86.         Shape1.Visible = True
  87.         
  88.         LabPer.Caption = "0%"
  89.         DltW = Picture1.Width / 100
  90.         
  91.         DoEvents
  92.         
  93.         F1 = FreeFile: Open SourFile For Binary As F1
  94.         F2 = FreeFile: Open ObjFile For Binary As F2
  95.         
  96.         FSize = LOF(F1)
  97.         BTest = FSize - LOF(F2)
  98.         
  99.         While BTest > 0
  100.             If BTest < BufSize Then
  101.                Chunk = BTest
  102.             Else
  103.                Chunk = BufSize
  104.             End If
  105.             
  106.             If Chunk > 0 Then
  107.                 ReDim Buf(Chunk - 1)
  108.                 Get F1, , Buf
  109.                 Put F2, , Buf
  110.                 BTest = FSize - LOF(F2)
  111.             End If
  112.             
  113.             PrgVal = (100 - Int(100 * BTest / FSize))
  114.             
  115.             If OleVal <> PrgVal Then
  116.                 If PrgVal < 0 Then PrgVal = 0
  117.                 If PrgVal > 100 Then PrgVal = 100
  118.                 Shape1.Left = DltW * PrgVal - Shape1.Width
  119.                 LabPer.Caption = PrgVal & "%"
  120.                 DoEvents
  121.             End If
  122.             OleVal = PrgVal
  123.         Wend
  124.         
  125. FileCopyError:
  126.         Copy = (Err.Number = 0 Or Err.Number = 380)
  127.         Err.Clear
  128.         Close F1
  129.         Close F2
  130.         
  131. End Function
  132. '注意!不要删除或修改下列被注释的行!
  133. Public Property Get BackColor() As OLE_COLOR
  134.     BackColor = M_BkColor 'LabPer.BackColor
  135. End Property
  136. Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
  137.     M_BkColor = New_BackColor
  138.     Picture1.BackColor = M_BkColor
  139.     PropertyChanged "BackColor"
  140. End Property
  141. Public Property Get Appearance() As Integer
  142.     Appearance = Picture1.Appearance
  143.     Picture1.BackColor = M_BkColor
  144. End Property
  145. Public Property Let Appearance(ByVal New_Appearance As Integer)
  146.     Picture1.Appearance() = New_Appearance
  147.     Picture1.BackColor = M_BkColor
  148.     PropertyChanged "Appearance"
  149. End Property
  150. '注意!不要删除或修改下列被注释的行!
  151. 'MappingInfo=LabPer,LabPer,-1,Font
  152. Public Property Get Font() As Font
  153.     Set Font = LabPer.Font
  154. End Property
  155. Public Property Set Font(ByVal New_Font As Font)
  156.     Set LabPer.Font = New_Font
  157.     PropertyChanged "Font"
  158. End Property
  159. '注意!不要删除或修改下列被注释的行!
  160. 'MappingInfo=LabPer,LabPer,-1,FontSize
  161. Public Property Get FontSize() As Single
  162.     FontSize = LabPer.FontSize
  163. End Property
  164. Public Property Let FontSize(ByVal New_FontSize As Single)
  165.     LabPer.FontSize() = New_FontSize
  166.     PropertyChanged "FontSize"
  167. End Property
  168. '注意!不要删除或修改下列被注释的行!
  169. 'MappingInfo=LabPer,LabPer,-1,ForeColor
  170. Public Property Get ForeColor() As OLE_COLOR
  171.     ForeColor = LabPer.ForeColor
  172. End Property
  173. Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
  174.     LabPer.ForeColor() = New_ForeColor
  175.     PropertyChanged "ForeColor"
  176. End Property
  177. Public Property Get BlockSize() As Long
  178.     BlockSize = M_BlockSize
  179. End Property
  180. Public Property Let BlockSize(ByVal New_BlockSize As Long)
  181.     If New_BlockSize < 1 Then New_BlockSize = 1
  182.     If New_BlockSize > 1000 Then New_BlockSize = 1000
  183.     
  184.     M_BlockSize = New_BlockSize
  185.     PropertyChanged "BlockSize"
  186. End Property
CyberChef本地搭建 阅读详情

相关推荐

BQ25713寄存器配置全解析:从基础原理到笔记本充电实战

在电源管理系统中,寄存器配置是实现精细化控制的核心技术。其原理是通过I2C等总线向芯片内部特定地址写入二进制代码,直接设定其工作参数与行为逻辑,从而实现对电压、电流、功率及保护阈值的底层控制。这项技术的价值在于,它能将通用电源管理芯片灵活适配于千差万别的具体应用,是提升系统性能、可靠性与能效的关键。在便携设备、嵌入式系统等场景中,精准的寄存器配置决定了充电效率、动态响应和故障保护能力。本文聚焦于**BQ25713**这款经典充电管理芯片,深入剖析其**ChargeOption**、**ProchotOpti

weixin_42713608的博客 293

vb中copyFile与Filecopy的区别 容易踩坑

踩了个坑 给大家分享一下 记得区分 这里是引用 添加链接描述

qq_38610729的博客 747

Windows C语言编程:Beep API实现蜂鸣器原理与实战

如果你在 Windows 上写过 C 语言程序,想给程序加个简单的提示音,第一个想到的可能是 printf("\a") 。这个转义字符确实能在某些终端里发出“嘀”的一声,但它太原始、太不可控了,而且很多时候根本没声音。那么,有没有一种更“Windows”、更可控、更专业的方法来让你的程序“说话”呢? 答案是肯定的,而且它比你想象的要强大和复杂。Windows 提供了一个名为 Beep 的 API 函数,专门用于生成蜂鸣声。你可能觉得这功能太简单,甚至有点过时——不就是让电脑“哔”一声吗?但恰恰是这个看似简单

weixin_34109408的博客 399

VB 极速自动备份文件助手 涉及可识别 Unicode 编码文件名

自动备份文件 涉及 Unicode 文件名的操作

Will_lliW的博客 522

Python主要智能优化算法库汇总

最近几年简单浏览和对比了一些智能算法的库。现将各种库的主要信息、相关优缺点简单整理如下,各位同学可根据自己的需求和喜好进行选择。 文章目录1、DEAP2、mealpy3、scikit-opt (国产良心)4、Geat2(国产用心)5、pygmo26、pyswarms7、SciPy(想不到吧)小结 1、DEAP 项目地址:https://github.com/DEAP/deap 安装: pip install deap 优点: 起点高,发表在Journal of Machine Learning Rese

半个冯博士 2万+

Data+AI新玩法:Text2SQL让数据查询变得如此简单!

你是不是也遇到过这种情况?明明手头有海量数据,却因为SQL这道“门槛”,让分析和决策变得复杂和拖沓。你可能想着:“要是我能直接用自然语言和数据库对话,那该多好!你不是一个人在这样想,Text2SQL技术正是为了帮你摆脱这一困境而诞生的。

Ase5gqe的博客 872

VB6.0 ActiveX 控件开发详解 [第三章:属性的设计,属性映射,属性的初始化,属性的保存]

第三章:属性的设计,属性映射,属性的初始化,属性的保存 第一节:属性的设计        废话不多说,前文再续,书接上一回。上回说到,如何对界面进行布置和写动态修改控件大小的代码;这一回,我来介绍一下如何设计属性,这是难点。        启动我们上次做好的工程,我们需要想想,我们这个控件需要些什么属性?既然是图片框架控件,那么我们就需要一个Picture属性,同时,在以前的代码里,没有调整

几罗星人的专栏 2万+

对话系统简介

《文本上的算法》学习笔记1、问答型1.1、基于语义分析的方法1.2、基于信息抽取的方法1.3、端对端的方法2、任务型2.1、生成式模型( Generative Model )2.2、判别式模型( Discrimitive Model )2.3、规则系统3、闲聊型3.1、规则方法3.2、生成模型3.3、检索方法 个人认为NLP领域最难的方向可以说是阅读理解与文本生成/摘要,而对话系统,尤其是闲聊常常...

盘一哈nlp 6758

VB开发OCX控件的属性之自定义列表项

到这里一个OCX控件属性的编写就结束了,测试,打开Form窗体,在左边的部件栏中单击刚编写的UserControl控件图标,然后在Form窗体中拖出一个UserControl1控件,在这个控件的属性栏我们就可以看到"BorderStyle"这个属性了。“Style”是类的名称(自设),而这个类里面的“0-1-2-3-4-5”便是该类中包含的成员,“[]“中的字符串可以是中文或其他语言,但”=“后必须是数字,字符串和等号后的数字是对等的,在设计中可以用”[]“里的字符串或相应的数字相互对替。...

键盘上的舞指 1048

微机原理--输入输出实验--emu8086

通过实验,验证了基本要求,实现了一位数加法运算的功能,同时实现了两位数加法运算的功能,还有一位数的除法。思考题(1)输入输出数据和计算用数据的区别:从键盘上输入以及输出的数据要在通过转化为计算机所识别的二进制的数字,和计算所用的数据之间相差30H。(2)单字符输入输出和串输入输出的不同之处:单字符的输入使用1号功能键,输出通过2号功能调用,且待显示字符送给DL寄存器;串输入使用0A功能,输出通过9号功能调用,DS:DX指向待显示字符串,且字符串必须以“$”结束。

m0_58837398的博客 2421

ThinkBook 16p 2024 BIOS降压定频实战:从解锁CFG Lock到AC Loadline调优

高性能笔记本在满载时频繁撞上温度墙,通常源于固件层默认电压冗余过大,而系统级降压工具又受限于CFG Lock锁定。要根治问题,需要从BIOS固件层面理解电压管理机制——AC/DC Loadline参数控制着CPU在不同负载下的电压请求,通过修改这些负载线值可以安全降低电压,解锁CFG Lock后还能让XTU、ThrottleStop等软件调参工具恢复可用。这种BIOS级调优在工程实践中广泛用于改善散热、稳定频率、压降风扇噪音,尤其适用于联想ThinkBook 16p 2024与拯救者Y9000P等采用HX平

weixin_32496547的博客 395

c++ 删除文件_文件操作Files vb.net

File类用于VB.NET中的File操作。我们可以创建,删除,复制等操作。如何创建文件?为了创建一个新的File,我们可以在File类中调用Create方法。语法:File.Create(FilePath)FilePath:新文件对象的名称File.Create(“ c: testFile.txt”)如何检查文件是否存在?在创建File对象之前,我们通常会检查File是否存在。为此,我们在Fil...

weixin_39934640的博客 267

YOLOv8改进---BiFPN特征融合

yolov8结合BiFPN进行改进

qq_41920323的博客 4527

COPY合并文件及思考

其实,以前也知道COPY有合并文件的功能,只是很少使用到。     如  copy /b 1.txt + 2.exe = 3.jpg     最近遇到了纠结的事情,没有办法通过其他途径获取到外网的文件,庆幸的是,能够浏览某些网站。而自己,恰好有些东西要用,怎么办呢?于是就想到了上面的这个命令,将一个文件或几个文件,与图片合并后,然后上传到个人网站(当然不希望公开的,呵呵),然后再拆分的方式来解

SmartyIdiot的专栏 2660

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

How to Copy an Entire Directory in VB6?

Sub Copy(ByVal SourcePath As String, ByVal DestinationPath As String)    拷贝指定目录下所有文件到另一位置    by VBDN 2005-8-26 http://blog.csdn.net/vbdn/    注意:SourcePath,DestinationPath这两个目录一定要存在,否则会出错    使用举例: 

VBDN的专栏 1234

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

VB.net文件操作

文件读写整理: 1.文件度

ecjtuAndy的专栏 4851

深度学习工具包 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")

VB.NET中对象的克隆

VB.NET中对象的克隆侯永锋       在3DMAX里面,做好一个物体(父物体)以后,可以选择Edit菜单中的Clone,下面有三中选项:Copy(生成一个同模样的子物体,两者的操作互不影响),Instance(父子互动,父物体的操作同样影响子物体,子物体也一样),还有一个Reference(暂不考虑)。       在VB.NET,同样会碰到这样的问题。创建一个复杂对象(可能有很

Montaque & DotNet 2045

vb.net file.copy 语法错误

VB.NET 中的 File.Copy 语法应该是这样的:File.Copy(源文件路径, 目标文件路径[, 是否覆盖现有文件]) 。如果你在使用 File.Copy 时遇到语法错误,建议你检查一下参数是否正确,或者检查一下当前路径是否有权限访问。 ...

weixin_42601547的博客 384

vb 中拷贝文件

       FileCopy("源文件名","目标文件名") 两个参数都是必选的,且都包含路径。        在VB中filecopy函数可以直接调用。而CopyFile函数则不能要先定义filesystemobject变量,然后才能用。有过copyFile比fileCopy的功能有所不同。         FileCopy是单个文件的copy,目标文件名可以和源文件名不同,也就是说Copy文...

miaozk2006的专栏 572

VB.Net语言 复制、删除文件案例

VB.NET语言经过长时间的发展,很多用户都很了解VB.NET语言了,这里我发表一个关于VB.Net语言 复制、删除文件的例子,和大家一起分享一下。   VB.Net语言 复制、删除文件代码:   Imports System.IO   Imports System.IO.Directory   ' ===========================================

CHEN_DO_IT的专栏 1041

VB.NET复制删除文件

有些人认为操作文件是一件非常简单的是,其实并不是,如果你没有权限你就不能对文件进行更改,但是我们今天不讲权限的问题,我们来对VB.NET复制删除文件这个问题进行简单的介绍一下。   VB.NET复制删除文件代码: VB.NET版      Imports System.IO     Imports System.IO.Directory     ' =======

Claire_sun的专栏 1523

vb如何向别的计算机发送文件夹,VB怎样复制文件夹?(包括里面的文件)

满意答案给你一个列子sourcePath 为源文件地址targetPath 存放文件的地址'复制文件夹到指定位置Function CopyDir(ByVal sourcePath As String, ByVal targetPath As String) As BooleanTry'检查目标目录是否以目录分隔符结束,不是则添加If Microsoft.VisualBasic.Right(targ...

weixin_34471172的博客 717

vb.net用Marshal类在内存中处理图像

vb.net操作不了指针,只能用marshal类来进行托管内存和非托管内存之间的交互,但是这样也依然比用GetPixel和SetPixel速度快。 讲之前先介绍一些方法的用法 Bitmap.LockBits 方法 定义如下: Public Function LockBits (rect As Rectangle, flags As ImageLockMode, format As PixelFor...

weixin_42150685的博客 1302

关于VB.NET实现多线程拷贝文件

此示例结合了 `System.Threading` 命名空间的功能以及文件操作的相关 API。以上代码定义了一个名为 `CopyFile` 的方法用于单个文件的复制,并将其封装在一个独立的线程中运行。对于更加复杂的场景,还可以引入异步事件(如 `OnCompleted` 或自定义委托),从而进一步增强程序的灵活性和可扩展性。在此示例中,`BackgroundWorker` 被用来执行文件复制任务,同时允许 UI 线程保持响应状态。- **异步事件驱动模型**:更适合复杂业务逻辑下的解耦设计。

cncbook1979的博客 994

vb.net中彩色图像数据的快速获取

         一直以来,图像处理都是VB的禁区,主要的原因可能是因为她没有指针,而图像的数据量通常都很大。其实,只要有正确的方法,VB同样可以写出高效而又快速的图像处理程序的。        我并不是学图像处理这方面的。可以说,我的专业和图像毫不占边,但因老板项目的需要,自学了一些图形图像学方面的知识。网络上图像方面大部分的代码都是用VC写的,对于我这个对C系列语言不感冒的人来说实在是太痛

ssihc0的专栏 1696

VB常用文件类

Option Explicit'*************************************************************************************************************'   读写文件函数'**********************************************************...

miaozk2006的专栏 375
上一篇: VB网络校时.
下一篇: VB中启动控制面板命令
华芸智森
博客等级 码龄25年 571粉丝 25原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值