1:
Design a product catalogue with products (name, price, description), and n-level and multiple categories and manufacturer (name, logo). Draw normalized table structure with primary & foreign keys and write SQL to retrieve all n-level category products recursively, expected output:
Books – Philosophy – Metaphysics
Books – Philosophy – Confucianism - Mencius
Books – Literature – Lin Yutang
Software – Utilities – File Management2:
Write an ASP.net web site with a contact us form to send email to [email protected]. Use [email protected] as SENDER, get FROM from contact us form. Use local IIS SMPT as SMPT server. The following email header is expected:
Sender: <[email protected]>
Return-Path: <[email protected]>
Received: from iron2.hkstp.org [202.94.235.243] by MAIL.REASONABLES.COM with SMTP;
   Sun, 22 Mar 2009 04:16:05 -0400
Received: from smtp.hkstp.org ([192.168.106.16])
  by iron2.hkstp.org with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Mar 2009 16:16:12 +0800
Received: from ri (mail01.edm.hkstp.org [202.94.235.148])
by smtp.hkstp.org (8.13.4/8.13.4) with ESMTP id n2M8FW4L031832
for <[email protected]>; Sun, 22 Mar 2009 16:16:12 +0800
Date: Sun, 22 Mar 2009 16:16:12 +0800
From: John Smith<[email protected]>
Reply-To:<[email protected]>
To: <[email protected]>
Subject: Realizing Value from IT Investment3:
Write a Windows form application that returns the difference of two given files using Levenshtein distance (edit distance).
A commonly-used bottom-up dynamic programming algorithm for computing the Levenshtein distance involves the use of an (n + 1) × (m + 1) matrix, where n and m are the lengths of the two strings. Here is pseudocode for a function LevenshteinDistance that takes two strings, s of length m, and t of length n, and computes the Levenshtein distance between them:
int LevenshteinDistance(char s[1..m], char t[1..n])
   // d is a table with m+1 rows and n+1 columns
   declare int d[0..m, 0..n]
 
   for i from 0 to m
       d[i, 0] := i
   for j from 1 to n
       d[0, j] := j
 
   for i from 1 to m
       for j from 1 to n
           if s[i] = t[j] then cost := 0
                          else cost := 1
           d[i, j] := minimum(
                                d[i-1, j] + 1,     // deletion
                                d[i, j-1] + 1,     // insertion
                                d[i-1, j-1] + cost   // substitution
                            )
 
   return d[m, n]
Two examples of the resulting matrix (the minimum steps to be taken are highlighted):
k i t t e n
0 1 2 3 4 5 6
s 1 1 2 3 4 5 6
i 2 2 1 2 3 4 5
t 3 3 2 1 2 3 4
t 4 4 3 2 1 2 3
i 5 5 4 3 2 2 3
n 6 6 5 4 3 3 2
g 7 7 6 5 4 4 3
S a t u r d a y
0 1 2 3 4 5 6 7 8
S 1 0 1 2 3 4 5 6 7
u 2 1 1 2 2 3 4 5 6
n 3 2 2 2 3 3 4 5 6
d 4 3 3 3 3 4 3 4 5
a 5 4 3 4 4 4 4 3 4
y 6 5 4 4 5 5 5 4 3
The invariant maintained throughout the algorithm is that we can transform the initial segment s[1..i] into t[1..j] using a minimum of d[i,j] operations. At the end, the bottom-right element of the array contains the answer.

解决方案 »

  1.   

    好像都是课后作业嘛
    第二个还需要SMTP,需配置IIS才行,光代码也实现发不了邮件
      

  2.   

    设计一个产品的产品目录(名称,价格,描述),和n级和多个类别和制造商(名称,标识)。抽奖及外键与主表的结构和编写标准化的SQL检索所有n级递归类产品,预期的输出:
    图书 - 哲学 - 形而上学
    图书 - 哲学 - 儒家 - 孟子
    图书 - 文学 - 林语堂
    软件 - 工具 - 文件管理2:
    写一ASP.net与我们联系表格发送电子邮件至[email protected]网站。使用发件人[email protected],从我们接触到的形式。使用本地IIS SMPT作为SMPT服务器。下面的电子邮件标题预计:
    发件人:<[email protected]>
    返回路径:<[email protected]>
    收稿:从iron2.hkstp.org由MAIL.REASONABLES.COM与SMTP [202.94.235.243];
      太阳,2009年3月22日4时16分05秒-0400
    收稿:从smtp.hkstp.org([192.168.106.16])
      通过与ESMTP/TLS/DHE-RSA-AES256-SHA iron2.hkstp.org; 2009年3月22日16时16分12秒0800
    收稿:从里(mail01.edm.hkstp.org [202.94.235.148])
    由smtp.hkstp.org(8.13.4/8.13.4)与ESMTP编号n2M8FW4L031832
    为<[email protected]>;孙,2009年3月22日16点16分12秒0800
    日期:Sun,2009年3月22日十六点16分12秒0800
    来自:约翰史密斯<[email protected]>
    回复:<[email protected]>
    致:<[email protected]>
    主题:实现从IT价值投资3:
    写一个Windows窗体应用程序,返回两个指定使用Levenshtein距离(编辑距离)文件的差异。
    一个常用的自下而上的动态规划计算Levenshtein距离算法涉及到一个(n使用1)×(1米)矩阵,其中n和m是两个字符串的长度。下面是一个函数LevenshteinDistance,它有两个字符串伪,长度米s,以及长度为n吨,并计算它们之间的Levenshtein距离:
    诠释LevenshteinDistance(焦炭真相[1 ..米],焦炭吨[1 .. ŋ])