Reactive Extensions (Rx) 入门(2) 安装 Reactive Extensio
原文:http://www.atmarkit.co.jp/fdotnet/introrx/introrx_01/introrx_01_02.html 作者:河合 宜文 安装方法 关于 Rx 的安装,可以通过 Reactive Extensions (Rx) 的主页的直接下载安装,当然也可以利用 NuGet 导入 dll (http://nuget.org/packages/Rx-Main
原文:http://www.atmarkit.co.jp/fdotnet/introrx/introrx_01/introrx_01_02.html
作者:河合 宜文
安装方法
关于 Rx 的安装,可以通过 Reactive Extensions (Rx) 的主页 的直接下载安装,当然也可以利用 NuGet 导入 dll (http://nuget.org/packages/Rx-Main) [译注: NuGet 是VS集成的在线 dll部署工具,非常方便]。Rx 不管是 Installer 还是 NuGet 安装的,都有 Stable(稳定版) 和 Experimental(实验版) 两种。
Stable版是API中方法名等不会再变更而Experimental版则是在Stable版中加入了一些实验性的方法等。例如:C# 5.0中新增特性await/async关键字、Expand方法等只在Experimental版中有。只在Experimental版中有的方法会以[ExperimentalAttribute]特性标识,在Visual Studio中通过metadata的表示可以区分出来。因此,在利用Experimental版的时候,这些加上[ExperimentalAttribute]特性标识的方法将来方法名,参数列表还是有可能发生变化的,需要留意。
另外,Experimental版在现在Developer Preview(开发者预览版)中的.NET Framework 4.5和WinRT(Windows 8 运行环境)中已经包含了。C#5.0中特别是针对异步编程比较大的变化策略,已经在反映在Experimental版中。
Assembly分类
Rx的Assembly按照如下功能划分。
程序集名 | NuGet Package名(*1) | 功能 |
System.Reactive | Rx-Main | 基本Core API |
System.Reactive.Windows.Forms | Rx-WinForms | WindowsForm中使用的 ControlScheduler类(*2)和扩展方法 |
System.Reactive.Windows.Threading | Rx-WPF Rx-Silverlight |
WPF/Silverlight中使用的DispatcherScheduler类(*2)和扩展方法 |
System.Reactive.Providers | Rx-Providers | IQbservable接口和其他类库(*3) |
Microsoft.Reactive.Testing | Rx-Testing | UnitTest和Mockup |
Rx的Assembly一览 | ||
Rx的Assembly文件、一般放在「C:\Program Files\Microsoft Reactive Extensions SDK」(32bit版),而64bit版则是放在「C:\Program Files (x86)\Microsoft Reactive Extensions SDK」) | ||
*1 一览中提到的Package是指Stable版,Experimental版的时候则带有「_Experimental」比如:「Rx_Experimental-Main」 | ||
*2 Scheduler 是基于Rx的时间和线程管理的类。ControlScheduler类是对于WinForm及控件进行BeginInvoke调用,DispatcherScheduler类是对Dispatcher进行BeginInvoke。 | ||
*3 「IQbservable」接口名取自「Queryable Observable」。表达式树可以生成一个 Observable 对象。IObservable 接口和 IQbservable 接口的关系就和 IEnumerable 接口和 IQueryable 接口关系相当。 |
Windows Phone 7 SDK 里集成的标准的 Rx 程序集则和上面说的有些不同:
程序集名 | 功能 |
System.Observable | IObservable |
Microsoft.Phone.Reactive | Core API和DispatcherScheduler类 |
![]() | |
Windows Phone 7 SDK的程序集一览 |
如果更加重视是否是使用标准程序集且不需要额外引用程序集,那么直接使用 Microsoft.Phone.Reactive;如果希望能在 WPF,Sliverlight 中移植,那么就选择 Data Developer Center 版本好了。
相关的库
Javascript 版本并不包含在Install 中,但可以从 Rx 主页最下方下载 ZIP 得到。库的主体是 Rx.js ,除此之外还有 jQuery 和 prototype.js。
命名空间分类
Rx 主要是以扩展方法为中心的,如果没有正确的使用 using/Import 导入命名空间则无法使用。下面例举主要的命名空间以及代表的功能和类。
名前空間 | 功能点 |
System | Subscribe订阅 IObservable 接口使用的Lambda表达式的扩展方法 |
System.Reactive | 主要接口和一些基本类 |
System.Reactive.Concurrency | 实现 IScheduler 接口的一些类 |
System.Reactive.Disposables | 实现 IDisposable 接口的一些类 |
System.Reactive.Joins | 利用 Observable.And/Observable.Then 方法进行Join操作的类 |
System.Reactive.Linq | Rx 主要的命名空间,Observable 类和IObservable接口的一些扩展方法 |
System.Reactive.Subjects | 实现 ISubject 接口(实现 Rx 语义的事件)的一些类 |
System.Reactive.Threading.Tasks | Task 相互转换的扩展方法 |
![]() | |
Rx 的命名空间和代表性的功能以及类 |
另外,Windows Phone 中,Microsoft.Phone.Reactive 程序集里的 Rx 全部在 Microsoft.Phone.Reactive 命名空间下。
Reactive Extensions (Rx) 入门(1) —— Reactive Extensions 概要
Reactive Extensions (Rx) 入门(2) —— 安装 Reactive Extensions
Reactive Extensions (Rx) 入门(3) —— Rx的事件编程①

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

