文章分类

站点统计

  • 分类总数: 13 个
  • 文章总数: 145 篇
  • 评论总数: 47 条
  • 附件总数: 59 个
  • 建站日期: 2008-08-18
  • 访问总数: 472873 人次
  • RSS订阅: 文章|评论

Mono 2.0发布:介绍及特性列表

Admin 于 2008-10-09 07:21:46 发表.Net


Mono
是一个多平台支持的开源的.NET framework的实现,支持的操作系统有Unix, Windows, MacOS 和一些其他操作系统。

Mono 2.0包括ADO.NET 2.0/ASP.NET 2.0/Windows.Forms 2.0/System.XML 2.0/System.Drawing/Linq/GTK#等类库的实现。还包括C# 3.0/VB 8/IL编译器和很丰富的工具。 这个release比1.x更为完整和成熟了。其中,C#编译器对C# 3的支持已经完整;标准库方面,WinForms 2.0的API已经完整支持,LINQ和ASP.NET的支持也比之前更为完善;执行引擎开始共享泛型代码后占用内存量减少了。

现在的MONO已经是完全胜任.NET 2.0的工作,并且有众多3.0的特性了,连Linq都有了,SQLite的Provider也有了,现在的MONO已经走出实验室,可以进行小规模的Linux平台上应用开发了。


Microsoft Compatible APIs

  • ADO.NET 2.0 API for accessing databases.
  • ASP.NET 2.0 API for developing Web-based applications.
  • Windows.Forms 2.0 API to create desktop applications.
  • System.XML 2.0: An API to manipulate XML documents.
  • System.Core: Provides support for the Language Integrated Query (LINQ).
  • System.Xml.Linq: Provides a LINQ provider for XML.
  • System.Drawing 2.0 API: A portable graphics rendering API.

Mono APIs

  • Gtk# 2.12: A binding to the Gtk+ 2.12 and GNOME libraries for creating desktop applications on Linux, Windows and MacOS X.
  • Mono.Cecil: A library to manipulate ECMA CLI files (the native format used for executables and libraries).
  • Mono.Cairo: A binding to the Cairo Graphics library to produce 2D graphics and render them into a variety of forms (images, windows, postscript and PDF).
  • Mono's SQLite support: a library to create and consume databases created with SQLite.
  • Mono.Posix: a library to access Linux and Unix specific functionality from your managed application. With both a low-level interface as well as higher level interfaces.

Third Party APIs bundled with Mono

  • Extensive support for databases: PostgreSQL, DB2, Oracle, Sybase, SQL server, SQLite and Firebird.
  • C5 Generics Library: we are bundling the C5 generics collection class library as part of Mono.

Compilers

These compilers are part of the Mono 2.0 release:

  • C# 3.0 compiler implementation, with full support for LINQ.
  • Visual Basic 8 compiler.
  • IL assembler and disassembler and the development toolchain required to create libraries and applications.

Tools

Mono includes profiling tools, the standard development kit tools that are part of the .NET framework

  • Debugger: this is the first release when we support a debugger for managed code.
  • Gendarme: is an extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compiler do not typically check or have not historically checked.
  • Mono Linker: a linker that allows developers to reduce the size of their executables and libraries by removing features from libraries using an XML definition of the desired public API.
  • Mono Tuner: a tool to apply arbitrary user-defined transformations to assemblies. Mono uses this library to produce the Silverlight core libraries from the main system libraries.
  • Mono Documentation Tools: the Mono Documentation framework has been upgraded to support documenting generics and extension methods. The tools can be used to produce online and offline documentation for any any APIs, and are used by the project to document our own APIs.

2.0 Release Notes: http://www.mono-project.com/Release_Notes_Mono_2.0

Mono Project Announces Mono 2.0 for Cross-Platform Microsoft .NET Development: http://www.novell.com/news/press/mono-project-announces-mono-2-0-for-cross-platform-microsoft-net-development/

Miguel de Icaza's :http://tirania.org/blog/archive/2008/Oct-06.html

被阅981次, 0票Mono 发表评论

微软修改了Managed Extensibility Framework(MEF)的协议

