虎克的博客

Enthusiasm Biogeography-Biodiversity Informatics-Data Sciences

发表生物学编程和应用程序的期刊

| Comments

您想发表在生物或医学编程方面的工作吗?呵呵,下面这个刊物可以提供你机会哦。

2009-05-08_163602

http://www.scfbm.org/info/about/

   original link:
   <a href='http://Apiaceae.github.io/blog/2009/05/09/%E5%8F%91%E8%A1%A8%E7%94%9F%E7%89%A9%E5%AD%A6%E7%BC%96%E7%A8%8B%E5%92%8C%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E7%9A%84%E6%9C%9F%E5%88%8A/'>http://Apiaceae.github.io/blog/2009/05/09/%E5%8F%91%E8%A1%A8%E7%94%9F%E7%89%A9%E5%AD%A6%E7%BC%96%E7%A8%8B%E5%92%8C%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E7%9A%84%E6%9C%9F%E5%88%8A/</a><br/>
   &nbsp;written by <a href='http://Apiaceae.github.io'>Hooker</a>
   &nbsp;posted at <a href='http://Apiaceae.github.io'>http://Apiaceae.github.io</a>
   </p>

科属种XML文档三级树状图浏览的实现

| Comments

数据库表的结构为三表:科表Family, 属表Genus, 物种表Species

查询生成XML文档的SQL代码:

—两张表链接查询科、属生成XML文件

SELECT Family.FamilyName, Genus.GenusName

FROM Family

JOIN Genus ON Family.FamilyID = Genus.FamilyID

ORDER BY Family.FamilyName, Genus.GenusName

FOR XML AUTO, ROOT(‘Taxon’)

 

 

 

 

—三张表科、属、种关联查询生成XML文件

SELECT  Family.FamilyName,

        Genus.GenusName,

        Species.AbbreviateName

FROM    Family

        INNER JOIN Genus ON Family.FamilyID = Genus.FamilyID

        INNER JOIN Species ON Genus.GenusID = Species.GenusID

        WHERE dbo.Family.FamilyName=‘Apiaceae’

        ORDER BY FamilyName,GenusName,AbbreviateName

FOR     XML AUTO,

            ROOT(‘Taxon’)

所生成的XML文档示例:

?xml version="1.0" encoding="UTF-8"?>

<Taxon>

  <Family FamilyName="Apiaceae">

    <Genus GenusName="Acronema">

      <Species AbbreviateName="Acronema alpinum" />

      <Species AbbreviateName="Acronema astrantiifolium" />

      <Species AbbreviateName="Acronema brevipedicellatum" />

      <Species AbbreviateName="Acronema chienii" />

      <Species AbbreviateName="Acronema chienii var. dissectum" />

      <Species AbbreviateName="Acronema chinense" />

      <Species AbbreviateName="Acronema chinense var. humile" />

      <Species AbbreviateName="Acronema commutatum" />

      <Species AbbreviateName="Acronema edosmioides" />

      <Species AbbreviateName="Acronema forrestii" />

      <Species AbbreviateName="Acronema gracile" />

      <Species AbbreviateName="Acronema graminifolium" />

      <Species AbbreviateName="Acronema handelii" />

      <Species AbbreviateName="Acronema hookeri" />

      <Species AbbreviateName="Acronema hookeri var. graminifolium" />

      <Species AbbreviateName="Acronema minus" />

      <Species AbbreviateName="Acronema muscicola" />

      <Species AbbreviateName="Acronema nervosum" />

      <Species AbbreviateName="Acronema paniculatum" />

      <Species AbbreviateName="Acronema schneideri" />

      <Species AbbreviateName="Acronema sichuanense" />

      <Species XML编程学习笔记(一)
      
    
    
      

| Comments

通过使用DOM: Document Object Model操控XML文档

什么时候使用DOM


Before you go ahead and use DOM for accessing your XML documents, you should understand
the areas to which DOM is best suited and areas where its use should be avoided.
The decision of whether to use DOM is governed by the following core factors:
Read/write access: DOM allows you to read and write the XML document. But do you really
need to change the underlying document?
Memory footprint: DOM loads the entire document in memory. Naturally the memory
footprint of DOM is larger. Are your documents large, say over 100MB?
Type of access: DOM allows you to access any node randomly. This is possible because the
entire document tree is available in memory. Do you need such access? Or is sequential
access sufficient?
Answers to the preceding questions will help you to decide whether to use DOM. To
summarize, DOM is best suited in the following scenarios:
? You want to modify the XML documents, that is, read-only access is not sufficient.
? You want to access various nodes randomly, that is, sequential access is not sufficient.
? You want to process documents that are small in size.
? The memory footprint is not a constraint.

