it-e-05 Air floating displays

Todays display technologies form a field of huge interest as they are evolving with big steps while expanding the range of their applications following the demands of the market. Two new display technologies, which are still in development, impress us mostly for their concept and not so much for their display quality or their potential applications.
Fog Screen company suggests a screen created by a thick layer of fog, formed in between of two air surfaces of smooth flow. The FogScreen works very much like an ordinary screen in terms of projection properties. It can be used for both back and front projection. This kind of screens allow the projection of very impressive images, while the viewer can walk through the screen, walk directly into the images, and through them! The fog used is dry, so it doesn't make you wet even if you stay under the Fog Screen device for a long time. The fog is made of ordinary water with no chemicals whatsoever. The screen is supported by projectors with brightness of at least 3,000 ANSI Lumens and for the best result, a dark background is highly recommended.
The world premiere demonstration of FogScreen was at the Science Fair in Turku, Finland in October 2002, and its researchers are awarded for their discovery. Its first installations have already been made in museums in France and Finland and it has recently been produced to the U.S.A in the form of interactive screen.

A relevant technology is being developed by the "IO2 Technologies" company. Known by the name "Heliodisplay", this technology uses a device that displays on a bed of air above it. Nothing is added to the air so there is not any harmful gas or liquid emitted from the device, and nothing needs to be refilled. The device produces interactive images, which means it can be used as a "floating touch screen". In the course of developing the technology, Heliodisplays have been built that display images ranging from 5" to 42" and it is estimated that it can reach 150". Like the FogScreen, Heliodisplay is best viewed in dark backgrounds. Although Heliodisplay is plug-and-play compatible with most video sources (TV, DVD, computer, videogame, etc.) and anything can be projected on the FogScreen, both screen technologies are not meant to substitute computer or television screens. Their basic application fields include projections in board meetings and presentations, trade shows, museum, theme parks etc.

Continue reading it-e-05 Air floating displays

it-e-06 System Software

Software refers to computer programs. Programs are the instructions that tell the computer how to process data into the form you want. There are two kinds of software: system software and application software.
System software is a collection of programs that enables application software to run on a computer system's hardware devices, it is background software and includes programs that help the computer manage its own internal resources.
Application software is a specialized programs that enables the user to accomplish specific tasks. In this text, we mainly discuss system software.
System software consists of four kinds of programs: bootstrap loader, diagnostic routines,basic input-output system, and operating system. Among these four parts, the operating system is we most concerned with, whith helps manage computer resources. Most important operating systems are: Windows, Windows NT, OS/2, Macintosh, and Unix.
Windows

Windows gets its name because of its ability to run multiple applications at the same time, each in its own window. Windows offers graphical user interface (GUI), presents the user with graphic images of computer functions and data. It provides a standard mechanism for copying or moving information from one program to another. This mechanism, called the Clipboard, means that information created in one context is instantly reusable in another, you don't need to reenter information or work with clumsy data-transfer utilities. Windows also has DDE (dynamic data exchange) and OLE (object linking and embedding) functions. In DDE two or more applications can be linked. This way, data created in one application is automatically entered into the others. OLE, like DDE, links data between applications. Additionally, OLE allows the application receiving the data to directly access the application that created the data.
Windows NT

Windows NT is an operating system designed to run on a wide range of
powerful computers and microcomputers. It is a very sophisticated and powerful operation system. Developed by Microsoft, Windows NT is not considered a replacement for Windows.
[1]Rather, it is an advanced alternative designed for very powerful microcomputers and networks. Windows NT has two major advantages when compare to Windows:
Multiprocessing It is similar to multitasking except that the applications are run independently at the same time. For instance, you could be printing a word processing document and using a database management program at the same time. [2]With multitasking, the speed at which the document is printed is affected by the demands of the database management program. With multiprocessing, the demands of the database management program do not affect the printing of the document.Networking In many business environments, workers often use computer to communicate with one another and to share software using a network. This is made possible and controlled by special system software. Windows NT has network capabilities and security checks built into the operating system. This makes network installation and use relatively easy. OS/2 OS/2 stands for Operating System/2. It was developed jointly by IBM and Microsoft
Corporation. OS/2 has many similarities with Windows NT. It is designed for very powerful microcomputers and has several advanced features. Some of its advantages over Windows NT
include:
Minimum system configuration Like Windows NT, OS/2 requires significant memory
and hard disk space. However, OS/2 requires slightly less.
Windows application Like Windows NT, OS/2 does not have a large number of
application programs written especially for it. OS/2 can also run Windows programs, but it runs these programs slightly faster than Windows NT.
Common user interface Microcomputer application programs written specifically for
Windows NT, as well as for OS/2, have consistent graphics interfaces. Across applications, the user is provided with similar screen displays, menus, and operations. Additionally, OS/2 offers a consistent interface with mainframes, minicomputers, and microcomputers. Macintosh Operation System The Macintosh Software, which runs only on Macintosh computers, offers a high-quality graphical user interface and is very easy to use. Apple Macintosh System 7.5 designed for Apple computers using Motorola's PowerPC microprocessor, is a significant milestone for Apple. It is a very powerful operating system like Windows NT and OS/2. System 7.5 has  network capabilities and can read Windows and OS/2 files. It has several

advantages:
Ease of use The graphical user interface has made the Macintosh popular with many
newcomers to computing. This because it is easy to learn.
Quality graphics Macintosh has established a high standard for graphics processing. This is a principal reason why the Macintosh is popular for desktop publishing. Users are easily able to merge pictorial and text materials to produce nearly professional-looking newsletters, advertisements, and the like.

