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

In typical designs, a task has three states: running, ready and blocked. Most tasks are blocked for most of the time. Only one task per CPU is running. The ready list is usually short, two or three tasks at most. The real trick is designing the scheduler. Usually the data structure of the ready list in the scheduler is designed so that search, insertion and deletion require locking interrupts only for small periods of time, when looking at precisely defined parts of the list. This means that other tasks can operate on the list asynchronously, while it is being searched. A typical successful schedule is a bidirectional linked list of ready tasks, sorted in order by priority. Although not fast to search, the time taken is deterministic. Most ready lists are only two or three entries long, so a sequential search is usually the fastest, because it requires little set-up time. The critical response time, sometimes called the "flyback time" is the time it takes to queue a new ready task, and restore the state of the highest priority task. In a well-designed RTOS, readying a new task will take 3-20 instructions per ready queue entry, and restoration of the highest-priority ready task will take 5-30 instructions. On a 20MHz 68,000 processor, task switch times run about 20 microseconds with two tasks ready. 100 MHz ARM CPUs switch in a few microseconds.

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

【转】webqq实现

谁说腾讯不创新

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

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

【总体体验】

电脑上国内普及的1M网速,首次加载2s,登录加载3s,大部分用户的体验应该都优于这个。3G体验也近似于这种水准。

算上各种因素(带宽被占用等),就算以20K/S的网速来看,首次加载的时间10s,而登录加载15秒,这是GPRS能达到的顶级体验。

或许,从门户站点的体验上来看,这并不是特别难以实现的事情;然而这是个应用,对比起许多应用程序的几秒乃至几十秒的启动速度而言,这种体验已经非常优秀。

【架构鸟瞰】跨平台:

先看HTML标签,它有着如下class:

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

可以看到,它把环境都记录在了这里面,包括操作系统、浏览器、渲染引擎、FLASH版本等等。

我们大可以猜想,web2.qq是有对各个浏览器做相关HACK的。

但是,可以看到web2.qq里基本没用HTML5,UI用的是CSS绝对定位的九宫格负外边距圆角,相当不语义化的解决方案……更甚者,其中有些应用还是只有IE下才能使用……从这点看来,开发团队显然认为IE才是国内最大的用户群使用的浏览器。

JavaScript:

