# it-e-42 Algorithm Design and Implementation

This course introduces a set of fundamental design principles and problem-solving techniques
for the construction and implementation of computer algorithms. Problem solutions are developed
in a design language such as Pseudocode and then coded in a high-level structured programming
language. (Consult the Computer Science Department for the language currently in use.) Topics
such as problem specification, top-down design with stepwise refinement, standard data types,
control structures, subprograms, modular design, and parameter passing are presented through a
study of specific example algorithms. Style, documentation, solution robustness, and conformance
with specifications are emphasized throughout.
Prerequisites: High school algebra I & II.

The purpose of this course is to present a coherent set of tools and techniques for the
development of computer solutions to simple problems in data manipulation and report
generation. Upon completion of the course, a student should be able to: analyze a problem
statement for completeness and clarity; use the method of top-down, modular, structured design
to develop a hierarchy chart (structure chart) and a set of Pseudocode modules for a problem
solution; convert this solution into source code in the designated high-level language in
accordance with a well-defined set of style rules; debug and test the program; and provide clear
documentation for the result.

the "problem-solving universe"
operational definition of computer (specifically, electronic digital stored-program
computer)
components of a typical computer
fundamental computer capabilities (read, write, store, compute, compare)
formulating precise specifications for a problem and its solution
preconditions and post conditions

specification of user requirements in measurable terms
tools for algorithm development
algorithm design languages (Pseudocode, flowcharts)
top-down design and stepwise refinement (including contrast with bottom-up
design)
structure charts (hierarchy charts)
subprograms (procedures, functions) and the modular design of algorithms
standard control structures:
sequence, decision, loop (pre-test, post-test, count- controlled), module
nested control structures
decision tables, decision trees
identifiers, variables, constants, expressions
typing and structuring of data
standard data types:
numeric (integer vs. real)
character, character string
boolean
file type (for sequential text files)
record types
array types
primitive data structures:
simple variables
record variables
arrays
character strings
some common algorithmic techniques
file operations (create, open, close, read, write)
sequential processing of data records
end-of-file testing
report generation (headers, footers, page breaks, simple control breaks)

use of counters and accumulators
numeric computations (evaluating formulas, generating sequences, printing
tables)
exchanging (swapping) data values
complex decisions and branching
testing and validating data
use of 'flag' variables
finding maximum and minimum values
array manipulations (filling, summing, searching, printing)
uses of record variables
communication between modules:
formal parameters, arguments, parameter passing, inheritance
coding algorithms in a high-level language
overall structure of a program (including stylistic layout)
internal and external documentation
nesting of procedures and functions
declarations, formal parameter lists
file variables and file operations
input/output (keyboard and file)
translation of standard control structures
arithmetic expressions
assignment statements, type compatibility
boolean expressions
implementing an algorithm on the computer
transcribing a pseudocode algorithm into a programming language
log-in procedures, customizing the account
creating a source file
compiling the program; compilation errors
generation of test data
executing the program; run-time (execution) errors