XmlDocument类有三种方式载入XML文档:

  • 指定XML文件的路径或者Url地址;
  • 通过包括XML文件的文件流等流对象;
  • 包括XML文件的内存字符串;

示例代码如下:

   1:  private void button1_Click(object sender, EventArgs e)

   2:          {

   3:              try

   4:              {

   5:                  XmlDocument doc = new XmlDocument();

   6:                  if (radioButton1.Checked)

   7:                  {

   8:                      //用Url方式载入XML文件

   9:                      doc.Load(textBox1.Text);                    

  10:                  }

  11:                  if (radioButton2.Checked)

  12:                  {

  13:                      //用文件流的方式载入XML文件

  14:                      FileStream stream = new FileStream(textBox1.Text, FileMode.Open);

  15:                      doc.Load(stream);

  16:                      stream.Close();

  17:                  }

  18:                  if (radioButton3.Checked)

  19:                  {

  20:                      //用内存中字符串的形式载入XML文件

  21:                      doc.LoadXml(textBox1.Text);

  22:                  }

  23:                  MessageBox.Show("文件成功写入!");

  24:              }

  25:              catch (Exception ex)

  26:              {

  27:                  MessageBox.Show(ex.Message);

  28:                  

  29:              }

  30:          }

导航XML文件中的内容

使用TreeView控件来加载如下的XML文档

示例XML文件:

<?xml version="1.0" encoding="utf-8"?>

<!— This is list of employees —>

<employees>

    <employee employeeid="1">

        <firstname>Nancy</firstname>

        <lastname>Davolio</lastname>

        <homephone>(206) 555-9857</homephone>

        <notes><![CDATA[includes a BA in psychology from Colorado State University in

1970. She also completed "The Art of the Cold Call." Nancy is a member of

Toastmasters International.]]></notes>

   original link:
   <a href='http://Apiaceae.github.io/blog/2009/04/30/XML%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%28%E4%B8%80%29/'>http://Apiaceae.github.io/blog/2009/04/30/XML%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%28%E4%B8%80%29/</a><br/>
   &nbsp;written by <a href='http://Apiaceae.github.io'>Hooker</a>
   &nbsp;posted at <a href='http://Apiaceae.github.io'>http://Apiaceae.github.io</a>
   </p>

XML相关的术语和定义

| Comments

  • DTDs and XML Schemas

用来定义XML文档结构

  • Parsing XML Documents

the software that processes XML documents is called a parser (or XML
processor). XML parsers allow you read, write, and manipulate XML documents. XML parsers
can be classified in two categories depending on how they process XML documents:
? DOM-based parsers (DOM stands for Document Object Model)
? SAX-based parsers (SAX stands for Simple API for XML)

  • XSLT
  • XPath
  • XML Serialization
  • Remoting
  • Web Services
  • XML Documentation

2009-04-29_215914

Technorati 标签: ,
   original link:
   <a href='http://Apiaceae.github.io/blog/2009/04/30/XML%E7%9B%B8%E5%85%B3%E7%9A%84%E6%9C%AF%E8%AF%AD%E5%92%8C%E5%AE%9A%E4%B9%89/'>http://Apiaceae.github.io/blog/2009/04/30/XML%E7%9B%B8%E5%85%B3%E7%9A%84%E6%9C%AF%E8%AF%AD%E5%92%8C%E5%AE%9A%E4%B9%89/</a><br/>
   &nbsp;written by <a href='http://Apiaceae.github.io'>Hooker</a>
   &nbsp;posted at <a href='http://Apiaceae.github.io'>http://Apiaceae.github.io</a>
   </p>

XML为基础的应用系统的优点

| Comments

传统网络应用程序的结构

 

 

XML为基础的应用程序的结构

 

 

  • The application has multiple types of clients. It is not tied only to web browsers
  • There is loose coupling between the client and the processing logic
  • New types of clients can be added at any time without changing the processing logic on the server
  • The data and the presentation logic are neatly separated from each other. Web clients have one set of presentation logic, whereas desktop applications have their own presentation logic
  • Data sharing becomes easy, because the outputted data is in XML format

XML的优点

| Comments

XML Is an Industry Standard


