# it-e-07 embedded system

An "embedded system" is a special-purpose computer system, which is completely encapsulated by the device it controls. An embedded system has specific requirements and performs pre-defined tasks, unlike a general-purpose personal computer.
Characteristics

Two major areas of differences are cost and power consumption. Since many embedded systems are produced in the tens of thousands to millions of units range,reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs. The slowness is not just clock's speed. The wholearchitecture of the computer is often intentionally simplified to lower costs. For example,embedded systems often use peripheralscontrolled by synchronous serial interfaces, which are ten to hundreds of times slower than comparable peripherals used in PCs. Programs on anembedded system often must run with real-time constraints with limited hardware resources:often there is no disk drive, operating system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard and screen. Firmwareis the name for software that is embedded in hardware devices, e.g. in one or more ROM Flash memory IC chips. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods of time, sometimes measured in years.
Firmware is usually developed and tested to much stricter requirements than is general purposesoftware (which can usually be easily restarted if a problem occurs). In addition, because the embedded system may be outside the reach of humans (down an oil well borehole, launched intoouter space, etc.), embedded firmware must usually be able to self-restart even if some sort of catastrophic data corruption has taken place. This last feature often requires external hardware assistance such as a watchdog timer that can automatically restart the system in the event of a software failure.

Platform

There are many different CPU architectures used in embedded designs. This in contrast to the desktop computer market, which as of this writing (2003) is limited to just a few competing architectures, mainly the Intel/AMD x86, and the Apple/Motorola/IBM PowerPC, used in the Apple Macintosh. One common configuration for embedded systems is the system on a chip, an application-specific integrated circuit, for which the CPU was purchased as intellectual property to add to the IC's design.

# 读书笔记:Effective Java, Second Edition-5章

Item 23: Don’t use raw types in new code

raw type指没有指明类型的如List

List<String> 是 List的子类 但不是 List<Object>的子类，ArrayList<Object>才是List<Object>的子类。

List.class,String[].class, and int.class 合法,但 List<String>.class and List<?>.class不合法。

instance操作符只能使用Raw Type  (o instanceof Set) √ , (o instanceof Set<?>) ×

﻿Set<Object> is a parameterized type representing a set that can contain objects of  any type,

Set<?> is a wildcard type representing a set that can contain only  objects of some unknown type, 无法使用

Set is a raw type, which opts out of the generic type system.

The first two are safe and the last is not.

Term
Example

Parameterized type
List<String>

Actual type parameter
String

Generic type
List<E>

Formal type parameter
E

Unbounded wildcard type
List<?>

Raw type
List

Bounded type parameter
<E extends Number>

Recursive type bound
<T extends Comparable<T>>

Bounded wildcard type
List<? extends Number>

Generic method
static <E> List<E> asList(E[] a)

Type token
String.class

Item 24: Eliminate unchecked warnings

Item 25: Prefer lists to arrays

Item 26: Favor generic types

1:字段类型是T[],使用Object数组转换

private E[] elements;

// The elements array will contain only E instances from push(E).
// This is sufficient to ensure type safety, but the runtime
// type of the array won't be E[]; it will always be Object[]!
@SuppressWarnings("unchecked")
public Stack() {
elements = (E[]) new Object[DEFAULT_INITIAL_CAPACITY];
}

2:字段类型是Object数组,每次取数组元素时转换

// Appropriate suppression of unchecked warning
public E pop() {
if (size==0)
throw new EmptyStackException();
// push requires elements to be of type E, so cast is correct
@SuppressWarnings("unchecked")

E result = (E) elements[--size];
elements[size] = null; // Eliminate obsolete reference
return result;
}

Item 27: Favor generic methods

Item 28: Use bounded wildcards to increase API flexibility

PECS 原则:if a parameterized type represents a T producer, use <? extendsT>;if it represents a T consumer, use <? superT>.

// Wildcard type for parameter that serves as an E consumer
public void popAll(Collection<? super E> dst) {
while (!isEmpty())
}

// Wildcard type for parameter that serves as an E producer
public void pushAll(Iterable<? extends E> src) {
for (E e : src)
push(e);
}

