详解Silverlight 2中的独立存储

Silverlight之独立存储(10) 独立存储 代码下载 1.        独立存储 独立存储是一种数据存储机制,它在代码与保存的数据之间定义了标准化的关联方式,从而提供隔离性和安全性。同时,标准化也提供了其他好处。管理员可以使用旨在操作独立存储的工具来配置文件存储空间、设置安全策略及删除未使用的数据。通过独立存储,代码不再需要使用唯一的路径来指定文件系统中的安全位置,同时可以保护数据免遭只具有独立存储访问权限的其他应用程序的 阅读详情
 

独立存储(Isolated Storage)是Silverlight 2中提供的一个客户端安全的存储,它是一个与Cookie机制类似的局部信任机制。独立存储机制的APIs 提供了一个虚拟的文件系统和可以访问这个虚拟文件系统的数据流对象。Silverlight中的独立存储是基于 .NET Framework中的独立存储来建立的,所以它仅仅是.NET Framework中独立存储的一个子集。

Silverlight中的独立存储有以下一些特征:

1. 每个基于Silverlight的应用程序都被分配了属于它自己的一部分存储空间, 但是应用程序中的程序集却是在存储空间中共享的。一个应用程序被服务器赋给了一个唯一的固定的标识值。基于Silverlight的应用程序的虚拟文件系 统现在就以一个标识值的方式来访问了。这个标识值必须是一个常量,这样每次应用程序运行时才可以找到这个共享的位置。

2.独立存储的APIs 其实和其它的文件操作APIs类似,比如 File 和 Directory 这些用来访问和维护文件或文件夹的类。 它们都是基于FileStream APIs 来维护文件的内容的。

3.独立存储严格的限制了应用程序可以存储的数据的大小,目前的上限是每个应用程序为1 MB。

使用独立存储

Silverlight 中的独立存储功能通过密封类IsolatedStorageFile来提供,位于命名空间System.IO.IsolatedStorag 中,IsolatedStorageFile类抽象了独立存储的虚拟文件系统。创建一个 IsolatedStorageFile 类的实例,可以使用它对文件或文件夹进行列举或管理。同样还可以使用该类的 IsolatedStorageFileStream 对象来管理文件内容,它的定义大概如下所示:



在Silverlight 2中支持两种方式的独立存储,即按应用程序存储或者按站点存储,可以分别使用GetUserStoreForApplication方法和 GetUserStoreForSite方法来获取IsolatedStorageFile对象。下面看一个简单的示例,最终的效果如下图所示:



下面来看各个功能的实现:

创建目录,直接使用CreateDirectory方法就可以了,另外还可以使用DirectoryExistes方法来判断目录是否已经存在:

void btnCreateDirectory_Click(object sender, RoutedEventArgs e)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
String directoryName = this.txtDirectoryName.Text;
if (this.lstDirectories.SelectedItem != null)
{
directoryName = System.IO.Path.Combine(this.lstDirectories.SelectedItem.ToString(),
directoryName);
}

if (!store.DirectoryExists(directoryName))
{
store.CreateDirectory(directoryName);
HtmlPage.Window.Alert("创建目录成功!");
}
}
}

创建文件,通过CreateFile方法来获取一个IsolatedStorageFileStream,并将内容写入到文件中:

void btnCreateFile_Click(object sender, RoutedEventArgs e)
{
if (this.lstDirectories.SelectedItem == null &&
this.txtDirectoryName.Text == "")
{
HtmlPage.Window.Alert("请先选择一个目录或者输入目录名");
return;
}
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
String filePath;
if (this.lstDirectories.SelectedItem == null)
{
filePath = System.IO.Path.Combine(this.txtDirectoryName.Text,
this.txtFileName.Text + ".txt");
}
else
{
filePath = System.IO.Path.Combine(this.lstDirectories.SelectedItem.ToString(),
this.txtFileName.Text + ".txt");
}

IsolatedStorageFileStream fileStream = store.CreateFile(filePath);
using (StreamWriter sw = new StreamWriter(fileStream))
{
sw.WriteLine(this.txtFileContent.Text);
}
fileStream.Close();
HtmlPage.Window.Alert("写入文件成功!");
}
}

读取文件,直接使用System.IO命名空间下的StreamReader:

void btnReadFile_Click(object sender, RoutedEventArgs e)
{
if (this.lstDirectories.SelectedItem == null ||
this.lstFiles.SelectedItem == null)
{
HtmlPage.Window.Alert("请先选择目录和文件!");
return;
}
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
String filePath = System.IO.Path.Combine(this.lstDirectories.SelectedItem.ToString(),
this.lstFiles.SelectedItem.ToString());
if (store.FileExists(filePath))
{
StreamReader reader = new StreamReader(store.OpenFile(filePath,
FileMode.Open, FileAccess.Read));
this.txtFileContent.Text = reader.ReadToEnd();

this.txtDirectoryName.Text = this.lstDirectories.SelectedItem.ToString();
this.txtFileName.Text = this.lstFiles.SelectedItem.ToString();
}
}
}