Admin 于 2008-10-09 06:51:24 发表.Net

      Managed Extensibility Framework(MEF)是.NET平台下的一个扩展性管理框架,它是一系列特性的集合,包括依赖注入(DI)以及Duck Typing等。MEF为开发人员提供了一个工具,让我们可以轻松的对应用程序进行扩展并且对已有的代码产生最小的影响,开发人员在开发过程中根据功能要 求定义一些扩展点,之后扩展人员就可以使用这些扩展点与应用程序交互;同时MEF让应用程序与扩展程序之间不产生直接的依赖,这样也允许在多个具有同样的 扩展需求之间共享扩展程序。进一步了解MEF可以看看TerryLee的文章:使用Managed Extensibility Framework方便的扩展应用程序

      MEF之前放到了CodePlex的时候所使用的协议并不是开源协议,MS-LPL或者叫Microsoft Limited Permissive,这个协议要求代码只能在Windows平台上运行,不能在*unix平台上运行,在这个项目在CodePlex上放出来后,在开发社区,包括Mono之父Miguel De Icaza 对它提出了批评,微软积极听取社区的意见,意识到开源社区的价值,Glenn宣布了将这个项目的协议更改为开源的 MS-PL 协议

      MEF现在采用MS-PL协议和社区的声音和微软员工的努力分不开,以及微软认同开源社区的价值。大家也许已经知道开源项目Castle项目的创始人Hamilton Verissimo,加入了微软,担任微软MEF项目经理,这是它在Msdn的 Hamilton Verissimo blog

      刚刚看到开源运动和MVP,里面有很多回帖,对微软和开源之间存在很大的误解,需要有时间来修正。微软已经改变了 Enterprise Library 4 源代码的许可协议, 以基于开源友好的 Microsoft Public License (Ms-PL) 许可协议发布,可以在Mono下使用Enterprise Library 4.0。微软还在CodePlex上开源的很多项目都将将有利于在Unix上通过Mono重用这些类库,繁荣开源社区。

被阅1241次, 0票MEF 发表评论

介绍Reflexil

Admin 于 2008-10-05 07:08:02 发表.Net

Reflexil是一个.NET程序集编辑器,方便开发人员对.NET程序进行修改;可以作为一个Reflector插件修改程序集的IL并保存到磁盘文件,也可以在自己的.NET程序中调用进行更为灵活的.NET程序集修改。Reflexil使用的Mono.Cecil[作者:Jb Evain ]。

Reflexil是个开源项目,位于http://sourceforge.net/projects/reflexil/ ,作者:Sebastien LEBRETON ,blog:http://sebastien.lebreton.free.fr/blog/,使用GPL License。

下载最新版本

CodeProject上一篇详细介绍文章:Assembly Manipulation and C#/VB.NET Code Injection

被阅1661次, 0票Reflexil Reflector 发表评论

Lucene.Net基本用法

Admin 于 2008-10-04 09:02:02 发表.Net