ToaddusersinMySQLeffectivelyandsecurely,followthesesteps:1)UsetheCREATEUSERstatementtoaddanewuser,specifyingthehostandastrongpassword.2)GrantnecessaryprivilegesusingtheGRANTstatement,adheringtotheprincipleofleastprivilege.3)Implementsecuritymeasuresl

ToaddanewuserwithcomplexpermissionsinMySQL,followthesesteps:1)CreatetheuserwithCREATEUSER'newuser'@'localhost'IDENTIFIEDBY'password';.2)Grantreadaccesstoalltablesin'mydatabase'withGRANTSELECTONmydatabase.TO'newuser'@'localhost';.3)Grantwriteaccessto'

The string data types in MySQL include CHAR, VARCHAR, BINARY, VARBINARY, BLOB, and TEXT. The collations determine the comparison and sorting of strings. 1.CHAR is suitable for fixed-length strings, VARCHAR is suitable for variable-length strings. 2.BINARY and VARBINARY are used for binary data, and BLOB and TEXT are used for large object data. 3. Sorting rules such as utf8mb4_unicode_ci ignores upper and lower case and is suitable for user names; utf8mb4_bin is case sensitive and is suitable for fields that require precise comparison.

The best MySQLVARCHAR column length selection should be based on data analysis, consider future growth, evaluate performance impacts, and character set requirements. 1) Analyze the data to determine typical lengths; 2) Reserve future expansion space; 3) Pay attention to the impact of large lengths on performance; 4) Consider the impact of character sets on storage. Through these steps, the efficiency and scalability of the database can be optimized.

MySQLBLOBshavelimits:TINYBLOB(255bytes),BLOB(65,535bytes),MEDIUMBLOB(16,777,215bytes),andLONGBLOB(4,294,967,295bytes).TouseBLOBseffectively:1)ConsiderperformanceimpactsandstorelargeBLOBsexternally;2)Managebackupsandreplicationcarefully;3)Usepathsinst

The best tools and technologies for automating the creation of users in MySQL include: 1. MySQLWorkbench, suitable for small to medium-sized environments, easy to use but high resource consumption; 2. Ansible, suitable for multi-server environments, simple but steep learning curve; 3. Custom Python scripts, flexible but need to ensure script security; 4. Puppet and Chef, suitable for large-scale environments, complex but scalable. Scale, learning curve and integration needs should be considered when choosing.

Yes,youcansearchinsideaBLOBinMySQLusingspecifictechniques.1)ConverttheBLOBtoaUTF-8stringwithCONVERTfunctionandsearchusingLIKE.2)ForcompressedBLOBs,useUNCOMPRESSbeforeconversion.3)Considerperformanceimpactsanddataencoding.4)Forcomplexdata,externalproc


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version