删除目录和文件:

void btnDeleteFile_Click(object sender, RoutedEventArgs e)
{
if (this.lstDirectories.SelectedItem != null &&
this.lstFiles.SelectedItem != null)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
String filePath = System.IO.Path.Combine(this.lstDirectories.SelectedItem.ToString(),
this.lstFiles.SelectedItem.ToString());
store.DeleteFile(filePath);
HtmlPage.Window.Alert("删除文件成功!");
}
}
}

void btnDeleteDirectory_Click(object sender, RoutedEventArgs e)
{
if (this.lstDirectories.SelectedItem != null)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
store.DeleteDirectory(this.lstDirectories.SelectedItem.ToString());
HtmlPage.Window.Alert("删除目录成功!");
}
}
}

获取目录列表和文件列表:

void lstDirectories_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (lstDirectories.SelectedItem != null)
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
String[] files = store.GetFileNames(
this.lstDirectories.SelectedItem.ToString() + "/");
this.lstFiles.ItemsSource = files;
}
}
}

void BindDirectories()
{
using (IsolatedStorageFile store =
IsolatedStorageFile.GetUserStoreForApplication())
{
String[] directories = store.GetDirectoryNames("*");
this.lstDirectories.ItemsSource = directories;
}
}

增加配额

在 本文一开始我就提到独立存储严格的限制了应用程序可以存储的数据的大小,但是我们可以通过IsolatedStorageFile类提供的 IncreaseQuotaTo方法来申请更大的存储空间,空间的大小是用字节作为单位来表示的,如下代码片段所示,申请独立存储空间增加到5M:

using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
long newQuetaSize = 5242880;
long curAvail = store.AvailableFreeSpace;

if (curAvail < newQuetaSize)
{
store.IncreaseQuotaTo(newQuetaSize);
}
}

当我们试图增加空间大小时浏览器将会弹出一个确认对话框,供我们确认是否允许增加独立存储的空间大小。



文件被存往何处

既 然独立独立存储是存放在客户端本地,那到底存放在何处呢?在我个人计算机上的地址 为:C:UsersTerryLeeAppDataLocalLowMicrosoftSilverlightis5kq51b.2q4pksdhgue.3rx, 不同机器会有一些变化,另外在XP下的存储位置与Vista是不相同的。在g文件夹下面,我们找到当前应用程序的一些公有信息,可以看到有如下三个文件:



id.dat记录了当前应用程序的ID

quota.dat记录了当前应用程序独立存储的配额,即存储空间大小

used.dat记录已经使用的空间

在另一个s文件夹下可以找到我们创建的目录以及文件,并且可以打开文件来看到存储的内容,如下图所示:



禁用独立存储

现在我们来思考一个问题,既然独立存储是一个与Cookie机制类似的局部信任机制,我们是否也可以禁用独立存储呢?答案自然是肯定的。在Silverlight应用程序上点击右键时,选择Silverlight Configuration菜单,将会看到如下窗口:



在这里我们可以看到每一个应用程序存储空间的大小以及当前使用的空间;可以删除应用程序独立存储数据或者禁用独立存储的功能。

独立存储配置

最 后在简单说一下独立存储配置,在Beta 1时代是应用程序配置,现在不仅支持应用程序配置,同时还支持站点配置,我们可以用它来存储应用程序配置如每个页面显示的图片数量,页面布局自定义配置等 等,使用IsolatedStorageSettings类来实现,该类在设计时使用了字典来存储名-值对,它的使用相当简单:

IsolatedStorageSettings appSettings =
IsolatedStorageSettings.ApplicationSettings;

appSettings.Add("mykey","myValue");
appSettings.Save();

IsolatedStorageSettings siteSettings =
IsolatedStorageSettings.SiteSettings;
siteSettings.Add("mykey1","myValue1");
siteSettings.Save();

独立存储配置的机制与我们上面讲的一样,它也是基于本地文件存储,系统默认的会创建一个名为__LocalSettings的文件进行存储,如下图所示:



打开文件后可以看到,存储的内容(此处进行了整理)

<ArrayOfKeyValueOfstringanyType
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<KeyValueOfstringanyType>
<Key>mykey</Key>
<Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema"
i:type="d3p1:string">myValue</Value>
</KeyValueOfstringanyType>
</ArrayOfKeyValueOfstringanyType>

值得一提的是使用独立存储配置不仅仅可以存储简单类型的数据,也可以存储我们自定义类型的数据。

小结