本文仅记录一些简单的使用方法,供初学者参考。[from:http://www.rainsts.net/article.asp?id=313]

被阅1170次, 0票Lucene.Net 发表评论

.NET Interface(wrapper) of AStyle[uncompleted]

Admin 于 2008-10-02 05:24:55 发表.Net

被阅949次, 0票AStyle 发表评论

Lucene.Net简单应用

Admin 于 2008-10-01 02:24:25 发表.Net

Lucene.Net是一个性能很好的信息检索库(或者叫搜索引擎内核)。Lucene.Net提供一套完整的API供应用程序实现全文索引与精确查询功能。这里只描述最基本的应用:

 1、建立索引

  1. //state the file location of the index 
  2. string indexFileLocation = @"C:\Index";  
  3. Lucene.Net.Store.Directory dir = 
  4.     Lucene.Net.Store.FSDirectory.GetDirectory(indexFileLocation, true); 
  5.  
  6. //create an analyzer to process the text 
  7. Lucene.Net.Analysis.Analyzer analyzer = new 
  8. Lucene.Net.Analysis.Standard.StandardAnalyzer();  
  9.  
  10. //create the index writer with the directory and analyzer defined. 
  11. Lucene.Net.Index.IndexWriter indexWriter = new 
  12. Lucene.Net.Index.IndexWriter(dir, analyzer,  
  13.            /*true to create a new index*/ true);  
  14.  
  15. //create a document, add in a single field 
  16. Lucene.Net.Documents.Document doc = new 
  17. Lucene.Net.Documents.Document(); 
  18.  
  19. Lucene.Net.Documents.Field fldContent =  
  20.   new Lucene.Net.Documents.Field("content",  
  21.   "The quick brown fox jumps over the lazy dog"
  22.   Lucene.Net.Documents.Field.Store.YES,  
  23.   Lucene.Net.Documents.Field.Index.TOKENIZED,  
  24.   Lucene.Net.Documents.Field.TermVector.YES); 
  25.  
  26. doc.Add(fldContent); 
  27.  
  28. //write the document to the index 
  29. indexWriter.AddDocument(doc); 
  30.  
  31. //optimize and close the writer 
  32. indexWriter.Optimize();  
  33. indexWriter.Close(); 

 这里用到了5个主要类:Directory、Analyzer、IndexWriter、Document和Field。通过Directory 实例记录需要存储的索引;Analyzer用于分析目标文本;结合Directory与Analyzer创建IndexWriter实例;结合 Document实例与Field实例保存文档要被IndexWriter存储的内容。然后调用IndexWriter的Optimize方法与 Close方法。
    1、Lucene.Net.Store.Directory  - Directory代表目标索引目录。Lucene.Net中包含了两种实现:FSDirectory与RAMDirectory,分别将索引结果存放于 文件系统与内存。开发人员也可以通过继承Directory来实现自己的存储方法。
    2、Lucene.Net.Analysis.Analyzer - Analyzer用于将文本分割成词语或词组,同时可去除多余的词语(比如英语里的and、a、the等等)。StandardAnalyzer实例化时 可传递要忽略的词语列表,如果传递的参数为空则使用Lucene.Net默认的设置。开发人员可通过继承Analyzer实现自己的文档索引方式。
    3、Lucene.Net.Index.IndexWriter - 用于配合Analyzer将分析结果保存到Directory。
    4、Lucene.Net.Docuemnts.Docuemnt - 用于代表一封EMail、或者一个网页、一篇文章等。
    5、Lucene.Net.Documents.Field - Docement包含一个用于描述文档的Field列表。每个Field包括一个name与相应的value,其中value包含了可用于查询的文本。 Field.Store用于告诉IndexWriter将field的value保存到索引以便检索时取出。此外,Field.Index用于告诉 IndexWriter如何索引当前field,比如Field.Index.TOKENIZED表示将文本拆 分,Field.Index.UNTOKENIZED则相反。

2、在索引中进行查找

  1. //state the file location of the index 
  2. string indexFileLocation = @"C:\Index"
  3. Lucene.Net.Store.Directory dir = 
  4.     Lucene.Net.Store.FSDirectory.GetDirectory(indexFileLocation, true); 
  5.  
  6. //create an index searcher that will perform the search 
  7. Lucene.Net.Search.IndexSearcher searcher = new 
  8. Lucene.Net.Search.IndexSearcher(dir); 
  9.  
  10. //build a query object 
  11. Lucene.Net.Index.Term searchTerm =  
  12.   new Lucene.Net.Index.Term("content""fox"); 
  13. Lucene.Net.Search.Query query = new Lucene.Net.Search.TermQuery(searchTerm); 
  14.  
  15. //execute the query 
  16. Lucene.Net.Search.Hits hits = searcher.Search(query); 
  17.  
  18. //iterate over the results. 
  19. for (int i = 0; i < hits.Length(); i++) 
  20.     Document doc = hits.Doc(i); 
  21.     string contentValue = doc.Get("content"); 
  22.  
  23.     Console.WriteLine(contentValue); 

 涉及的类有:Directory、IndexSearch、Query、Hits、Term。其中Query有多种实现:TermQuery, BooleanQuery, PhraseQuery, PrefixQuery, PhrasePrefixQuery, RangeQuery, FilteredQuery, 及 SpanQuery。Lucene.Net.Search.Hits用于表示查找的结果。

被阅1286次, 0票Lucene.Net 发表评论

使用了Mono.Cecil的一些项目

Admin 于 2008-09-30 11:37:02 发表.Net

开源项目

  • 编译器

  • 代码质量

    • Gendarme : Gendarme is a tool to find problems in programs.
    • Monoxide : Monoxide is an extensible assembly viewer.
  • 开发环境

    • SharpDevelop : 开源的.NET平台IDE,支持C#, VB.NET 及Boo等语言开发。
    • MonoDevelop : 基于GNOME IDE primarily designed for C# and other .NET languages.
    • MonoUML : CIL反向工程插件
    • Reflexil : 提供程序集修改功能的Reflector插件
  • AOP应用

    • AspectDNG : 静态织入器
    • SetPoint : 一个AOP引擎
    • Compose* : Compose* (or: ComposeStar) is a project that aims at enhancing the power of component- and object-based programming.
  • 程序集处理

    • Mono Linker : The linker is a tool one can use to only ship the minimal possible set of functions that a set of programs might require to run as opposed to the full libraries.
    • Mono Merge : 将多个程序集合并成单个程序集。
  • 数据库相关

    • db4o : 面向对象数据库,纯托管代码实现,支持.NET与Mono。
    • Euss : Evaluant Universal Storage Services (EUSS) is an extensible programming model and runtime components for building data aware solutions on the .Net platform.
  • 混淆器

    • Obfuscar : 一个简单的.NET程序混淆器
    • SharpObfuscator : It is a Software Protection tool, designed to help .NET developers efficiently protect their software.
  • 其它

    • mdb : Mono的托管代码调试器。

闭源项目

  • 编译器

    • Mainsoft CIL to Java bytecode compiler
  • 代码质量

  • Knowledge-Based Engineering 

    • Pacelab Suite: Knowledge-based engineering platform for multidisciplinary product modeling, design analysis, verification and optimization 
  • 代码混淆器

被阅1369次, 0票Cecil Mono 发表评论

IronPython 2.0 beta 5 已经发布

Admin 于 2008-09-30 00:02:48 发表.Net

IronPython 2.0 beta 5 已经发布,下载地址:http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=15625。IronPython 2.0 Beta 5是2.0系列的最后一个beta版本,下个版本就是RC版了。也就是说到了下个版本所有API都将固化了。现在也是到学习IronPython 2的时间了。从beta 4发布就有了msi 安装文件,并且带来了python的标准库 ,标准库的许可是以Python Software Foundation license 发布,这也就意味着移值cpython应用会很容易了。

值得注意的是带来了DLR hosting spec 的稳定版本,你可以从这里下载 DLR hosting spec的word 版本 http://compilerlab.members.winisp.net/dlr-spec-hosting.doc

这个版本还有一个最明显的变化的是命名空间作了个重大的修改,把所有的DLR 类型从System移到了Microsoft,原因是http://lists.ironpython.com/pipermail/users-ironpython.com/2008-August/thread.html#8036 许多人把IronPython嵌入到C# (.NET 3.5)项目中。

另外一点是DLR 宿主API不有一个针对Python的默认配置,现在应该用IronPython.Hosting.Python去创建脚本引擎,这样在应用程序中宿主 IronPython就更容易了。IronPython.Hosting.Python有几个辅助方法,以创建一个ScriptRuntime或 ScriptEngine ,并为ScriptRuntime和ScriptEngine增加了一些Python-specific 扩展方法。

  1. using IronPython.Hosting; 
  2.  
  3. ScriptEngine engine = Python.CreateEngine(); 
  4.  
  5. ScriptScope sys = engine.GetSysModule(); 
  6. var platform = sys.GetVariable("platform"); 
  7. Console.WriteLine(platform); 
  8.  
  9. ScriptScope builtins = engine.GetBuiltinModule(); 
  10. var pow = builtins.GetVariable<doubledouble,double>>("pow"); 
  11. Console.WriteLine(pow(2,3)); 
  12.  
  13. ScriptScope clr = engine.GetClrModule(); 
  14. var getPythonType = clr.GetVariable
  15. Console.WriteLine(PythonType.Get__name__(getPythonType(typeof(string)))); 

see also:http://blogs.msdn.com/srivatsn/archive/2008/09/16/hosting-ironpython-made-easier.aspx

被阅1002次, 0票IronPython 发表评论
2 / 7 / 55 | « 1 2 3 4 5 » |
Powered by MiniBoke v2.0.0.8 Build 0828

Copyright © 2008 开源吧!. All rights reserved.

粤ICP备07500939号