1, stepwise  ['step,waiz]

2, clarity  ['klæriti]
n. 清楚,透明

3, refinement  [ri'fainmənt]
n. 精致,高尚,精巧

4, arithmetic  [ə'riθmətik, ,æriθ'metik]
n. 算术，算法

Continue reading it-e-42 Algorithm Design and Implementation

# it-e-41 Some Rules for Well-drawn Flow Charts

Well-drawn flow charts are easy to read. Here are a few rules for well-drawn flow charts:
Every flowchart has a START symbol and a STOP symbol.
The flow of sequence is generally from the top of the page to the bottom of the page. This
can vary with loops which need to flow back to an entry point.
Use arrow-heads on connectors where flow direction may not be obvious.
There is only one flow chart per page.
A page should have a page number and a title.
A flow chart on one page should not break and jump to another page.
A flow chart should have no more than around 15 symbols (not including START and
STOP).

Continue reading it-e-41 Some Rules for Well-drawn Flow Charts

# web 工具 资源

http://pixelcurse.com

http://www.freecsstemplates.org/

http://templates.arcsin.se/

http://www.stylishtemplate.com/demos/web-template-4426/

http://www.nuviotemplates.com/preview.php?template=simplify-02

http://demo.tutorialzine.com/freebies/free-xhtml-css3-website-template/template.html

http://cssremix.com/

http://www.gbin1.com/tools/design/20130422-free-flat-ui-design/

http://www.sswowo.com/getcssimages/

http://jsfiddle.net/

http://jsbin.com

http://cssdesk.com/

https://app.asana.com

http://colorschemedesigner.com/

http://www.techfrom.com/2879.html

http://www.softicons.com/

1、中文图标搜索 http://www.iconpng.com/

5、提供搜索http://www.icones.pro/

6、国外图标http://weloveicons.com/

http://blog.bingo929.com/cheat-sheets-for-web-develop.html

jquery cheetsheet http://www.futurecolors.ru/jquery/

php cheetsheet http://www.cheatography.com/davechild/cheat-sheets/php/

http://www.mezzoblue.com/zengarden/resources/

http://www.csszengarden.com

css3

http://www.iteye.com/news/25360

MarkMan

– 马克鳗 可以很方便的为设计稿添加标记，双击、滚轮、拖动… http://www.getmarkman.com/

# html标记判断IE版本的方法

1. <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
2. <!--[if IE]> 所有的IE可识别 <![endif]-->
3. <!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->
4. <!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->
5. <!--[if gt IE 5.0]> IE5.0以及IE5.0以上版本都可以识别 <![endif]-->
6. <!--[if IE 6]> 仅IE6可识别 <![endif]-->
7. <!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![endif]-->
8. <!--[if gte IE 6]> IE6以及IE6以上版本可识别 <![endif]-->
9. <!--[if IE 7]> 仅IE7可识别 <![endif]-->
10. <!--[if lt IE 7]> IE7以及IE7以下版本可识别 <![endif]-->
11. <!--[if gte IE 7]> IE7以及IE7以上版本可识别 <![endif]—>

# base64数据和@font-face

base64：

div {
width:100px;
height:100px;
background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAQMAAABKLAcXAAAABlBMVEX/AAAAAP9sof2OAAAAIUlEQVR4nGNgGAWjgFTw//8HJF4Dg8CI5aGGxCgYBcQBAMULD/2Zt2wmAAAAAElFTkSuQmCC);
}

<img src="data:image/png;base64,
//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
g9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC"/>

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAQMAAABKLAcXAAAABlBMVEX/AAAAAP9sof2OAAAAIUlEQVR4nGNgGAWjgFTw//8HJF4Dg8CI5aGGxCgYBcQBAMULD/2Zt2wmAAAAAElFTkSuQmCC

1:放在css里面很容易做到缓存效果，大部分应用都是基于这个考虑。

2:css可使用gzip压缩。

3:减少请求次数。

1：ie8以上才支持base64编码。要ie7以下支持，也不是没办法，看这篇文章

2:这样的方式不好重用。

3：放在css里面的话会造成大数据量，css没下载完之前，其他样式也没显示出来。

4:很麻烦。

@font-face

@font-face {
font-family: Delicious;
src: url('Delicious-Roman.otf');
}

FF3.5以上以及其他浏览器都支持这种写法，但是在格式上有区别

ie支持.eot (Embedded OpenType) 和.ote

@font-face{
font-family: Gentium;
src: url("data:font/
truetype;base64,…");
}

# HTML5 Quick Learning Guide

HTML5 Quick Learning Guide
Just what you need to know to quickly
move from HTML / XHTML to HTML5
Brought to you by
http://freehtml5templates.com/
HTML5 syntax is compatible with both HTML4 and XHTML1. Want to close
empty elements with a slash? Go for it. Rather not? Then don't. Want to use
lower case? Upper case? Take your pick. In other words, you really don't have
to change the way you handle these things, so don't worry, ok?
HTML5 doctype is much simpler:
New way:
<!doctype html>
Old ways:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
or
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Meta charset tag is much simpler:
New way:
<meta charset="UTF-8">
Old way:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-
8" />
Divs are now used for styling rather than structure; HTML5 includes several
new structural elements that help define parts of the document. Let's take a
look at the main new structural elements that you'll probably use right away.
(Note that included in the head is an HTML5 shiv that allows us to style elements in IE,
and a basic CSS style is also included so we can help browsers that aren't caught up yet to
render the new block-level elements as block-level elements. For now, it's easiest just to
automatically include them. Understanding why can come later.)
Main Structural Elements You'll Use Most Often in HTML5
<nav>
<section>
<article>
<aside>
<footer>
Although these sound like “positions” in a document, and very often will be
used in that way, they really are about grouping and not positioning. You might
have 3 <sections> in a page, with each <section> having its own <header> and
<footer> for instance. (Note that these elements – like classes – can be used
more than once on a page).
But to keep things simple, for this document's purpose, let's just think of a
content section that contains a couple of articles, a sidebar, and a footer.
In HTML4 or XHTML, you probably would have used divs, classes and ids to
group each of those areas. You can and should still use divs, classes and ids for
styling reasons, but they may no longer be as necessary as before for
structural purposes. Some documents may be able to get by without them
completely, while most will probably still need them for styling. But again, for
the purposes of learning the quick facts to create a simple HTML5 document,
let's keep this really basic.
Here's a simple way to code a very basic document that contains a top header,
a menu for navigation, a content section that contains a couple of articles, a
sidebar, and a footer in HTML5.
<!doctype html>
<html>
<meta charset="utf-8">
<title>Very Basic Document</title>
<style>header, footer, section, aside, nav, article {display: block;}</style>
<body>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
</ul>
</nav>
<h1><a href="#">Very Basic Document</a></h1>
<h2>A tag line might go here</h2>
<section>
<article>
<h3><a href="#">First Article Title</a></h3>
<img src="images/flower.jpg" alt="flower">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. </p>
</article>
<article>
<h3><a href="#">Second Article Title</a></h3>
<img src="images/tree.jpg" alt="tree">
<p>Praesent libero. Sed cursus ante dapibus diam.</p>
</article>
</section>
<aside>
<h4>Connect With Us</h4>
<ul>
</ul>
</aside>
<footer>
</footer>
</body>
</html>
As you can see, the structure is fairly simple, and you can style these new
structural elements in the CSS. However, because you may have some of these
structural elements within different groupings on a page (such as several
sections having different headers and footers), you may want to style each
differently. In that case, you can still assign ids and classes just as you would
in HTML4 or XHTML.
The point of the structural elements is to designate structure after all;
presentation is dealt with in the CSS in whatever manner works best for you,
using ids and classes.
So what are the actual definitions of these new structural elements?
you'd usually wrap in a H1, H2, Hx, etc)
<nav> represents a section of the document intended for navigation. (Like a
<section> represents a generic document or application section. It can be
used together with the h1, h2, h3, h4, h5, and h6 elements to indicate the
document structure. (Just a logical grouping such as a content section)
<article> represents an independent piece of content of a document, such as
a blog entry or newspaper article. (Independent is the key word here. If the
piece of content could make sense plucked out of this document and placed
somewhere else, it's probably an article)
<aside> represents a piece of content that is only slightly related to the rest
of the page. (Usually a sidebar, but could be another type of content that
<footer> represents a footer for a section and can contain information about
the author, copyright information, et cetera. (You know, like... a footer)
Of course, HTML5 comes with other interesting elements such as the video and
audio elements, plus new and changed elements and attributes, but all of
those belong in a separate cheat sheet. This one is to get you up and running
fast, so there you have it. Just the basics that will let you quickly move from
HTML4 or XHTML to HTML5 right now!
If you want to delve into the finer points, I recommend starting with the W3C
draft, entitled HTML5 differences from HTML4 located at
http://dev.w3.org/html5/html4-differences/
This document created by http://freehtml5templates.com/
Feel free to share this document with others, keeping in mind that
3.0/us/).
Share it; don't sell it. Share it; don't change it.
Pretty simple, yes? :)

<!doctype html>

<meta charset="UTF-8">

<nav>导航
<section>文档部分，例如第一部分，第二部分
<article>文章，数据应该在这部分显示（Independent数据独立性）
<aside>边，预祝内容无关的元素
<footer>页脚

Continue reading HTML5 Quick Learning Guide

# it-e-40 Algorithms and Flowcharts

The computer scientist Niklaus Wirth stated that:
Programs = Algorithms + Data
The algorithm is part of the blueprint or plan for the computer program; an algorithm is:
"An effective procedure for solving a problem in a finite number of steps."
It is effective, which means that an answer is found and it finishes, that is it has a finite
number of steps. A well-designed algorithm will always provide an answer, and it may not be the
A well-designed algorithm is also guaranteed to terminate.
The key features of an algorithm are:
Sequence (also known as Process),
Decision (also known as Selection)
Repetition (also known as Iteration or Looping)
In 1964 the mathematicians Corrado Bohm and Guiseppe Jacopini demonstrated that any
algorithm can be stated using sequence, decision and repetition. The work of Bohm and Jacopini
was of great importance since it eventually led to the disciplines of structured program design
that are much used today.
Sequence means that each step or process in the algorithm is executed in the specified order.
In an algorithm each process must be in the correct place, otherwise the algorithm will most
probably fail.
The Decision constructsIf ... then, If ... then ... else ...
In algorithms the outcome of a decision is either true or false, and there is no in between.
The outcome of the decision is based on some condition that can only result in a true or false
value[1].
The decision takes the form: if proposition then process
A proposition in this sense is a statement, which can only be true or false. It is either true
that today is Wednesday or false that today is Wednesday. It can't be both true and false. If the
proposition is true then the process, which follows the then, is executed.
The decision can also be stated as:
if proposition
then process1
else process2
This is the if ... then ... else ... form of the decision. This means that if the proposition is true

then execute process1 else or otherwise execute process2.
The first form of the decision if proposition then process has a null else, that is, there is no
else.
The Repetition constructsRepeat and While
Repetition takes two forms, the Repeat loop and the While loop.
The repeat loop is used to iterate or repeat a process or sequence of processes until some
condition becomes true. It has the general form:
Repeat
Process1
Process2
ProcessN
Until proposition
The repeat loop does some processing before testing the state of the proposition.
The while loop is used to iterate or repeat a process or sequence of processes while some
condition becomes true. It has the general form:
While proposition
Process1
Process2
ProcessN
The while loop tests the state of the proposition first.
There are four different ways of stating algorithms: Step-Form, Pseudocode, Flowchart, and
Nassi-Schneiderman.
The first two are written forms. The written form is just normal language.[2]A problem with
human language is that it can seem to be imprecise. In terms of meaning, what I write may not be
the same as what you read.[3]Pseudocode is also human language but tends toward more precision
by using a limited vocabulary.
The last two are graphically-oriented, that is they use symbols and language to represent
sequence, decision and repetition.
Flow charts are a graphical method of designing programs and once
the rules are learned they are very easy to draw. A well-drawn flow chart
is also very easy to read.
The major symbols are the DECISION (also known as selection)
and the SEQUENCE (or process) symbols. The START and STOP symbols are called the
terminals. The SUBPROCESS symbol is a variation on the sequence symbol.

1, imprecise  [,impri'sais]

Continue reading it-e-40 Algorithms and Flowcharts

# 使用jni调用unrar

rar的官方网站 上有使用各种语言调用unrar.dll解压缩的例子，但是没有使用java的jni的例子。

7月28号更新了,原因是有人实验有的rar文件使用junrar报异常，但是winrar是可以打开的，我检查了这个文件

“File is not valid RAR archive” 我也做不了别的，只是将这个异常反映到java异常信息中。

jniunrar下载链接

unrar with jni, a java library

# it-e-39 Database New Horizon

The modern database era began in 1970, when E.F. Codd published his paper "A Relational
Model of Data for Large Shared Data Banks." His ideas enabled the logical manipulation of data
to be independent of its physical location, greatly simplifying the work of application developers.
Now we are poised for another leap forward. Databases will scale to gargantuan proportions,
span multiple locations and maintain information in heterogeneous formats. And they will be
autonomous and self-tuning. The major database vendors are pursuing these goals in different
ways.
Thirty years ago, IBM researcher Selinger invented "cost-based" query optimization, by
which searches against relational databases such as IBM's DB2 minimized computer resources by
finding the most efficient access methods and paths. Now Selinger is leading an effort at IBM
called Leo for Learning Optimizer that she says will push DB2 optimization into a new
realm.
Rather than optimizing a query once, when it's compiled, Leo will watch production queries
as they run and fine-tune them as it learns about data relationships and user needs. For example,
Leo would come to realize that a ZIP code can be associated with only one state, or that a Camry
is made only by Toyota, even if those rules aren't specified in advance.
Selinger says Leo will be most helpful in large and complex databases, and in databases
where interdata relationships exist but aren't explicitly declared by database designers. Leo is
likely to be included in commercial releases of DB2 in about three years, she says.
Whether the future of databases is the traditional, relational and SQL model with XML
technologies incorporated into it or a new XML-based model is a matter of debate. XML will
become the dominant format for data interchange with its flexibility and ability to provide
self-description, according to Don Chamberlin, a database technology researcher at IBM.
Relational databeses, he said, will be fitted with front ends to support XML and process
queries based on the XQuery standard. XML will become the "lingua franca" for exchange of
data. "We'll also see some large relational systems adapt to XML as a native format,"Chamberlin
said.Technologists are in the early stages of development of XML technologies. SQL will not go
away, but there are new data formats for which it just was not designed, he said.
Sun's Rick Cattell, a distinguished engineer at the company, had a less dominant outlook for
XML, saying very few people are going to store XQuery data in an XML format."I think the
momentum behind relational databases is insurmountable,"Cattell said, adding that he was
drawing on his experience with object-oriented databases, which were unable to unseat relational
databases in enterprise IT shops. Developers, Cattell said, will need tools to convert relational
data to XML and vice versa.
Currently, performance on the Web is hindered because of translations between Java and
XML data formats. Eventually, an extension of XQuery will replace both Java and SQL

according to some experts.
The next step in the evolution of databases is to provide a more powerful way to query them
than what is being done on search sites such as Google today.
Experts are expecting tuple space technology, which is intended to make it easier to store and
fetch data by recognizing patterns. And in-memory databases technology is a "no-brainer,"but there is
not enough memory available yet to accommodate it.
Microsoft Corp. says users will never be persuaded to dump everything e-mail, documents,
audio/video, pictures, spreadsheets and so on into one gigantic database. Therefore, the
software vendor is developing technology that will allow a user to seamlessly reach across
multiple, heterogeneous data stores with a single query.
Microsoft's Unified Data project involves three steps. First, the company will devise
"schema" based on XML that define data types. Then it will develop methods for relating
different data types to each other and finally develop a common query mechanism for distributed
databases. For example, I want to search for a document that references Microsoft, and the
document "tells" the query that there's also a media file in another place that references
Microsoft.
The technology will appear in 18 months in SQL Server. It will be added to other Microsoft
products in ensuing years.
Oracle Corp. says its customers are moving toward data stores of huge size and complexity,
spread over multiple locations. The company says its products will not only evolve to handle
those kinds of jobs, but will also do them extraordinarily well. "Over the next couple of releases,
we'll see essentially fully autonomous databases," says Robert Shimp, vice president of database
marketing.
Oracle also wants to facilitate collaboration for people in different companies with widely
varying information types."What doesn't exist today is the underlying infrastructure, or plumbing,
that's capable of managing all these diverse types of data,"Shimp says."What you need is the
ability to link all these clustered databases around the globe into a single, unified view for the
individual user."
Elsewhere, researchers are finding that the best design for some database applications isn't a
traditional database at all, but rather data streams. Researchers at Stanford University are working
on ways that continuous flows of information—such as Web site hits, stock trades or
telecommunications traffic—can be passed through queries and then archived or discarded. A
query might, for example, be written to look continuously for suspicious patterns in network
traffic and then spit out an alert.
The problem in handling some kinds of problems with a traditional database management
system is one of timeliness, says Jennifer Widom, a computer science professor at Stanford. "If
you want to put a stream of data into a DBMS, you have to at some point stop, create a load file,
load the data and then query it,"she says. "Data stream queries are continuous; they just sit there
and give you new answers automatically."

Widom and her colleagues are developing algorithms for stream queries, and she says her
group will develop a comprehensive data stream management system. A prototype of such a
system will take a number of years to develop, and the underlying technology will then be either
licensed or offered as freeware, she says.

1, poise  [pɔiz]
n. 平衡,姿势,镇静
v. 使...平衡,保持平衡,保持...姿势

2, leap  [li:p]
n. 跳跃,剧增,急变
v. 跳跃,跃过,猛冲
a. 闰年的
3, gargantuan  [gɑ:'gæntjuən]
a. 巨大的,庞大的
4, proportions  [prə'pɔ:ʃəns]
n. 比例；大小（proportion的复数形式）
5, insurmountable  [,insə'mauntəbl]
6, momentum  [məu'mentəm]
n. 势头；[物] 动量；动力；冲力
7, unseat  [,ʌn'si:t]
vt. 罢免；剥夺…的席位；使失去资格；使从座位上（或马背上）摔下
vt. 说服，劝说；使某人相信；劝某人做（不做）某事
vi. 说服；被说服
9, gigantic  [dʒai'gæntik]
a. 巨大的
10, heterogeneous  [,hetərəu'dʒi:njəs]
11, ensue  [in'sju:]
vi. 跟着发生，接着发生；继起
vt. 追求
12, facilitate  [fə'siliteit]
vt. 促进；帮助；使容易
13, diverse  [dai'və:s, di-]
Powered by Hydejack v6.6.1