Item 29: Consider typesafe heterogeneous containers

// Typesafe heterogeneous container pattern - implementation
public class Favorites {
private Map<Class<?>, Object> favorites = new HashMap<Class<?>, Object>(); //以Class<?>作为键达到多种类型的目的。注意Class<?>这个特殊的形式参照Item23.
public <T> void putFavorite(Class<T> type, T instance) {
if (type == null)
throw new NullPointerException("Type is null");
favorites.put(type, instance);
}
public <T> T getFavorite(Class<T> type) {
return type.cast(favorites.get(type));//将Object安全的转为了绑定类型

Continue reading 读书笔记:Effective Java, Second Edition-5章

# 【转】面试官心得

1.自我介绍

其实我想要的不是姓名，年龄，工作经历这些，拜托这些简历上都有我不是文盲，我是想知道你的优点，特长这些信息，你可以很自豪的告诉我你擅长数据库，解决过****等无数难题就可以了。

2.我们公司会有自己的一套框架，你是否很快速的接受它，如果不能适应改怎么办

我想知道的是你的学习能力和适应能力，并且如果你对框架有你独到的见解，我会加分的

3.能不能够加班，或者出差，如果加班没有工资的话是否能接受

这个我想要知道的是，一是否能吃苦耐劳，与公司同进退，二是看你的应变能力，我不想听简单的能与不能，其实是想看你的应变，你能否处理好这件事，三如果你什么情况都能接受，我也不会要你的，记住什么都能接受是对自己水平的不自信。

4.是否有职业规划

如果没有这个的话，我会认为你不想在在这个行业干出一些成绩，只想混日子。

5.继续上面的问题，如果你选择技术方面发展，我会问，怎么才算是合格的程序员，什么样的代码是好代码，如果选择管理方面发展，我会问，你过去开发程序的过程是怎么样的。

这个纯粹是了解下你目前的能力，我觉得这个已经大概可以展现你部分的能力了。

剩下还有5到技术问题，这个就不方便透露了，但是我会分为三个级别，初级，你答上来我会认为你合格，中级我会为你加分，高级我会为你加薪就是这么简单。

希望会对大家有所帮助。

# openfire 插件开发

JiveGlobals.getHomeDirectory()

Log.getLogDirectory()

Plugin Structure

myplugin/
|- plugin.xml      <- Plugin definition file
|- changelog.html  <- Optional changelog file for plugin
|- logo_small.gif  <- Optional small (16x16) icon associated with the plugin (can also be a .png file)
|- logo_large.gif  <- Optional large (32x32) icon associated with the plugin (can also be a .png file)
|- classes/        <- Resources your plugin needs (i.e., a properties file)
|- lib/            <- Libraries your plugin needs
|- src/
|- database    <- Optional database scripts for your plugin
|- java        <- Java source code for your plugin
|   |- com
|       |- mycompany
|           |- *.java
|- web
|- images/    <- Any images your JSP pages need (optional)
|- WEB-INF
|- web.xml    <- Optional file where custom servlets can be registered

ant plugin -Dplugin=myplugin

openfire提供离线消息发送，但是不提供历史消息存储。因此需要写插件来保存历史记录。

# [转csdn文章]学习HTML5不可错过的12家国外网站(组图)

### 学习HTML5不可错过的12家国外网站(组图)

2011-04-21 23:43 | 25977次阅读 | 来源：CSDN编译 【已有60条评论】发表评论

[CSDN编译]HTML5是近十年来Web开发标准最巨大的飞跃。和以前的版本不同，HTML5并非仅仅用来表示Web内容，它的新使命是将 Web带入一个成熟的应用平台，在HTML5平台上，视频、音频、图象、动画以及同电脑的交互都被标准化。对于广大开发人员和设计者，究竟该如何入手 HTML5及获取相关的国外最新资源。以下是广大HTML5技术爱好者学习和参考相关技术不可错过的12家外网，它们或是采用HTML5技术开发出的案例，或是HTML5相关的学习资源，供国内的开发人员参阅。

(1)HTML5 Labs

HTML5实验室，这里有HTML5标准、范型和应用规范的最新内容。

(2)HTML5 – Wikipedia

(3)Apple – HTML5

(5)Dive into HTML5 by Mark Pilgrim

(6)HTML 5 Cheat Sheet (PDF) – Smashing Magazine(关于HTML5资料的PDF文档精华 )

(7)HTML5 Rocks(需翻墙)

HTML5 Rocks的内容包括了HTML5的演示、视频、如何使用HTML5的API、基础进阶教程等等。

(8)World’s Biggest PacMan

(9)HTML5 Gallery

(10)HTML5 Demos

(11)W3Schools HTML5

# it-e-08 Real-Time Operating System

A "Real-Time Operating System" or "RTOS" is an operating system that has been
developed for real-time applications. Typically used for embedded applications. Note that this type of operating system does not necessarily have high throughput — the specialized scheduling algorithm and a high clock-interrupt rate can both interfere with throughput. An early example of a large-scale real-time operating system was the so-called "control program" developed by American Airlines and IBM for the Sabre Airline Reservations System. Debate exists about what actually constitutes real-time.
Scheduling

Continue reading it-e-08 Real-Time Operating System

# 【转】webqq实现

2010-12-09 11:37    总点击量：160     总评论数：2

谁说腾讯不创新？WEB2.QQ就是个挺强悍的反击。咋一看到时我不禁摸摸头，难道这就是传说中的QQ OS？

【总体体验】

【架构鸟瞰】跨平台：

class= “javascriptEnabled win win6_1 firefox firefox3_6 gecko gecko20100914_0 flash flash10_0″

JavaScript：

web2.qq用的是jQuery，加上一些如JSON、基础交互的实现。 web2.qq用的是jQuery的一个子集，加上基础UI组件、所使用到的交互等功能模块。

jet核心 sizzle选择器 xhr/ajax 基础动画、拖曳、贴齐、弹窗、窗口大小调整等交互。嗯，好像也没看出WEB2.QQ里有多少动画。 尺寸、swf、css、数据等等一堆杂七杂八的小东西

【加载问题】

HTML的流量大小基本可以忽略，主要重量在JS上面。从这点上看，跨浏览器的脚本已经成为WEB开发的难点与重点。 首次载入页面的JS预加载：jet.all.js库80K，webqq.main.js库100K。而且，只有JET放在了head里加载，而webqq.main.js是放在div#desktop后面加载的，所以，时间线上到把页面展示出来并可以点击“登录键”，只有100K左右的HTML/CSS/JS，剩下的都是应用栏及任务栏等的加载，然后就是那一堆图片的加载与默认应用的加载。 永远不会进行自动登录。一是保证了网页沙箱上的安全性，二也不会让浏览器一次承担500K以上的加载负担，保证了体验的平滑过渡。相信用户也都能接受没有自动登录功能的WEBQQ。 点击登录后再次加载不超过300K的JS。这里俺有点困惑，因为真的需要300K来实现主要的QQ功能么？毕竟很多的应用其实都是基于网页实现，并不要求直接脚本实现。估计，这里还是有优化空间的。 所有控件使用独立的JS。模块化的体现。中间或许难免会有重造轮子的事情，但却是大型团队开发所难以避免的。 腾讯一惯强大的服务器支撑能力。这点其实非常重要，否则加上每次加载的延迟与缓慢的速度，甚至偶尔还来个404什么的，体验绝对不会是现在这个样子。 CSS文件上的加载基本与JS相对应，也就是一个JS一个CSS。同理，模块化的开发。会造成冗余但却足够实用和敏捷。 貌似没启用GZIP？有可能是会对服务器端性能造成影响？粗略估计，使用了GZIP后首次加载的180K的JS会变成50K左右，不过，有没这个必要呢？ 【展望】

#2发表时间：2010-12-9 16:38:05 引用 回复

Web QQ算是web应用的尝试，此文也仅仅写了一些界面的东西，而且WebQQ还有一个Sliverlight版本

Web QQ的核心应该是消息服务这块，不知怎么实现的。下面贴一个网上的分析：

Web QQ的原理大概如下：

# 云计算

http://www.hudong.com/wiki/%E4%BA%91%E8%AE%A1%E7%AE%97

(2) 虚拟化。云计算支持用户在任意位置、使用各种终端获取应用服务。所请求的资源来自“云”，而不是固定的有形的实体。应用在“云”中某处运行，但实际上用户无需了解、也不用担心应用运行的具体位置。只需要一台笔记本或者一个手机，就可以通过网络服务来实现我们需要的一切，甚至包括超级计算这样的任务。

(3) 高可靠性。“云”使用了数据多副本容错、计算节点同构可互换等措施来保障服务的高可靠性，使用云计算比使用本地计算机可靠。

(4) 通用性。云计算不针对特定的应用，在“云”的支撑下可以构造出千变万化的应用，同一个“云”可以同时支撑不同的应用运行。

(5) 高可扩展性。“云”的规模可以动态伸缩，满足应用和用户规模增长的需要。

(6) 按需服务。“云”是一个庞大的资源池，你按需购买；云可以象自来水，电，煤气那样计费。

(7) 极其廉价。由于“云”的特殊容错措施可以采用极其廉价的节点来构成云，“云”的自动化集中式管理使大量企业无需负担日益高昂的数据中心管理成本，“云”的通用性使资源的利用率较之传统系统大幅提升，因此用户可以充分享受“云”的低成本优势，经常只要花费几百美元、几天时间就能完成以前需要数万美元、数月时间才能完成的任务。

SaaS
SaaS是Software-as-a- service(软件即服务)的简称，它是一种通过Internet提供软件的模式，用户无需购买软件，而是向提供商租用基于Web的软件，来管理企业经营活动。“相对于传统的软件，SaaS解决方案有明显的优势，包括较低的前期成本，便于维护，快速展开使用。这些优势导致SaaS在中国市场增长明显。”Springboard中国区软件行业研究经理刘经纬(JingweiLiu)说，“随着企业IT预算持续受到严格的审查和企业减少雇用技术人员，我们可以在未来的几个月中看到中国市场对SaaS解决方案有明显的需求。”
PaaS

IaaS
IaaS (Infrastructure as a Service) 基础设施即服务。消费者通过 Internet 可以从完善的计算机基础设施获得服务。这类服务称为基础设施即服务（Infrastructure asaService，IaaS）。基于Internet 的服务（如存储和数据库）是 IaaS的一部分。
IaaS最大优势在于它允许用户动态申请或释放节点，按使用量计费。运行IaaS的服务器规模达到几十万台之多，用户因而可以认为能够申请的资源几乎是无限的。而IaaS是由公众共享的，因而具有更高的资源使用效率。

1、特权用户访问若使用云计算，你的机密数据将由贵公司外面的人员来处理，所以可想而知：不是贵公司的员工完全可以访问这些数据。

2、法规遵从在《萨班斯－奥克斯利法案》当道的时代，公司有责任实施严格的数据监控和归档级别。即便一家公司与外部的云计算服务提供商签订了合同，这些法规仍要求这家公司负有责任。云计算服务提供商应当提交审计和安全方面的证书，确保对方能够履行约定的承诺。 “如果云计算提供商不愿意或者没能力做到遵从法规，这表明客户只能用它们来处理最不重要的功能。”

3、数据位置若使用云计算，你不知道自己的数据到底存放在什么地方。服务器可能建在马来西亚加拿大或者美国的新泽西州，说不定同时建在上述三个地方。

4、数据隔离当然，云计算提供商会使用SSL来保护传输中的数据，但当贵公司的数据位于存储设备中时，可能与其他公司的数据共用一只 “虚拟保管箱”。贵公司的数据与别人的数据经过适当隔离吗？提供商可能会夸耀自己的加密技术如何强大、安全。你会听到密钥长度有多长、采用哪种深奥的加密算法。不过，如果你的数据能够被提供商读取，那么可以这么认为：数据也会被别人读取。

5、可用性从理论上来说，如果你使用云计算服务提供商，没有必要担心自己的数据会消失――这些提供商很容易采用冗余机制把你的数据复制到众多地方，这样万一系统崩溃，仍可以高枕无忧。但你的员工能不能随时访问完成工作所需的数据呢？比方说，要是虚拟管道受到堵塞会怎样？要是提供商自身出现的某种内部故障导致你无法访问自己的关键数据，又会怎样？忠告：“公司应当为任何重要的IT工作负载确定服务级别方面的要求，并且需要提供商签订服务级别协议，从而确保合同里面写明惩罚条款，以防出现服务级别协议未得到遵守的情况。”

6、灾难恢复

7、调查支持 开展内部的法律调查向来就不是容易的事，因为这需要清查可能散布在实体位置和虚拟位置的大批文档。如果你使用云计算服务提供商，那么开展这种调查更是困难重重：许多客户的数据也许散布在地点不断变化的一系列数据中心。

8、存活能力你的提供商会被收购吗？或者更糟糕的是，会破产吗？如果是这样，对方需要多久才能把数据交还给你、而且采用的格式让你可以导入到另一家提供商的基础设施上？

9、降低风险方面的支持 你的员工开始使用外部提供商时，会经历一个学习过程。这家提供商提供的界面用起来多容易？提供商是否帮助你的管理人员设置监控政策？又采取了哪些措施来防范恶意软件网络钓鱼

PS:

# it-e-09 Application software

﻿Application software might be described as end-user software. Application software performs
useful work on general-purpose tasks such as word processing and cost estimating. There are
certain general-purpose programs that are widely used in nearly all career areas. They are: word
processing, electronic spreadsheets, graphic programs and so on. They are also called basic tools
and have some common features.
Insert Point

The insert point or cursor shows you where you can enter data next. Typically ,
it is a blinking vertical bar on the screen. You can move it around using a mouse or the directional
arrow keys on many keyboards.

Almost all software packages have menus. Typically, the menus are displayed in a
menu bar at the top of the screen. When one of these is selected, a pull-down menu appears. This
is a list of commands associated with the selected menu.
Help

For most applications, one of the menus on the menu bar is Help. When selected, the
locate reference information about specific commands, and central options to move around.
Button Bars

Button bars typically are below the menu bar. They contain icons or graphic
representations for commonly used commands. This offers the user a graphic approach to
selecting commands. It is an example of a graphic user interface in which graphic objects rather
than menus can be used to select commands.
Dialog Box Dialog boxes frequently appear after selecting a command from a pull-down
Scroll Bars Scroll bars are usually located on the right and/or the bottom of the screen.
They enable you to display additional information not currently visible on the screen.
WYSIWYG Pronounced "wizzy-wig", WYSIWYG stands for "What You See Is What You
Get." This means that the image on the screen display looks the same as the final printed document.
Application programs without WYSIWYG cannot always display an exact representation of the
final printed document. The WYSIWYG feature allows the user to preview the document's
appearance before it is printed out.
Function Keys

Function keys are labeled F1, F2, and so on. These keys are positioned
along the left side or along the top of the keyboard. They are used for commands or tasks that are
performed frequently, such as underlining. These keys do different things in different software
packages.
Now let's introduce respectively the most common used application software: word processing,
Word processing software is used to create, edit, save, and print documents. Documents can
be any kind of text material. With word processing, you view the words you type on a monitor
instead of on a piece of paper. After you finish your typing, save your words on diskettes or hard
disk, and print the results on paper.
The beauty of this method is that you can make changes or corrections before printing out
the document. Even after your document is printed out, you can easily go back and make changes.
You can then print it out again. Want to change a report from double spaced to single spaced?
Alter the width of the margins on the left and right? Delete some paragraphs and add some others
from yet another document? A word processor allows you to do all these with ease. Indeed,
deleting, inserting, and replacing—the principal correcting activities—can be done just by
pressing keys on the keyboard. Popular word processing software are Word , WPS and so on.
They have some common features.
Word Wrap and the Enter Key One basic word processing feature is word wrap. When
you finish a line, a word processor decides for you and automatically moves the insertion point to
the next lines. To begin a new paragraph or leave a blank line, you press the Enter key.
Search and Replace A search or find command allows you to locate any character, word,
or phrase in your document. When you search, the insertion point moves to the first place the
item appears. If you want, the program will continue to search for all other locations where the
item appears. The replace command automatically replaces the word you search for with another
word. The search and replace commands are useful for finding and fixing errors.
Cut, Copy, and Paste With a word processor, you select the portion of text to be moved by
highlighting it. Using either the menu or button bar, choose the command to cut the selected text.
The selected text disappears from your screen. Then move the insertion point to the new location
and choose the paste command to reinsert the text into the document. In a similar manner, you
can copy selected portions of text from one location to another.

A spreadsheet is an electronic worksheet used to organize and manipulate
numbers and display options for analysis. Spreadsheets are used by financial analysts, accountants,
contractors, and others concerned with manipulating numeric data. Spreadsheets allow you to try
out various "what-if" kinds of possibilities. That is a powerful feature. You can manipulate numbers
by using stored formulas and calculate different outcomes.
A spreadsheet has several parts. The worksheet area of the spreadsheet has letters for
column headings across the top. It also has numbers for row headings down the left side. The
intersection of a column and row is called a cell. The cell holds a single unit of information. The
position of a cell is called the cell address. For example, "A1" is the cell address of the first
position on a spreadsheet, the topmost and leftmost position. A cell pointer—also known as the
cell selector—indicates where data is to be entered or changed in the spreadsheet. The cell
pointer can be moved around in much the same way that you move the insertion pointer in a
word processing program. Excel is the most common spreadsheet software. It has some common
Format Label is often used to identify information in a worksheet, it is usually a word or
symbol. A number in cell is called a value. Labels and values can be displayed or formatted in
different ways. A label can be centered in the cell or positioned to the left or right. A value can be

displayed to show decimal places, dollars, or percent. The number of decimal positions can be
altered, and the width of columns can be changed.
Formulas One of the benefits of spreadsheets is that you can manipulate data through the
use of formulas. Formulas are instructions for calculations. They make connections between
numbers in particular cells.
Functions

Functions are built-in formulas that perform calculations automatically.
Recalculation

Recalculation or what-if analysis is one of the most important features of
recalculate automatically. Thus you can substitute one value for another in the cells affected by
your formula and recalculate the results. For more complex problems, recalculation enables you
to store long, complicated formulas and many changing values and quickly produce alternatives.

# it-e-10 Software Development Kit

A "Software Development Kit", or "SDK" for short, is typically a set of development tools
that allows a software engineer to create applications for a certain software package, software
framework, hardware platform, computer system, operating system or similar. It may be something
as simple as an application programming interface in the form of some files to interface to a
particular programming language, or include sophisticated hardware to communicate with a certain
embedded system. Common tools include debugging aids and other utilities. SDKs also
frequently include sample code and supporting technical notes or other supporting documentation
to help clarify points from the primary reference material. A software engineer typically receives
the SDK from the target system developer. Oftentimes, the SDK can be downloaded directly via
the Internet. Many SDKs are provided for free to encourage developers to use the system or
language. Sometimes this is used as a marketing tool. For example, "Foo Products" might
provide the "Widget SDK" for free to encourage people to use it. Thus, more people will be
encouraged to buy more of their widgets since they can program them for free. SDKs may have
attached licenses that make them unsuitable for building software intended to be developed under
an incompatible license. For example, a proprietarySDK will likely be incompatible with Free
software development. And a GPL licensed SDK will "likely" be incompatible with proprietary
software development. LGPL SDKs are typically safe for proprietary development. An SDK for
an operating system add-on (for instance, QuickTime for Mac OS) may include the add-on

software itself, to be used for development purposes, if not necessarily for redistribution. An

interesting situation arises here between platforms where it is possible to develop applications

that can at least start up on a system configuration without the add-on installed, and use a

Gestalt-style run-time "environment query" to determine if the add-on is present, and ones where
the application will simply fail to start. In other words, it is possible to build a single binary that
will run on configurations with and without the add-on present, albeitoperating with reduced
functionality in the latter situation.

Continue reading it-e-10 Software Development Kit

## Pagination

Total views.

Powered by Hydejack v6.6.1