As you learned previously, XML is a W3C recommendation. This means it is an industry standard
governed by a vendor-independent body. History shows that vendor-specific proprietary
standards don’t get massive acceptance in the software industry. This nonacceptance affects
overall cross-platform data sharing and integration. Being an industry standard has helped
XML gain huge acceptance.

XML Is Self-Describing


XML documents are self-describing. Because of markup tags, they are more readable than, say,
comma-separated values (CSV) files.

XML Is Extensible


Markup languages such as HTML have a fixed set of tags and attributes—you cannot add your
own tags. XML, on the other hand, allows you to define your own markup tags.

XML Can Be Processed Easily


Traditionally, the CSV format was a common way to represent and transport data. However, to
process such data, you need to know the exact location of the commas (,) or any other delimiter
used. This makes reading and writing the document difficult. The problem becomes severe
when you are dealing with a number of altogether different and unknown CSV files.
As I said earlier, XML documents can be processed by a piece of software called a parser.
Because XML documents use markup tags, a parser can read them easily. Parsers are discussed
in more detail later in this chapter.

XML Can Be Used to Easily Exchange Data


Integrating cross-platform and cross-vendor applications is always difficult and challenging.
Exchanging data in heterogeneous systems is a key problem in such applications. Using XML
as a data-exchange format makes your life easy. XML is an industry standard, so it has massive
support, and almost all vendors support it in one way or another.

XML Can Be Used to Easily Share Data


The fact that XML is nothing but textual data ensures that it can be shared among heterogeneous
systems. For example, how can a Visual Basic 6 (VB6) application running on a Windows
machine talk with a Java application running on a Unix box? XML is the answer.

XML Can Be Used to Create Specialized Vocabularies


As you already know, XML is an extensible standard. By using XML as a base, you can create
your own vocabularies. Wireless Application Protocol (WAP), Wireless Markup Language
(WML), and Simple Object Access Protocol (SOAP) are some examples of specialized XML
vocabularies.

如何利用UBio的FindIT服务从文本和Word文档中提取拉丁学名

| Comments

   下面两个图是我们经常在Word或文本文档中见到的物种名录最基本的格式

2009-04-28_103612 2009-04-28_103633

将上面这些文件中的名录数据Copy到一个单独的文本文件,然后上传到UBio的名录网络服务网站: http://www.ubio.org/tools/recognize.php

2009-04-28_105013

点击上图中的浏览按钮将文本文件上传,选中文件类型:File Type为Plain Text;然后下面有几个Parsing Algorithm的选项:TaxonFinder(忽略名录中的学名的作者字符串,仅仅通过名称来匹配和检查);Resolve Authors(包括拉丁学名中的作者来检查)。最后点击Submit按钮,返回的结果如下图:

2009-04-28_104041

2009-04-28_104107

2009-04-28_104212

2009-04-28_104234

如上图所示,系统服务通过给拉丁学名标记不同的颜色和积分值来说明这些拉丁学名检查的正确程度。

Beginning ASP.NET 2.0 and Databases学习笔记(一)

| Comments

The services (and corresponding namespaces) offered by these class libraries include the following:

  • System Types (System): Includes definitions for most simple data types, conversion functions between types, some mathematical functions, arrays, and ways to handle exceptions.

  • Input/Output (System.IO): Includes classes to read and write to data streams (for example, output to an external device such as a Pocket PC) and to files on drives.

  • Data Access (System.Data): Includes classes to interact with external data, typically a database. This namespace includes most of ADO.NET, which is used by the ASP.NET 2.0 data controls, and thus is of particular interest to this book.

  • Security (System.Security): Includes the classes to implement the foundations of security, particularly the system of permissions.

  • Data Structures (System.Collections): Includes classes to organize and maintain sets of data within .NET including lists, dictionaries, and hash tables. (Note that the System.Data names-pace is for communicating with sets of external data.)

  • Configuration (System.Configuration): Includes classes to establish configuration settings and to handle errors using the settings.

  • Networking (System.Net): Includes classes to work with networking protocols such as IP and Sockets.

  • Reflection (System.Reflection): Includes classes that allow a program to look at itself to identify its own characteristics, such as specialty data types and the organization of the code.

  • Globalization (System.Globalization): Includes classes that hold culture-specific settings such as syntax of dates and currency.

  • Painting and Drawing (System.Drawing): Includes classes that can interface with the graphical user interface. This namespace includes many classes for specific types of renderings, including Pen, Brush, and Imaging.

  • Tracing and Diagnostics (System.Diagnostics): Includes classes to analyze problems, including the dissection of system processes, process counters, and event logs.

  • Windows (Client) Application Model (System.Windows.Forms): Includes classes that allow implementation of the Windows user interface.

  • Web Application Model (System.Web): Includes classes that provide a programming model for producing Web pages. The Web page code runs on the server and renders HTML to the client’s browser. This class includes over a dozen subclasses that focus on various types of browsers and server services. These are of great interest in this text because System.Web is, essentially, ASP.NET.