本文详细介绍了Silverlight 2中的独立存储机制,希望对大家有所帮助。

基于STM32的智能水温控制系统设计 智能水温控制系统广泛应用于家庭、工业、农业等多个场景,尤其在热水器、恒温泳池和地暖系统中,通过实时监测和调节水温,提高设备的效率和用户的舒适度。本文基于STM32微控制器设计了一个智能水温控制系统,能够实时监测水温、用户设置温度,并根据需要控制加热器或冷却装置,确保水温维持在设定范围内。系统能够根据用户设定自动控制加热和冷却设备,确保水温维持在舒适的范围内,并通过OLED屏实时显示水温信息。在生成的项目基础上,编写水温监测、目标温度设定、加热器和冷却装置控制、OLED数据显示以及超温报警的代码。 阅读详情

相关推荐

基于WEKWS模型的语音唤醒关键词识别

本文所使用的模型网络结构继承自论文《Compact Feedforward Sequential Memory Networks for Small-footprint Keyword Spotting》,文中研究了将低秩矩阵分解与传统FSMN相结合的紧凑型前馈顺序记忆网络(cFSMN)用于远场关键字检测任务。

YuZhou的博客 6605

WCF结果中有Dictionary类型 生成代理类之后T变成ArrayOfKeyValueOfstringstringKeyValueOfstringstring