Consistent interfaces Macintosh applications have a consistent graphics interface. Across all applications, the user is provided with similar screen displays, menus, and operations. Multitasking Like Windows, Windows NT, and OS//2, the Macintosh System enables you to do multitasking. That is, several programs can run at the same time.
Communications between programs The Macintosh system allows applications programs
to share data and commands with other applications programs.
Unix

Unix was originally developed by AT&T for minicomputers and is very good for
multitasking. It is also good for networking between computers. Unix initially became popular in industry because for many years AT&T licensed the system to universities for a nominal fee. It is popular among engineers and technical people, with the arrival of very powerful microcomputers, Unix is becoming a larger player in the microcomputer world. Unix can be used with different types of computer systems, that is, it is a portable operating system. It is used with microcomputers,
minicomputers, mainframes, and supercomputers. The other operating systems are designed for microcomputers and are not nearly as portable. It also has the advantages of multitasking, multiprocessing, multiuser, and networking.

Continue reading it-e-06 System Software

mysql dump 乱码问题

将utf8编码的数据库使用mysqldump.exe来导出,得到的却是乱码

明明设置了--default-character-set=utf8 任然如此,网上搜了些文章,例如 http://blog.derjohng.com/2006/01/18/backup-mysql-utf8-data/

说的是改为--default-character-set=latin1,我试了一下,还是乱码。莫名其妙,想了想试试如下的命令

"D:\Program Files\MySQL\MySQL Server 5.5\bin\mysqldump.exe" --user=root --password=root --default-character-set=gbk --skip-opt --add-drop-table --set-charset --dump-date --result-file=data.sql test

这样导出的结果编码才是正确的。(注意不要丢掉--skip-opt 选项)

问题是解决了,我还是莫名其妙。

明明设置的是utf8,数据库my.ini里面默认也是utf8,哪里搞出个gbk来了?

看官方文档,有这么一句话:

http://dev.mysql.com/doc/refman/5.1/en/charset-configuration.html

when character_set_system differs from character_set_server or character_set_client, and you input characters manually (as database object identifiers, column values, or both), these may be displayed incorrectly in output from the client or the output itself may be formatted incorrectly. In such cases, starting the mysql client with --default-character-set=system_character_set—that is, setting the client character set to match the system character set—should fix the problem.

似乎是要匹配文件系统字符集,也就是你的操作系统字符集。

Continue reading mysql dump 乱码问题

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.

Continue reading it-e-07 embedded system

读书笔记: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

消灭warning……

Item 25: Prefer lists to arrays

数组是协变的,if Sub is a subtype of Super, then the array type Sub[] is a subtype of Super[].

如此相反的是:Generics, by contrast, are invariant: for any two distinct types Type1 and Type2, List<Type1> is neither a subtype nor a supertype of List<Type2>

泛型的类型更强

不能建立泛型数组,因为需要保证泛型的类型安全【略】

总体来说就是,数组和泛型结合的不是很好,如果你碰到这种情况,使用列表代替数组。

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())
dst.add(pop());
}

// 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到技术问题,这个就不方便透露了,但是我会分为三个级别,初级,你答上来我会认为你合格,中级我会为你加分,高级我会为你加薪就是这么简单。

       希望会对大家有所帮助。

Continue reading 【转】面试官心得

openfire 插件开发

此blog可行http://www.blogjava.net/jyleon/articles/255623.html

补充几点:

下载的openfire包目录/openfire/documentation/plugin-dev-guide.html中介绍了怎么开发插件.

要将源代码放在openfire的源代码目录中用其build.xml来编译。

在3.6.3中,最终打成的包是.pack文件,似乎插件里面getResourseAsSream方法不能用。

在3.6.4中,最终打成的包是.jar( zip格式),penfire启动后会解压缩生成目录,可看到插件被作为一个jar包放在lib目录下。所以只要第一次使用build命令打包,在以后直接将工程打成jar包放到lib目录下即可:测试是可行的。

但是注意,不能将发布的插件jar包删除,删除了的话,对应的文件夹也会被openfire自动删除。

两个可能有用的方法:

JiveGlobals.getHomeDirectory()

Log.getLogDirectory()

 

再回过来详细介绍一下,之前做过的又忘了,好些东西都重来了一遍。

现在已目前最新的包openfire-3.7.1为例:

将源码下下来66M多,不知为什么一下增加这么多了。

期目录结构如下图:

Snap1

将我们的插件以文档(documentation\docs\plugin-dev-guide.html#Using the Openfire Build Script)规定的格式存放,

Plugin Structure

myplugin/
 |- plugin.xml      <- Plugin definition file
 |- readme.html     <- Optional readme file for plugin
 |- 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
         |- *.jsp      <- JSPs your plugin uses for the admin console
         |- images/    <- Any images your JSP pages need (optional)
         |- WEB-INF
             |- web.xml    <- Optional file where custom servlets can be registered

将myplugin整个文件夹放在src\plugins中。

然后在其build文件夹中可找到build.xml,使用如下命令可单独编译单个plugin,但应在编译单个plugin之前至少运行一次plugins任务,负责无法编译单个plugin,报错为lib文件夹找不到,webapp目录找不到 :

ant plugin -Dplugin=myplugin

运行命令即可在work\plugins中找到编译好的plugin。

如果你在eclipse中,可右键点击build.xml, run as/Ant Build …/ 注意是三个点的那个才有更多选项。

Snap3

Snap4

这样配置和上面的命令行方式效果一样。

 

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

Continue reading openfire 插件开发

Pagination


Total views.

© 2013 - 2019. All rights reserved.

Powered by Hydejack v6.6.1