可以从request上看到,WEBQQ2用的JS基础库是JET(http://code.google.com/p/j-et/)。这玩意儿挺不给力呀,文档少得可怜,但从那点可怜的文档上看来,它其实是个黏合剂:把各种JS库给无冲突地黏合起来,以达到多框架并用的开发

这个框架主要分为三个层:

最底层:JS扩展功能与代码组织功能,用于增强JS对多框架开发的黏合能力。 中间层:跨浏览器扩展模块,及其它可选模块比如选择器等。似乎,选择器、AJAX、JSON、基础UI及交互等功能是放在这个层面的。 应用层:UI组件、实时动画、游戏引擎等。大块头就放这里,而这些估计都不是初次加载的东西。

而未经GZIP压缩的jet.all.js大小为80K,只比jQuery略大一点点,那么我们大可以假设:

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

个人看来,第一种情况不太可能。因为里面包含了大量的UI交互,如弹窗、自动贴齐、拖曳、九宫格圆角、PNG半透明等等。我不信WEBQQ会把这些轮子在每个APP上都重造。所以,使用jet的理由就很明显了:webqq团队需要一个胶水,把各种选用的框架给粘在一起,而且开发成本与学习成本都要足够低。所以,就选用了jet,和一堆流行的框架。

而就个人看来,它核心库里应该包含的实现有:

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

曾经有考虑过使用jQuery与jQueryUI里的交互部分来作为应用的支撑库,但jQuery+uicore+interactive加起来将有150K的大小,显然web2.qq用了个更轻量的解决方案。

【加载问题】

所有的大型应用都得考虑模块加载问题,如何保持模块间的相互独立及良好通信等等。

在页面内容的加载问题上,其实之前都已经有了比较多的解决方案:

预加载:某些大块头的东西应该在用户驻留在页面上的空隙进行加载。 懒加载:该加载时才加载,而优先加载用户可能操作的部分。 CACHE:其实这个在网页上比较难实现,但也不是没有办法:使用AIR/HTML5或是内嵌页面的瘦客户端。严格来说,除了HTML5之外的解决方案,都不能算在标准的范畴。

而WEBQQ2最集中体现了前两者的使用。让我们从 HTTP Request 的角度分析下 web2.qq.com 的加载:

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左右,不过,有没这个必要呢? 【展望】

最近在翻译《HTML5 for Web Designer》,也的确像上面写的那样,HTML5/CSS3的工作只是把原本很流行的、却需要HACK或是需要脚本的东西—迁移到了较为定义式的语言上罢了。

所以,腾讯发力了,腾讯证明了,一站式的体验也能在WEB上实现,而且用的不是新标准的东西,而仍然是WEB2.0的东西—在IE下都能正常地使用,虽然不那么流畅。

但是随着腾讯的WEB2.QQ及社区开放平台等的相继出现,有个依然没太大改变的地方是,接口依旧相当封闭。这点依然让我比较不满呀。

就像是,腾讯走的是比较像APPSTORE的道路:开放了这个平台给你,但你只能用这个平台,而不能用其它平台。

但的确的,腾讯在用户体验与IT应用上,都是在国内处于领航地位的。虽然一家独大的确比较让人苦闷。也期待国内其它IT企业在腾讯的压力下能迎头赶上,把国内的web与标准化真正推动起来。

也继续期待HTML5时代的真正来临,尤其是离线与同步应用上上。

JET代码范例及API  SVN地址 http://j-et.googlecode.com/svn/truck/

关键字(Tags): webQQ JET

上一篇U盘终结者网丫场掀云计算应用的革命热潮
下一篇中科院研究生院利用ipv6代理实现免流量费上网方法

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

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

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

Web QQ的原理大概如下:
客户端的JavaScript建立连接后,发起一个长连接。如果服务器端没有收到更新或消息,这个HTTP连接就一直不会返回任何数据,直到超时(一般不会超过60秒),超时会发回一个数据,指示客户端再次发起长连接;如果服务器端有数据,那么服务器端也会发送数据,并指示立刻断开这个连接,客户端收到数据,对应更新浏览器页面,还是会再次发起长连接。如此长连接不断,直到退出。简单说,客户端JavaScript就是一个循环创建连接查询的过程,当然还需要加入错误异常(譬如网络异常)的处理。
而服务器端的Cometd实现,我猜是使用epoll或者又叫NIO的技术,原理基本上是收到HTTP连接,不再是单独创建一个线程来处理,而是直接把连接放归epoll或NIO的框架接管,只有需要读数据或者需要写数据时,再通过epoll或 NIO的API进行通知。epoll或NIO可以看作一个单独线程,而这个线程里面所有数据处理基本都是跟网络有关,不会堵塞,所以可以同时接管1万到几十万的连接数据读写(最近通过dbanotes看到50万连接的极端案例)。所以这种框架下的Cometd服务器端,实际线程数小,开销很小,只要网卡够快,内存够大,CPU够快,程序够稳定,就可以轻松支撑万计的长连接。
如果按照一台服务器支持1万的长连接来看,只需要100台服务器就可以支持100万的web QQ在线了。而服务器的均衡可以在JavaScript端稍作处理,或者外加一台服务器做均衡即可实现。而以腾讯在服务器均衡、服务器群部署方面的经验来说,这些早是小儿科了。
我猜测web QQ要么有自己很成熟的Cometd服务器框架,要么就自己专门针对web QQ开发他们自己的Cometd服务器。直接使用Apache + PHP或者已有的服务器,估计很难达到高性能高稳定性。而重新开发一款Cometd服务器,对于有经验的开发人员和设计人员,花个把月时间,应该可以完成。
上述这些理解,主要是基于我自己开发web MSN/Gtalk/Facebook Chat/Yahoo Messenger网页聊天服务( http:/webuzz.im/ )的理解。相比较web QQ而言,我开发的网页聊天还需要从服务器端再连接其他服务器(譬如MSN/Gtalk的官方服务器),服务器端还需做很多其他方面优化。我使用的 Cometd服务器是自己定制开发的,使用的通信协议则是Java2Script的Simple RPC/Pipe( http:/j2s.sourceforge.net/ ),不是JSON相关的协议。以前看到web QQ出来,我也过去瞅一下他们具体如何保持连接,基本原理都一样。当然我相信他们的服务器端是绝对的强。

Continue reading 【转】webqq实现

云计算

 

通过互动百科整理:

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

云计算 - 定义

狭义云计算是指IT基础设施的交付和使用模式,指通过网络以按需、易扩展的方式获得所需的资源(硬件、平台、软件)。 提供资源的网络被称为“云”。“云”中的资源在使用者看来是可以无限扩展的,并且可以随时获取,按需使用,随时扩展,按使用付费。这种特性经常被称为像水电一样使用IT基础设施。

广义云计算是指服务的交付和使用模式,指通过网络以按需、易扩展的方式获得所需的服务。这种服务可以是IT和软件、互联网相关的,也可以使任意其他的服务。

区别:

网格计算是分布式计算的一种,与云计算不同。

云计算 - 特点

(1) 超大规模。“云”具有相当的规模,Google云计算已经拥有100多万台服务器, AmazonIBM微软Yahoo等的“云”均拥有几十万台服务器。企业私有云一般拥有数百上千台服务器。“云”能赋予用户前所未有的计算能力。

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

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

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

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

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

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

云计算 - 三种主要应用形式

根据现在最常用,也是比较权威的NIST(National Institute of Standards and Technology,美国国家标准技术研究院)定义,云计算主要分为三种服务模式,而且这个三层的分法重要是从用户体验的角度出发的。
这三种服务模式是SaaS(Software as a Service),PaaS(Platform as a service)和 IaaS(Infrastructure as a service)。对普通用户而言,他们主要面对的是SaaS这种服务模式,而且几乎所有的云计算服务最终的呈现形式都是SaaS。
SaaS
SaaS是Software-as-a- service(软件即服务)的简称,它是一种通过Internet提供软件的模式,用户无需购买软件,而是向提供商租用基于Web的软件,来管理企业经营活动。“相对于传统的软件,SaaS解决方案有明显的优势,包括较低的前期成本,便于维护,快速展开使用。这些优势导致SaaS在中国市场增长明显。”Springboard中国区软件行业研究经理刘经纬(JingweiLiu)说,“随着企业IT预算持续受到严格的审查和企业减少雇用技术人员,我们可以在未来的几个月中看到中国市场对SaaS解决方案有明显的需求。”
PaaS
通过网络进行程序提供的服务称之为SaaS(Software as a Service),而云计算时代相应的服务器平台或者开发环境作为服务进行提供就成为了 PaaS(Platform as a Service)。所谓PaaS实际上是指将软件研发的平台(计世资讯定义为业务基础平台)作为一种服务,以SaaS的模式提交给用户。因此,PaaS也是SaaS模式的一种应用。但是,PaaS的出现可以加快SaaS的发展,尤其是加快SaaS应用的开发速度。在2007年国内外SaaS厂商先后推出自己的PaaS平台,从某种意义上说,PaaS是SaaS的源泉。
在云计算应用的大环境下,PaaS的优势显而易见:
开发简单,因为开发人员能限定应用自带的操作系统,中间件和数据库等软件的版本,比如SLES 11,WAS 7和DB2 9.7等,这样将非常有效缩小开发和测试的范围,从而极大地减低开发测试的难度和复杂度。
部署简单,首先,如果使用虚拟器件方式部署的话,能将本来需要几天的工作缩短到几分钟,能将本来几十步操作精简到轻轻一击。其次,能非常简单的将应用部署或者迁移到公有云上,以应对突发情况。
维护简单,因为整个虚拟器件都是来自于同一个ISV(Independent Software Vendors),所以任何软件升级和技术支持,都只要和一个ISV联系就可以了,不仅避免了常见的扯皮现象,而且简化了相关流程。
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:

到底是不是人云亦云?

云终端:是云计算的终端--个人理解。
云服务:网上说的都扯到云计算上去了。
我认为云服务包括以下特征:
以互联网作为平台
以个人为服务对象??
以web为访问形式
集成,简洁,使用方便

Continue reading 云计算

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.     
Menus

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     
Help options appear. [1]These options typically include a table of contents, a search feature to     
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     
menu. These boxes are used to specify additional command options.     
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,     
and spreadsheets.     
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.
Spreadsheet

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
features of spreadsheet programs.
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
spreadsheets. If you change one or more numbers in your spreadsheet, all related formulas will
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.

Continue reading it-e-09 Application software

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

java json xpath jsonpath

jsonpath和xpath语法不通http://goessner.net/articles/JsonPath/

java实现http://code.google.com/p/json-path/

google 既然搜不到,你猜我是怎么找到的?

XPath
JSONPath
Description

/
$
the root object/element

.
@
the current object/element

/
. or []
child operator

..
n/a
parent operator

//
..
recursive descent. JSONPath borrows this syntax from E4X.

*
*
wildcard. All objects/elements regardless their names.

@
n/a
attribute access. JSON structures don't have attributes.

[]
[]
subscript operator. XPath uses it to iterate over element collections and for predicates. In Javascript and JSON it is the native array operator.

|
[,]
Union operator in XPath results in a combination of node sets. JSONPath allows alternate names or array indices as a set.

n/a
[start:end:step]
array slice operator borrowed from ES4.

[]
?()
applies a filter (script) expression.

n/a
()
script expression, using the underlying script engine.

()
n/a
grouping in Xpath

XPath has a lot more to offer (Location pathes in not abbreviated syntax, operators and functions) than listed here. Moreover there is a remarkable difference how the subscript operator works in Xpath and JSONPath.

Square brackets in XPath expressions always operate on the node set resulting from the previous path fragment. Indices always start by 1.With JSONPath square brackets operate on the object or array addressed by the previous path fragment. Indices always start by 0. |2007-08-18| e3#JSONPath examples

Let's practice JSONPath expressions by some more examples. We start with a simple JSON structure built after an XML example representing a bookstore (original XML file).

{ "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.99 }, { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.99 } ], "bicycle": { "color": "red", "price": 19.95 } } }

XPath
JSONPath
Result

/store/book/author
$.store.book[*].author
the authors of all books in the store

//author
$..author
all authors

/store/*
$.store.*
all things in store, which are some books and a red bicycle.

/store//price
$.store..price
the price of everything in the store.

//book[3]
$..book[2]
the third book

//book[last()]
$..book[(@.length-1)]
$..book[-1:]
the last book in order.

//book[position()<3]
$..book[0,1]
$..book[:2]
the first two books

//book[isbn]
$..book[?(@.isbn)]
filter all books with isbn number

//book[price<10]
$..book[?(@.price<10)]
filter all books cheapier than 10

//*
$..*
all Elements in XML document. All members of JSON structure

Continue reading java json xpath jsonpath

it-e-11 Introduction to computer network

Computer network is a system connecting two or more computers. A computer network allows
user to exchange data quickly, access and share resources including equipments, application software,
and information.
Data communications systems are the electronic systems that transmit data over communications
lines from one location to another. You might use data communications through your microcomputer
to send information to a friend using another computer. You might work for an organization whose
computer system is spread throughout a building, or even throughout the country or world. That is, all
the parts—input and output units, processor, and storage devices—are in different places and linked
by communications. Or you might use telecommunications lines—telephone lines—to tap into
information located in an outside data bank. You could then transmit it to your microcomputer for
your own reworking and analysis.
To attach to a network, a special-purpose hardware component is used to handle all the
transmission. The hardware is called a network adapter card or network interface card (NIC), it is
a printed circuit board plugged into a computer's bus, and a cable connects it to a network
medium.
Communications networks differ in geographical size. There are three important types:
LANs, MANs, and WANs.
Local Area Networks

Networks with computers and peripheral devices in close physical
proximity—within the same building, for instance—are called local area networks (LANs).
Linked by cable-telephone, coaxial, or fiber optic. LANs often use a bus form organization. In a
LAN, people can share different equipments, which lower the cost of equipments. LAN may be
linked to other LANs or to larger networks by using a network gateway. With the gateway, one
LAN may be connected to the LAN of another LAN of another office group. It may also be
connected to others in the wide world, even if their configurations are different. Alternatively, a
network bridge would be used to connect networks with the same configurations.
There is a newly development for LANs: WLAN. A wireless LAN (WLAN) is a flexible
data communication system implemented as an extension to, or as an alternative for, a wired
LAN within a building or campus. Using electromagnetic waves, WLANs transmit and receive
data over the air, minimizing the need for wired connections. Thus, WLANs combine data
connectivity with user mobility, and, through simplified configuration, enable movable LANs.
Over the recent several years, WLANs have gained strong popularity in a number of vertical
markets, including the health-care, retail, manufacturing, warehousing, and academic arenas.
[1]These industries have profited from the productivity gains of using hand-held terminals and
notebook computers to transmit real-time information to centralized hosts for processing. Today

WLANs are becoming more widely recognized as a general-purpose connectivity alternative for
a broad range of business customers.
Applications for Wireless LANs [2]Wireless LANs frequently augment rather than replace
wired LAN networks—often providing the final few meters of connectivity between a backbone
network and the mobile user. The following list describes some of the many applications made
possible through the power and flexibility of wireless LANs:
Doctors and nurses in hospitals are more productive because hand-held or notebook
computers with wireless LAN capability deliver patient information instantly.
Consulting or accounting audit engagement teams or small workgroups increase productivity
with quick network setup.
Network managers in dynamic environments minimize the overhead of moves, adds,
and changes with wireless LANs, thereby reducing the cost of LAN ownership.
Training sites at corporations and students at universities use wireless connectivity to
facilitate access to information, information exchanges, and learning.
Network managers installing networked computers in older buildings find that wireless
LANs are a cost-effective network infrastructure solution.
Retail store owners use wireless networks to simply frequent network reconfiguration.
Trade show and branch office workers minimize setup requirements by installing preconfigured
wireless LANs needing no local MIS support.
Warehouse workers use wireless LANs to exchange information with central databases and
increase their productivity.
Network managers implement wireless LANs to provide backup for mission-critical
applications running on wired networks.
Senior executives in conference rooms make quicker decisions because they have real-time
information at their fingertips.
The increasingly mobile user also becomes a clear candidate for a wireless LAN. Portable
access to wireless networks can be achieved using laptop computers and wireless NICs. This
enables the user to travel to various locations–meeting rooms, hallways, lobbies, cafeterias,
classrooms, etc.–and still have access to their networked data. Without wireless access, the user
would have to carry clumsy cabling and find a network tap to plug into.
Metropolitan Area Networks

These networks are used as links between office buildings in
a city. Cellular phone systems expand the flexibility of MAN by allowing links to car phones and
portable phones.
Wide Area Networks

Wide area networks are countrywide and worldwide networks.
Among other kinds of channels, they use microwave relays and satellites to reach users over long
distances. One of the most widely used WANs is Internet, which allows users to connect to other
users and facilities worldwide.

Continue reading it-e-11 Introduction to computer network

[转]JCA--又一个半拉子架构的介绍

Java 2企业版(J2EE)连接器架构(JCA)是对J2EE标准集的重要的补充. 它注重的是用于将Java程序连接到非Java程序和软件包的中间件的开发.JCA是由Sun公司领导的Java标准化组织开发的.JCA 目前还是在最后的草案阶段, 它定于2001年年底发布并且将成为J2EE 1.3 的一部分.JCA 提供了许多值得注意的好处, 但是直接的JCA编程并不是每个人都能学会.
JCA包括三个关键的元素:
JCA 资源适配器
系统介面
通用客户介面(CCI Common Client Interface,目前还是可选内容)
JCA 是软件工业界在应用程序集成领域建立标准进行的第一步工作,而以前要做到这一点基本上是通过专有的中间件完成的.这是迈向正确方向的第一步, 因为应用程序的集成已经不仅成为了业界领袖面临的首要问题而且也让大多数主流软件商无法回避.
JCA 资源适配器是定制的Java程序用来实现对特定的外部程序的连接(无论它是一个以前遗留下来的程序,还是购买的程序).一个遵循JCA标准的资源适配器都必须支持JCA系统界面,以便通过连接缓冲进行性能优化并支持自动的安全签名.JCA还提供一组界面支持事务管理(虽然实际上在资源适配器中对分布式事务的支持是可选的).
一个全功能的资源适配器允许连接到外部(目标)程序来完成以下功能:
使得目标程序能够参与与其它应用程序和数据库之间分布式的基于XA的事务过程.
能够在不牺牲应用程序的安全级别的前提下掩盖外部平台的安全细节.
能够增加应用程序的可伸缩性.

要支持JCA的事务和安全功能需要目标程序通过资源适配器为程序的访问暴露足够的事务和安全界面.过时的应用程序或者是应用程序平台如果不经过加强则有可能只能部分的符合JCA标准. 许多的适配软件很可能只能支持最小的"无事务"选项而且可能只能拥有一个部分支持目标环境的安全结构的安全界面.
最小化的资源适配器也许只能改进那些在JCA出现以前由不同的销售商开发的非标准适配器.在目前的开发阶段,JCA与更现代的和更开放的目标应用程序或环境结合的时候最能体会它的威力.到2004年,在软件集成项目中少于百分之三十的软件包和遗留下来的适配软件将使用JCA, 而且拥有完全功能的将少于百分之十--包括对事务的支持,完全的安全性,以及CCI(0.7 的可能性).
资源适配器用系统界面来与底层的J2EE应用服务器交互.资源适配器通过JCA系统界面将繁杂的细节处理过程交给底层的应用服务器,从而满足可伸缩性,集成性,和安全性方面的要求,上层的应用程序假设底层的应用服务器知道如何处理对JCA系统界面调用.因此,应用服务器销售商声明支持JCA,其本身并不保证能够提供对应用程序集成的支持除非销售商还提供(通过合作或是独立开发)预先开发的JCA资源适配器.
JCA 通用客户界面是调用程序(用户程序或是集成中间件)使用的一套应用编程界面(API).JCA CCI被用做对资源适配器的标准访问过程,不管实际的目标程序或是环境是如何工作的.因为所有的资源适配器支持相同的一套AIP,所有的调用程序和外界程序间的交互过程就形成了标准.但是对CCI支持在JCA 1.0中是可迁的.许多的资源适配器会暴露非标准的但是满足特定目标或平台访问方式的客户界面.
CCI与企业版JavaBeans(EJB)的调用界面是不同的,而且JCA 资源适配器的封装方式也不尽相同;JCA的Java编译文件(JAR)与EJB JAR文件有不同的设计方式.所以CCI代表了J2EE范围内一个新的专门的编程模型;它是复杂的而且需要专门的技术知识.但是实际使用CCI的开发者的大部分很可能将是工具软件销售商(例如WebGain和IBM Visual Age)以及集成中间件生产商(例如WebMethods和TIBCO Software),而不是企业应用开发者.
要支持JCA, 集成中间件销售商一般不得不采用一整套J2EE平台,就象JCA设计需要的那样(也就是"managed"选项).但它们中的大多数还没有这样的能力,所以可能只是实现JCA标准的功能弱一些的"unmanaged"选项.这种情况很可能拖延集成中间件销售商对JCA全部标准的采用,因而也就会拖延对整个 JCA的采用.到2004年,所有主导的集成中间件销售商都将通过独立开发或是合作在它们的产品里捆绑进一个J2EE应用服务器(0.7的可能性).
JCA 对 Web服务(Web services)
资源适配器的代码是复杂的,需要对目标平台内部结构的深刻了解和程序设计方面高级的知识.因此,外部应用程序(而不是调用程序的开发者)销售商将开发大部分的资源适配器.所以,套装软件销售商和运行环境销售商对它的采用程度将决定整个工业对JCA的接受程序.目前,很少有销售商已经开始(并己决定了发布时间)致力于为它们的程序提供JCA资源适配器.虽然我们可以预见在未来的六个月内还会有类似的宣称出现,但是销售商必须决定是否支持JCA或者Web服务描述语言(WSDL)作为它们标准的外部访问界面.
JCA在功能上比Web服务要丰富,但是它发布起来更难而且限制了销售商只能从 Java环境访问它们.Web服务界面能够自动的包括对Java,微软,和其它结构的支持.一个可能的折衷是销售商同时提供对JCA和Web服务界面的支持,也许使用Web服务来打包JCA CCI.在未来的版本里,JCA很可能扩展它对XML和松偶合访问的支持.未来的JCA版本还可能提供对CCI和Web服务的标准化的支持.因此,JCA 将为对JCA资源适配器的紧耦合(JCA)和松耦合提供协议.
未来对适配器的改进要求
JCA要求资源适配器运行在J2EE容器里;非Java目标程序的本地适配器是不被支持的.通常,将适配器和目标应用程序放在一起能够提高集成度和事务交换的能力.要达到这个目的,用户将不得不走到标准的前面去.开发一个外部的非JCA适配器然后为它开发一个JCA包容器是可能的.但是这种分布的适配器将不那么好管理而且不太可能实现JCA标准的完整功能.
JCA标准没有解决一个资源适配器是应该总是代表整个目标环境(3270 CICS)还是代表一个或多个外部程序的功能(例如这样的功能,"从一个3270 CICS 应用程序获取客户信息").复合资源适配器--那些为几个外部环境(例如AS/400和R/3)--则连提都没有提到.当前的应用集成的实际显示一个适配器的功能范围可以是"瘦"或者含有很多的技术而在商业逻辑方面变得"胖"而笨重.对大多数集成项目来说关键性的异步集成方式也没有出现在JCA 1.0里. 当实际采用JCA的时候这些问题就会出现而且有可能需要在JCA未来的版本里做进一步的扩展和明确.制定JCA 2.0的工作已经开始.
应用集成更大的一幅画面
JCA 的范围被限制在适配器技术里,这相对于整个应用集成平台来说是一个小部分.许多应用集成的需求和方案还没有包括在J2EE里.它不支持语义数据传输,业务进程管理,异步集成(JCA 的目标只有请求/应答 式的适配器风格),消息仓库和集成系统管理.JCA完全面向对同步复合应用的支持,支异步应用程序集成视而不见.要满足这些要求,到2004年附加的与集成有关的标准将被添加进J2EE(0.8的可能性).
总结
JCA是对J2EE显著的扩展,但它没有能够适应所有应用集成项目的需求. 不管JCA如何,J2EE的用户在建立它们的集成内构的时候将继续部分的依赖专有解决方案

Continue reading [转]JCA--又一个半拉子架构的介绍

it-e-12 What is a Firewall

The term "firewall" illustrates a system that protects a network and the machines on them
from various types of attack. Firewalls are geared towards keeping the server up all the time and
protecting the entire network.
The primary goal of a firewall is to implement a desired security policy; controlling access
in both directions through the firewall, and to protect the firewall itself from compromise. It
wards off intrusionattempts, Trojans and other malicious attacks.
They are meant for the home user in a networked environment. They aim to block simple
attacks, unlike the enterprise level firewalls that the corporate world uses at the server or router end.
There are many ways to implement a firewall, each with specific advantages and disadvantages.
Nowadays organizations and professionals use Internet technology to establish their online
presence and showcase their products and services globally. Their endeavor is to leverage digital
technology to make their business work for them.
All the organizations and professionals are shifting from Dialup to broadband and getting a
fixed IP. It has led to an increase in security attacks, bugs in everyday working. This does not

mean that Dialup being anonymous dynamic link or the firewall of the ISP network make you
pretty safe.
Now if your machine was under attack, you must have wondered what went wrong making
your system crash suddenly. It is not necessary for anyone to actually know about you or your IP
address to gain access to your system.
If your system is infected or prone to intrusions, then beyond the anonymity of your Dialup
connection or a dynamic IP, your system can be hacked.
Intrusion

There are many ways to gain unauthorized access to a system. Operating system
vulnerabilities, cracked or guessed passwords are some of the more common. Once access is
attained, the intruder can send email, tamper with data, or use the system privileges to attack
another system.
Information Theft and Tampering

Data theft and tampering do not always require that the
system be compromised. There have been many bugs with FTP servers that allow attackers to
download password files or upload Trojan horses.
A Service Attacks

Any attack that keeps the intended user from being able to use the
services provided by their servers is considered a denial of service attack. There are many types
of denial of service attacks, and unfortunately are very difficult to defend against. "Mail bombs"
are one example in which an attacker repeatedly sends large mail files in the attempt at filling the
server's disk file system thus preventing legitimate mail from being received.
Joyrider

Not all attacks on computer systems are malicious. Joyriders are just looking for
fun. Your system may be broken into just because it was easy, or to use the machine as a
platform to attack others. It may be difficult to detect intrusion on a system that is used for this
purpose. If the log files are modified, and if everything appears to be working, you may never
know.
Vandals

A vandal is malicious. They break in to delete files or crash computer systems
either because they don't like you, or because they enjoy destroying things. If a vandal breaks
into your computer, you will know about it right away. Vandals may also steal secrets and target
your privacy.

Spies

Spies are out to get secret information. It may be difficult to detect break-ins by
spies since they will probably leave no trace if they get what they are looking for.
A personal firewall, therefore, is one of the methods you can use to deny such intrusions.

Continue reading it-e-12 What is a Firewall

it-e-13 How Firewalls Work

Firewalls basically work as a filter between your application and network connection. They
act as gatekeepers and as per your settings, show a port as open or closed for communication.
You can grant rights for different applications to gain access to the internet and also in a reverse
manner by blocking outside applications trying to use ports and protocols and preventing attacks.
Hence you can block ports that you don't use or even block common ports used by Trojans.
Using Firewalls you can also block protocols, so restricting access to NetBIOS will prevent
computers on the network from accessing your data. Firewalls often use a combination of ports,
protocols, and application level security to give you the desired security.
Firewalls are configured to discard packets with particular attributes such as:
Specific source or destination IP addresses.
Specific protocol types.
TCP flags set/clear in the packet header.
Choose the firewalls which have the ability to ward off all intrusion attempts, control
applications that can access the internet, preventing the malicious scripts or controls from
stealing information or uploading files and prevent Trojans and other backdoor agents from
running as servers.
The purpose of having a firewall cannot be diminished in order to gain speed. However,
secure, high-performance firewalls are required to remove the bottleneck when using high speed
Internet connections. The World-Wide-Web makes possible the generation of enormous amounts
of traffic at the click of a mouse.
Most of these firewalls are free for personal use or offer a free trial period. All the personal
firewalls available can't ensure 100% security for your machine. Regular maintenance of the
machine is needed for ensuring safety.

Continue reading it-e-13 How Firewalls Work

Pagination


Total views.

© 2013 - 2024. All rights reserved.

Powered by Hydejack v6.6.1