解决方案 在返回结果model上加[KnownType(typeof(Dictionary<string, string>))],完整代码: [DataContract] [KnownType(typeof(Dictionary<string, string>))] public class RetJson<T> { [...

专注于编程、AI、人工智能等多个领域内容研究和分析 636

解密m3u8视频合并:从猫抓插件到本地文件修改全流程

本文详细解析了m3u8视频合并的全流程,特别针对加密视频片段提供了解决方案。从使用猫抓插件捕获m3u8文件地址,到利用N_m3u8DL-CLI工具自动下载、解密并合并ts片段,手把手教你处理AES-128加密等常见问题,最终生成完整的本地MP4文件,适合需要备份或处理流媒体资源的用户。

weixin_29290947的博客 1378

WCF学习心得----(六)数据协定

--前言            最近各种事忙的把之前的WCF学习给耽误了一些,今天抽时间把之前的学习内容给总结了一下,因为知识点比较细碎没有做太多的练习示例,只是对其中关键的知识点做了总结,希望可以对大家有所帮助。 第六章 数据协定 6.1 数据协定的概述 默认的情况下WCF使用称之为数据协定序列化程序的序列化引擎对数据进行序列化和反序列化,所有的.NET Framework基元类型,如整

xuemoyao的专栏 2528

system_stm32f10x.c文件分析

配置系统时钟(包括系统时钟源、锁相环(PLL)倍频系数、高级高性能总线(AHB)/ 高级外设总线(APBx)预分频器以及闪存相关设置)。该函数在系统复位后的启动阶段被调用,且调用时机早于跳转到主程序之前。

Jia shuheng的博客 611

告别玄学调试:手把手教你读懂全志芯片的sys_config.fex配置文件(以i2c配置为例)

本文深入解析全志芯片的sys_config.fex配置文件,以I2C设备驱动为例,详细讲解从引脚定义到驱动加载的全过程。通过实战案例和高级调试技巧,帮助开发者快速掌握硬件配置与内核驱动的联动机制,提升开发效率。

weixin_33737134的博客 425

《WCF技术内幕》翻译29:第2部分_第5章_消息:使用消息头(下)

Posted on 2009-12-17 22:49 Frank Xu Lei 阅读(84) 评论(0)  编辑 收藏 网摘 所属分类: 《WCF技术内幕》翻译, SOA and EAI <!--<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"xmlns:dc="http:/

微软特邀讲师 老徐FrankXuLei 的专栏 1394

【Dynamo学习笔记】Dynamo for Revit建模基础

为了能和Revit进行交互,Dynamo中内置了很多Revit的节点,包含一系列用于选择、创建、编辑、查询等操作,帮助用户简化建模的过程,提高工作效率,拓展模型的应用。为了简化程序,我们可以将一些通用的节点流程编组封装成自定义节点。首先,我们选中我们需要封装的节点组,在空白处点击右键,选择创建自定义节点。

喵木木的博客 4435

U9 如何配置SV

1、运行Code目录下的bat文件,将dll拷到相应目录下 2、将BpImplement下的svc文件拷到portal的services目录下 3、配置Services目录下的web.config文件,示例如下:                           binding="basicHttpBinding" />     其中PMRMACheckSVStub是BpI

hduzh的专栏 2302

【WRF模拟】土地利用类型的确定:最大覆盖法/瓦片法

土地利用类型的确定:最大覆盖法/瓦片法

WW、forever的博客 1535

一桶令牌的时间账本:四类限流算法的边界推演与Guava RateLimiter源码精读

限流的难点不在背出算法名,而在算清每一笔账:按哪一秒计数、超额请求排队还是拒绝、空闲后能否突发、集群总量如何约束。本文在可复现的虚拟时间实验台上对比固定窗口、滑动窗口、漏桶与令牌桶,实测边界双倍突发与分桶滑动的真实上界,拆解Nginx limit_req的千分位记账与延迟机制,纠正Resilience4j常被误称漏桶的说法,并逐行精读Guava SmoothRateLimiter的预消费、懒惰补账与预热积分,复刻迷你限流器与其完成七万次零差异对账,最后给出集群配额、分层防护与参数确定的方法。

曾经“等你生日那天”都遥远得像未来,如今却可欢愉的挥手说“下个十年见” 86万+

【WP8】自定义配置存储类

之前在WP7升级到WP8的时候遇到配置不兼容的问题 情景:之前只有一个WP7版本,现在需要发布WP8版本,让用户可以从原来的WP7版本升级到WP8版本   一般情况下从WP7升级到WP8没什么问题   但是在项目中升级到WP8的时候,原先在WP7下保存在IsolatedStorageSettings的数据都不出来,经过调试发现 1、IsolatedStorageSettings存放数据的隔...

weixin_34247299的博客 181

C++之2048小游戏 第二期

游戏会有初始化、绘制界面、处理输入、更新游戏状态、判断胜负等部分。所以,可能需要一个二维数组来表示4x4的网格,存储每个格子的数值。然后,需要处理键盘输入,尤其是方向键的控制,这可能需要使用EasyX的键盘事件处理函数。然后,关于图形绘制部分,每个格子的大小、颜色、数字的显示都需要设计。不同的数字对应不同的颜色,比如2是浅色,4稍深,以此类推。可能需要一个函数根据数字的值返回对应的颜色,然后在绘制时调用。接下来,处理数字的移动和合并逻辑。这是比较复杂的部分。

Lucky_Glory的博客 807

详解Silverlight 2中的独立存储(Isolated Storage)

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://terrylee.blog.51cto.com/342737/84585 ...

weixin_34260991的博客 506

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

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

详解Silverlight 2中的独立存储(转载)

独立存储(Isolated Storage)是Silverlight 2中提供的一个客户端安全的存储,它是一个与Cookie机制类似的局部信任机制。独立存储机制的APIs 提供了一个虚拟的文件系统和可以访问这个虚拟文件系统的数据流对象。Silverlight中的独立存储是基于 .NET Framework中的独立存储来建立的,所以它仅仅是.NET Framework中独立存储的一个子集。 Silv

tongyiyi的专栏 598

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

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

基于MP2642GR-Z与MK24FN1M0的两串锂电池主动均衡设计

串联锂电池组中,电芯不一致引发的木桶效应会直接限制整组可用容量,长期浮充更会加剧一致性偏差。主动均衡通过能量转移将高电压电芯的能量搬运至低电压电芯,相比被动均衡电流更大、发热更小,是BMS与储能系统提升寿命的关键技术。在备用电源、储能模组等场景中,高效均衡能有效延缓电芯失配,保障系统可靠运行。基于MP2642GR-Z均衡前端芯片与MK24FN1M0主控MCU的两串电池模组设计,覆盖硬件拓扑、电感选型、电压采样、均衡策略与调试避坑,实现了模组压差稳定控制在10mV以内,为同类BMS开发提供了可复用的工程路径。

weixin_33868027的博客 386

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

数据之独立存储(Isolated Storage)[转]

作者:webabcd介绍Silverlight 2.0 数据的独立存储(Isolated Storage): IsolatedStorageFile - 操作 独立存储 的类 IsolatedStorageFile.GetUserStoreForSite() - 按站点获取用户的独立存储 IsolatedStorageFile.GetUserStoreForApp...

weixin_34393428的博客 107

silverlight 独立存储

独立存储是silverlight提供的一个客户端存储,是一种局部信任机制。 独立存储提供了一个虚拟的文件系统的数据流对象,,是基于.net framework中独立存储建立起来的一个子集。 独立存储具有以下特点: 1、基于silverlight的应用程序被分配了属于它子集的存储空间,但是应用程序的程序集在存储空间中是共享的。 2、 IsolatedStorageFileStream 扩

记事本 1327

Silverlight 中的 独立存储

详解Silverlight 2中的独立存储(Isolated Storage) 转载于:https://www.cnblogs.com/Ken-Cai/archive/2012/08/14/2638828.html

weixin_30399871的博客 83
上一篇: 北美PC游戏销量排行榜
下一篇: ASP.net 页面被关闭后,服务器端是否仍然执行中?
普通网友
博客等级 码龄20年 9479粉丝 5860原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值