Note that the .NET Framework contains two application programming models, one for client applications (System.Windows.Forms) and one for Web-based applications (System.Web).

ASP.NET also introduces Web programming innovations that greatly improve the development model over classic Active Server Pages (ASP):

  • Language-independence: Because ASP.NET is part of the .NET Framework, ASP.NET applications can be constructed in the language of your choice, for example Visual C#, Visual Basic .NET, or J#. Classic ASP (versions 1, 2, and 3), on the other hand, was generally used only with JScript or VBScript pages.

  • Compiled instead of interpreted: Unlike classic ASP, which interprets programming instructions every time the page is requested, ASP.NET dynamically compiles pages on the server into native programming instructions that can be run much, much faster. Frequently, an ASP.NET page will run an order of magnitude faster than the same page written in Classic ASP.

  • Event-driven programming model: In classic ASP, pages are always executed in a top-down linear fashion, and HTML markup is often mixed in with the programming instructions. Anyone with experience in Classic ASP knows that this can make your pages difficult to read, and even more difficult to maintain. ASP.NET introduces an event-driven model that allows you to separate code from markup content and to factor code into meaningful units for handling specific tasks, such as responding to a button click from the client. This VB-like eventing model greatly improves the readability and maintainability of your pages.

  • Server controls: Classic ASP requires you to dynamically construct a page rendering by piecing together HTML fragments in code, which often results in writing the same code over and over again across your applications. (How many times have you constructed a table of data from a database query?) One of the great advancements that ASP.NET brings to Web programming is Microsoft’s encapsulation of code to perform common behavior into server controls that can be easily reused within an application. A server control is created declaratively, just like an HTML tag, but represents a programmable object on the server that can interact with your code and output a custom dynamic HTML rendering. ASP.NET includes over 80 server controls that encapsulate behavior that ranges from standard form elements to complex controls such as grids and menus.

  • Design time improvements to controls (when used with Visual Web Developer): Developers can decrease the time it takes to develop a complex page by using design time interfaces such as the Smart Tasks panels, tag-level navigation bars, and wizards that can set control properties.

A number of data source controls are available for many types of databases and even nonrelational data sources. Although additional controls are already in development by third parties, the following five data source controls ship with ASP.NET 2.0:

  • SqlDataSource control: To connect to the Microsoft SQL Server and other T-SQL databases that have a managed provider

  • AccessDataSource control: To connect to Microsoft Access files (extension of .MDB)

  • ObjectDataSource: To connect to middle-tier business objects

  • XmlDataSource: To connect XML content

  • SiteMapDataSource: To connect XML files in the format of the ASP.NET 2.0 site map (or site data through a custom provider)

Data-bound controls include many that are familiar from ASP.NET 1.x, as well as some that are completely new for ASP.NET 2.0:

  • GridView and DataGrid: For tabular data. GridView is new for version 2, whereas the legacy DataGrid remains largely unchanged for ASP.NET 1.x.

  • DetailsView and FormView: Display data for one record at a time.

  • DataList and Repeater: Display multiple data records in flexible layouts defined by the page programmer.

  • ListBox, DropDownList, BulletedList, CheckBoxList, and RadioButtonList: Display a group of options with the expectation that the user will make a selection.

  • AdRotator: Display an advertisement from a store of advertisements. This control was offered in ASP.NET version 1.x but has been updated to be compatible with data source controls.

  • TreeView and MenuView: Display hierarchical data.

 

Review of Terminology

To round out t

   original link:
   <a href='http://Apiaceae.github.io/blog/2009/04/28/Beginning+ASP.NET+2.0+and+Databases%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%28%E4%B8%80%29/'>http://Apiaceae.github.io/blog/2009/04/28/Beginning+ASP.NET+2.0+and+Databases%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%28%E4%B8%80%29/</a><br/>
   &nbsp;written by <a href='http://Apiaceae.github.io'>Hooker</a>
   &nbsp;posted at <a href='http://Apiaceae.github.io'>http://Apiaceae.github.io</a>
   </p>