diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/atom03.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/atom03.gif new file mode 100644 index 00000000..5ca4c41e Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/atom03.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/joomla_powered.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/joomla_powered.gif new file mode 100644 index 00000000..94f48435 Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/joomla_powered.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/opml.png b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/opml.png new file mode 100644 index 00000000..e4b95649 Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/opml.png differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss-valid-1237993180.png b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss-valid-1237993180.png new file mode 100644 index 00000000..2f35acc0 Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss-valid-1237993180.png differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss091.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss091.gif new file mode 100644 index 00000000..7240ff67 Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss091.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss10.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss10.gif new file mode 100644 index 00000000..4c2831b7 Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss10.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss20.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss20.gif new file mode 100644 index 00000000..48e4af4a Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss20.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss_excerpts.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss_excerpts.gif new file mode 100644 index 00000000..a1a44f49 Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss_excerpts.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss_fullposts.gif b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss_fullposts.gif new file mode 100644 index 00000000..7ffe907d Binary files /dev/null and b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/buttons/rss_fullposts.gif differ diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/images/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/assets/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/controllers/defaultcontroller.php b/oss/joomla/trunk/components/com_ninjarsssyndicator/controllers/defaultcontroller.php new file mode 100644 index 00000000..fdb95427 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/controllers/defaultcontroller.php @@ -0,0 +1,20 @@ + diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/controllers/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/controllers/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/controllers/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed1.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed1.xml new file mode 100644 index 00000000..8c833ea4 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed1.xml @@ -0,0 +1,76 @@ + + + + + HA 资讯 - PostgreSQL + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:48:55 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + PostgreSQL 8.4.1发布 + http://news.hawebs.net/index.php?option=com_content&view=article&id=117:postgresql-841&catid=36:postgresql&Itemid=57 +
这次更新主要修改了“无法再连接共享内存”的问题,它一直困扰着许多Windows PostgreSQL的用户。另外更多的就是对8.4.x版本的更新,详情请查看PostgreSQL 8.4.1发布文档。

查看PostgreSQL详情:http://www.postgresql.org/docs/current/static/release.html

下载PostgreSQL:http://www.postgresql.org/download/]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 04 Mar 2010 17:12:22 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=117:postgresql-841&catid=36:postgresql&Itemid=57 +
+ + 9.0 Alpha 4 版本发布 + http://news.hawebs.net/index.php?option=com_content&view=article&id=116:90-alpha-4-&catid=36:postgresql&Itemid=57 +
9.0alpha4已提供下载。这个测试版相对于前一个测试版新增了一些主要的特性。

请下载,安装,测试,使用,并且欢迎给开发小组提供相关建议来改善下一个版本。

新增特性如下:
* Streaming Replication for binary log-based replication of PostgreSQL
* New in-memory, high-performance Listen/Notify queue
* Automatic row-count return to drivers on SELECT queries
* ROWS PRECEDING and ROWS FOLLOWING windowing functions

这些主要特性的添加,供用户进行有针对性的测试。如果你希望组织这个版本的测试,请参考Alpha/Beta版本的测试页。

Alpha并不是一个稳定版,同时请不要使用Alpha版本运行在你的生产环境中,Alpha版本仅供测试新特性。我们并不能保证在当前Alpha 版本中包含的特性或者APIs能够使用,或者与最终版返回相同的结果。前一个Alpha版本被命名为“8.5”。“9.0”与PostgreSQL与发行版具有相同的版本号。Alpha或Beta版的发现将会在数周内提供测试。

更多的发行日志,可以在Alpha版的信息页中找到。

Alpha4当前只提供源代码,二进制分发包将随后发布。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 04 Mar 2010 16:57:00 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=116:90-alpha-4-&catid=36:postgresql&Itemid=57 +
+ + MicroOLAP PostgreSQL数据库建模工具发布新版本 + http://news.hawebs.net/index.php?option=com_content&view=article&id=115:microolap-postgresql&catid=36:postgresql&Itemid=57 + MicroOLAP PostgreSQL 数据库建模工具使用整合图形化界面,可以让你清晰和有效的数据库结构;查看所有数据表的完整结构;表、视图之间的关系;存储过程以及其他对象。使用这个工具中的修改选项,你可以很容易在服务器上生成物理数据库,根据你的模型修改物理数据库。

你可以从下面的地址中下载测试版
http://microolap.com/products/database/postgresql-designer/download/

更新日志如下:
[!] WineHQ support enhanced
[+] DEFERRABLE clause now proccessed for FOREIGN KEY by SQL Reverse Engineering
[*] SQL Reverse Engineering: function now created if specified in CREATE TRIGGER and "Create nonexistent references object" checked
[-] "After changing interface language Object Tree View not refreshed immediatly" bug fixed
[-] "Cannot add object through Object Tree View popup menu after interface lanuage changed" bug fixed
[-] "Cannot delete all tablespaces from model" bug fixed
[-] "Cannot save Begin and End Scripts using Database Editor" bug fixed
[-] "Command 'wine PgMDD.exe' fails in the shell" bug fixed
[-] "Modify Database duplicates FOREIGN KEYs sometimes" bug fixed
[-] "Width for stored routines calculated wrong sometimes" bug fixed

如果你有任何问题,你可以通过下面的链接提交给开发小组:
http://www.microolap.com/support/

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 04 Mar 2010 16:47:42 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=115:microolap-postgresql&catid=36:postgresql&Itemid=57 +
+ + 挑战Oracle 专访PostgreSQL创始人 + http://news.hawebs.net/index.php?option=com_content&view=article&id=96:oracle-postgresql&catid=36:postgresql&Itemid=57 + 当Oracle、IBM、Microsoft、Sybase 等几大数据库厂商在数据库领域处于垄断地位的时候,出现了以MySQL、PostgreSQL为代表的开放数据库,推动开源软件事业发展同时,激烈的竞争无疑让用户获得了实惠。

如今,MySQL前途因为Oracle与Sun并购存在不确定性而变得扑朔迷离,无疑让开源数据库的发展受到很大的挫伤,甚至改变目前的市场格局。而接连受到IBM入股跟红帽1900万美元注资的开源数据库厂商—EnterpriseDB,能否扛起开源大旗呢?为此IT168邀请到了 PostgreSQL创始人、EnterpriseDB发起人、资深数据库架构师Bruce Momjian来为我们解惑。

IT168:请您介绍下EnterpriseDB与PostgreSQL的关系,在中国,可能很多用户对PostgreSQL如雷贯耳,但对EnterpriseDB却比较陌生。


Bruce Momjian:Postgres(PostgreSQL的前身)可追溯至1986年的加州柏克莱大学。已经有20年的发展历史了,该大学在1994年以BSD授权方式将程式码开放给开源社区,社区则加入了SQL支援,然后一直发展至今。

而EnterpriseDB成立的初衷是为PostgreSQL用户提供技术支持。公司成立于2006年,在过去的三年半的时间里,主要的工作是让 PostgreSQL能更好更方便的为企业级用户所使用。通过赞助社区活动,推动社区的发展。而最终的目的,是为更多的人所使用。使迁移更加简便。

EnterpriseDB在PostgreSQL基础上,针对企业级应用进行了专门的优化,同时,增加了一系列如动态性能调优(DynaTune)、 EDB Loader、高效批量SQL处理等高级特性;另外需要需要提的一点是EnterpriseDB基于针对Oracle的兼容性技术国际领先。

IT168:商业数据库市场的产品已经很拥挤了,包括微软,IBM,oracle,Sybase等;EnterpriseDB为何还想进入这个市场?

Bruce Momjian:商业数据库市场的竞争激烈,是公认的事实。为什么要进入?正是因为这是个比较成熟的市场了,技术上达到比较先进的一个平台了。我坚信开源这种开发模式,是非常适合市场的。在操作系统市场上我们已经能看到Linux这个成功案例了。其实你要看10年或15年前的操作系统市场,也是一个很成熟的市场了。但为什么还有开源产品的进入呢?而5年前,我们看到,开源的操作系统为企业用户提供了更好的企业解决方案。所以我觉得同样的道理,EnterpriseDB这个开源数据库也能为用户提供一个更好的解决方案。EnterpriseDB能提供更加可靠的,更加灵活优良的服务。

在这个成熟的数据库市场中,开源数据库与其他商业数据库去竞争,大家也许觉得是不太现实的。其实不是这样的。看操作系统,我们就能够发现开源软件是有优势的。

IT168:关于开源数据库MySQL被Sun收购,Sun又被oracle收购,这一切使得MySQL数据库的前途扑朔迷离。


对MySQL数据库的前途您如何看?您是否认为,PostgreSQL应该担负起过去由MySQL担负的重任?

Bruce Momjian:MySQL衰退,这并不是一件很令人惊奇的事情。我认为MYSQL衰退缘自2个方面的原因,其一,MySQL目标定位不明晰,其二MySQL不是一个纯粹的开源数据库。

之所以说MYSQL目标定位不明晰,是因为其目标定位是在网络应用的用户层面上,而互联网企业要求的是一个快速反应时间和较小的用户量,但相对大用户来说,MySQL就有点捉襟见肘了,虽然他们非常努力去出满足大客户的应用,想扩展企业级,大客户的应用标准,但因为开发的框架不是很明晰,导致先是被 Sun收购,又被Oracle并购。这就是不成功的地方。

另外MySQL不是一个纯粹的开源数据库。MySQL数据库是一个公司的一产品,是一个公司做了绝大部分开发的工作,所以MySQL不是完全意义上的数据库,这是个劣势,不能得到绝大多数人的支持,或让社区更多人参与进来。

PostgreSQL与MySQL不同,PostgreSQL一开始就是定位在ORACLE这些大数据库能做的事情。所以MySQL势力越来越小,而 PostgreSQL却在变大。但随着时间的发展,谁都不知道会怎样。大家可以看到PostgreSQL的增长是有目共睹的,最近有4个关于 PostgreSQL的大会在世界各地举行。

IT168:关于迁移的问题,我们知道,EnterpriseDB在和oracle数据库的兼容性方面表现得尤为出色。请问,您是否有了解一些基于Oracle的核心应用迁移到EnterpriseDB的案例,这其中迁移的工作量和对业务的风险究竟有多大?

Bruce Momjian:我们并不是承诺EnterpriseDB是100%兼容oracle,如果那么做成本非常高,也没什么太大用处。所以只要保证80%就够了,我们有一本非常厚的营销手册,告诉用户怎么去使用。节约了时间,也节约了成本,所以EnterpriseDB不是100%的完美,但能满足大部分用户服务。

我举个FTD关键业务从Oracle迁移到EnterpriseDB的例子,FTP(Florists’ Transworld Delivery)是全球一流的花卉及相关产品和服务供应商。全球拥有50000个分支机构,每年要处理大约1500万订单,年收入约4.5亿美元。 FTD选择EnterpriseDB的一个主要原因,就是它能够编写并运行Oracle下的应用程序,从而大幅降低迁移成本。EnterpriseDB解决方案的成本,只有相同配置Oracle的六分之一。另外EnterpriseDB的兼容能力和便捷的Oracle复制功能让整个处理过程得以在六周内完成,提升性能400%。

IT168:据我们了解,目前国内一些Oracle的核心用户,因为成本的原因,都在考虑选用其它的数据库产品,相比其它数据库,您认为EnterpriseDB在哪些方面可以给企业降低成本?

Bruce Momjian:商业版的产生,是需要企业来雇佣很多的工程师来做这样的工作。是在一个很受局限的环境,由销售人员去觉得研发什么样的产品,其实这是价格非常昂贵的,因为需要付出很多的薪水。但开源数据库在社区当中,成千上万的人同在想一个问题,同时进行开发,因此会有很多很好的想法。而很大一部分人是不需要付出薪水的,完全不需要承担着部分费用,支出成本要低很多,更新也很快,软件产品比商业产品更加先进,这点在linux上体现明显,对比unix我们就很清楚。

商业版的公司目标是盈利,是尽可能多的去赚用户的钱。EnterpriseDB提供给用户,但并不需要你花很多钱。

IT168:关于数据库服务,目前国内被大量采用的数据库Oracle在技术服务方面受到用户抱怨,如果未来EnterpriseDB在中国大量被采用,您觉得如何才能做好数据库的技术服务工作?是否有一些计划和措施?

Bruce Momjian:呵,听到这种抱怨我很开心。其实不仅仅是你们听到了,我们也会经常听到类似的抱怨。我们听到很多用户抱怨只能用Oralce,这种情况使得用户非常的抓狂。如何提供好的售后跟售前是很重要的。有一个重要的一点,如果你使用oracle,那么基本上你被厂商锁定绑定了。即使有不好的服务,你也没有选择,只能接受他们的服务。EnterpriseDB是建立在开源数据库上的,因此遇到问题不仅仅可以从EnterpriseDB获得服务,也能从社区获得服务。

如何要证明EnterpriseDB能做好售后服务,在当前这种激烈的竞争环境下,让我们必须做好售后服务,不然的话,就会失去用户。

IT168:上月Red Hat宣布以1900万美元注资Enterprise DB,能否介绍下这方面的情况?

Bruce Momjian:红帽注资是个非常容易理解的事情,因为我们的目标群体是一样的。用了红帽的产品,既然用了开源的操作系统或者中间件那么在数据库方面也会很容易会选择开源的数据库。这也让两个公司之间合作更紧密。

另外Enterprise DB公司很多员工之前都是受雇于红帽的,如CEO,主管销售经理,等等很多员工都是从红帽过来的。为什么红帽能选择EnterpriseDB,是因为他们有销售开源软件的经验,而且大家都彼此熟悉。

IT168:请问EnterpriseDB的缓存技术icache和其它厂商主推的内存数据库的区别是什么?

Bruce Momjian:缓存技术的出现,是让用户解决存储技术方面的内容。icache利用数据压缩,使数据尽量完全储存在内存里,进而获得显著的性能提升。我们的目标是在低廉硬件环境下存储更多的数据。其他的商业软件可能做不到。这是我们比较突出的一点。

IT168:中国的开发者目前参与全球开源项目的人数非常少,您对中国的数据库开发者和技术开发者参与全球性开源项目有何建议?


Bruce Momjian:在这块,我确实有很多想法,要持续增长社区的规模与人数,这是非常非常重要的。PostgreSQL在日本也遇到这样的状况,使用PostgreSQL的人非常多,但社区参与的却不多。在日本我们的做法是,专门有一组人,去帮助不懂英文的人,去参与到这个项目中去。这会有效的影响到部门员工参与到开源项目,也会影响到企业参与到开源项目里来,比如索尼。这些大公司里都会有部门来参与PostgreSQL。使用者精通某种语言,很容易就能参与到全球的某个项目中。一个小的组织,里可能有1-2个人既懂英文,又懂母语。这样能帮助组织很容易参与到项目里。需要的就是个联系的人。这样可以邀请国外的专家,正在使用的产品的专家,来参与研讨会。语言往往是个鸿沟。

IT168:ITPUB是中国最大的数据库技术社区,中国几乎所有的DBA都在这个社区活跃和讨论问题,而Chinaunix是中国最大的开源技术社区,您想对这两个社区的网友说些什么吗?

Bruce Momjian:其实我们大家都知道,中国是一个非常有潜力的国家。比如奥林匹克。我们看到中国的增长。PostgreSQL是个全球性的社区,我们希望更多的人都参与进来,我希望在PostgreSQL社区中,中国的参与度超过其他国家。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Fri, 19 Feb 2010 19:46:55 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=96:oracle-postgresql&catid=36:postgresql&Itemid=57 +
+ + PostgreSQL创始人:MySQL衰退属必然 + http://news.hawebs.net/index.php?option=com_content&view=article&id=95:postgresqlmysql&catid=36:postgresql&Itemid=57 + Sun被Oracle收购后,关于MySQL何去何从一直被业界争论不休。这个最受欢迎的开源数据库,因为这起并购交易存在不确定性而变得扑朔迷离,导致大量用户流失。近日,PostgreSQL创始人之一的Bruce Momjian在接受媒体采访时表示MySQL衰退,这并不是一件很令人惊奇的事情。 Bruce Momjian认为MySQL衰退缘自2个方面的原因,其一,MySQL定位不明晰,其二MySQL不是一个纯粹的开源数据库。

Bruce Momjian进一步解释:之所以说MySQL定位不明晰,是因为其初始目标定位在网络应用的用户层面上,而互联网企业要求的是一个快速反应时间和较小的用户量,但相对大用户来说,MySQL就有点捉襟见肘了。虽然MySQL非常努力去试图满足大客户的应用,想扩展企业级应用标准,但因为前期开发的框架不是很明晰,导致不是很成功,结果是我们看到的先是被Sun收购,又被Oracle并购。

作为一个小型关系型数据库管理系统,MySQL的开发者为瑞典MySQLAB公司,并在2008年1月16日被Sun微系统公司以10亿美元的价格收购。

Bruce Momjian认为:MySQL数据库是一个公司的一产品,是一个公司做了绝大部分开发的工作,所以MySQL不是完全意义上的开源数据库,这是个劣势,不能得到绝大多数人的支持,或让社区更多人参与进来。

IDC的数据显示,2008年MySQL营收为4000万美元,市场份额为0.2%。MySQL每天下载量约为6万次,是当前应用最广泛的开源数据库, 按照欧盟委员会的说法,其实际竞争力远高于按市场份额计算应有的水平。同时,欧盟委员会还表示担忧,甲骨文收购开源软件数据库软件MySQL可能会消除重要的竞争对手和提高这种软件的价格。尽管Oracle承诺会保持MySQL的独立性,众多反对者还是担心,如果MySQL被最大的私有数据库厂商 Oracle收归麾下,可能遭到Oracle的抛弃甚至打压。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Fri, 19 Feb 2010 19:34:18 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=95:postgresqlmysql&catid=36:postgresql&Itemid=57 +
+ + Yahoo! 的数据仓库 + http://news.hawebs.net/index.php?option=com_content&view=article&id=94:yahoo-&catid=36:postgresql&Itemid=57 + 微软对 Yahoo! 的收购持久战可能让很多人都新闻疲劳了。但今天看到的这个关于 Yahoo! 的技术新闻还是值得看一下的:Size matters: Yahoo claims 2-petabyte database is world's biggest, busiest 。Yahoo! 的 VP Waqar Hasan 在文中披露 Yahoo!的数据仓库当前容量为 2PB。用于分析每月5亿的用户访问行为,每天处理 240 亿次的事件,号称世界上单个最大、最忙的数据库。

尽管有的数据仓库容量要比雅虎的大。但那些 DB 或是存储非关系性数据,或是存储的压缩后的原始数据,不能进行即时分析,雅虎之前的也有数百 T 这样的数据。眼下 Yahoo!数据仓库存储的是结构化、可分析的数据。预计下一年可能膨胀到数十 PB 。eBay 号称数据总量有 6PB ,不过根据一些消息来看,单个最大的 DB 只有 1.4 PB。

Yahoo! 在 2005 年买了一家叫 Mahat Technologies 的初创公司(就是 Waqar Hasan 操刀的),这家公司以 PostgreSQL 数据库为基础,开发了一个新型 DB,其特点是 基于列 的而不是基于行的模式。不难理解,这样数据写入的速度会慢下来,但是读取的速度会快很多【去年的侠客行上,雷鸣在演讲的时候讲过他在百度的时候做的一个优化的例子。和这个思想非常相似,所以当时我说对我"有启发"】。Yahoo! 买了之后,对该产品进行了持续性的改进(内部代号: ELCARO ?) ,比如压缩,并行处理能力加强、优化查询等等特性的添加改进。而针对使用者的接口仍是 PostgreSQL 。这应该也算 PostgreSQL 在顶级企业又一个成功案例。

这么大的数据库并没有采用传统的 SMP 架构构建,而是采用普通 PC 作集群(用了不到 1000 台) 。很明显这是 Share Nothing 而不是 Share Storage 的 DB 集群。通过上述独特的设计方式,能够对此海量数据进行有效的分析,这是个不小的技术革新,也是与 Google Map Reduce 完全不同的计算模式。

让人感慨的是 关于世界上的超大数据库 一文中罗列的数据,现在看惊人起来已经并不了。以前总说信息爆炸,这个时代刚刚来临。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 17 Feb 2010 16:29:26 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=94:yahoo-&catid=36:postgresql&Itemid=57 +
+ + FeedLounge使用PostgreSQL的经验 + http://news.hawebs.net/index.php?option=com_content&view=article&id=93:feedloungepostgresql&catid=36:postgresql&Itemid=57 + 这是我唯一看到的 Web 2.0 公司使用 PostgreSQL 的,可惜还失败了。

FeedLounge 是一个提供在线 RSS Reader 的站点。已经在2007年6月1日黯然宣布失败。这里不去讨论他们失败的各种原因,只说说从他们 Blog 上看来的关于他们选择数据库的经验。

FeedLounge 在数据库的使用上路线是这样的:

MySQL(MyISAM) --> MySQL(InnoDB) --> PostgreSQL

最初是 MyISAM 方式,迁移到 InnoDB ,数据库从大约 1G 膨胀超出了 10G,而且发现引发了新的性能问题,经过尝试发现不能解决后,迁移到 PostgreSQL,总存储从 InnoDB 方式的 34G 缩小到 9.6G,而且,恢复时间也只是原来的大约 1/5 (导出用 Mysqldump,载入用 psql ). 此外,关于内存利用方式上也有一些差异, MySQL : innodb_buffer_pool 6GB + O_DIRECT flush, PostgreSQL 设置上限 2G,只用了 1.2 G。遗憾的是,看不到切换前后性能数据更为详细的对比。

FeedLounge 当时每天要处理的事务量:每天超过 400 万次查询,超过 200 万次的更新/插入操作,高峰期每秒钟有 2000 个更新/插入操作(这应该是批处理阶段)。硬件如何呢? 数据库服务器的硬件:两路 Opteron CPU,8 GB 内存, 6 SATA 7200RPM 16MB 硬盘, RAID 5 ,控制器有 128M. 可以看出来了吧, 7200 转的硬盘 + RAID 5 根本不适合这样的应用。从这一点上说,数据库类型切换其实解决不了本质的问题。

另外看到的有趣参考信息:

FeedDigest 在当时每天有超过 400 万次的查询,超过 200 万次插入,机器硬件只用了双奔四 CPU(2.8GHz) ,1G内存。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 17 Feb 2010 16:20:49 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=93:feedloungepostgresql&catid=36:postgresql&Itemid=57 +
+ + POSTGRESQL文档转移服务器 + http://news.hawebs.net/index.php?option=com_content&view=article&id=48:postgresql&catid=36:postgresql&Itemid=57 + POSTGRESQL文档转移服务器

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 15 Oct 2009 04:06:10 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=48:postgresql&catid=36:postgresql&Itemid=57 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed10.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed10.xml new file mode 100644 index 00000000..b58226ff --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed10.xml @@ -0,0 +1,151 @@ + + + + + HA 资讯 - 综合 + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:53:43 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + 思科推新一代路由器 + http://news.hawebs.net/index.php?option=com_content&view=article&id=120:2010-03-11-07-01-08&catid=30:the-community&Itemid=18 + 据国外媒体报道,思科周二宣布推出新一代的运营商级路由器,称其将以大幅提高的速度和传输能力“改造”整个互联网,在不到4分钟时间里传输完成迄今所有问世的电影。

+

 

+

思科称,新一代的运营商级路由系统名为“CRS-3”,其传输能力较最接近的竞争性产品高出11倍以上。这种新系统能以每秒 322T(Terabit)的速度传输语音、数据和视频,“传输能力相当于前一款产品的三倍”,“能在略高于一秒钟的时间里下载美国国会图书馆的全部藏 书”。该款路由器计划在今年第三季上市,售价为9万美元,如果全面部署,类似的高速传输系统的成本最高可达100万美元。

+

 

+

思科还称,AT&T已经对这种新产品进行了成功测试,“这是世界上首次针对100Gbps级骨干网技术的现场测试”。此外,这种新系统还能“让中国的每个人都能同时进行视频通话;在不到4分钟时间里传输完成迄今所有问世的电影”。

+

 

+

思科指出,设计生产CRS-3系统“旨在更快地为个人消费者带来令人感叹的新体验、为服务提供商创造新的收入机会、以及在工作领域提供新的合作方式,从而改造宽带通信和娱乐行业”。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 11 Mar 2010 07:00:26 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=120:2010-03-11-07-01-08&catid=30:the-community&Itemid=18 +
+ + 从“熊猫烧香”案看中国黑客网 + http://news.hawebs.net/index.php?option=com_content&view=article&id=114:2010-03-01-01-16-21&catid=30:the-community&Itemid=18 +
这款“熊猫烧香”电脑蠕虫病毒由27岁的李俊编写,它在2006年和2007年曾在中国感染了数百万台电脑,李俊本人最终也因此坐牢。通过诱骗电脑用户打开一则看似友好的电子邮件,“熊猫烧香”病毒得以从一台电脑传播到另一台电脑,它会将电脑游戏网站的用户密码、财务信息和现金余额窃取到李俊的那些同谋者手里,而在被感染的电脑里留下一个熊猫卡通形像作为他们自己的名片。

当谷歌公司(Google Inc.)上个月指控说它和其他20多家公司的内部网络在一起网络攻击中被攻破时,它说这次攻击是从中国发起的,就复杂程度而言,这一被称做“极光行动”(Aurora)的网络攻击比“熊猫烧香”要高几个量级。与留下“名片”且迅速、随机传播的“熊猫烧香”电脑病毒不同,“极光行动”的发起者会将目标对准那些自己所袭击公司的特定员工,并且会竭尽全力掩盖自己的踪迹。

目前尚无证据显示谷歌遭受的这次网络攻击与熊猫病毒事件有任何关联。外界清楚的是,李俊是在中国的一个黑客网内学到了电脑病毒开发方法并发起网络攻击的,这一黑客网对全球电脑用户来说仍然是一个实实在在且日益增大的威胁。

人们很少能追踪到中国黑客的身份、动机和手法。但基于对安全专家的采访、独立科技公司的鉴识报告及黑客们自己的叙述,人们能够以“熊猫烧香”案为窗口对中国地下黑客网的运作情况有一个难得的了解。

据美国的技术安全公司赛门铁克(Symantec Corp.)称,李俊的熊猫案是中国借助电脑病毒的互联网有组织犯罪第一案。电脑一旦被“熊猫烧香”病毒感染,电脑桌面上每个可执行文件,比如微软(Microsoft Corp.)的Word文件,其图标会变成一个熊猫形像。若点击这个熊猫形像,电脑会立刻开始下载互联网上的一款软件,而这款软件则能让李俊的电脑获取这台电脑存储的财务信息。

网络专家们说,黑客论坛很有可能成为中国政府有力的黑客招聘场所,中国政府正日益担忧其自身的网络安全。事实上,据一名正式参与传播“熊猫烧香”病毒的人说,他后来被中国警方雇佣,从事了侵入互联网用户电脑帐户的工作。这一说法无法得到独立消息来源的证实。

中国对它是黑客天堂的说法嗤之以鼻。国务院新闻办公室网络局的官员彭波二月中旬对国有媒体说,中国政府从未支持或参与过网络攻击,也永远不会这样做。他说,事实上中国是遭受全球黑客攻击最严重的国家。

据一位知情人士说,正在调查谷歌遭网络攻击的人员虽然仍不知道攻击是从什么地方发起的,但他们一直在调查上海交通大学和山东蓝翔高级技工学校的电脑是否与此次袭击有关。《纽约时报》(New York Times)上周四报导说,此次攻击的调查人员追踪到了这两所学校的电脑。

李俊落网后以破坏计算机信息系统罪被判处四年监禁,他去年12月在服满三年刑期后获释。李俊虽然拒绝正式接受采访,但在一系列短暂的电话通话、网上聊天以及电子邮件中,他表示自己正在寻求“新的开始”,或许可以做一名网络安全专家,即所谓的“白帽”。李俊获释后,在他父母于武汉郊区的三层楼房内住了几天。他已经用自己的宏碁 (Acer)笔记本电脑与熊猫案的其他涉案人员取得了联系。李俊说,他有兴趣与这些以前的同谋一起从事合法生意。

李俊的黑客生涯开始于1999年5月,距他17岁生日还有一个月,当时美国飞机轰炸了中国驻贝尔格莱德大使馆。这次轰炸激怒了正在武汉的网吧里游荡的李俊,他不再玩电脑游戏,开始成为一名黑客。

李俊是从他儿时认识的雷磊那里学习技术的。雷磊在一次采访中说,李俊学会了如何控制数千台电脑使之成为“肉鸡”,从而对网站发起攻击。据雷磊称,当北京的学生在向美国大使馆投掷石块时,两位瘦削的年轻人在武汉一家昏暗网吧的二层,发起他们自己的“对美黑客战”,扰乱了二三十家美国网站。李俊通过电子邮件说,我们当时太年轻,净干些疯事。

雷磊回忆,接下来几年里,两人组成团伙进行黑客攻击,从网民手中盗取资金。他们从网上下载简单的攻击程序攻入游戏账户,盗取玩家的虚拟货币然后卖掉。游戏玩家为提升级别,会购买一些特殊武器或其他物品,这些东西是可以换成现金的。

现年27岁的雷磊因“熊猫烧香”案受到和李俊类似的指控,在湖北省关押李俊的同一座监狱呆了一年,2008年释放。雷磊目前在其父亲位于武汉的制造企业工作,计划开办一家网络安全公司。而身穿皮衣、喜欢美国嘻哈音乐的李俊,仍然蔑视权威,在一次采访中,为了避开交通拥堵,开着他的豪华丰田(Toyota)汽车在武汉的街道上逆向而行。

两位黑客说,他们加入一家网上黑客联盟“小刀会”之后,技术日益提高。“小刀会”的名字来自于清朝的一个起义团体。李俊使用了网名“WHboy”(武汉男生)。

网络安全专家说,中国黑客从总体上并不像好莱坞影片中的那种固定模式:美国地下室里精通电脑的孤独天才,或把电脑玩得出神入化的俄罗斯犯罪团伙成员,他们设计并执行攻击,获取各种各样的利益。相反,中国的黑客团体是一个广泛分布和结构松散的数字技工群体。

李俊通过电子邮件回答《华尔街日报》提问时说,至于中国黑客,他们的整体技术水平赶不上美国或俄罗斯的黑客,但中国拥有世界上最大的黑客群体。他还提到自己与外国黑客的交流,他说,我经常从他们的网站上下载黑客软件,拿来跟我或其他中国黑客写的程序作比较。

网络安全专家说,在中国的黑客圈里,人人都有具体分工,而且是按件出售自己的作品来获取报酬,而不是为了较高的绩效评分而工作。恶意程序的编写人员常常是利用从其他人手中买到的代码拼凑成自己的程序,李俊也不例外。整个操作过程就像是流水线一样:编写人员编好程序后就卖给其他人,买到这些程序的人会发动更大范围的攻击,传播恶意软件,启动它,并分享回报。

一家美国大型科技公司驻上海的中国安全研究专家说,这种链条模式是中国独有的。他说,中国黑客活动的组织架构像是多层次直销甚至是传销,而不是结成一体的犯罪团伙,从无到有地编写“技术干净”的代码。

李俊说,和中国多数黑客一样,他也是在那些谋划技术攻击的聊天室网络里成长的,这种网络不正式,但很活跃。黑客和网络安全人士表示,这些论坛跟犯罪培训学校加硬件商店没有什么区别,形成了一个网络地下世界,在这里,网络游戏、银行网站和苹果(Apple Inc.)iPhone技术秘密的门锁承受着来自世界最大网民群体的严酷压力测试。

黑客们说,为了规避禁止销售恶意软件的法律,编程人员把他们的黑客行为变相地宣扬成“培训”或“辅导”。想成为经销商的人在拉顾客时,把自己叫做“送信员”,而急于在地下世界树立声誉的“脚本小子”则会购买黑客工具并启动攻击。

举例来说,在传播过程中,任何人都可以利用一种病毒,让它攻击另外一个目标或是窃取不同的数据。附赠的所谓“信封”也有售:模仿现有网站的源代码价格为人民币50元(约合7美元),网站用户数据要价500元。论坛所有者和参与者掩盖了自己的身份。参与其中的主要障碍在于中文。

网络安全专家说,黑客“众包”的做法(crowd sourcing,即很多人共同编写和执行代码)降低了个人面临的风险,而且即使有人被抓或论坛被关闭,网络本身也不会受损。李俊在发给《华尔街日报》的电子邮件中回忆道,2006年10月,他曾经求助于这些论坛,想从几种网络帐户窃取资金,买一辆路虎(Land Rover)。

在武汉市中心租来的公寓里,李俊用一台戴尔(Dell)电脑设计了“熊猫烧香”病毒(现在的正式名称为W32.Fujacks),该病毒会向网络用户发送一个软件包,从游戏网站等10种不同途径窃取虚拟货币点数和其他项目。这个软件利用保护不力的防火 ,几乎可影响任何连接互联网的电脑。

李俊在这些黑客论坛寻找可用的代码,最后选中了一个名为“Nimaya”的病毒脚本。雷磊说,作为反馈,在黑客界的“同行评审”中,李俊将自己编写的东西的样本发到了大富翁编程网站(delphibbs.com)之类的论坛上。李俊在电子邮件中说,如果没有科技的创新、分享和交换,黑客技术不可能这么快发展到今天的地步。

几周后,李俊用一个窃取自QQ聊天的图标作为他长达数万行的代码的标志:举着三根香的熊猫。他将从网站窃取资金的工具拿去出售,最初找了10个分销下线,向每个下线收取了约120美元。

赛门铁克(Symantec)说,“熊猫烧香”以惊人的、数百万倍的频率复制。它令一些收到者想起了六年前源自菲律宾的“我爱你”(ILOVEYOU)病毒。但“熊猫烧香”还有一个恶意功能:黑客可以利用其“后门”从流行的网络游戏中窃取虚拟货币,包括腾讯公司(Tencent Inc.)运营的那些游戏。腾讯发言人说,许多公司都受到了影响,并拒绝就“熊猫烧香”事件置评。

雷磊回想起两个人没日没夜地试图转卖他们窃取的虚拟财产。他们以面值10%的折扣向网络买家出售,“就像Ebay一样”,雷磊说。这种伎俩赚了多少无法确知,不过雷磊说有时他们一天可以赚1,200美元。他们一起狂欢,李俊还买了台2,000美元的电脑,不过雷磊说除此而外他们并没花掉太多。

不久,中国网民以及政府机构纷纷谴责“影响极坏的熊猫烧香”。“熊猫烧香”的改进版或复制版开始造成其他损害:导致电脑蓝屏、运行速度变慢、系统崩溃、程序被清除。2007年初,两人意识到“熊猫烧香”已经失控,计划逃往中国西部。当时警方已经跟踪到“熊猫烧香”的源头是李俊和雷磊在武汉租住的月租合72美元的公寓。警方2月3日突袭这间公寓时只有李俊一个人在家。

剃了光头的李俊戴着手铐出现在法庭,被判犯有破坏计算机信息系统罪及盗窃18,000美元。

雷磊后来被捕。警方在浙江、云南和山东省逮捕了其他参与“熊猫烧香”攻击者,其中一些也被判刑。许多人的身份没有公布,包括促使“熊猫烧香”传播及从中获利者。

在李俊开始为期四年的刑期时,国有媒体拍摄了身穿黄色上衣的他在监狱里用电脑清除“熊猫烧香”病毒的照片。(不过没有效果。去年11月,网络安全公司McAfee Inc.警告说“熊猫烧香”病毒的新变种正在传播。)

去年12月,李俊因表现良好提前获释。他第一个电话就打给了雷磊。

在类似Twitter的新浪微博上,李俊的关注者迅速扩大到17,000人,他发布了一条有关未来计划的意义含糊的信息:“牛奶会有的,面包也会有的,一切重新开始。”]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 01 Mar 2010 01:13:07 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=114:2010-03-01-01-16-21&catid=30:the-community&Itemid=18 +
+ + 悼念王选:伟大发明家和失意企业家间的孤独者 + http://news.hawebs.net/index.php?option=com_content&view=article&id=73:2009-12-19-02-41-47&catid=30:the-community&Itemid=18 + “就像新闻联播里的国家领导人一样,感觉很遥远。”当微软亚洲研究院的曾凤萍来到王选的灵堂,向自己的师爷——王选告别时,他对王选还是那么陌生。王选已经淡出人们视野好几年了。直到2006年2月13日,他的突然辞世才重新引发人们的关注。“全国停用一天激光照排”可能是对王选最恰当的悼念方式,不过谁又敢让全世界中文阅读者一天没有任何报纸可看。但也许只有这样,人们才能深切地感受到,这位老人曾怎样改变了我们的生活。但又有谁知道,一个有市场头脑的卓越学者,伴随着革新中文印刷事业的巨大成就,孤独地游走在校园和企业、学术和市场之间——他的成功与失败皆源于此。

冷门的选择
上海衡山路,著名的情人街,浪漫的小洋楼展示着曾经的陈旧与辉煌。69年前,王选就诞生在这条街的964弄15号。弹指一挥间,一切物事人非。在如今已是太平洋商厦的繁华胜景里,谁还能凭此追忆当年法国梧桐遮掩下、昏暗狭窄的石库门里,曾经有个伟大的生命在此呱呱坠地。“这个孩子我不想要了。”在上海衡山路一幢二层小楼里,心烦意乱的周邈清对丈夫王守其说,因为照顾4个孩子,她已经够累了。此后因为忙,周没顾上这事,王选作为他们的第5个孩子在1937年2月5日还是降生了。王家是典型的严父慈母。父亲毕业于南洋公学(现上海交通大学),当了一辈子的会计,做事认真到难以想象的地步——写信必用复写纸留底,别人的来信则要按时间整齐地排好。他的爱国情绪在日据时期表现得淋漓尽致,曾经大女儿为省钱买了一把日本的铅笔,他勃然大怒,一把夺过来扔到炉中烧了。父亲的言传身教,被幼年王选看在眼里,不自觉地受到影响,惟独在日常生活中东西乱放这点不像父亲。
1954年,王选考取了北京大学数学系。中国从那年开始全面学习前苏联的教育体制,该级生源之好在数学系历史上空前绝后,后来共出了6名院士。现北京大学数学研究所所长张恭庆院士和王选在中学和大学都是同学。在他的印象中,王选的成绩非常优秀,“他在各方面都对自己都要求很高,从小就乐于帮助学习有困难的同学。他选择专业方向,也是从国家需要考虑的,而不是个人,这给我的印象很深。”张恭庆院士说。大二下学期分专业,那时数学被看成是科学王冠上的明珠。学习好的同学基本上都选择了数学,王选却出人意料地挑中了当时大家都不甚了解的冷门专业——计算机。若干年后,王选称,这是因为他觉得计算机大有前途。对此,张恭庆的评价是:“我相信他有这样的眼光。”

年轻的老病号
1958年,北大决定研制一台“红旗机”响应轰轰烈烈的大跃进。在研制者的计划中,这是一台可以每秒进行1万次定点运算的中型计算机。如果成功,其运算速度在当年可以排进世界前20位。留在无线电系任教的王选成了逻辑设计的主力。在狂热的“大跃进”氛围下,王选经常连轴转,他曾经40个小时没合眼。可偏偏又赶上“三年自然灾害”时期,为了省口粮,他晚饭经常只就着黄酱喝碗稀粥,全身浮肿却仍旧没日没夜地工作。“红旗机”最终流产了,王选则开始不明原因的低烧,他的肺部查出有阴影,吃了各种药也不见好转,只能回上海家中休养。“同志们,永别了。”在火车站,王选的一句玩笑让同事们潸然泪下。事实上,王选的先天体质就不好。张恭庆院士回忆说:“王选看上去始终很瘦弱,脸色不好,中学时就那样,他有先天性哮喘。”3年后,刚回到北大的王选因为参加劳动一病不起,再次返回上海。此时政治环境已不允许他静养,因为本就是“右派”的父亲又戴上了“现行反革命”的帽子,王家被查抄。1968年年底,王选由于“偷听敌台广播”(学英语)被勒令返回北大上学习班。在此期间,他再次开始莫名其妙的低烧,只要一动就大口喘气,虚弱到连出门的力气都没有。此后的6年中,王选成了“劳保”户。他的邻居,法律系的金瑞林老师,就经常看见坐在北大佟府院子破木椅上晒太阳的王选捂着胸口剧烈地咳嗽。看着高高的枝头上挂着的几个孤零零的柿子,靠在椅子里的王选苦涩地想起同事们的安慰之语:你以后可以翻译些资料什么的。大家都觉得,他以后再也做不了研究工作了,但他真不甘心,满腹的知识和想法就晒太阳了吗?

当代毕昇
《澳门日报》的工人抱怨:“不是我们不愿用铅字,而是我们在澳门已经雇不到愿意去拣铅字的工人。”卧病多年、几乎被无线电系遗忘的王选意识到,如果这一切都能用计算机操作,结果将大不一样!激动不已的他决定着手研究,也算给自己找点事做。鸦片战争以来,有一种产业格局一直压得中国人抬不起头:中国技术与国外同类技术放在一起比较时,前者落后得仿佛大家不属于同一时代。但王选的激光照排技术改变了这样的格局——他选择的不是追赶,而是直接超越。最终,国外的排版系统全部被赶出中国市场,中国的铅字排版在几年内也一阵风似地都换掉了。很多人将王选最大的贡献归为激光照排系统,但确切地说,是他改变了一个行业!对市场的敏锐成就了王选,但也让他从一开始在北大就不被传统的眼光认可,直至今日。1975年,王选的妻子陈堃銶听说了“748工程”。这是为了解决汉字的计算机输入/输出问题,国家于1974年8月设立的重点科技攻关项目——“汉字信息处理系统工程”,包括三个子项目:汉字通信系统、汉字信息检索、汉字照排系统。其中汉字照排是利用计算机和相关的光学、机械技术,进行汉字的输入、编辑、输出、印刷等操作。美国报界在1970年前后已全部采用电子排版,但中国仍然在拣铅字:拣字员端着拣字盘,在几平方米的拣字房里一天要走几十里;拼完版后还要把这些版捆在一起打样张,有好几十斤重。铅对人的神经系统伤害极大,刷子和去污粉怎么也刷不干净钻进指甲缝里的油墨。铅字印刷的痛苦深深地印在每个排版工人的心中!他们迫切希望,有一种技术能替代这种原始的劳作。据了解,当时国际上流行的电子排版系统属于第3代,第4代(用激光扫描的方法来还原输出)正在研制中。在信息存储方面,已普遍淘汰模拟式而采用了数字式,用点阵的方式,即用无数的小点来描述字符。这对只有26个字母的英文来说当然没问题,但中文却有上万个字!如果每个字都用点阵来表示,字库会相当巨大,庞大的信息量对当时计算机的处理速度和存储能力而言,实在难以承受。良好的数学背景让王选很自然地想起信息压缩的办法,即以一种特征来描述巨大的信息量,具体办法是用线段(笔画)来描述字形。这种矢量算法是一种根本性的进步,不仅解决了信息量的问题,而且在字形放大时不会出现毛边。10年之后,当西方遇到激光打印机的文字保真问题,才想起了矢量算法。然而,1975年11月初“748工程”报告论证会上,王选在满怀希望呈报自己的方案时,却被大多数人斥为“玩数学游戏”。会议最终选择了一个二代机(光学机械式)方案作为“748项目”。王选遭受沉重打击,但他执拗地认为自己的判断是对的。天无绝人之路,当时四机部计算机工业管理局局长郭平欣非常欣赏王选的数字式存储思路,并在10个月后越过重重阻挠为王争取到了机会,这样就在事实上形成了两个“748工程”并行的局面。在考虑汉字信息的高速还原和输出问题时,王选再次有了“跨越式思维”:搞应用必须着眼于系统成熟时的国际技术情况;否则等产品研制出来,就已经落后了,只能永远跟在别人后面亦步亦趋。于是,他毅然跳过第二代、第三代(阴极射线管)排版系统,直接跨入国外还没有商品化的第四代系统,用激光扫描的方法来还原输出,也就是我们现在所说的“激光照排”。“王选想搞第四代,我还想搞第八代呢!”对这么一个小小助教加长期病号的狂妄想法,很多人嗤之以鼻。“王选怎么去搞黑不溜秋的印刷!”不少计算机的同行都瞧不上他!在他们的眼里,数据库的结构、操作系统才是正经的学术研究。在北大,尤其是理科,一直以基础研究为重点,应用研究很少。王选所做的东西实质上是印刷,与向来阳春白雪的北大学术正途和北大传统格格不入。当时,王所在的无线电系明确表示不支持,原定的会战班子根本组织不起来;合作单位新华社也停止了配合,项目被整体搁置了。小方鹏就是那时注意到王选的。“他总穿一件破中山装,骑辆破自行车,在北大南门的国槐大道上来来往往,和其他普通老师没什么两样。”不知为什么,从小在北大长大、见过无数书痴的方鹏,一下子就感觉这个人很孤独。身为北大老师的爸妈告诉他,那人叫王选,他们系的人对他搞的那些东西压根瞧不上!

新的印刷革命
别人不相信,王选就Do it yourself(自己动手),从1975年一直做到1993年,18年里没有节假日、没有周末。王选夫妇没有孩子。功成名就之后,王曾说自己特别理解一句名言:“一个献身于学术的人就再也没有权利像普通人那样生活。”1977年,电子工业部、新华社和北大召开的三方会议让“748工程”重新得到了支持。兴奋之极的王选觉得前景一片光明,但上天似乎一定要让他饱经磨难。1979 年,英国蒙纳公司(该公司于1976年发明了第四代激光照排机——Monotype,但只能用于英文排版印刷;同时期还有美国IPX公司、HTS公司等则都在抓紧研制汉字激光照排机)要来中国展览他们的第四代机,并引起多家出版单位兴趣的消息让王选有些蒙了,也急了,他的四处奔走最终使有关部委压下了这股引进风。1984年初,第2次引进高潮汹涌而来,行政命令此时已不能解决问题,《人民日报》海外版、新华印刷厂等有钱的大报和印刷厂纷纷引进国外产品。“748工程”的一些协作单位也蠢蠢欲动要撤出,甚至放言“今秋印刷展开幕之时,就是‘748工程’垮台之日”。1984年底,美国IPX公司到新华社介绍产品,当时尚在与北大合作的新华社工作人员在地下室里调试软件时不客气地说:“人家都有现成产品了,你们还搞什么?”气得工程师王增抗吃不下饭。在那段艰难的日子里,大家咬牙坚持着,并给系统起名“华光”,意为中华之光。1985年7月,在纽约HTS公司总部,HTS总裁春风得意地告诉王选,他刚从北京回来,已经和《人民日报》签订了430万美元的照排设备合同。王选大受刺激,就在两个月前,前后历时5年、6家单位通力协作的华光II型系统刚刚通过了国家级鉴定。与外界的压力相比,华光在研发和试用中遇到的问题更让人头痛。在国家政策的倾斜照顾下,华光Ⅲ型获得的第一个用户是《经济日报》,在运行过程中,重字、重行、丢字、丢行等错误频频,标题移动困难,改过的错字有时又会悄悄跳出来;电源设计不合理、抗干扰性差、扫描抖动、暗盒不严、走纸不匀等一系列问题让《经济日报》忍无可忍,曾发出最后通牒:“如果不解决问题,就退回铅排作业。”华光公司只能立刻调集北大、潍坊、杭州等地各方技术骨干跟班作业,随时解决出现的“火情”。多番周折后,系统才运行顺畅。 1987 年下半年,华光Ⅲ型的运行越来越顺利,效益也大大提高。10月,党的13次代表大会在京召开,大会工作报告全文34000多字,《经济日报》在收到新华社电讯稿之后,立即上华光系统进行计算机排版,整个过程仅用20分钟,其他大报则召集一批最熟练的铅字排版工人,苦战了三四个小时。激光照排的威力充分显示出来,并因此名躁天下。1988年7月18日,《经济日报》卖掉了一切铅作业设备,告别“铅与火”,迎来“光与电”,在当时引起极大轰动。《人民日报》当时撰文“如果活字印刷是一次印刷革命的话,这个系统的诞生,将是一场新的印刷革命的开端”。王选被称为“当代毕昇”。1988年,华光IV型投入批量生产。由于采用两块专用的超大规模集成芯片,它大大加速了字形复原速度,每秒可复原710个字,是当时世界第一。华光 IV还能提供多种艺术字体、上百种花边和上千种网纹,并实现了文字和图形、黑白照片的合一处理……这些功能当时即使在国外的中文、日文照排系统中也闻所未闻。物美价廉的华光Ⅳ型迅速普及。
“在电脑激光照排车间,十几台电脑前坐着十几位穿白大褂的姑娘,姑娘们纤细的手指在键盘上灵活起落,仿佛弹奏着美妙的乐曲……而过去的铅排车间里到处立着一排排黑乎乎的铅字架,一个个铅字要从架子上拣出来,码成一篇篇文章,再放到铁案上拼成大样。”这是 1988年12月6日,《经济日报》记者詹国枢对报社使用激光照排前后的描述。显然,汉字印刷业经历的是一种翻天覆地的变化。过去出书很难,一本书要半年甚至一年才能排出来,现在3天就排完了。而对于普通人来说,以前的报纸字体非常少,版式也很简单,顶多就是套个红印;而后来出版物的版式越来越复杂,彩色出版物也越来越多,这都与激光照排系统的发明和进步有关。1989年底,国外的照排系统被迫全部退出中国市场。

校园里的先行者
“王选”和“方正”,两个词是紧密联系的。在王的照排系统横扫中国时,方正,这家当时在中关村那家倒腾电脑的公司也摇身变成了一家极有发展前景的高科技公司。“老师”和“企业的管理者”,两个大相径庭的角色,原本要求的就是两种完全不同的人格和素质。当王选从北大教授变成方正的高层时,必须接受人们像对待企业家那样残酷无情。在北大,王选还可以以Do it yourself的方式最终获得别人的尊重,而在企业的名利场上,最终他无能为力。“如果仅仅为了报专利、评职称,目的早就达到了。从一开始我们就是想让中国甩掉铅字。”1982年,一位领导告诉王选,很多部门担心激光照排系统的原理性样机不能继续改进并投入实用,因为很多高校的科研成果都只是为了献礼、评奖、评职称,王选不假思索就说出了以上的话。学校里有技术的人很多,但很多研究成果根本无法转化为效益和生产力,像王选这样能把钱和技术结合得很好的很少。在方正有了爆发性盈利时,“748实验室”(后为北大计算所)也有了充足的资金。而像王选这样,能够根据市场的需求来确立自己研究方向的在北大更是少之又少。“他对我们的要求是‘顶天立地’,技术要一流,同时做出来的东西要实用。” 王选的学生、现方正研究院院长及CTO肖建国回忆道,王选确定科研课题前,都会先花大量时间考虑:这个技术演化下去会成为什么样的产品,在市场上会有什么反应;或是现在市场上需要什么产品,我们的技术能不能演化过去,从市场驱动和技术驱动进行双向思维。聪明的人有很多,而市场头脑正是王选不同于其他教授、用自己的发明造福社会的根本原因。1989年夏,在北大档案馆前的一棵大树下,王选找肖建国谈话,要他转课题,做彩色出版。当时国内的彩色出版物还不多,国际上连研发这项技术的试验设备都还很少,只能根据揣摩和替代设备来研究。两年后,成果一诞生就立刻成了世界领先。曾经人们以 “当代毕昇”来称呼王选。对于这个评价,有人则认为是一种贬低,等于完全将王选从学者这块剔出来了,毕昇只是一个匠人。王选的东西是可以卖的,而学者的东西是无法卖的——从北大的价值观来看,王选也许不那么成功,但对社会来说他的成果转化为巨大的生产力,是最伟大的科学家。

+

“狂妄”的推销者
1988年春,北大的校办企业北大新技术公司介入了激光照排系统的生产和销售。那是一群人们眼中“不务正业”的老师攒起来的,在中关村“倒卖”PC,学校则会把一些不要的人往那儿塞。1991年3月8日,王选和一直生产和销售激光照排机的潍坊华光公司分手,从此,北大新技术公司和王选的激光照排紧紧地绑在了一起,并重新为系统取名 “方正”。方正和华光成了市场上的一对死对头,失去研发支持的华光很快就败下阵来。1993年2月,方正集团正式成立。王选领导的北大计算所逐渐融入其中。“在大厦周围,你们都可以开着车跑来跑去,你们会挣到很多钱!”这就是王选给方正员工描绘出的诱人前景,“物质的事情你们不用想,你们现在的业务很神圣,你们是当代的毕昇!”刚刚毕业的北大研究生李毅,听得热血沸腾,和一帮同事们干得特别卖力。那时李毅经常跟着王选一起见客户或开会。有次劝说《辽宁日报》不要采用华光系统,王选直截了当地对那位总编说:“错过这一次,就没人可以救你了。华光没有研发,你要用他们的,出报会比别人差,以后是死路一条!”这种狂放的言语让一旁的李毅听得很吃惊。王选有个习惯,不管出差到哪儿,上飞机后总要先看报纸——用放大镜看那些字,就能看出来用的是哪家的技术。早些年很有趣,后来就没意思了,因为基本上都是自己的了。现在北美的每一张华文报纸用的都是方正产品,欧洲基本也如此。王选特别关心的日本,也有100多家用了方正的技术。打败华光后,客户已没有什么可比较的,就是排着队签合同。
“优惠5%行不行?”
“对不起,只能优惠2%。”
“算了,这2%我不要了,什么时候能保证我联机啊?”
现已是某跨国公司高管的李毅回忆起方正岁月还有几分留恋,“哪像现在成天研究竞争对手,打得一塌糊涂。”“那个照排卡插到机器里、报纸裹一裹(连包装都没有),就卖几十万。那个卡比金子都贵。”李毅说,“那是我感到技术最值钱的时候,方正稀里糊涂地挣了那么多钱!”

+


功成身未退的烦恼
方正系统红遍大江南北。它的发明者——王选,被人们奉为“中国激光照排之父”,名片上多了行“方正控股有限公司董事局主席”。
王选并不喜欢生意场。上世纪80年代末,当时的香港商人张旋龙慕名找来,但王选根本不理他,他看不起商人。后来在湖南举办的一次亚细亚国际文字会议上,二人再次相遇。张旋龙看到王选“就穿着凉鞋、短裤,吃饭的时候也不和人讲话。别人敬酒就说‘不会喝’;吃完就走,也不打招呼,根本不懂得应酬”。但王选明白,必须借助生意人。为了打开日本、欧美市场,他找到了会做生意的张旋龙,2002年还力挺张成为方正控股(总部在香港,是方正所有海外分支机构的管理平台)的董事局主席。王选在很多场合都说自己只是一个科学家。但他身处方正控股董事局主席之位,无怪乎别人用企业家的眼光去审视他。1999年方正爆发的“逼宫事件”,让“王选系”这个名词开始挂在很多人嘴边。在随后的很多报导中,王选被描述成方正拉帮结派文化的代表。王选是真正掌握着内部的权力,还是只是代表企业形象?“一讲话就知道了,(王选)根本就没有公司的概念,对于利益不理解。”在方鹏的印象中,王选对员工讲话就像老师和学生谈话,谈的更多的是理想,是勇于面对挑战,是怎么把事情做好。“一想起王选,我就觉得他是个极孤独的人,不知道为什么。在北大是这样,后来到了方正还是这样。”方鹏说。在北大要谈学术,到方正则要谈钱。王选从没公开谈过和那些商人在一起的感觉。2002年7月,王选真正淡出了方正,也远离了是是非非。激光照排,这个当初激动人心,改变了一个产业的发明,就像很多改变了我们生活的了不起的发明一样,随着它逐步成为很成熟、很基础的东西,也就不再有人关注。
直到2006年2月13日,王选突然辞世,把他重新拉回我们的视线。“只要你读过书、看过报,你就要感谢他,就像你每天用到电灯要感谢爱迪生一样。”王选走了,北大未名BBS上,有网友这样留言。王选走了,但他又还活着,这不仅是指他发明创造的激光照排依然泽被后世,他的精神也不失为唤起中国科技界探索创新的号角。更值得感动的是,王选是在拖着孱弱的身躯,在不被大多数人理解的环境中独自打拼出今天的局面。因此,无论他被包装成什么样,无论他在什么位置上,他本质上只是一个科学家——一个改变了我们生活的伟大科学家!

(注:文中的方鹏、李毅,应被采访者要求,均为化名)

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Sat, 19 Dec 2009 02:37:07 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=73:2009-12-19-02-41-47&catid=30:the-community&Itemid=18 +
+ + 美国证券市场概述 + http://news.hawebs.net/index.php?option=com_content&view=article&id=71:2009-12-05-04-47-38&catid=25:the-project&Itemid=18 + 美国证券市场历史悠久,它萌芽于独立战争时期。第一次和第二次产业革命使股份制得到迅猛发展,企业纷纷借助证券市场筹集大量资金,1929年经济大危机后美国政府加强对证券市场的立法监管和控制,整个市场进入规范发展阶段,美国的证券市场也因此而快速地发展成为世界最大的证券市场。仅纽约证券交易所 2002年的证券交易额就为10.3万亿美元,占全球证券交易量的77%,居世界第一,美国的证券市场已成为国际经济的“晴雨表”。所以,美国的证券市场对于正处于发展阶段的中国证券市场而言是具重要的借鉴意义的。

+

美国证券市场投资品种十分丰富,有证券和股指(如道琼斯指数、标准普尔500指数等)的现货、证券和股指的期货及期权、可转换债券、信托凭证(ADRs)等品种。投资者不仅可以进行各类品种的单独投资,还可以进行它们之间的套戥交易,避免因各类投资者行为趋同而造成市场单边运行,出现暴涨暴跌的局面。例如投资者可以在股市看跌时,通过买入一个看跌期权或卖出股指期货合约,以较小的代价实现保值避险或投机盈利的目的,使股市投资风险得到有效的分散,从而减少因大量抛售带来的股市进一步下跌。

+

美国证券发行市场是国际性的市场,发行规模和容量都很大。仅纽约证券交易所一家在2002年就有挂牌交易的上市公司2783家,发行总股本3499亿股,市价总值为13.4万亿美元。我国的证券市场只为国内的企业服务,截止到2003年底全国有1287家上市公司,发行总股本6428.46亿股,其中流通股份为2267.58亿股,通过证券市场共筹集资金1万亿人民币。我国的B股市场作为筹集外资的场所,一直与A股市场分离,自成立以来一级市场一贯清冷, 1991年至2003年底B股市场IPO(首次发行)仅筹集资金46.75亿美元,而通过B股市场配股筹资到的资金仅为3.27亿美元。

+

 

+

美国股票市场的特点

+

美国有多层次的股票市场:美国有四个全国性的股票交易市场。公司无论大小,在投资银行的支持下,均有上市融资的机会。美国没有货币管制,美元进出美国自由,且政策鼓励外国公司参与投资行为,成为世界金融之都;

+

资金供应充沛、流通性好:数量巨大、规模各异的基金、机构和个人投资者根据各自的要求和目的在不同的股市寻找不同的投资目标,为美国股市提供了世界上最庞大的资金基础,从而使美国股市的交投十分活跃,融资及并购活动频繁;

+

融资渠道非常自由:上市公司可随时发行新股融资。发行时间与频率没有限制,通常由董事会决定,并向证券监管部门上报。通常如果监管部门在20天内没有回复,则上报材料自动生效。如监管部门提出问题,则回答其问题。通常监管部门有30天的必须答复时间下限。当公司股票价格达到5美元以上时,上市公司股东通常可将其持有的股票拿到银行抵押,直接获得现金贷款。上市公司还可以向公众发行债券融资;

+

管理层个人利益最大化:公司管理层可直接持股或拥有期权。因为美国上市公司股票是全部流通的,拥有股票就视同拥有现金;

+

交易方式灵活:没有涨停板的做法,股票可随时买卖。股市自早9点至下午4点,连续进行,中间无休息。4点后有些证券公司提供场外电子交易,直到晚上7点。

+

 

+

美国证券市场的构成

+

全国性的证券市场主要包括:纽约证券交易所(NYSE)、全美证券交易所(AMEX)、纳斯达克市场(NASDAQ)和招示板市场(OTCBB);

+

区域性的证券市场包括:费城证券交易所(PHSE)、太平洋证券交易所(PASE)、辛辛那提证券交易所(CISE)、中西部证券交易所(MWSE)以及芝加哥期权交易所(CHICAGO BOARD OPTIONS EXCHANGE)等。

+

 

+

1、纽约证券交易所(New York Stock Exchange NYSE)

+

美国和世界上最大的证券交易市场。1792年5月17日,24个从事股票交易的经纪人在华尔街一棵树下集会,宣告了纽约股票交易所的诞生。1863年改为现名,直到1865年交易所才拥有自己的大楼。座落在纽约市华尔街11号的大楼是1903年启用的。交易所内设有主厅、蓝厅、“车房”等3 个股票交易厅和1个债券交易厅,是证券经纪人聚集和互相交易的场所,共设有16个交易亭,每个交易亭有16—20个交易柜台,均装备有现代化办公设备和通讯设施。交易所经营对象主要为股票,其次为各种国内外债券。除节假日外,交易时间每周5天,每天5小时。自20世纪20年代起,它一直是国际金融中心,这里股票行市的暴涨与暴跌,都会在其他资本主义国家的股票市场产生连锁反应,引起波动。现在它还是纽约市最受欢迎的旅游名胜之一。

+

对非美国公司上市要求:

+

最低公众持股数量和业务记录:公司最少要有2000名股东(每名股东拥有100股以上);或2200名股东(最近6个月月平均交易量为10万股);或 500名股东(最近12个月月平均交易量为100万股);至少有110万股的股数在市面上为投资者所拥有(公众股110万股)。

+

最低市值:公众股市场价值为4000万美金;有形资产净值为4000万美金。

+

盈利要求:上市前两年,每年税前收益为200万美金,最近一年税前收益为250万美金;或三年必须全部盈利,税前收益总计为650万美金,最近一年最低税前收益为450万美金;或最近一个会计年度市值总额不低于5亿美金且收入达到2亿美金的公司:三年调整后净收益合计2500万美金(每年报告中必须是正数)。

+

上市企业类型:主要面向成熟企业。

+

采用会计准则:美国一般公认会计原则。

+

公司注册和业务地点:无具体规定。

+

公司经营业务信息披露规定:要遵守交易所的年报、季报和中期报告制度。

+

其他因素:对公司的管理和操作有多项要求;详细说明公司所属行业的相对稳定性,公司在该行业中的地位,公司产品的市场情况。

+

 

+

2、全美证券交易所(Amex)

+

前身为纽约股票证券交易场外市场联盟,主要交易建国初期的美国政府的债券和新成立的企业的股票,后来逐渐形成了完善的交易规则。1921年,由场外交易变为场内交易。1953年,正式改名为全美证券交易所,且沿用至今。其业务包括股票业务,期权业务,交易所交易基金(ETFs)业务。

+

全美证券交易所上市公司包括发明型科技企业到标准普尔500强公司。交易所交易股票的行业范围包括银行金融业、通信技术、资源及能源、制造工业、批发零售业、健康产业、房地产及REITs等。全美交易所为个人和机构投资者、股票发行者提供包括所有行业领域的金融机会。该交易所还是世界第二大股票期权交易所。1993年,全美交易所首创这一金融产品,目前是世界上最受欢迎的投资品种。

+

从2000年1月起,作为主要金融指数的全美交易所综合指数已经超过了纽约交易所综合指数以及纳斯达克综合指数。全美交易所交易的最大的25家上市公司包括英美烟草、帝国石油、美孚石油、埃克森石油、通用汽车公司、杜邦公司等跨国企业。

+

 

+

3、纳斯达克(NASDAQ)

+

由全美证券交易商协会(NASD)创立并负责管理, 是全球第一个电子交易市场。 由于吸纳了众多成长迅速的高科技企业,纳斯达克给人一种扶持创业企业的印象。

+

纳斯达克共有两个板块:全国市场(National Market)和1992年建立的小型资本市场(Small Cap Market)。纳斯达克在成立之初的目标定位在中小企业。因为企业的规模随着时代的变化而越来越大,现在纳斯达克反而将自己分成了一块"全国市场" (National Market), 一块"中小企业市场"(Small Cap Market),以及以美分为交易单位的柜台买卖中心(OTCBB)和粉单交易市场(英文叫Pink Sheets,是垃圾股票交易的地方)。

+

纳斯达克拥有自己的做市商制度(Market Maker),它们是一些独立的股票交易商,为投资者承担某一只股票的买进和卖出。这一制度安排对于那些市值较低、交易次数较少的股票尤为重要。通过这种做市商制度使上市公司的股票能够在最优的价位成交,同时又保障投资者的利益。这些做市商由NASD的会员担任。每一只在纳斯达克上市的股票,至少要有两个以上的做市商为其股票报价;一些规模较大、交易较为活跃的股票的做市商往往能达到40-45家。这些做市商包括世界顶级的投资银行。

+

与其它创业版相比,在纳斯达克上市的要求是最严格而复杂的,同时由于它的流动性很大,在该市场直接上市所需进行的准备工作也最为繁重。

+

到2005年底,纳斯达克中国上市公司有:中华网、新浪网、搜狐网、网易、TOM网、盛大网络、侨兴电话、空中网、前程无忧、金融界、携程网、亚信科技、掌上灵通、UT斯达康、九城关贸、第九城市、北京科兴、华友世纪、汽车系统、太平洋商业、分众传媒、德信无线、百度、杨凌博迪森、美东生物、e龙、中国医疗、中国科技众品食业。

+

 

+

4、招示板市场(OTCBB)

+

OTCBB(Over The Counter Bulletin Board)的全称是场外交易(或柜台交易)市场行情公告板(或电子公告板),是美国最主要的小额证券市场之一。

+

OTCBB不是证券交易所,也不是挂牌交易系统,它只是一种实时报价服务系统,不具有自动交易执行功能。在OTCBB报价的股票包括:不能满足交易所或 NASDAQ上市标准的股票以及交易所或NASDAQ退市的证券。OTCBB没有上市标准,任何股份公司的股票都可以在此报价,但是股票发行人必须按规定向SEC提交文件,并且公开财务季报和年报。这些条件比交易所和NASDAQ的要求相对简单。OTCBB采用做市商制度,只有经SEC注册的做市商才能为股票发行人报价。NASD和SEC对OTCBB报价的做市商进行严格的监管。目前有不少中国企业先在OTCBB上市,之后再转到NASDAQ或其他交易所上市。

+

OTCBB上市

+

一旦客户公司通过了投资顾问公司的资格初审,投资顾问公司将指导和监督该客户公司与壳公司之间的并购工作。在客户公司签了合作意向书并支付保证金给壳公司之后,投资顾问公司会: 编制整个专案的计划及时程表;提供壳公司的尽职调查报告;草拟股票交换协议书;审阅SEC所要求的申报材料。

+

与首次公开发行 (IPO )将上市和融资一步完成不同,反向兼并分两步走。首先完成反向兼并,然后通过上市企业的资本私募(Private Investment in Public Equity,简称PIPE) 或登记的公开发行来募集资金。投资顾问公司将审阅定向发售备忘录 (适用于上市公司以PIPE方式增发新股) 或审阅招股说明书 (适用于注册的证券公开发行),完成定向募集或公开发行的全部手续,之后为在纳斯达克(NASDAQ)、场外交易公告牌(OTCBB)和粉单市场 (Pink Sheets) 的股票做市。一段时间后,投资顾问公司将继续协助客户完成从OTCBB 到NASDAQ 或 AMEX 的挂牌申请。

+

近年来,PIPE已经成为资本募集的最主要的手段之一。主要面向为机构投资者, 富有的个人投资者, 美国以外的海外投资者。对于私募的金额没有限制性规定。资本私募投资人在一年内不可以将股权在市场上销售,但是可以进行私下交易,通过证券商或注册经纪人进行资本私募会发生佣金费用,佣金平均在8%-10%左右。

+

 

+

5、粉纸交易市场(Pink Sheets)

+

粉纸交易市场,是纳斯达克最低层的报价系统,在这个系统中,市场每周对交易公司进行一次纸上报价,流动性比OTCBB更差。粉纸交易市场不是一个自动报价系统,而是经纪商通过电话询问至少3个做市商的报价之后,再与最佳报价的市场做市商成交。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Sat, 05 Dec 2009 04:47:38 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=71:2009-12-05-04-47-38&catid=25:the-project&Itemid=18 +
+ + 部署中文新闻发布系统 + http://news.hawebs.net/index.php?option=com_content&view=article&id=46:2009-10-14-16-37-03&catid=1:latest-news&Itemid=50 + 部署中文新闻发布系统。

+

 

+

现已进入测试阶段。

]]>
+ service@hawebs.net (Administrator) + Wed, 14 Oct 2009 16:36:02 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=46:2009-10-14-16-37-03&catid=1:latest-news&Itemid=50 +
+ + Content Layouts + http://news.hawebs.net/index.php?option=com_content&view=article&id=24:content-layouts&catid=29:the-cms&Itemid=38 + Joomla! provides plenty of flexibility when displaying your Web content. Whether you are using Joomla! for a blog site, news or a Web site for a company, you'll find one or more content styles to showcase your information. You can also change the style of content dynamically depending on your preferences. Joomla! calls how a page is laid out a layout. Use the guide below to understand which layouts are available and how you might use them.

Content

Joomla! makes it extremely easy to add and display content. All content is placed where your mainbody tag in your template is located. There are three main types of layouts available in Joomla! and all of them can be customised via parameters. The display and parameters are set in the Menu Item used to display the content your working on. You create these layouts by creating a Menu Item and choosing how you want the content to display.

Blog Layout

Blog layout will show a listing of all Articles of the selected blog type (Section or Category) in the mainbody position of your template. It will give you the standard title, and Intro of each Article in that particular Category and/or Section. You can customise this layout via the use of the Preferences and Parameters, (See Article Parameters) this is done from the Menu not the Section Manager!

Blog Archive Layout

A Blog Archive layout will give you a similar output of Articles as the normal Blog Display but will add, at the top, two drop down lists for month and year plus a search button to allow Users to search for all Archived Articles from a specific month and year.

List Layout

Table layout will simply give you a tabular list of all the titles in that particular Section or Category. No Intro text will be displayed just the titles. You can set how many titles will be displayed in this table by Parameters. The table layout will also provide a filter Section so that Users can reorder, filter, and set how many titles are listed on a single page (up to 50)

Wrapper

Wrappers allow you to place stand alone applications and Third Party Web sites inside your Joomla! site. The content within a Wrapper appears within the primary content area defined by the "mainbody" tag and allows you to display their content as a part of your own site. A Wrapper will place an IFRAME into the content Section of your Web site and wrap your standard template navigation around it so it appears in the same way an Article would.

Content Parameters

The parameters for each layout type can be found on the right hand side of the editor boxes in the Menu Item configuration screen. The parameters available depend largely on what kind of layout you are configuring.

]]>
+ service@hawebs.net (Administrator) + Tue, 12 Aug 2008 22:33:10 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=24:content-layouts&catid=29:the-cms&Itemid=38 +
+ + The Joomla! Community + http://news.hawebs.net/index.php?option=com_content&view=article&id=27:the-joomla-community&catid=30:the-community&Itemid=18 + Got a question? With more than 210,000 members, the Joomla! Discussion Forums at forum.joomla.org are a great resource for both new and experienced users. Ask your toughest questions the community is waiting to see what you'll do with your Joomla! site.

Do you want to show off your new Joomla! Web site? Visit the Site Showcase section of our forum.

Do you want to contribute?

If you think working with Joomla is fun, wait until you start working on it. We're passionate about helping Joomla users become contributors. There are many ways you can help Joomla's development:

  • Submit news about Joomla. We syndicate Joomla-related news on JoomlaConnectTM. If you have Joomla news that you would like to share with the community, find out how to get connected here.
  • Report bugs and request features in our trackers. Please read Reporting Bugs, for details on how we like our bug reports served up
  • Submit patches for new and/or fixed behaviour. Please read Submitting Patches, for details on how to submit a patch.
  • Join the developer forums and share your ideas for how to improve Joomla. We're always open to suggestions, although we're likely to be sceptical of large-scale suggestions without some code to back it up.
  • Join any of the Joomla Working Groups and bring your personal expertise to the Joomla community. 

These are just a few ways you can contribute. See Contribute to Joomla for many more ways.

]]>
+ service@hawebs.net (Administrator) + Tue, 12 Aug 2008 16:50:48 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=27:the-joomla-community&catid=30:the-community&Itemid=18 +
+ + Welcome to Joomla! + http://news.hawebs.net/index.php?option=com_content&view=article&id=1:welcome-to-joomla&catid=1:latest-news&Itemid=50 + Joomla! is a free open source framework and content publishing system designed for quickly creating highly interactive multi-language Web sites, online communities, media portals, blogs and eCommerce applications.


Joomla! LogoJoomla! provides an easy-to-use graphical user interface that simplifies the management and publishing of large volumes of content including HTML, documents, and rich media. Joomla! is used by organisations of all sizes for intranets and extranets and is supported by a community of tens of thousands of users.

+

阅读全文...

]]>
+ service@hawebs.net (Administrator) + Tue, 12 Aug 2008 10:00:00 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=1:welcome-to-joomla&catid=1:latest-news&Itemid=50 +
+ + What's New in 1.5? + http://news.hawebs.net/index.php?option=com_content&view=article&id=22:whats-new-in-15&catid=29:the-cms&Itemid=18 + As with previous releases, Joomla! provides a unified and easy-to-use framework for delivering content for Web sites of all kinds. To support the changing nature of the Internet and emerging Web technologies, Joomla! required substantial restructuring of its core functionality and we also used this effort to simplify many challenges within the current user interface. Joomla! 1.5 has many new features.

+

阅读全文...

]]>
+ service@hawebs.net (Administrator) + Mon, 11 Aug 2008 22:13:58 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=22:whats-new-in-15&catid=29:the-cms&Itemid=18 +
+ + Extensions + http://news.hawebs.net/index.php?option=com_content&view=article&id=26:extensions&catid=29:the-cms&Itemid=40 + Out of the box, Joomla! does a great job of managing the content needed to make your Web site sing. But for many people, the true power of Joomla! lies in the application framework that makes it possible for developers all around the world to create powerful add-ons that are called Extensions. An Extension is used to add capabilities to Joomla! that do not exist in the base core code. Here are just some examples of the hundreds of available Extensions:

  • Dynamic form builders
  • Business or organisational directories
  • Document management
  • Image and multimedia galleries
  • E-commerce and shopping cart engines
  • Forums and chat software
  • Calendars
  • E-mail newsletters
  • Data collection and reporting tools
  • Banner advertising systems
  • Paid subscription services
  • and many, many, more

You can find more examples over at our ever growing Joomla! Extensions Directory. Prepare to be amazed at the amount of exciting work produced by our active developer community!

A useful guide to the Extension site can be found at:
http://extensions.joomla.org/content/view/15/63/

Types of Extensions

There are five types of extensions:

  • Components
  • Modules
  • Templates
  • Plugins
  • Languages

You can read more about the specifics of these using the links in the Article Index - a Table of Contents (yet another useful feature of Joomla!) - at the top right or by clicking on the Next link below.


Component - Joomla! Extension Directory Components

A Component is the largest and most complex of the Extension types. Components are like mini-applications that render the main body of the page. An analogy that might make the relationship easier to understand would be that Joomla! is a book and all the Components are chapters in the book. The core Article Component (com_content), for example, is the mini-application that handles all core Article rendering just as the core registration Component (com_user) is the mini-application that handles User registration.

Many of Joomla!'s core features are provided by the use of default Components such as:

  • Contacts
  • Front Page
  • News Feeds
  • Banners
  • Mass Mail
  • Polls

A Component will manage data, set displays, provide functions, and in general can perform any operation that does not fall under the general functions of the core code.

Components work hand in hand with Modules and Plugins to provide a rich variety of content display and functionality aside from the standard Article and content display. They make it possible to completely transform Joomla! and greatly expand its capabilities.


Module - Joomla! Extension Directory Modules

A more lightweight and flexible Extension used for page rendering is a Module. Modules are used for small bits of the page that are generally less complex and able to be seen across different Components. To continue in our book analogy, a Module can be looked at as a footnote or header block, or perhaps an image/caption block that can be rendered on a particular page. Obviously you can have a footnote on any page but not all pages will have them. Footnotes also might appear regardless of which chapter you are reading. Simlarly Modules can be rendered regardless of which Component you have loaded.

Modules are like little mini-applets that can be placed anywhere on your site. They work in conjunction with Components in some cases and in others are complete stand alone snippets of code used to display some data from the database such as Articles (Newsflash) Modules are usually used to output data but they can also be interactive form items to input data for example the Login Module or Polls.

Modules can be assigned to Module positions which are defined in your Template and in the back-end using the Module Manager and editing the Module Position settings. For example, "left" and "right" are common for a 3 column layout.

Displaying Modules

Each Module is assigned to a Module position on your site. If you wish it to display in two different locations you must copy the Module and assign the copy to display at the new location. You can also set which Menu Items (and thus pages) a Module will display on, you can select all Menu Items or you can pick and choose by holding down the control key and selecting multiple locations one by one in the Modules [Edit] screen

Note: Your Main Menu is a Module! When you create a new Menu in the Menu Manager you are actually copying the Main Menu Module (mod_mainmenu) code and giving it the name of your new Menu. When you copy a Module you do not copy all of its parameters, you simply allow Joomla! to use the same code with two separate settings.

Newsflash Example

Newsflash is a Module which will display Articles from your site in an assignable Module position. It can be used and configured to display one Category, all Categories, or to randomly choose Articles to highlight to Users. It will display as much of an Article as you set, and will show a Read more... link to take the User to the full Article.

The Newsflash Component is particularly useful for things like Site News or to show the latest Article added to your Web site.


Plugin - Joomla! Extension Directory Plugins

One of the more advanced Extensions for Joomla! is the Plugin. In previous versions of Joomla! Plugins were known as Mambots. Aside from changing their name their functionality has been expanded. A Plugin is a section of code that runs when a pre-defined event happens within Joomla!. Editors are Plugins, for example, that execute when the Joomla! event onGetEditorArea occurs. Using a Plugin allows a developer to change the way their code behaves depending upon which Plugins are installed to react to an event.


Language - Joomla! Extensions Directory Languages

New to Joomla! 1.5 and perhaps the most basic and critical Extension is a Language. Joomla! is released with multiple Installation Languages but the base Site and Administrator are packaged in just the one Language en-GB - being English with GB spelling for example. To include all the translations currently available would bloat the core package and make it unmanageable for uploading purposes. The Language files enable all the User interfaces both Front-end and Back-end to be presented in the local preferred language. Note these packs do not have any impact on the actual content such as Articles.

More information on languages is available from the
http://community.joomla.org/translations.html

]]>
+ service@hawebs.net (Administrator) + Mon, 11 Aug 2008 06:00:00 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=26:extensions&catid=29:the-cms&Itemid=40 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed11.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed11.xml new file mode 100644 index 00000000..e4ee8a61 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed11.xml @@ -0,0 +1,19 @@ + + + + + HA 资讯 - 资源下载 + + http://news.hawebs.net/zh/ + Tue, 30 Mar 2010 16:01:27 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + Manning - AJAX In Action + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=122:manning-ajax-in-action&catid=49:2010-03-29-21-36-44&Itemid=59 + + yuchenghu@hawebs.net (HAWEBS) + Mon, 29 Mar 2010 21:43:44 GMT + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=122:manning-ajax-in-action&catid=49:2010-03-29-21-36-44&Itemid=59 + + + diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed3.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed3.xml new file mode 100644 index 00000000..c93f494e --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed3.xml @@ -0,0 +1,49 @@ + + + + + HA 资讯 - Derby + + http://news.hawebs.net/zh/ + Thu, 01 Apr 2010 02:10:41 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + Derby 系统要求 + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=119:derby-&catid=42:derby&Itemid=57 +
你计算机安装的JAVA版本必须高于1.4。 Java开发工具包(JDK)在对新Derby用户的自学习教程被要求执行。

使用java -version命令,来检查Java虚拟机安装的正确版本。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 11 Mar 2010 04:29:32 GMT + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=119:derby-&catid=42:derby&Itemid=57 +
+ + Derby 产品文档 + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=118:derby-&catid=42:derby&Itemid=57 +
Derby入门指南
描述如何安装和配置Derby。 包括针对新用户的自学教程和针对有JDBC经验用户的快速指南。 本指南同时也介绍了 dblook, ij,和sysinfo工具和Derby包含和使用的库和脚本。

Derby开发者指南
描述Derby所有的通用部署功能和特性,比如Derby的JDBC和SQL特性,部署Derby应用,使用属性文件、安全和其他高级特性。

Derby参考手册
文档描述了SQL语言在Derby中的实现。 手册提供了Derby的JDBC和JTA实现、关键字、系统表、属性和SQL异常(SQLExceptions)的相关参考信息。

Derby调优
文档提供了提高性能小技巧、更深层次的性能讨论和Derby的优化信息。

Derby工具包指南
描述如何使用Derby的工具包,比如dblook、ij和sysinfo,和如何使用系统过程导入导出数据,以及如何在数据库中使用Java代码。

Derby服务器和管理指南
第一部分讨论了服务器配置的,以及如何进行客户端编程和数据库管理。 一些系统可能需要管理进程,比如备份数据库。 这些进程独立于任何服务器框架,但是是多用户或大小系统的独特特性。
第二部分讨论了管理问题,比如备份和死锁调试。

Derby API参考
API参考是由Derby公共类自动生成而来。 不提供JDBC的API,因为这是Java 2 标准版平台的一部分。 更多API类的信息,请参考Derby参考手册。
你可以从下Apache的官方地址中访问10.5版手册和API参考

产品文档随Derby同时安装。 手册被安装在docs子目录中。 API参考安装在javadoc子目录中。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 11 Mar 2010 04:27:47 GMT + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=118:derby-&catid=42:derby&Itemid=57 +
+ + Derby 10.5.3.0 于2009年8月发布 + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=98:derby-10530-20098&catid=42:derby&Itemid=57 + Derby的最新版 10.5.3.0于2009年8月26日发布。

Apache Derby是Apache数据库项目的一个子项目。

Derby是支持ISO/ANSI SQL和JDBC标准的纯Java关系数据库引擎。

Derby 10.5.3.0的下载链接为:

http://db.apache.org/derby/derby_downloads.html

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Sun, 21 Feb 2010 06:35:36 GMT + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=98:derby-10530-20098&catid=42:derby&Itemid=57 +
+ + Apache Derby 数据库项目 + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=74:apache-derby-&catid=42:derby&Itemid=57 + Apache Derby是Apache DB的子项目,是一个使用Java编写的开源关系型数据库。关键特点包括:

+

1. 程序小巧,基础引擎和内嵌的JDBC驱动总共大约2MB。

+

2. 基于Java、JDBC和SQL标准。

+

3. 提供内嵌的JDBC驱动,你可把Derby潜入到基于Java的应用程序中。

+

4. 支持客户端/服务器模式。

+

5. 安装、布置和使用简单。

+

对于如何入门Derby,请参阅IBM 用 Apache Derby 进行开发的相关技术文章。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 06 Jan 2010 05:39:04 GMT + http://news.hawebs.net/zh/index.php?option=com_content&view=article&id=74:apache-derby-&catid=42:derby&Itemid=57 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed4.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed4.xml new file mode 100644 index 00000000..8c462ea2 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed4.xml @@ -0,0 +1,61 @@ + + + + + HA 资讯 - SQLite + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:52:58 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + 面向企业应用Android集成SQLite和GG Apps + http://news.hawebs.net/index.php?option=com_content&view=article&id=110:androidsqlitegg-apps&catid=37:sqlite&Itemid=57 +
未来的Cloud计算中谁更有优势呢? 看来Windows Live发展不是很顺利,但是现在GG Apps的用户也很少。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:45:31 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=110:androidsqlitegg-apps&catid=37:sqlite&Itemid=57 +
+ + 开源数据库SQlite再获Adobe赞助支持 + http://news.hawebs.net/index.php?option=com_content&view=article&id=109:sqliteadobe&catid=37:sqlite&Itemid=57 + 国外媒体消息,Adobe公司周一已经正式表示将帮助并赞助开源项目SQLite数据库。此前该项目已经得到了两个大公司的支持,它们分别是Mozilla和Symbian。

Adobe公司负责开源项目的Dave McAllister也在博客上证实了这个消息,他表示:“通过支持SQLite的工作,Adobe可以改善并增强SQLite的功能等等” “Adobe支持SQLite社区的举动显示了Aodbe为开发源码做出的承诺,并且,为了社会的最佳利益,SQLite应保持独立和自主”

但是实际上严格的说,SQLite并不完全符合开发源码项目的要求,SQLite的底层代码应该是免费提供的公有财产,并不符合开放源码项目的技术要求,但是该软件的大部分代码都是开源的。目前Adobe Lightroom软件正是使用了SQLite的技术。

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:43:05 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=109:sqliteadobe&catid=37:sqlite&Itemid=57 +
+ + SQLite的体系结构介绍 + http://news.hawebs.net/index.php?option=com_content&view=article&id=108:sqlite&catid=37:sqlite&Itemid=57 +
简介

显示了SQLite的主要成分及各成分之间是如何相互关联的。接下来的文本将简要的介绍每个单一的成分。

这篇文档描述SQLite第三版,它和 2.8版以及早期的版本基本相似,但在一些细节上是有区别的。

接口程序

SQLite类库大部分的公共接口程序是由main.c,legacy.c, 和vdbeapi.c源文件中的功能执行的。 但有些程序是分散在其他文件夹的,因为在其他文件夹里他们可以访问有文件作用域的数据结构。sqlite3_get_table()这个程序是在table.c中执行的。sqlite3_mprintf()在printf.c中执行。sqlite3_complete()在tokenize.c中执行。 Tcl 接口程序用tclsqlite.c来执行。

为了避免和其它软件在名字上有冲突,SQLite类库中所有的外部符号都是以sqlite3为前缀来命名的。这些被用来做外部使用的符号(换句话说,这些符号用来形成SQLite的API)是以sqlite3_.来命名的。

Tokenizer

当执行一个包含SQL语句的字符串时,接口程序要把这个字符串传递给tokenizer。Tokenizer的任务是把原有字符串分成一个个标示符,并把这些标示符传递给剖析器。Tokenizer是在C文件夹tokenize.c中用手编译的。

在这个设计中需要注意的一点是,tokenizer调用parser。熟悉YACC和BISON的人们也许会习惯于用parser调用 tokenizer。 The author of SQLite的作者已经尝试了这两种方法,并发现用tokenizer调用parser会使程序运行的更顺利。YACC使程序更滞后一些。

Parser

The parser是一个部分,它基于文件场景赋予tokens意思。SQLite的parser是由LemonLALR(1) parser generator产生的。Lemon和YACC/BISON一样做同样的工作,但是它使用不同的输入语句,这个输入语句是不易出错的。 Lemon也产生一个parser,这个parser是可重入的并且是线程安全的。 Lemon 定义了无终端解除程序的概念,所以当遇到语法错误的时候,它不会泄露内存。驱动Lemon的原文件在parse.y.

因为lemon是一个在发展机械上不常见的程序,所以lemon的源代码(只是一个C文件)是在SQLite分布区的"tool"子目录下的。 lemon的文档是在分布区的 "doc"子目录下的。

代码发生器

在剖析器收集完符号并把之转换成完全的SQL语句时,它调用代码产生器来产生虚拟的机器代码,这些机器代码将按照SQL语句的要求来工作。在代码产生器中有许多文件; attach.c, auth.c, build.c, delete.c, expr.c, insert.c, pragma.c, select.c, trigger.c, update.c, vacuum.c and where.c. 正是在这些文件中,最具有重要意义的事情发生了。 expr.c 处理表达式代码的生成。 where.c 处理SELECT, UPDATE and DELETE语句中WHERE子句的代码的生成。文件 attach.c, delete.c, insert.c, select.c, trigger.c update.c,和vacuum.c处理SQL语句中具有同样名字的语句的代码的生成。(每个文件调用expr.c and where.c中的程序) All other 所有SQL的其它语句的代码是由build.c生成的。文件auth.c 执行sqlite3_set_authorizer()的功能.

虚拟机器

由代码生成器产生的程序由虚拟机器来运行。总而言之,虚拟机器主要用来执行一个为操作数据库而设计的抽象的计算引擎。机器有一个用来存储中间数据的存储栈。每个指令包含一个操作代码和三个额外的操作数。

虚拟机器本身是被包含在一个单独的文件vdbe.c中的。虚拟机器也有它自己的标题文件:vdbe.h它在虚拟机器和剩下的SQLite类库之间定义了一个接口程序,vdbeInt.h它定义了虚拟机器的结构。文件vdbeaux.c包含了虚拟机器所使用的实用程序和一些被其它类库用来建立VM程序的接口程序模块。文件vdbeapi.c包含虚拟机器的外部接口,比如sqlite3_bind_...类的函数。单独的值(字符串,整数,浮动点数值,BLOBS)被存储在一个叫 "Mem"的内部目标程序里,"Mem"是由vdbemem.c执行的。

SQLite使用C语言程序来来执行SQL函数。即使内置的SQL函数也是用这种方法来执行的。大部分的SQL内置函数(ex:coalesce(),count(),substr(), and so forth)可以在func.c里发现。日期和时间转换函数在date.c.

B-树

SQLite数据库在磁盘里维护,使用源文件btree.c中的B-树执行。数据库中的每个表格和目录使用一个单独的B-tree。所有的 B-trees 被存储在同样的磁盘文件里。文件格式的细节被记录在btree.c.

开头的备注里。 B-tree子系统的接口程序被标题文件btree.h所定义。.

页面高速缓存

B- tree模块要求信息来源于磁盘上固定规模的程序块。默认程序块的大小是1024个字节,但是可以在512和65536个字节间变化。页面高速缓存负责读,写和高速缓存这些程序块。页面高速缓存还提供重新运算和提交抽象命令,它还管理关闭数据库文件夹。 B-tree驱动器要求页面高速缓存器中的特别的页,当它想修改页或重新运行改变的时候,它会通报页面高速缓存。为了保证所有的需求被快速,安全和有效的处理,页面高速缓存处理所有的微小的细节。

运行页面高速缓存的代码在专门的C源文件pager.c中。页面高速缓存的子系统的接口程序被目标文件pager.h所定义。

OS 接口程序

为了在POSIX和Win32 之间提供一些可移植性,SQLite操作系统的接口程序使用一个提取层。 OS提取层的接口程序被定义在os.h. 每个支持的操作系统有它自己的执行文件: Unix使用os_unix.c,windows使用os_win.c。每个具体的操作器具有它自己的标题文件:os_unix.h,os_win.h, etc.

Utilities

内存分配和字符串比较程序位于util.c。剖析器使用的表格符号被hash.c中的无用信息表格维护。源文件utf.c包含UNICODE转换子程序。SQLite有它自己的执行文件printf()(有一些扩展)在printf.c中,还有它自己随机数量产生器在random.c.

测试代码

如果你计算回归测试脚本,多于一半的SQLite代码数据库的代码将被测试。 在主要代码文件中有许多assert()语句。另外,源文件test1.c通过test5.c和md5.c执行只为测试用的扩展名。os_test.c向后的接口程序用来模拟断电,来验证页面调度程序中的系统性事故恢复机制。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:42:10 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=108:sqlite&catid=37:sqlite&Itemid=57 +
+ + 浅谈SQLite:实现与应用 + http://news.hawebs.net/index.php?option=com_content&view=article&id=107:sqlite&catid=37:sqlite&Itemid=57 +
首先,来看看都有哪些人在使用SQLite,主页上列举一长串NB的用户,其中不乏像Adobe,Apple,Firefox,甚至连google,Microsoft,SUN这样的用户。据说,Google在它的Desktop for Mac,Google Gears,以及Android,甚至Chrome中都用到SQLite,而且,Google的工程师对SQLite的全文检索功能作了很大的贡献 (contribution)。还有Apple,Micorsoft,SUN等等,这里就不列举了。详细见http://www.sqlite.org /famous.html。有这些公司的参与,对SQLite的发展应该有很大的帮助,尤其是像Google这样的用户。

下面从实现及应用的角度来谈谈SQLite,先看看SQLite的特点(功能)吧。

特点

简单 (simple):SQLite是一个非常轻量级自包含(lightweight and self-contained)的DBMS:一个头文件,一个动态库文件,你就拥有了关系数据库的所有功能了。简单,是SQLite最明显的哲学。它提供的API少而简单。只需要一个DLL文件,你的程序马上就拥有了一个功能强大的数据库引擎,这是一件很美妙的事。

小巧(small):我用VS 2005在Windows下编译的3.6.11,Release版为368K,用时不到20秒——而编译MySQL时,要花上几分钟。而当我插入10000条int数据时,内存开销660K,磁盘开销92K。

事务(transaction):事务是现代商业数据处理系统最基本的要求,而Access,不论是在可执行文件大小(看了一下Access2003的可执行文件大小为6.32M,两者不是一个量级),还是事务特性,都是不能和SQLite 相比的。

并发性(Concurrency):由于SQLite通过OS的文件锁来实现库级锁,粒度很大,但是,它通过一些复杂特殊的处理(具体可以参见分析系列),尽量的提升了读写的并发度。如果你还有担心,你可以看看这篇文章:http://www.dbanotes.net/database /sqlite_cms.html。

SQL92:SQLite支持绝大部分的标准SQL语句,你只需要几百K的空间,就可以换来需要上百兆的通用DBMS几乎所有操作了。

方便(Convenience):如果你的程序要使用SQLite,只需要将拷贝你的程序目录即可。

开源(Opensource):这是它最强大的地方。开源,意味着你可以品读它的源码,你可以随时修改它,加入你自己的特性,而这一切完全免费的。开源,是一种精神。

实现部分

好了,现在从实现的角度来谈谈个人体会,这也是我比较关注的。

SQLite是一款优秀的嵌入式数据库管理系统,这里有两层含义:一是它经常作为动态库嵌入到应用程序;另外一方面它通常用于嵌入式设备或其它要求较低的桌面应用。如果把它作为内存数据库,个人觉得不是很适合。毕竟,它的写并发性不是很好,此时, TimesTen也许会更好,Berkey DB也许是一个不错的选择。SQLite这样的嵌入式数据库与主存数据库的应用场景、实现以及对资源的需求都是不一样的。

(1)事务处理

事务的核心问题有两个:并发控制和恢复。解决了并发控制和恢复问题的系统,就能允许它的用户假设程序是原子的(atomically)执行的——好像没有其它的程序同时执行;而且是可靠的(reliably)——不会产生失败。原子性和可靠性的抽象,则称为事务(transaction)。其实,事务并不是DBMS的专利,任何分布式系统,都面对并发和恢复问题,而解决的方法就是事务,只不过,我们更常听到DBMS中的事务。并发控制保证事务的原子执行,它使得交错执行的事务看起来是一个接一个的顺序执行的,完全没有交错执行。如果交错执行的结果与顺序执行的结果一致,则称为串行化(serializable)。恢复使得数据库仅仅包含那些正常完成的事务的结果。如果事务在执行的过程中发生错误,不能继续进行,恢复算法必须清除部分完成事务产生的影响。

并发控制

SQLite只支持库级锁,库级锁意味着什么?——意味着同时只能允许一个写操作,也就是说,即事务T1在A表插入一条数据,事务T2在B表中插入一条数据,这两个操作不能同时进行,即使你的机器有100个CPU,也无法同时进行,而只能顺序进行。表级都不能并行,更别说元组级了——这就是库级锁。但是,SQLite尽量延迟申请X锁,直到数据块真正写盘时才申请X锁,这是非常巧妙而有效的。

恢复

SQLite的恢复技术是影子分页技术(shadow paging)技术的典型代表。

DBMS的常用恢复技术有影子分页技术与基于日志的技术,前者在早其数据库管理系统中用到,比如System R,现代DBMS中已经很难见到它的身影了。

影子分页技术与基于日志技术相比,优点是实现简单,消除了写日志记录的开销,恢复的速度也快(不需要redo和undo)。影子分页的缺点就是事务提交时要输出多个块,这使得提交的开销很大,而且以块为单位,很难应用到允许多个事务并发执行的情况——这是它致命的缺点。

(2)查询处理

SQLite的查询处理本质上就是一个SQL编译器和一个虚拟机。而实现这些功能只用了十多个文件,整个实现实现简单而有效,但是也存在一些问题。首先,SQLite字典数据很简单,实际上它的字典就一个表sqlite_mater,所有的信息都是通过对sqlite_master中SQL语句进行解析获取的,而解析一个SQL语句,都需要进行词法分析、语法分析、甚至虚拟机代码的生成。而这一过程是很需要时间的,而且,查询计划也没有重用。其次,查询优化还比较简单,特别是连接操作,只通过循环来做(MySQL也一样)。但是,仅仅数万代码,我们不能对它要求太苛求。

(3)存储模型

SQLite的文件物理上被划分成相同大小的块;逻辑上划分成一些B-Tree——每个表对应一个B-Tree。而没有像Oracle,或者 InnoDB对数据块进行复杂的逻辑组织,这种按需分配数据块的做法必然影响磁盘的读写性能。不过,归根到底,还是源于它的应用场景。

(4)缓冲区管理

Buffer的管理对于DBMS,无疑是非常重要的,SQLite在其它方面做得比较简单,但是在缓冲区管理这一块,它还是做足了功夫。 SQLite采用DBMS常用的LRU算法。更值得一提的是,在较新的版本中,SQLite采用和虚拟文件系统的类似的方式,实现了让默认缓冲区管理子系统可以很容易的切换成其它的缓冲区管理算法,这是非常灵活的。

(5)I/O

SQLite采用简单的阻塞I/O,较新的版本将异步I/O作为可选的扩展,但是,由于SQLite没有日志,所以,事务中ACID中的D,就无法保证,所以,如果你的数据很关键,请不要用 SQLite的异步I/O。另一方面,实际上,很多嵌入式操作系统,比如Windows CE并不支持异步I/O(不过,这可以通过多线程加以解决)。

但是,这些“缺点”并不是SQLite的缺点,相对于通过DBMS,恰恰是它的优点,这样的实现简单,而且对资源的需求较低。对嵌入式设备、或者那些要求较低的应用,已经足够,足够就好。

应用场景

嵌入式设备:这应该是SQLite应用的主要场景,很多公司都在他们的嵌入式应用程序中使用SQLite,其中不乏google的Android。

桌面应用:如果你已经厌恶了fopen,fread,fwrite这些函数,SQLite是你不错的选择,它接口简单,而且支持事务。前些天无意中下了一个cookie清除软件——CookieCrumbler,打开一看,发现里面竟然有一个sqlite3.dll,着实让我震惊了一把。

Websites:如果你的站点的访问量、数据量小的个人站点,SQLite可以代替开销较大的MySQL和繁杂的Access。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:37:15 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=107:sqlite&catid=37:sqlite&Itemid=57 +
+ + 数据库服务器SQLite + http://news.hawebs.net/index.php?option=com_content&view=article&id=106:sqlite&catid=37:sqlite&Itemid=57 + SQLite是遵守ACID的关联式数据库管理系统,它包含在一个相对小的C库中。它是D.RichardHipp建立的公有领域项目。

不像常见的客户-服务器范例,SQLite引擎不是个程序与之通信的独立进程,而是连接到程序中成为它的一个主要部分。所以主要的通信协议是在编程语言内的直接API调用。这在消耗总量、延迟时间和整体简单性上有积极的作用。整个数据库(定义、表、索引和数据本身)都在宿主主机上存储在一个单一的文件中。它的简单的设计是通过在开始一个事务的时候锁定整个数据文件而完成的。

特征库实现了多数的SQL-92标准,包括事务,就是代表原子性、一致性、隔离性和持久性的(ACID),触发器和多数的复杂查询。不进行类型检查。你可以把字符串插入到整数列中。例如,某些用户发现这是使数据库更加有用的创新,特别是与无类型的脚本语言一起使用的时候。其他用户认为这是主要的缺点。

多个进程或线程可以访问同一个数据而没有问题。可以并行的满足多个读访问。只有在其他访问当前不被服务的时候才能满足写访问;否则写访问失败并带有一个错误代码(也可以在可配置的超时过期之后自动的重试)。

提供了叫做sqlite的一个独立程序用来查询和管理SQLite数据库文件。 它也充当写使用SQLite库的应用的一个例子。

语言绑定可以从C/C++程序中使用这个库,还可以获得对Tcl和一些其他脚本语言的绑定。

在CPAN的DBD::SQLite上有一个Perl的DBI/DBD模块,它不是到SQLite的接口,而是包括整个SQLite数据库引擎在其中并不需要任何额外的软件。

还有一个Python模块叫做PySQLite。

PHP从PHP5.0开始包含了SQLite,但是自5.1版之后开始成为一个延伸函式库。SQLite能与PHP4一起工作但不包含在其中。

Rails2.0.3将缺省的数据库配置改为了SQLite 3

SQLite管理客户端

SQLite亦可以作为桌面数据库使用,以下为第三方SQLite的GUI软件。例如,

* SQLiteMan,使用QT开发的一个SQLite客户端,支持多语言、跨平台。SQLiteMan
* SQLite Manager, 以 火狐浏览器的扩展形式提供的SQLite客户端。
* SQLite Database Browser, a graphical client to access SQLite databases
* SqlPro SQL Client, another graphical client to work with SQLite databases

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 00:47:17 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=106:sqlite&catid=37:sqlite&Itemid=57 +
+ + SQLite简介 + http://news.hawebs.net/index.php?option=com_content&view=article&id=97:sqlite&catid=37:sqlite&Itemid=57 + SQLite第一个Alpha版本诞生于2000年5月. 至今已经有9个年头了. SQLite也迎来了一个版本 SQLite 3已经发布.SQLite是一款轻型的数据库,是遵守ACID的关联式数据库管理系统,它的设计目标是嵌入式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内存就够了。它能够支持 Windows/Linux/Unix等等主流的操作系统,同时能够跟很多程序语言相结合,比如Tcl、PHP、Java等,还有ODBC接口,同样比起 Mysql、PostgreSQL这两款开源世界著名的数据库管理系统来讲,它的处理速度比他们都快。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Sat, 20 Feb 2010 17:44:09 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=97:sqlite&catid=37:sqlite&Itemid=57 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed5.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed5.xml new file mode 100644 index 00000000..b9db1f36 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed5.xml @@ -0,0 +1,82 @@ + + + + + HA 资讯 - 图片频道 + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:53:14 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + 飞机起飞后从机翼泄漏数百加仑燃料 + http://news.hawebs.net/index.php?option=com_content&view=article&id=105:2010-02-23-23-50-41&catid=47:2010-02-21-23-30-59&Itemid=58 + {boncko}/mygallery/105{/boncko}

+

 

+

一架满载乘客的英国度假公司飞机在从一意大利机场起飞后数秒从其机翼下泄漏了数百加仑的燃料。飞机不得不紧急迫降,摄影师拍下了惊心动魄的场景。

这架属于度假公司托马斯-库克的波音757客机从都灵的卡塞洛机场起飞,飞往英国的伯明翰,机上有滑雪度假归来的231名乘客。就在飞机离开跑道后数分钟,5739号航班的机长用电台通知塔台,告诉他正在处理一重大险情。他发现有大量燃料从飞机右翼喷出。地面的官员也发现了这一险情,立刻启动了重大事件应对方案,消防车被派往跑道两侧,机场也立刻被关闭。

一系列令人感到惊叹的照片显示,甚至是在起落架舱门关闭时,燃料就发生了泄漏。人们可以在天蓝色的天空中看到燃料泄漏的轨迹。惊慌的乘客们也发现了燃料泄漏现象,飞行员在到达安全高度之前向乘客们通报这一情况,他在抵达安全高度开始返航。燃料的泄漏意味着飞行员将永远无法抵达伯明翰,他在空中飞行了半小时以减轻飞机的重量,最终于当地时间21日中午安全降落。

波音757客机随后前往机场的一个封闭地区,消防队员在旁边待命。应急人员包围了飞机,乘客们安全地离机。一名乘客称:“坐在飞机右翼一侧的乘客们很快就注意到了燃料的泄漏,人们立刻发出了警报。飞行员立刻打开了通话器,向乘客们介绍了情况,但一些人担心,由于泄漏了大量燃料,飞机将无法返回都灵。飞机最终安全落地,飞行员和机组人员都很兴奋,当我们再次回到地面时,人群中发出欢呼声和掌声。”

乘客们当晚被安排在一家宾馆,工程师则从伯明翰飞往都林以解决飞机的故障。机场官员称,这一故障是由于阀门出现了问题。由于清除泄漏的燃料,飞机跑道被关闭了两小时。包括托马斯-库克一架从曼彻斯特飞来的飞机在内的数架进场航班被备降至米兰机场。

排除故障的飞机于22日早晨安全抵达伯明翰。

托马斯-库克公司的一位发言人称:“我们可以证实,前往伯明翰的TCX127L航班昨天在从都灵机场起飞后发生了燃料泄漏事故,飞行员立刻将飞机安全降落。一名工程师被派往都灵去修理飞机,我们为飞机的延误道歉,飞机于今天早晨完成了它的旅程。”

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Tue, 23 Feb 2010 23:49:26 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=105:2010-02-23-23-50-41&catid=47:2010-02-21-23-30-59&Itemid=58 +
+ + 纽约州 - 90号高速 + http://news.hawebs.net/index.php?option=com_content&view=article&id=104:-90&catid=47:2010-02-21-23-30-59&Itemid=58 + 今天要回家了。数天的尼亚加拉大瀑布之旅,留在心中的只有一些的纯净。

+

 

+

{boncko}/mygallery/104/{/boncko}

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 22 Feb 2010 04:15:53 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=104:-90&catid=47:2010-02-21-23-30-59&Itemid=58 +
+ + 猪农的困惑 + http://news.hawebs.net/index.php?option=com_content&view=article&id=103:2010-02-22-03-56-45&catid=47:2010-02-21-23-30-59&Itemid=58 + 作者:墨子书

+

 

+

应朋友之约“扫街”,原本想拍一些体现春节的“年味”,扫入镜头的不是大红灯笼和春联,而是一些沿街摆地摊的进城卖肉的“猪农”。在他们的脸上,看不到过节的喜悦和笑容,而是一脸的困惑和无耐,还有愁绪和沮丧。停下脚步与一为性梁的老叔聊了几句才得知个中缘由:去年的这一天,肉价是每斤14元,而今年的同一天却是每斤7元,收如减少了一半,而且还卖不动,有的清早就进了城,直到下午也还没动,闲聊中一位大爷说,他们卖的是便宜价,可平时吃的是高价肉。。。。气愤的是肉没卖出去,可有关部门的收费却一分没少。。。。。原本是想杀了猪卖了钱给家里添点年货或者给小孩攒点学费。。。。。

+

 

+

{boncko}/mygallery/103/{/boncko}


REF
http://www.llgyw.com/bbs/PostView.asp?PostPage=1&BoardID=13&imageID=21730&page=1&imageNum=1&SearchWords=&sstype=1

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 22 Feb 2010 03:54:42 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=103:2010-02-22-03-56-45&catid=47:2010-02-21-23-30-59&Itemid=58 +
+ + 挣学费 + http://news.hawebs.net/index.php?option=com_content&view=article&id=102:2010-02-22-03-50-15&catid=47:2010-02-21-23-30-59&Itemid=58 +
{boncko}/mygallery/102/{/boncko}

REF
http://www.llgyw.com/bbs/PostView.asp?BoardID=13&imageID=21804

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 22 Feb 2010 03:48:42 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=102:2010-02-22-03-50-15&catid=47:2010-02-21-23-30-59&Itemid=58 +
+ + 河滩 + http://news.hawebs.net/index.php?option=com_content&view=article&id=101:2010-02-22-03-39-37&catid=47:2010-02-21-23-30-59&Itemid=58 +
{boncko}/mygallery/101/{/boncko}


REF

http://www.llgyw.com/bbs/PostView.asp?BoardID=1&imageID=19189
]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 22 Feb 2010 03:37:56 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=101:2010-02-22-03-39-37&catid=47:2010-02-21-23-30-59&Itemid=58 +
+ + 舞龙 + http://news.hawebs.net/index.php?option=com_content&view=article&id=100:2010-02-22-03-25-48&catid=47:2010-02-21-23-30-59&Itemid=58 +
{boncko}/mygallery/100/{/boncko}


REF

http://www.llgyw.com/bbs/PostView.asp?BoardID=21&imageID=19590
]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 22 Feb 2010 03:24:50 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=100:2010-02-22-03-25-48&catid=47:2010-02-21-23-30-59&Itemid=58 +
+ + 千里冰封 + http://news.hawebs.net/index.php?option=com_content&view=article&id=99:2010-02-21-23-42-05&catid=47:2010-02-21-23-30-59&Itemid=58 + 作者:秋影 

+

{boncko}/mygallery/99/{/boncko}

+

 

+

REF

+

http://www.llgyw.com/bbs/PostView.asp?BoardID=1&imageID=21762

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Sun, 21 Feb 2010 23:39:54 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=99:2010-02-21-23-42-05&catid=47:2010-02-21-23-30-59&Itemid=58 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed6.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed6.xml new file mode 100644 index 00000000..84c5265a --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed6.xml @@ -0,0 +1,93 @@ + + + + + HA 资讯 - 数据库 + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:53:26 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + Derby 系统要求 + http://news.hawebs.net/index.php?option=com_content&view=article&id=119:derby-&catid=42:derby&Itemid=57 +
你计算机安装的JAVA版本必须高于1.4。 Java开发工具包(JDK)在对新Derby用户的自学习教程被要求执行。

使用java -version命令,来检查Java虚拟机安装的正确版本。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 11 Mar 2010 04:29:32 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=119:derby-&catid=42:derby&Itemid=57 +
+ + Derby 产品文档 + http://news.hawebs.net/index.php?option=com_content&view=article&id=118:derby-&catid=42:derby&Itemid=57 +
Derby入门指南
描述如何安装和配置Derby。 包括针对新用户的自学教程和针对有JDBC经验用户的快速指南。 本指南同时也介绍了 dblook, ij,和sysinfo工具和Derby包含和使用的库和脚本。

Derby开发者指南
描述Derby所有的通用部署功能和特性,比如Derby的JDBC和SQL特性,部署Derby应用,使用属性文件、安全和其他高级特性。

Derby参考手册
文档描述了SQL语言在Derby中的实现。 手册提供了Derby的JDBC和JTA实现、关键字、系统表、属性和SQL异常(SQLExceptions)的相关参考信息。

Derby调优
文档提供了提高性能小技巧、更深层次的性能讨论和Derby的优化信息。

Derby工具包指南
描述如何使用Derby的工具包,比如dblook、ij和sysinfo,和如何使用系统过程导入导出数据,以及如何在数据库中使用Java代码。

Derby服务器和管理指南
第一部分讨论了服务器配置的,以及如何进行客户端编程和数据库管理。 一些系统可能需要管理进程,比如备份数据库。 这些进程独立于任何服务器框架,但是是多用户或大小系统的独特特性。
第二部分讨论了管理问题,比如备份和死锁调试。

Derby API参考
API参考是由Derby公共类自动生成而来。 不提供JDBC的API,因为这是Java 2 标准版平台的一部分。 更多API类的信息,请参考Derby参考手册。
你可以从下Apache的官方地址中访问10.5版手册和API参考

产品文档随Derby同时安装。 手册被安装在docs子目录中。 API参考安装在javadoc子目录中。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 11 Mar 2010 04:27:47 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=118:derby-&catid=42:derby&Itemid=57 +
+ + PostgreSQL 8.4.1发布 + http://news.hawebs.net/index.php?option=com_content&view=article&id=117:postgresql-841&catid=36:postgresql&Itemid=57 +
这次更新主要修改了“无法再连接共享内存”的问题,它一直困扰着许多Windows PostgreSQL的用户。另外更多的就是对8.4.x版本的更新,详情请查看PostgreSQL 8.4.1发布文档。

查看PostgreSQL详情:http://www.postgresql.org/docs/current/static/release.html

下载PostgreSQL:http://www.postgresql.org/download/]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 04 Mar 2010 17:12:22 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=117:postgresql-841&catid=36:postgresql&Itemid=57 +
+ + 9.0 Alpha 4 版本发布 + http://news.hawebs.net/index.php?option=com_content&view=article&id=116:90-alpha-4-&catid=36:postgresql&Itemid=57 +
9.0alpha4已提供下载。这个测试版相对于前一个测试版新增了一些主要的特性。

请下载,安装,测试,使用,并且欢迎给开发小组提供相关建议来改善下一个版本。

新增特性如下:
* Streaming Replication for binary log-based replication of PostgreSQL
* New in-memory, high-performance Listen/Notify queue
* Automatic row-count return to drivers on SELECT queries
* ROWS PRECEDING and ROWS FOLLOWING windowing functions

这些主要特性的添加,供用户进行有针对性的测试。如果你希望组织这个版本的测试,请参考Alpha/Beta版本的测试页。

Alpha并不是一个稳定版,同时请不要使用Alpha版本运行在你的生产环境中,Alpha版本仅供测试新特性。我们并不能保证在当前Alpha 版本中包含的特性或者APIs能够使用,或者与最终版返回相同的结果。前一个Alpha版本被命名为“8.5”。“9.0”与PostgreSQL与发行版具有相同的版本号。Alpha或Beta版的发现将会在数周内提供测试。

更多的发行日志,可以在Alpha版的信息页中找到。

Alpha4当前只提供源代码,二进制分发包将随后发布。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 04 Mar 2010 16:57:00 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=116:90-alpha-4-&catid=36:postgresql&Itemid=57 +
+ + MicroOLAP PostgreSQL数据库建模工具发布新版本 + http://news.hawebs.net/index.php?option=com_content&view=article&id=115:microolap-postgresql&catid=36:postgresql&Itemid=57 + MicroOLAP PostgreSQL 数据库建模工具使用整合图形化界面,可以让你清晰和有效的数据库结构;查看所有数据表的完整结构;表、视图之间的关系;存储过程以及其他对象。使用这个工具中的修改选项,你可以很容易在服务器上生成物理数据库,根据你的模型修改物理数据库。

你可以从下面的地址中下载测试版
http://microolap.com/products/database/postgresql-designer/download/

更新日志如下:
[!] WineHQ support enhanced
[+] DEFERRABLE clause now proccessed for FOREIGN KEY by SQL Reverse Engineering
[*] SQL Reverse Engineering: function now created if specified in CREATE TRIGGER and "Create nonexistent references object" checked
[-] "After changing interface language Object Tree View not refreshed immediatly" bug fixed
[-] "Cannot add object through Object Tree View popup menu after interface lanuage changed" bug fixed
[-] "Cannot delete all tablespaces from model" bug fixed
[-] "Cannot save Begin and End Scripts using Database Editor" bug fixed
[-] "Command 'wine PgMDD.exe' fails in the shell" bug fixed
[-] "Modify Database duplicates FOREIGN KEYs sometimes" bug fixed
[-] "Width for stored routines calculated wrong sometimes" bug fixed

如果你有任何问题,你可以通过下面的链接提交给开发小组:
http://www.microolap.com/support/

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 04 Mar 2010 16:47:42 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=115:microolap-postgresql&catid=36:postgresql&Itemid=57 +
+ + Sun收购MySQL后面临的五个问题 + http://news.hawebs.net/index.php?option=com_content&view=article&id=112:sunmysql&catid=48:mysql&Itemid=57 +
首先,让我们看一个小插曲。一年前我曾经建议 Schwartz,不要软件硬件两手抓,要么收购AMD公司,从而专注于微处理器市场;要么收购 Red Hat,拉起开源软件的大旗。巧合的是,在这之后,Sun除了开放其Solaris操作系统之外,其首席执行官Schwartz还令人惊讶的出现在去年夏天的SugarCRM开发者大会上,他与开源社区一直保持着紧密的联系。

同时,MySQL公司开发出的同名数据库备受称赞,它非常适合运行Web应用。而MySQL公司同时也是我认为在2008年将确定统治地位的十大开源公司之一。事实上,在此之前多数人认为,MySQL公司将在今年实现IPO上市。但是现在Sun拿出10亿美元一举把它拿下了。我们不得不说, Schwartz先生,你做出了一个非常英明的决策。大笔一挥,就让Sun从一个传统的硬件提供商摇身变为一个开源市场的领导者。

或许这不会解决Sun需要面对的所有短期收益和成长方面的挑战。但是,它将确保Sun将拥有数年的时间来解决这个问题。那么,通过收购MySQL,Sun公司最终将获得什么?这个公司将面临什么样的挑战?下面就是我所认为的这个交易会带来的一些最大的挑战。

一、挑战1——与甲骨文关系如何发展?

数年以来,Sun与甲骨文都是非常好的战略合作伙伴关系,现在Sun通过收购MySQL也有自己的数据库产品,这难免对它与甲骨文的关系带来影响。

在某些方面,MySQL与甲骨文在数据库市场上是竞争的关系。尽管甲骨文倾向更关注闭源应用和高端企业数据库,而MySQL则更适合低端Web 应用。但是两者之间的业务无疑存在重叠之处,而且在未来几年中,甲骨文和MySQL的竞争关系将越来越大。不过,我对此并不太担心。甲骨文和微软在很多方面也是既竞争又合作的关系。那么,甲骨文和Sun也可以保持这种关系。

二、挑战2——来自Red Hat

几个月以前,我曾经预言开源厂商Red Hat和MySQL将携手挑战任何对手,毕竟,Red Hat所提供的产品已经不仅限于Linux操作系统,现在它还提供中间件产品。另外Red Hat还与像SugarCRM之类的开源应用提供商保持紧密的联系。同时,MySQL也与众多开源应用提供商关系不错。

现在问题变成了:这个开源数据库(MySQL)或这个开源操作系统(Red Hat Linux)还将是开源领域的中心吗?就目前来说,这不是什么问题。MySQL和Red Hat都有足够的成长空间。但是,Sun/MySQL的组合将需要面临与Red Hat既竞争又合作的关系。

三、挑战3——来自软件开发者

作为一个闭源软件公司,Sun具有很长的历史。Sun Sloaris操作系统加上Sun的SPARC处理器曾经在数年的时间内统治网络计算时代。但是Solaris具有非常有限的软件开发者社区,他们当中很多专注于开发高价的华尔街金融应用。与之完全不同的是,MySQL具有一个迅速增长的全球开发者群体,他们在为MySQL平台增加增值应用。

Sun将需要确保它可以继续重视开源传统,因为这个公司不可能承受失去MySQL最关键追随者所带来的损失。

四、挑战4——转变合作伙伴和集成商的观点

开源市场非常热门。但是许多集成商——尤其是专注于华尔街和金融服务的高端Sun集成商——还没有发现开源应用的强大之处。Sun将需要将这些怀疑论者转化为开源行业的拥护者。

五、挑战5——文化上的碰撞

你曾经为一个被大型传统技术公司收购的小公司工作过吗?你曾经工作在一个决策可以立即被作出——而不是经过开会讨论的敏捷型企业吗?如果有的话,你会体会到Sun收购MySQL后所面临的两种文化的碰撞。作为一个快速发展的Web 2.0先驱,MySQL需要对自身进行调整以适应Sun更成熟的文化。反过来说,Sun需要保持MySQL的快速增长、创造性和开放的文化中最好的部分。

在以上Sun-MySQL组合所面临的所有挑战中,我认为第五个是其中最大的一个。不过,Sun将采取什么应对措施,这两个公司将走向何方?还需时间来证明。请在你的日历上圈出4月14日这个重要的日子。这是MySQL年度大会将在圣克拉拉召开的日子。Jonathan Schwartz和他的团队将在这次大会上有很多话要向客户和合作伙伴们讲。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 25 Feb 2010 08:33:54 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=112:sunmysql&catid=48:mysql&Itemid=57 +
+ + MySQL聚焦Web 2.0可扩展性 + http://news.hawebs.net/index.php?option=com_content&view=article&id=111:mysqlweb-20&catid=48:mysql&Itemid=57 +
一直以来,MySQL都致力于成为为在线应用服务的顶级数据库,就算是MySQL被Sun收购了,这个发展的重点还是没有转变。该公司的高管们在展望未来的时候曾表示对上述产品的重视对公司规模和深度的扩展都将有很大帮助。随着大规模Web应用的普及,无论是用户总量还是数据和交易总量都将以前所未有的速度迅速增长,因此,对绝大部分企业而言,应用的可扩展性变得非常重要。

原MySQL公司的产品副总裁 Zack Urlocker表示,他们正和Sun的性能工程师紧密合作,以便找出MySQL服务器以及特定的存储引擎可能存在的瓶颈。他们进行了很多在极端条件下的压力测试,并利用Sun的Dtrace等技术在显微镜下对应用程序的性能进行分析,以便找到瓶颈所在并进行有效的调试。

在并购之前,Sun和MySQL两家公司各自投入了一定精力到Memcache的研发当中。Memcache是一个高效分布式缓存系统,专门用于为数据库服务器大量减负,并通过全局缓存将数据库的负荷分配到低开销服务器。一些高通量的网站已经采用这项技术来进行网站性能优化。而MySQL也在努力将其自身和Sun关于这项技术各自的研究成果整合起来。

科技产业分析公司451 Group的分析员Matt Aslett表示,重心转向基于Web架构的企业应用对MySQL的发展百利而无一害:“Sun在收购MySQL的时候曾宣布将会把资源投入到开源数据库,将其作为关键任务高性能应用程序的一个选择。Sun的声明是这样说的,由于这些应用程序能够部署到基于Web的架构,所以Sun将会对这些应用程序提供支持。因此,如果将业务重心转向为内部应用程序部署而设的面向服务架构,那么MySQL的实用性也将大大提高。”

Aslett及其同僚 Raven Zachary在最近发表的一篇关于开源软件对数据库市场的影响的报告中,发现像MySQL和PostgreSQL这样的开源数据库事实上并不能代替非共享的私有产品。相反,该报告指出,企业对开源数据库的应用很广泛,但也很肤浅,缺乏深度,通常只是为了在特定的应用领域中,避免由于新项目的启动需要向私有软件供应商提交额外的认证许可费用而部署开源软件。

该报告还罗列了这种现象出现的一系列原因,包括对企业功能、服务和支持等方面的内容。不过,Urlocker表示,谈到传统的企业数据库应用,MySQL的重点并不在于要擂倒其私有的竞争对手,而是要成为Web 2.0企业的核心数据库。

Urlocker称,在Web 2.0应用和企业2.0应用之中,MySQL的增长速度和数量已经非常惊人。旧的关系数据库管理系统市场领域远不及这个领域发展迅猛。Web 2.0应用和所谓的企业2.0应用的最佳实务将成为未来十年市场增长的基础。所以,MySQL的计划是继续满足新应用开发人员利用 Web基础构建可扩展的应用程序的需求。Urlocker还表示,像数据仓库这样的领域对于开源来说还是一片刚刚开垦的处女地,在2008年,随着在顶级 MySQL上构建的特殊存储引擎的广泛应用,这个领域将会更加红火。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 25 Feb 2010 07:18:14 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=111:mysqlweb-20&catid=48:mysql&Itemid=57 +
+ + 面向企业应用Android集成SQLite和GG Apps + http://news.hawebs.net/index.php?option=com_content&view=article&id=110:androidsqlitegg-apps&catid=37:sqlite&Itemid=57 +
未来的Cloud计算中谁更有优势呢? 看来Windows Live发展不是很顺利,但是现在GG Apps的用户也很少。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:45:31 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=110:androidsqlitegg-apps&catid=37:sqlite&Itemid=57 +
+ + 开源数据库SQlite再获Adobe赞助支持 + http://news.hawebs.net/index.php?option=com_content&view=article&id=109:sqliteadobe&catid=37:sqlite&Itemid=57 + 国外媒体消息,Adobe公司周一已经正式表示将帮助并赞助开源项目SQLite数据库。此前该项目已经得到了两个大公司的支持,它们分别是Mozilla和Symbian。

Adobe公司负责开源项目的Dave McAllister也在博客上证实了这个消息,他表示:“通过支持SQLite的工作,Adobe可以改善并增强SQLite的功能等等” “Adobe支持SQLite社区的举动显示了Aodbe为开发源码做出的承诺,并且,为了社会的最佳利益,SQLite应保持独立和自主”

但是实际上严格的说,SQLite并不完全符合开发源码项目的要求,SQLite的底层代码应该是免费提供的公有财产,并不符合开放源码项目的技术要求,但是该软件的大部分代码都是开源的。目前Adobe Lightroom软件正是使用了SQLite的技术。

+

 

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:43:05 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=109:sqliteadobe&catid=37:sqlite&Itemid=57 +
+ + SQLite的体系结构介绍 + http://news.hawebs.net/index.php?option=com_content&view=article&id=108:sqlite&catid=37:sqlite&Itemid=57 +
简介

显示了SQLite的主要成分及各成分之间是如何相互关联的。接下来的文本将简要的介绍每个单一的成分。

这篇文档描述SQLite第三版,它和 2.8版以及早期的版本基本相似,但在一些细节上是有区别的。

接口程序

SQLite类库大部分的公共接口程序是由main.c,legacy.c, 和vdbeapi.c源文件中的功能执行的。 但有些程序是分散在其他文件夹的,因为在其他文件夹里他们可以访问有文件作用域的数据结构。sqlite3_get_table()这个程序是在table.c中执行的。sqlite3_mprintf()在printf.c中执行。sqlite3_complete()在tokenize.c中执行。 Tcl 接口程序用tclsqlite.c来执行。

为了避免和其它软件在名字上有冲突,SQLite类库中所有的外部符号都是以sqlite3为前缀来命名的。这些被用来做外部使用的符号(换句话说,这些符号用来形成SQLite的API)是以sqlite3_.来命名的。

Tokenizer

当执行一个包含SQL语句的字符串时,接口程序要把这个字符串传递给tokenizer。Tokenizer的任务是把原有字符串分成一个个标示符,并把这些标示符传递给剖析器。Tokenizer是在C文件夹tokenize.c中用手编译的。

在这个设计中需要注意的一点是,tokenizer调用parser。熟悉YACC和BISON的人们也许会习惯于用parser调用 tokenizer。 The author of SQLite的作者已经尝试了这两种方法,并发现用tokenizer调用parser会使程序运行的更顺利。YACC使程序更滞后一些。

Parser

The parser是一个部分,它基于文件场景赋予tokens意思。SQLite的parser是由LemonLALR(1) parser generator产生的。Lemon和YACC/BISON一样做同样的工作,但是它使用不同的输入语句,这个输入语句是不易出错的。 Lemon也产生一个parser,这个parser是可重入的并且是线程安全的。 Lemon 定义了无终端解除程序的概念,所以当遇到语法错误的时候,它不会泄露内存。驱动Lemon的原文件在parse.y.

因为lemon是一个在发展机械上不常见的程序,所以lemon的源代码(只是一个C文件)是在SQLite分布区的"tool"子目录下的。 lemon的文档是在分布区的 "doc"子目录下的。

代码发生器

在剖析器收集完符号并把之转换成完全的SQL语句时,它调用代码产生器来产生虚拟的机器代码,这些机器代码将按照SQL语句的要求来工作。在代码产生器中有许多文件; attach.c, auth.c, build.c, delete.c, expr.c, insert.c, pragma.c, select.c, trigger.c, update.c, vacuum.c and where.c. 正是在这些文件中,最具有重要意义的事情发生了。 expr.c 处理表达式代码的生成。 where.c 处理SELECT, UPDATE and DELETE语句中WHERE子句的代码的生成。文件 attach.c, delete.c, insert.c, select.c, trigger.c update.c,和vacuum.c处理SQL语句中具有同样名字的语句的代码的生成。(每个文件调用expr.c and where.c中的程序) All other 所有SQL的其它语句的代码是由build.c生成的。文件auth.c 执行sqlite3_set_authorizer()的功能.

虚拟机器

由代码生成器产生的程序由虚拟机器来运行。总而言之,虚拟机器主要用来执行一个为操作数据库而设计的抽象的计算引擎。机器有一个用来存储中间数据的存储栈。每个指令包含一个操作代码和三个额外的操作数。

虚拟机器本身是被包含在一个单独的文件vdbe.c中的。虚拟机器也有它自己的标题文件:vdbe.h它在虚拟机器和剩下的SQLite类库之间定义了一个接口程序,vdbeInt.h它定义了虚拟机器的结构。文件vdbeaux.c包含了虚拟机器所使用的实用程序和一些被其它类库用来建立VM程序的接口程序模块。文件vdbeapi.c包含虚拟机器的外部接口,比如sqlite3_bind_...类的函数。单独的值(字符串,整数,浮动点数值,BLOBS)被存储在一个叫 "Mem"的内部目标程序里,"Mem"是由vdbemem.c执行的。

SQLite使用C语言程序来来执行SQL函数。即使内置的SQL函数也是用这种方法来执行的。大部分的SQL内置函数(ex:coalesce(),count(),substr(), and so forth)可以在func.c里发现。日期和时间转换函数在date.c.

B-树

SQLite数据库在磁盘里维护,使用源文件btree.c中的B-树执行。数据库中的每个表格和目录使用一个单独的B-tree。所有的 B-trees 被存储在同样的磁盘文件里。文件格式的细节被记录在btree.c.

开头的备注里。 B-tree子系统的接口程序被标题文件btree.h所定义。.

页面高速缓存

B- tree模块要求信息来源于磁盘上固定规模的程序块。默认程序块的大小是1024个字节,但是可以在512和65536个字节间变化。页面高速缓存负责读,写和高速缓存这些程序块。页面高速缓存还提供重新运算和提交抽象命令,它还管理关闭数据库文件夹。 B-tree驱动器要求页面高速缓存器中的特别的页,当它想修改页或重新运行改变的时候,它会通报页面高速缓存。为了保证所有的需求被快速,安全和有效的处理,页面高速缓存处理所有的微小的细节。

运行页面高速缓存的代码在专门的C源文件pager.c中。页面高速缓存的子系统的接口程序被目标文件pager.h所定义。

OS 接口程序

为了在POSIX和Win32 之间提供一些可移植性,SQLite操作系统的接口程序使用一个提取层。 OS提取层的接口程序被定义在os.h. 每个支持的操作系统有它自己的执行文件: Unix使用os_unix.c,windows使用os_win.c。每个具体的操作器具有它自己的标题文件:os_unix.h,os_win.h, etc.

Utilities

内存分配和字符串比较程序位于util.c。剖析器使用的表格符号被hash.c中的无用信息表格维护。源文件utf.c包含UNICODE转换子程序。SQLite有它自己的执行文件printf()(有一些扩展)在printf.c中,还有它自己随机数量产生器在random.c.

测试代码

如果你计算回归测试脚本,多于一半的SQLite代码数据库的代码将被测试。 在主要代码文件中有许多assert()语句。另外,源文件test1.c通过test5.c和md5.c执行只为测试用的扩展名。os_test.c向后的接口程序用来模拟断电,来验证页面调度程序中的系统性事故恢复机制。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Wed, 24 Feb 2010 05:42:10 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=108:sqlite&catid=37:sqlite&Itemid=57 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed7.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed7.xml new file mode 100644 index 00000000..efd27939 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed7.xml @@ -0,0 +1,27 @@ + + + + + HA 资讯 - MySQL + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:52:16 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + Sun收购MySQL后面临的五个问题 + http://news.hawebs.net/index.php?option=com_content&view=article&id=112:sunmysql&catid=48:mysql&Itemid=57 +
首先,让我们看一个小插曲。一年前我曾经建议 Schwartz,不要软件硬件两手抓,要么收购AMD公司,从而专注于微处理器市场;要么收购 Red Hat,拉起开源软件的大旗。巧合的是,在这之后,Sun除了开放其Solaris操作系统之外,其首席执行官Schwartz还令人惊讶的出现在去年夏天的SugarCRM开发者大会上,他与开源社区一直保持着紧密的联系。

同时,MySQL公司开发出的同名数据库备受称赞,它非常适合运行Web应用。而MySQL公司同时也是我认为在2008年将确定统治地位的十大开源公司之一。事实上,在此之前多数人认为,MySQL公司将在今年实现IPO上市。但是现在Sun拿出10亿美元一举把它拿下了。我们不得不说, Schwartz先生,你做出了一个非常英明的决策。大笔一挥,就让Sun从一个传统的硬件提供商摇身变为一个开源市场的领导者。

或许这不会解决Sun需要面对的所有短期收益和成长方面的挑战。但是,它将确保Sun将拥有数年的时间来解决这个问题。那么,通过收购MySQL,Sun公司最终将获得什么?这个公司将面临什么样的挑战?下面就是我所认为的这个交易会带来的一些最大的挑战。

一、挑战1——与甲骨文关系如何发展?

数年以来,Sun与甲骨文都是非常好的战略合作伙伴关系,现在Sun通过收购MySQL也有自己的数据库产品,这难免对它与甲骨文的关系带来影响。

在某些方面,MySQL与甲骨文在数据库市场上是竞争的关系。尽管甲骨文倾向更关注闭源应用和高端企业数据库,而MySQL则更适合低端Web 应用。但是两者之间的业务无疑存在重叠之处,而且在未来几年中,甲骨文和MySQL的竞争关系将越来越大。不过,我对此并不太担心。甲骨文和微软在很多方面也是既竞争又合作的关系。那么,甲骨文和Sun也可以保持这种关系。

二、挑战2——来自Red Hat

几个月以前,我曾经预言开源厂商Red Hat和MySQL将携手挑战任何对手,毕竟,Red Hat所提供的产品已经不仅限于Linux操作系统,现在它还提供中间件产品。另外Red Hat还与像SugarCRM之类的开源应用提供商保持紧密的联系。同时,MySQL也与众多开源应用提供商关系不错。

现在问题变成了:这个开源数据库(MySQL)或这个开源操作系统(Red Hat Linux)还将是开源领域的中心吗?就目前来说,这不是什么问题。MySQL和Red Hat都有足够的成长空间。但是,Sun/MySQL的组合将需要面临与Red Hat既竞争又合作的关系。

三、挑战3——来自软件开发者

作为一个闭源软件公司,Sun具有很长的历史。Sun Sloaris操作系统加上Sun的SPARC处理器曾经在数年的时间内统治网络计算时代。但是Solaris具有非常有限的软件开发者社区,他们当中很多专注于开发高价的华尔街金融应用。与之完全不同的是,MySQL具有一个迅速增长的全球开发者群体,他们在为MySQL平台增加增值应用。

Sun将需要确保它可以继续重视开源传统,因为这个公司不可能承受失去MySQL最关键追随者所带来的损失。

四、挑战4——转变合作伙伴和集成商的观点

开源市场非常热门。但是许多集成商——尤其是专注于华尔街和金融服务的高端Sun集成商——还没有发现开源应用的强大之处。Sun将需要将这些怀疑论者转化为开源行业的拥护者。

五、挑战5——文化上的碰撞

你曾经为一个被大型传统技术公司收购的小公司工作过吗?你曾经工作在一个决策可以立即被作出——而不是经过开会讨论的敏捷型企业吗?如果有的话,你会体会到Sun收购MySQL后所面临的两种文化的碰撞。作为一个快速发展的Web 2.0先驱,MySQL需要对自身进行调整以适应Sun更成熟的文化。反过来说,Sun需要保持MySQL的快速增长、创造性和开放的文化中最好的部分。

在以上Sun-MySQL组合所面临的所有挑战中,我认为第五个是其中最大的一个。不过,Sun将采取什么应对措施,这两个公司将走向何方?还需时间来证明。请在你的日历上圈出4月14日这个重要的日子。这是MySQL年度大会将在圣克拉拉召开的日子。Jonathan Schwartz和他的团队将在这次大会上有很多话要向客户和合作伙伴们讲。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 25 Feb 2010 08:33:54 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=112:sunmysql&catid=48:mysql&Itemid=57 +
+ + MySQL聚焦Web 2.0可扩展性 + http://news.hawebs.net/index.php?option=com_content&view=article&id=111:mysqlweb-20&catid=48:mysql&Itemid=57 +
一直以来,MySQL都致力于成为为在线应用服务的顶级数据库,就算是MySQL被Sun收购了,这个发展的重点还是没有转变。该公司的高管们在展望未来的时候曾表示对上述产品的重视对公司规模和深度的扩展都将有很大帮助。随着大规模Web应用的普及,无论是用户总量还是数据和交易总量都将以前所未有的速度迅速增长,因此,对绝大部分企业而言,应用的可扩展性变得非常重要。

原MySQL公司的产品副总裁 Zack Urlocker表示,他们正和Sun的性能工程师紧密合作,以便找出MySQL服务器以及特定的存储引擎可能存在的瓶颈。他们进行了很多在极端条件下的压力测试,并利用Sun的Dtrace等技术在显微镜下对应用程序的性能进行分析,以便找到瓶颈所在并进行有效的调试。

在并购之前,Sun和MySQL两家公司各自投入了一定精力到Memcache的研发当中。Memcache是一个高效分布式缓存系统,专门用于为数据库服务器大量减负,并通过全局缓存将数据库的负荷分配到低开销服务器。一些高通量的网站已经采用这项技术来进行网站性能优化。而MySQL也在努力将其自身和Sun关于这项技术各自的研究成果整合起来。

科技产业分析公司451 Group的分析员Matt Aslett表示,重心转向基于Web架构的企业应用对MySQL的发展百利而无一害:“Sun在收购MySQL的时候曾宣布将会把资源投入到开源数据库,将其作为关键任务高性能应用程序的一个选择。Sun的声明是这样说的,由于这些应用程序能够部署到基于Web的架构,所以Sun将会对这些应用程序提供支持。因此,如果将业务重心转向为内部应用程序部署而设的面向服务架构,那么MySQL的实用性也将大大提高。”

Aslett及其同僚 Raven Zachary在最近发表的一篇关于开源软件对数据库市场的影响的报告中,发现像MySQL和PostgreSQL这样的开源数据库事实上并不能代替非共享的私有产品。相反,该报告指出,企业对开源数据库的应用很广泛,但也很肤浅,缺乏深度,通常只是为了在特定的应用领域中,避免由于新项目的启动需要向私有软件供应商提交额外的认证许可费用而部署开源软件。

该报告还罗列了这种现象出现的一系列原因,包括对企业功能、服务和支持等方面的内容。不过,Urlocker表示,谈到传统的企业数据库应用,MySQL的重点并不在于要擂倒其私有的竞争对手,而是要成为Web 2.0企业的核心数据库。

Urlocker称,在Web 2.0应用和企业2.0应用之中,MySQL的增长速度和数量已经非常惊人。旧的关系数据库管理系统市场领域远不及这个领域发展迅猛。Web 2.0应用和所谓的企业2.0应用的最佳实务将成为未来十年市场增长的基础。所以,MySQL的计划是继续满足新应用开发人员利用 Web基础构建可扩展的应用程序的需求。Urlocker还表示,像数据仓库这样的领域对于开源来说还是一片刚刚开垦的处女地,在2008年,随着在顶级 MySQL上构建的特殊存储引擎的广泛应用,这个领域将会更加红火。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Thu, 25 Feb 2010 07:18:14 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=111:mysqlweb-20&catid=48:mysql&Itemid=57 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed9.xml b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed9.xml new file mode 100644 index 00000000..d84afa0c --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/feed9.xml @@ -0,0 +1,106 @@ + + + + + HA 资讯 - OSS开放源代码 + + http://news.hawebs.net/ + Sun, 04 Apr 2010 03:52:37 GMT + FeedCreator 1.8.0-dev (info@mypapit.net) + + TCIP博览会,OASIS应急标准将显示在警报、警告、资源管理与医院协调的作用 + http://news.hawebs.net/index.php?option=com_content&view=article&id=121:tcipoasis-&catid=46:dita&Itemid=55 +
紧急模拟将涉及在费城瓦乔维亚频谱制冷系统的氨气泄漏。 OASIS标准将用于通知和协调涉及核生化反应部队,警察,公共工程人员,消防队员,医护人员,和红十字会。龙卷风天气警报将在复杂的居民撤离中加剧紧张状况。 参与演示者包括桌面预警和警报系统公司(WSI),以及国土安全部,国家海洋和大气管理局,美国联邦紧急事务管理局(FEMA),CellCast Technologies(专长是通过移动电话发送政府紧急警报),MyStateUSA(从事基于互联网技术促进政府与各界的信息快速交流业务),安全环境工程,慰问系统,通讯系统等等。

此次演示将利用美国国土安全部灾害管理的应急网络开放平台(DM-OPEN),该平台是业务互操作的主干,能够使各种第三方非应用程序,系统,网络和设备,以非专有的、开放格式下共享信息。DM-OPEN设计成为现场公共应急救援者、指挥中心和所有层级响应管理提供实时数据分发和态势感知支持。

在地理定位警报系统(GTAS)也将在互操作中发挥关键作用。GTAS是NOAA和FEMA集成公共警报和预警系统(IPAWS)联合开发努力的结果。GTAS允许警报和预警发往目标地理区域。在演示中 CAP?IPAWS 概况消息格式将用于通知紧急警报系统(EAS)。

WSI的总裁兼COO,Patrick J. Gannon说:“OASIS互操作标准在TCIP的展示,让人们看到WSI的警报和通知产品在真实应急情况下的表现,对应急管理从业者来说是一个绝好的机会。我们的 AdaptAlert?和OnAlert ?系统将与其他公司产品接口,从化学品泄漏、龙卷风警报,到获得CAP1.2 IPAWS概况消息激活广播公司的EAS设备,以及使用CAP1.1消息激活警笛并发给接受者”。]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 15 Mar 2010 21:44:23 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=121:tcipoasis-&catid=46:dita&Itemid=55 +
+ + 后台树形菜单V1.0模块开发完 + http://news.hawebs.net/index.php?option=com_content&view=article&id=113:v10&catid=41:joomla&Itemid=55 + + yuchenghu@hawebs.net (HAWEBS) + Fri, 26 Feb 2010 07:26:10 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=113:v10&catid=41:joomla&Itemid=55 + + + 什么是主题中的渐进公开 + http://news.hawebs.net/index.php?option=com_content&view=article&id=92:2010-02-08-22-45-51&catid=46:dita&Itemid=55 + 因为每一主题除了正文以外都有一个标题和简短描述,应用程序可以提供渐进公开。例如,用户可以在链接上看一下它的简短描述然后再决定是否按链接查看完余下的主题。渐进公开也允许有针对性的以不同查看环境浏览主题,无论是全屏幕浏览,还是集成帮助窗格,弹出信息或 PDA 屏幕。应用程序可以尽可能多的公开环境所支持的内容,以便用户决定从哪里和如何发掘更多内容。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:45:33 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=92:2010-02-08-22-45-51&catid=46:dita&Itemid=55 +
+ + 什么是在体系结构中主题结构 + http://news.hawebs.net/index.php?option=com_content&view=article&id=91:2010-02-08-22-45-26&catid=46:dita&Itemid=55 + 主题结构是我们为文档体系结构建立的某些条件的结果。
<topic> 是单一非嵌套主体和任何数量的嵌套主题的容器。
<title> 提供自我描述,与创作指南一致。
<body> 是段落级内容和任何数量的非嵌套部分的容器。
主题可以增加一个前言,其中包括简短描述和其他可选的元数据。
这些条件可导致下列结构:
<!ELEMENT topic (title,prolog?,body,%info-types,*>

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:44:59 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=91:2010-02-08-22-45-26&catid=46:dita&Itemid=55 +
+ + 为什么使用主题 + http://news.hawebs.net/index.php?option=com_content&view=article&id=90:2010-02-08-22-44-53&catid=46:dita&Itemid=55 + DITA 是基于主题的,因为主题是允许以不同交付上下文重用而不影响作者效率的最理想尺寸。如果我们选择小一些的单元,作者需要核对所有上下文的单元,以确保信息流正确。如果我们选择大一些的单元,信息不容易重新合并到不同交付上下文所需的结构。从作者的观点来说,一个主题要大到能自我容纳,但要小到特殊上下文需要的以任何高级结构的有效重用。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:44:30 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=90:2010-02-08-22-44-53&catid=46:dita&Itemid=55 +
+ + 什么是主题 + http://news.hawebs.net/index.php?option=com_content&view=article&id=89:2010-02-08-22-44-28&catid=46:dita&Itemid=55 + 主题是按单一题目范围组织的一段信息。从结构上看,它是一个后面跟随着文本和图象的主题,可选地按节组织成。主题有许多不同类型,最通用的是概念、任务和引用。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:44:02 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=89:2010-02-08-22-44-28&catid=46:dita&Itemid=55 +
+ + 有 DITA DTD 的 XML 模式吗 + http://news.hawebs.net/index.php?option=com_content&view=article&id=88:-dita-dtd--xml-&catid=46:dita&Itemid=55 + 还没有。文档若要跨系统使用以及有很长生命周期,就应该用已有的最标准格式定义,现在仍然是 DTD。
尽管 XML 模式可以提供 DTD 所不能提供的内容规则 ,但许多文档创作工具和生产工具仍然依赖于 DTD。如果您整个进程所有的工具都支持模式,对文档使用 XML 模式就有意义。如果您开发和生产文档的过程既可以使用支持 DTD 又可使用支持模式工具,那么目前最好依靠 DTD。除非您创建一个模式可以仅仅允许 DTD 所允许的,您就不能在模式和 DTD 驱动的创作系统中之间切换了。实际上,如果我们所依靠的工具在可以忽略 DTD 时,使用模式只有很少实际优势。
XML 模式的优点之一是它可以作为信息模型式的正式规范语言来使用。而现在,我们将继续使用 DTD 格式作为我们模型的记录定义,我们 将依赖于今后的工具来将 DTD 转换成即将出现的 W3C XML 模式标准。
我们设计 DITA 时,在预料到模式语言后的专门化原理,并且我们计划转到模式表示法上。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:39:01 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=88:-dita-dtd--xml-&catid=46:dita&Itemid=55 +
+ + 如何进行和控制对 DTD 的修改 + http://news.hawebs.net/index.php?option=com_content&view=article&id=87:-dtd-&catid=46:dita&Itemid=55 + DITA 设计是一个原型;该设计 — 包括 DTD 和样式表 — 将通过感兴趣的用户社区 — 您的反馈来不断地发展。
使用 DITA 论坛来讨论 DITA DTD 和样式表的使用。在 read-me 文档列出了几个已知的局限性,但当您在使用 DTD 时,无疑其他人也在期待的发现。通过 DITA 论坛中的讨论,我们将一些重要的想法应用至后续的刷新软件包。DITA 项目的体系结构设计师 Don Day 和 Michael Priestley 以及其他人将积极监控论坛。
在我们知道将更改或应该考虑的事项有是:
XLink 库的使用
新的专门化
改进的内容模型定义
新的语义标记

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:34:51 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=87:-dtd-&catid=46:dita&Itemid=55 +
+ + 为什么不使用 DocBook + http://news.hawebs.net/index.php?option=com_content&view=article&id=86:-docbook&catid=46:dita&Itemid=55 + 尽管 DocBook 和 DITA 都着重于交付技术信息,但 DocBook 的解决方案主要侧重于交付书籍,而 DITA 则着重于交付主题,它可以组装到书中,也可以一起链接至帮助集或网站。DITA 的主要延展机制 -- 专门化 -- 是基于主题级的信息分类,而不是文档分类。专门化允许作者描述特定信息域而不影响常规过程或增加核心 DTD 复杂性。主题类型、主题内容和基于主题的转换都设计成通过引用来重用。因此,重用的控制移到重用者而不影响访问公共过程或工具,也不需要损害信息的可移植性、使用期限或一致性。

]]>
+ yuchenghu@hawebs.net (HAWEBS) + Mon, 08 Feb 2010 22:33:03 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=86:-docbook&catid=46:dita&Itemid=55 +
+ + 通过发布新版本ARBORTEXT® 5.3,PTC将业务扩展到DITA领域 + http://news.hawebs.net/index.php?option=com_content&view=article&id=84:arbortextr-53ptcdita&catid=46:dita&Itemid=55 + PTC 公司今天发布了他们的动态出版软件的最新版本Arbortext 5.3。这个版本使PTC的业务扩展到Darwin信息类型化体系结构(DITA)。DITA,是一个由OASIS发起的计划,为编辑、制作和发表技术信息提供了一个基于XML的体系结构。OASIS (结构信息标准化促进组织)是一个国际性的非赢利联盟,主要从事于促进电子商务标准的发展、融合与运用。IBM于2004年3月将DITA 赠予 OASIS,现在受OASIS DITA技术委员会的管理。

+

PTC预期,截止到2008年底,基于DITA的新XML出版装置将会高达80%。由于结合了许多XML出版发行方面的最佳实践,DITA成为XML领域最重要的革新之一。首先,DITA需要使用一种模块化的方法来创建出版物,这点对于有效地重复使用信息和为多元读者的不同需求提供信息配置来说是非常重要的。其次,DITA允许不同的组织根据他们的具体需求来订制他们自己的应用,并同时维持了与所有其他使用DITA的组织轻松共享信息的能力。第三,DITA通过允许对XML应用的改写而增加了组织回复新需求的灵活性,同时保持与所有现存的下游应用程序的兼容性。为实行DITA计划而使用 Arbortext 5.3 的公司将能够大幅度降低与建立XML出版发行系统相关联的成本。

+

OASIS DITA 技术委员会主席Don Day指出,“尽管DITA的主题与映射在概念上非常简单,但对于一些作者来说应付体系结构本身的众多特性一直是一件极富挑战的事情。我们很高兴地看到 PTC正在不断改进他们的Arbortext 5.3 产品以帮助作者更好的使用DITA的各种特性。”

+

Arbortext从2004年就开始支持DITA,在用户接口、样式表和文档类型定义(DTD)方面对标准DITA信息类型(任务、概念和引用) 提供支持,并且支持DITA的“特殊化”性能,“内容引用”包含机制和客户表模型。此次推出的Arbortext 的最新版本包括下述方面的增强,可以支持:

+

编辑

+

为创建主题和“映射”提供简化的用户界面,能够列出将被汇编到最终的出版物中的所有主题。

+

针对完整的出版物中的所有文件的拼写检查和搜索/替换功能。

+

“配置”功能提供了一个简单的用户界面,帮助作者轻松地创建适应于不同读者需求的出版物。

+

出版发行

+

支持DITA映射,控制最终文档的汇编和出版

+

为打印版本和电子输出版本提供简化的样式表开发过程

+

“对于通过这种最新版本的Arbortext 5.3动态发布软件来扩展我们对DITA的支持,我们感到由衷的兴奋,”PTC公司Arbortext产品管理副总裁PG Bartlett说, “作为唯一能够为企业级需求提供带有DITA支持的完整动态发行解决方案的供应商,我们一直致力于帮助企业缩减开发、维护和出版技术出版物的成本”。

+

Arbortext 5.3 发售日期

+

Arbortext 5.3计划的发售日期是2006年12月。如需关于Arbortext 5.3的更多信息,请访问www.ptc.com上Arbortext 产品页。
关于PTC的动态出版解决方案

+

PTC的动态出版解决方案能够帮助公司自动汇编和出版多种语言和格式的产品或服务信息。这些解决方案由Arbortext产品家族构成,应用于30%的制造、生命科学、发行、政府、保险和金融服务行业的财富500强公司。

+

关于PTC
PTC为全球40,000多家企业提供领先的产品生命周期管理(PLM)、内容管理和动态发行解决方案。PTC客户包括制造、发行、服务、政府以及生命科学等行业中全球最具创新的企业。PTC已被列入标准普尔500(S&P 500)和罗素2000(Russell 2000)指数。有关PTC的详细信息,可以通过www.ptc.com或联系PTC当地办事处获得。

]]>
+ service@hawebs.net (Administrator) + Mon, 08 Feb 2010 02:41:07 GMT + http://news.hawebs.net/index.php?option=com_content&view=article&id=84:arbortextr-53ptcdita&catid=46:dita&Itemid=55 +
+
+
diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/feed/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/models/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/models/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/models/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/models/ninjarsssyndicator.php b/oss/joomla/trunk/components/com_ninjarsssyndicator/models/ninjarsssyndicator.php new file mode 100644 index 00000000..f8398e20 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/models/ninjarsssyndicator.php @@ -0,0 +1,214 @@ +setId((int)$id); + } + + function setId($id) + { + // Set id and wipe data + $this->_id = $id; + $this->_data = null; + } + + + function _buildQuery() + { + $query = "SELECT * FROM `#__ninjarsssyndicator_feeds` WHERE id = $this->_id"; + return $query; + } + + function getData() + { + $db = JFactory::getDBO(); + // Load the data + if (empty( $this->_data )) { + $query = $this->_buildQuery(); + $db->setQuery( $query ); + $this->_data = $db->loadObject(); + } + if (!$this->_data || $this->_data->published == 0) { + $this->_data = array(); + } + return $this->_data; + } + + function getContent() + { + + if (null === ($feed = $this->getData())) { + JError::raiseWarning( 'SOME_ERROR_CODE', JText::_( 'Error Loading Modules' ) . $db->getErrorMsg()); + return false; + } + + $seclist = $feed->msg_sectlist; + $FPItemsOnly = $feed->msg_FPItemsOnly; + $inclExclCatList = $feed->msg_includeCats; + $excatlist = $feed->msg_excatlist; + $exitems = str_replace(" ", "", $feed->msg_exitems); + $count = $feed->msg_count; + + $db = JFactory::getDBO(); + /* + + unused code + */ + //Xipat - VH (Feb 09 2009): Remove unuse code + /* + if ($feed->msg_sectcat != "") { + $tmp_cats = explode(",", $feed->msg_sectcat); + $cats = ""; + foreach ($tmp_cats as $tmp_cat) { + if ($cats == "") { + $cats = "\nAND (c.title = '$tmp_cat' "; + } else { + $cats .= "\nOR c.title = '$tmp_cat' "; + } + } + $cats .= ") "; + + } + */ + $date = JFactory::getDate(); + //$now = date( "Y-m-d H:i:s",time()+$mainframe->getCfg('offset')*60*60 ); + $now = $date->toMySQL(); + + switch (strtolower( $feed->msg_orderby )) { + case 'date': + $orderby = "a.created"; + break; + case 'rdate': + $orderby = "a.created DESC"; + break; + case 'mdate': + $orderby = "a.modified"; + break; + case 'mrdate': + $orderby = "a.modified DESC"; + break; + case 'catsect': + $orderby = intval($FPItemsOnly)==1 ? "f.ordering, a.ordering ASC, a.catid, a.sectionid" : "a.ordering ASC, a.catid, a.sectionid"; + break; + case 'artord': + $orderby = "a.ordering"; + break; + default: + $orderby = "a.created"; + break; + } + + /* SELECT construction */ + $queryUncat = "";//Oct 25 2008: include uncategories + $query = "SELECT u.id as userid, c.id as catid, s.id as secid, a.id as id, a.*, a.introtext as itext, a.fulltext as mtext, u.name AS author, u.usertype, u.email as authorEmail, a.created_by_alias as authorAlias, a.created AS dsdate, c.name as catName," + //Oct 24 2008: include slug and catslug for work with JRoute + . 'CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug,' + . 'CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as catslug' + ; + /* FROM */ + $query .= "\nFROM #__content AS a" + ; + + $query .= "\nLEFT JOIN #__users AS u ON u.id = a.created_by" + . "\nLEFT JOIN `#__categories` AS c on c.id = a.catid " + . "\nLEFT JOIN `#__sections` AS s on s.id = c.section " + ; + /* WHERE construction */ + $query .= "\n WHERE a.state='1'"; + /* JOIN construction */ + if (intval($FPItemsOnly)==1) { + // frontpage Items only + $query .= "\n AND a.id IN (SELECT content_id FROM #__content_frontpage)"; + } elseif (intval($FPItemsOnly)==2) { + // all articles except frontpage ones + $query .= "\n AND a.id NOT IN (SELECT content_id FROM #__content_frontpage)"; + } + + if ($exitems != "") { + $query .= "\n AND a.id NOT IN (" . $exitems . ")"; + } + if ($seclist!=="") { + if($seclist == "0")// Xipat - VH: Query uncategorised + { + $query .= "\n AND a.sectionid = 0"; + $queryUncat= " OR a.sectionid = 0 "; + } + else { + $query .= "\n AND s.id IN (" . $seclist . ")"; + } + } + else { + $queryUncat= " OR a.sectionid = 0 "; + } + + if ($excatlist!=="") { + if ($inclExclCatList){ + $query .= "\n AND c.id IN (" . $excatlist . ")"; + } else { + $query .= "\n AND c.id NOT IN (" . $excatlist . ")"; + } + } + + + + $nullDate = $db->getNullDate(); + $query .= "\n AND a.access <= 0" // item only public access check + . "\n AND (c.access <= 0 $queryUncat) " // category only public access check + . "\n AND (s.access <= 0 $queryUncat)" // section only public access check + . "\n" . 'AND (a.publish_up = '.$db->Quote($nullDate).' OR a.publish_up <= '.$db->Quote($now).')' + . "\n" . 'AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).')' + ; + /* ORDER BY, LIMIT ... construction */ + $query .= "\nORDER BY $orderby" + . ($count ? (" LIMIT " . $count) : "") + ; + + // die ($query); + + if (empty( $this->_content )) { + $db->setQuery( $query ); + $this->_content = $db->loadObjectList(); + } + if (!$this->_content) { + $this->_content = array(); + } + //die($query); + return $this->_content; + + } + + function getMenuItemArray(){ + $type = 'content_blog_section'; + $database = JFactory::getDBO();; + $itemids = NULL; + + $database->setQuery("SELECT id, componentid " + . "\n FROM #__menu " + . "\n WHERE type = '$type'" + . "\n AND published = 1"); + $rows = $database->loadObjectList(); + foreach ($rows as $row) { + $itemids[$row->componentid] = $row->id; + } + return $itemids; + } + + +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/ninjarsssyndicator.php b/oss/joomla/trunk/components/com_ninjarsssyndicator/ninjarsssyndicator.php new file mode 100644 index 00000000..33421b7f --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/ninjarsssyndicator.php @@ -0,0 +1,23 @@ +execute( JRequest::getVar('task')); + + +// Redirect if set by the controller +$controller->redirect(); +?> diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/views/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/tmpl/default.php b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/tmpl/default.php new file mode 100644 index 00000000..6df4d6f4 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/tmpl/default.php @@ -0,0 +1,253 @@ +id; + $docache = intval($this->cache)>0?1:0; + //add_stats($lists); /*<< MAD 2007/09/28 */ //Oct 24 2008 + + + //if type is Summaries then get numwords from db + $numWords = $this->numWords > 0 ? $this->numWords: 10000; // numWord == 0 represents ALL + + /*if type is RSS then use admin defined default + if (($this->type=="RSS") || ($this->type=="RSSSUMM")) + { + //$this->type = "RSS".$row->defaultType; + $this->type = "RSS2.0";// TO-DO + } + */ + + //make a feed id based filename + $filename = JPATH_COMPONENT.DS."feed".DS."feed".$feedid.".xml"; + $rss = new UniversalFeedCreator(); + + //Use cache if docache is set to 1 + if (intval($docache)==1) { + $rss->useCached($this->type,$filename,$this->cache); // use cached version if age<1 hour. May not return! + } + $rss->title = htmlspecialchars($this->title, ENT_QUOTES); + $rss->description = $this->description; + $rss->link = JURI::root(); + + $u = JFactory::getURI(); + $rss->syndicationURL = $u->toString(); + $rss->descriptionHtmlSyndicated = true; + + $image = new FeedImage(); + $image->title = $mainframe->getCfg('sitename'); + $image->url = $this->imgUrl; + $image->link = JURI::root(); + $image->description = $mainframe->getCfg('sitename'); + $image->descriptionHtmlSyndicated = true; + + if ( $this->imgUrl!="") { $rss->image = $image; } + //Xipat - VH (Feb 09 2009): Remove unuse code + /* + if (intval($this->catsInTitle)) { + $rss->title .= " (".htmlspecialchars($this->cat).")"; + } + */ + $rows = $this->content; + + //used to trigger content plugins below + JPluginHelper::importPlugin( 'content' ); + $dispatcher = JDispatcher::getInstance(); + + // Include menu itemid's in URLs by forming $itemids lookup array + //$itemids = makeMenuItemArray('content_blog_section'); + $itemids = $this->menuitemarray; + foreach ($rows as $row) { + $item = new FeedItem(); + $item->title = htmlspecialchars($row->title); + $itemid = $itemids[$row->sectionid]; + + // be sure itemid has some content! + /*>>> AGE 20071012 */ + if ($itemid == "") $itemid = $mainframe->getItemid( $row->id, 0, 0 ); + /*<<< AGE 20071012 */ + if ($itemid == "") {$itemid = 99999999;} + + $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid),false,2); + $item->guid = $item->link; + + //Jroute produces htmlspecialchar modified urls. + //We need to decode them because the feedclass also specialchars them, giving us things like &amp; + //TODO - test special characters + //$itemurl = htmlspecialchars_decode ($itemurl); + + + /* >> DAN 2009/12/14 */ + /* fulltext options: + * 0 -> Do nothing + * 1 -> Read more link + * 2 -> Add to intro text + * 3 -> Use only full text + */ + $AddReadMoreLink = false; + + /* Testing Case statement below. If it works, remove this code- D + $words = $row->itext; + if ($this->fulltext == 2) { + $words .= $row->mtext; + } */ + + switch ($this->fulltext) { + case 0: + case 1: + $words = $row->introtext; + break; + case 2: + $words = $row->introtext.$row->fulltext; + break; + case 3: + $words = $row->fulltext; + break; + } + + // Check if $words is larger then the $numWords + // Add some extra words because characters are count as words (20% extra) + + if (str_word_count(trim($words)) > $numWords) + { + $AddReadMoreLink = true; + $words = word_limiter($words, $numWords); + } + + if($this->fulltext == 0) + { + $AddReadMoreLink = false; + } + + if ($this->fulltext == 1 or $AddReadMoreLink) { + if (strlen(trim($row->mtext)) > 0 or $AddReadMoreLink) + $words .= "\n

link . "\">" . JText::sprintf('Read more...') . "

"; + } + + if (!intval($this->renderHTML)) { + //Remove HTML tags if told not to render them + $words = noHTML ($words); + + } else { + //Remove images if told not to render them + //Images will also get remove with HTML tags above + if (!intval($this->renderImages)) { + $words = delImagesFromHTML($words); + } + } + + /* Convert relative urls to absolute */ + $words = addAbsoluteURL($words); + + $item->description = $words; + $item->descriptionHtmlSyndicated = true; + + //Many, many failed attempts to get the date right. + //Kept here for a while in case issues arise again - Dec 2009 + //After some issues with the date not coming out correctly I am trying the exact code from Com_content + //$itemDate = JFactory::getDate(JHTML::_('date', $row->dsdate, JText::_('DATE_FORMAT_LC2'))); + //$itemDate = JFactory::getDate(JHTML::_('date', $row->dsdate), 0); + //$itemDate = JFactory::getDate($row->dsdate, 0); + //$item->date = $itemDate->toRFC822() ; + //$item->date = strftime("%a, %d %b %Y %H:%M:%S",strtotime($row->dsdate))." -0700"; + //$item->date = date($row->dsdate, 'D, d M Y g:i:s')." GMT\n"; + + $item->date = date("r",strtotime($row->dsdate)); + $item->source = JURI::root(); + + if ($this->renderAuthorFormat){ + $author = trim($row->authorAlias); + + if (empty($author)) $author = $row->author; + + $item->author = $author; + $item->authorEmail = $row->authorEmail; + } + //If needed, trigger content plugins on the row content. + //TODO - expand this to allow for individual paramters for the plugin instances + $dispatcher->trigger( 'onPrepareNinjaRSSFeedRow', array( &$item ) ); + + + $rss->addItem($item); + } + + //If needed, trigger content plugins on the feed as a whole. + //TODO - expand this to allow for individual paramters for the plugin instances + $dispatcher->trigger( 'onPrepareNinjaRSSFeed', array( &$rss ) ); + + //If we are using the cache and the time out is greater than 0, then generate and use a file. + //Otherwise generate the feed on the fly + if (intval($docache)==1 && $this->cache > 0) + { + $rss->saveFeed($this->type,$filename,true); + } else { + $rss->outputFeed($this->type); + } + +function noHTML($words) { + $words = preg_replace("']*>.*?'si","",$words); + $words = preg_replace('/]*>([^<]+)<\/a>/is','\2 (\1)', $words); + $words = preg_replace('//','',$words); + //$words = preg_replace('/{.+?}/','',$words); + $words = strip_tags($words); + $words = preg_replace('/ /',' ',$words); + //$words = preg_replace('/&/','&',$words); + //$words = preg_replace('/"/','"',$words); + + return $words; +} + +function addAbsoluteURL($html) { + $root_url = JURI::root(); + $html = preg_replace('@href="(?!http://)(?!https://)([^"]+)"@i', "href=\"{$root_url}\${1}\"", $html); + $html = preg_replace('@src="(?!http://)(?!https://)([^"]+)"@i', "src=\"{$root_url}\${1}\"", $html); + + return $html; +} + +/* +** Delete all the images from the url +*/ +function delImagesFromHTML($html, $instances = -1) { + $html = preg_replace('//i','', $html, $instances); + + return $html; +} + +/* >> MAD 2007/10/09 + * Added function word_limiter + */ +function word_limiter($string, $limit = 100) { + $words = array(); + $string = eregi_replace(" +", " ", $string); + $array = explode(" ", $string); + //$limit = (count($array) <= $numwords) ? count($array) : $numwords; + for($k=0;$k < $limit;$k++) + { + if(($limit>0 && $limit == $k)||!isset($array[$k])) + break; + if (eregi("[0-9A-Za-zÀ-ÖØ-öø-ÿ]", $array[$k])) + $words[$k] = $array[$k]; + } + $txt = implode(" ", $words); + return $txt; +} + +function first_img_src($html) { + if (stripos($html, ' + * @since 1.3 + */ +class FeedItem extends HtmlDescribable { + /** + * Mandatory attributes of an item. + */ + var $title, $description, $link; + + /** + * Optional attributes of an item. + */ + var $author, $authorEmail, $authorURL,$image, $category, $comments, $guid, $source, $creator, $contributor; + + /** + * Publishing date of an item. May be in one of the following formats: + * + * RFC 822: + * "Mon, 20 Jan 03 18:05:41 +0400" + * "20 Jan 03 18:05:41 +0000" + * + * ISO 8601: + * "2003-01-20T18:05:41+04:00" + * + * Unix: + * 1043082341 + */ + var $date; + + /** + * Add element tag RSS 2.0, supported by ATOM 1.0 too + * modified by : Mohammad Hafiz bin Ismail (mypapit@gmail.com) + * + * + * display : + * + * + */ + var $enclosure; + + /** + * Any additional elements to include as an assiciated array. All $key => $value pairs + * will be included unencoded in the feed item in the form + * <$key>$value + * Again: No encoding will be used! This means you can invalidate or enhance the feed + * if $value contains markup. This may be abused to embed tags not implemented by + * the FeedCreator class used. + */ + var $additionalElements = Array(); + + // on hold + // var $source; +} + +class EnclosureItem extends HtmlDescribable { + /* + * + * core variables + * + **/ + var $url,$length,$type; + + /* + * + * supported by ATOM 1.0 only + * + */ + + var $language, $title; + /* + * For use with another extension like Yahoo mRSS + * Warning : + * These variables might not show up in + * later release / not finalize yet! + * + * + * var $width, $height, $title, $description, $keywords, $thumburl; + */ + + var $additionalElements = Array(); + +} + + +/** + * An FeedImage may be added to a FeedCreator feed. + * @author Kai Blankenhorn + * @since 1.3 + */ +class FeedImage extends HtmlDescribable { + /** + * Mandatory attributes of an image. + */ + var $title, $url, $link; + + /** + * Optional attributes of an image. + */ + var $width, $height, $description; +} + + + +/** + * An HtmlDescribable is an item within a feed that can have a description that may + * include HTML markup. + */ +class HtmlDescribable { + /** + * Indicates whether the description field should be rendered in HTML. + */ + var $descriptionHtmlSyndicated; + + /** + * Indicates whether and to how many characters a description should be truncated. + */ + var $descriptionTruncSize; + + /** + * Returns a formatted description field, depending on descriptionHtmlSyndicated and + * $descriptionTruncSize properties + * @return string the formatted description + */ + function getDescription() { + $descriptionField = new FeedHtmlField($this->description); + $descriptionField->syndicateHtml = $this->descriptionHtmlSyndicated; + $descriptionField->truncSize = $this->descriptionTruncSize; + return $descriptionField->output(); + } + +} + + + +/** + * An FeedHtmlField describes and generates + * a feed, item or image html field (probably a description). Output is + * generated based on $truncSize, $syndicateHtml properties. + * @author Pascal Van Hecke + * @version 1.6 + */ +class FeedHtmlField { + /** + * Mandatory attributes of a FeedHtmlField. + */ + var $rawFieldContent; + + /** + * Optional attributes of a FeedHtmlField. + * + */ + var $truncSize, $syndicateHtml; + + /** + * Creates a new instance of FeedHtmlField. + * @param $string: if given, sets the rawFieldContent property + */ + function FeedHtmlField($parFieldContent) { + if ($parFieldContent) { + $this->rawFieldContent = $parFieldContent; + } + } + + + /** + * Creates the right output, depending on $truncSize, $syndicateHtml properties. + * @return string the formatted field + */ + function output() { + // when field available and syndicated in html we assume + // - valid html in $rawFieldContent and we enclose in CDATA tags + // - no truncation (truncating risks producing invalid html) + if (!$this->rawFieldContent) { + $result = ""; + } elseif ($this->syndicateHtml) { + $result = "rawFieldContent."]]>"; + } else { + if ($this->truncSize and is_int($this->truncSize)) { + $result = FeedCreator::iTrunc(htmlspecialchars($this->rawFieldContent),$this->truncSize); + } else { + $result = htmlspecialchars($this->rawFieldContent); + } + } + return $result; + } + +} + + + +/** + * UniversalFeedCreator lets you choose during runtime which + * format to build. + * For general usage of a feed class, see the FeedCreator class + * below or the example above. + * + * @since 1.3 + * @author Kai Blankenhorn + */ +class UniversalFeedCreator extends FeedCreator { + var $_feed; + + function _setMIME() { + //switch (strtoupper($format)) { + + + header('Content-type: ' . $this->contentType .'; charset=' . $this->encoding, true); + + + } + + function _setFormat($format) { + switch (strtoupper($format)) { + + case "2.0": + case "RSS": //added 8 Jan 2007 + // fall through + case "RSS2.0": + $this->_feed = new RSSCreator20(); + break; + + case "1.0": + // fall through + case "RSS1.0": + $this->_feed = new RSSCreator10(); + break; + + case "0.91": + + // fall through + case "RSS0.91": + $this->_feed = new RSSCreator091(); + break; + + case "PIE0.1": + $this->_feed = new PIECreator01(); + break; + + case "MBOX": + $this->_feed = new MBOXCreator(); + break; + + case "OPML": + $this->_feed = new OPMLCreator(); + break; + + case "ATOM": + // fall through: always the latest ATOM version + case "ATOM1.0": + $this->_feed = new AtomCreator10(); + break; + + + case "ATOM0.3": + $this->_feed = new AtomCreator03(); + break; + + case "HTML": + $this->_feed = new HTMLCreator(); + break; + + case "JS": + // fall through + case "JAVASCRIPT": + $this->_feed = new JSCreator(); + break; + + default: + $this->_feed = new RSSCreator091(); + break; + } + + $vars = get_object_vars($this); + foreach ($vars as $key => $value) { + // prevent overwriting of properties "contentType", "encoding"; do not copy "_feed" itself + if (!in_array($key, array("_feed", "contentType", "encoding"))) { + $this->_feed->{$key} = $this->{$key}; + } + } + } + + /** + * Creates a syndication feed based on the items previously added. + * + * @see FeedCreator::addItem() + * @param string format format the feed should comply to. Valid values are: + * "PIE0.1", "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3", "HTML", "JS" + * @return string the contents of the feed. + */ + function createFeed($format = "RSS0.91") { + $this->_setFormat($format); + return $this->_feed->createFeed(); + } + + + + /** + * Saves this feed as a file on the local disk. After the file is saved, an HTTP redirect + * header may be sent to redirect the use to the newly created file. + * @since 1.4 + * + * @param string format format the feed should comply to. Valid values are: + * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM", "ATOM0.3", "HTML", "JS" + * @param string filename optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param boolean displayContents optional send the content of the file or not. If true, the file will be sent in the body of the response. + */ + function saveFeed($format="RSS0.91", $filename="", $displayContents=true) { + $this->_setFormat($format); + $this->_feed->saveFeed($filename, $displayContents); + } + + + /** + * Turns on caching and checks if there is a recent version of this feed in the cache. + * If there is, an HTTP redirect header is sent. + * To effectively use caching, you should create the FeedCreator object and call this method + * before anything else, especially before you do the time consuming task to build the feed + * (web fetching, for example). + * + * @param string format format the feed should comply to. Valid values are: + * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3". + * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param timeout int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour) + */ + function useCached($format="RSS0.91", $filename="", $timeout=3600) { + $this->_setFormat($format); + $this->_feed->useCached($filename, $timeout); + } + + + /** + * Outputs feed to the browser - needed for on-the-fly feed generation (like it is done in WordPress, etc.) + * + * @param format string format the feed should comply to. Valid values are: + * "PIE0.1" (deprecated), "mbox", "RSS0.91", "RSS1.0", "RSS2.0", "OPML", "ATOM0.3". + */ + function outputFeed($format='RSS0.91') { + $this->_setFormat($format); + $this->_setMIME($format); + $this->_feed->outputFeed(); + } + + +} + + +/** + * FeedCreator is the abstract base implementation for concrete + * implementations that implement a specific format of syndication. + * + * @abstract + * @author Kai Blankenhorn + * @since 1.4 + */ +class FeedCreator extends HtmlDescribable { + + /** + * Mandatory attributes of a feed. + */ + var $title, $description, $link; + + + /** + * Optional attributes of a feed. + */ + var $syndicationURL, $image, $language, $copyright, $pubDate, $lastBuildDate, $editor, $editorEmail, $webmaster, $category, $docs, $ttl, $rating, $skipHours, $skipDays; + + /** + * The url of the external xsl stylesheet used to format the naked syndication feed. + * Ignored in the output when empty. + */ + var $xslStyleSheet = ""; + + + /** + * The url of the external css stylesheet used to format the naked syndication feed. + * Ignored in the output when empty. + */ + var $cssStyleSheet = ""; + + + /** + * @access private + */ + var $items = Array(); + + + /** + * This feed's MIME content type. + * @since 1.4 + * @access private + */ + var $contentType = "application/xml"; + + + /** + * This feed's character encoding. + * @since 1.6.1 + * + * var $encoding = "ISO-8859-1"; //original :p + */ + var $encoding = "utf-8"; + + /* + * Generator string + * + */ + + var $generator = "info@mypapit.net"; + + + /** + * Any additional elements to include as an assiciated array. All $key => $value pairs + * will be included unencoded in the feed in the form + * <$key>$value + * Again: No encoding will be used! This means you can invalidate or enhance the feed + * if $value contains markup. This may be abused to embed tags not implemented by + * the FeedCreator class used. + */ + var $additionalElements = Array(); + + + /** + * Adds an FeedItem to the feed. + * + * @param object FeedItem $item The FeedItem to add to the feed. + * @access public + */ + function addItem($item) { + $this->items[] = $item; + } + + /** + * + * + * + **/ + function version() { + + return FEEDCREATOR_VERSION." (".$this->generator.")"; + } + + /** + * Truncates a string to a certain length at the most sensible point. + * First, if there's a '.' character near the end of the string, the string is truncated after this character. + * If there is no '.', the string is truncated after the last ' ' character. + * If the string is truncated, " ..." is appended. + * If the string is already shorter than $length, it is returned unchanged. + * + * @static + * @param string string A string to be truncated. + * @param int length the maximum length the string should be truncated to + * @return string the truncated string + */ + function iTrunc($string, $length) { + if (strlen($string)<=$length) { + return $string; + } + + $pos = strrpos($string,"."); + if ($pos>=$length-4) { + $string = substr($string,0,$length-4); + $pos = strrpos($string,"."); + } + if ($pos>=$length*0.4) { + return substr($string,0,$pos+1)." ..."; + } + + $pos = strrpos($string," "); + if ($pos>=$length-4) { + $string = substr($string,0,$length-4); + $pos = strrpos($string," "); + } + if ($pos>=$length*0.4) { + return substr($string,0,$pos)." ..."; + } + + return substr($string,0,$length-4)." ..."; + + } + + + /** + * Creates a comment indicating the generator of this feed. + * The format of this comment seems to be recognized by + * Syndic8.com. + */ + function _createGeneratorComment() { + return "\n"; + } + + + /** + * Creates a string containing all additional elements specified in + * $additionalElements. + * @param elements array an associative array containing key => value pairs + * @param indentString string a string that will be inserted before every generated line + * @return string the XML tags corresponding to $additionalElements + */ + function _createAdditionalElements($elements, $indentString="") { + $ae = ""; + if (is_array($elements)) { + foreach($elements AS $key => $value) { + $ae.= $indentString."<$key>$value\n"; + } + } + return $ae; + } + + function _createStylesheetReferences() { + $xml = ""; + if ($this->cssStyleSheet) $xml .= "cssStyleSheet."\" type=\"text/css\"?>\n"; + if ($this->xslStyleSheet) $xml .= "xslStyleSheet."\" type=\"text/xsl\"?>\n"; + return $xml; + } + + + /** + * Builds the feed's text. + * @abstract + * @return string the feed's complete text + **/ + function createFeed() { + } + + /** + * Generate a filename for the feed cache file. The result will be $_SERVER["PHP_SELF"] with the extension changed to .xml. + * For example: + * + * echo $_SERVER["PHP_SELF"]."\n"; + * echo FeedCreator::_generateFilename(); + * + * would produce: + * + * /rss/latestnews.php + * latestnews.xml + * + * @return string the feed cache filename + * @since 1.4 + * @access private + **/ + + function _generateFilename() { + $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + return substr($fileInfo["basename"],0,-(strlen($fileInfo["extension"])+1)).".xml"; + } + + + /** + * @since 1.4 + * @access private + */ + function _redirect($filename) { + // attention, heavily-commented-out-area + + // maybe use this in addition to file time checking + //Header("Expires: ".date("r",time()+$this->_timeout)); + + /* no caching at all, doesn't seem to work as good: + Header("Cache-Control: no-cache"); + Header("Pragma: no-cache"); + */ + + // HTTP redirect, some feed readers' simple HTTP implementations don't follow it + //Header("Location: ".$filename); + + Header("Content-Type: ".$this->contentType."; charset=".$this->encoding."; filename=".basename($filename)); + Header("Content-Disposition: inline; filename=".basename($filename)); + readfile($filename, "r"); + die(); + } + + /** + * Turns on caching and checks if there is a recent version of this feed in the cache. + * If there is, an HTTP redirect header is sent. + * To effectively use caching, you should create the FeedCreator object and call this method + * before anything else, especially before you do the time consuming task to build the feed + * (web fetching, for example). + * @since 1.4 + * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param timeout int optional the timeout in seconds before a cached version is refreshed (defaults to 3600 = 1 hour) + */ + function useCached($filename="", $timeout=3600) { + $this->_timeout = $timeout; + if ($filename=="") { + $filename = $this->_generateFilename(); + } + if (file_exists($filename) AND (time()-filemtime($filename) < $timeout)) { + $this->_redirect($filename); + } + } + + + /** + * Saves this feed as a file on the local disk. After the file is saved, a redirect + * header may be sent to redirect the user to the newly created file. + * @since 1.4 + * + * @param filename string optional the filename where a recent version of the feed is saved. If not specified, the filename is $_SERVER["PHP_SELF"] with the extension changed to .xml (see _generateFilename()). + * @param redirect boolean optional send an HTTP redirect header or not. If true, the user will be automatically redirected to the created file. + */ + function saveFeed($filename="", $displayContents=true) { + if ($filename=="") { + $filename = $this->_generateFilename(); + } + $feedFile = fopen($filename, "w+"); + if ($feedFile) { + fputs($feedFile,$this->createFeed()); + fclose($feedFile); + if ($displayContents) { + $this->_redirect($filename); + } + } else { + echo "
Error creating feed file, please check write permissions.
"; + } + } + + /** + * Outputs this feed directly to the browser - for on-the-fly feed generation + * @since 1.7.2-mod + * + * still missing: proper header output - currently you have to add it manually + */ + function outputFeed() { + echo $this->createFeed(); + } + + function setEncoding($encoding="utf-8") { + $this->encoding = "utf-8"; + + } + + +} + + +/** + * FeedDate is an internal class that stores a date for a feed or feed item. + * Usually, you won't need to use this. + */ +class FeedDate { + var $unix; + + /** + * Creates a new instance of FeedDate representing a given date. + * Accepts RFC 822, ISO 8601 date formats as well as unix time stamps. + * @param mixed $dateString optional the date this FeedDate will represent. If not specified, the current date and time is used. + */ + function FeedDate($dateString="") { + //this wasn't working properly (kept giving yesterday), so I replaced it with time() below - D + //if ($dateString=="") $dateString = date("r"); + + if ($dateString=="") $dateString = time(); + + if (is_numeric($dateString)) { + $this->unix = $dateString; + return; + } + if (preg_match("~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~",$dateString,$matches)) { + $months = Array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12); + $this->unix = mktime($matches[4],$matches[5],$matches[6],$months[$matches[2]],$matches[1],$matches[3]); + if (substr($matches[7],0,1)=='+' OR substr($matches[7],0,1)=='-') { + $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60; + } else { + if (strlen($matches[7])==1) { + $oneHour = 3600; + $ord = ord($matches[7]); + if ($ord < ord("M")) { + $tzOffset = (ord("A") - $ord - 1) * $oneHour; + } elseif ($ord >= ord("M") AND $matches[7]!="Z") { + $tzOffset = ($ord - ord("M")) * $oneHour; + } elseif ($matches[7]=="Z") { + $tzOffset = 0; + } + } + switch ($matches[7]) { + case "UT": + case "GMT": $tzOffset = 0; + } + } + $this->unix += $tzOffset; + return; + } + if (preg_match("~(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(.*)~",$dateString,$matches)) { + $this->unix = mktime($matches[4],$matches[5],$matches[6],$matches[2],$matches[3],$matches[1]); + if (substr($matches[7],0,1)=='+' OR substr($matches[7],0,1)=='-') { + $tzOffset = (substr($matches[7],0,3) * 60 + substr($matches[7],-2)) * 60; + } else { + if ($matches[7]=="Z") { + $tzOffset = 0; + } + } + $this->unix += $tzOffset; + return; + } + $this->unix = 0; + } + + /** + * Gets the date stored in this FeedDate as an RFC 822 date. + * + * @return a date in RFC 822 format + */ + function rfc822() { + //return gmdate("r",$this->unix); + $date = gmdate("D, d M Y H:i:s", $this->unix); + + if (TIME_ZONE!="") { + $date .= " ".str_replace(":","",TIME_ZONE); + } else { + $date .= " ".str_replace(":","","GMT"); + } + return $date; + } + + /** + * Gets the date stored in this FeedDate as an ISO 8601 date. + * + * @return a date in ISO 8601 (RFC 3339) format + */ + function iso8601() { + $date = gmdate("Y-m-d\TH:i:sO",$this->unix); + $date = substr($date,0,22) . ':' . substr($date,-2); + if (TIME_ZONE!="") $date = str_replace("+00:00",TIME_ZONE,$date); + return $date; + } + + + /** + * Gets the date stored in this FeedDate as unix time stamp. + * + * @return a date as a unix time stamp + */ + function unix() { + return $this->unix; + } +} + + +/** + * RSSCreator10 is a FeedCreator that implements RDF Site Summary (RSS) 1.0. + * + * @see http://www.purl.org/rss/1.0/ + * @since 1.3 + * @author Kai Blankenhorn + */ +class RSSCreator10 extends FeedCreator { + + /** + * Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0. + * The feed will contain all items previously added in the same order. + * @return string the feed's complete text + */ + function createFeed() { + $feed = "encoding."\"?>\n"; + $feed.= $this->_createGeneratorComment(); + if ($this->cssStyleSheet=="") { + $cssStyleSheet = "http://www.w3.org/2000/08/w3c-synd/style.css"; + } + $feed.= $this->_createStylesheetReferences(); + $feed.= "\n"; + $feed.= " syndicationURL."\">\n"; + $feed.= " ".htmlspecialchars($this->title)."\n"; + $feed.= " ".htmlspecialchars($this->description)."\n"; + $feed.= " ".$this->link."\n"; + if ($this->image!=null) { + $feed.= " image->url."\" />\n"; + } + $now = new FeedDate(); + $feed.= " ".htmlspecialchars($now->iso8601())."\n"; + $feed.= " \n"; + $feed.= " \n"; + for ($i=0;$iitems);$i++) { + $feed.= " items[$i]->link)."\"/>\n"; + } + $feed.= " \n"; + $feed.= " \n"; + $feed.= " \n"; + if ($this->image!=null) { + $feed.= " image->url."\">\n"; + $feed.= " ".$this->image->title."\n"; + $feed.= " ".$this->image->link."\n"; + $feed.= " ".$this->image->url."\n"; + $feed.= " \n"; + } + $feed.= $this->_createAdditionalElements($this->additionalElements, " "); + + for ($i=0;$iitems);$i++) { + $feed.= " items[$i]->link)."\">\n"; + //$feed.= " Posting\n"; + $feed.= " text/html\n"; + if ($this->items[$i]->date!=null) { + $itemDate = new FeedDate($this->items[$i]->date); + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + } + if ($this->items[$i]->source!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->source)."\n"; + } + if ($this->items[$i]->author!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->author)."\n"; + } + $feed.= " ".htmlspecialchars(strip_tags(strtr($this->items[$i]->title,"\n\r"," ")))."\n"; + $feed.= " ".htmlspecialchars($this->items[$i]->link)."\n"; + $feed.= " ".htmlspecialchars($this->items[$i]->description)."\n"; + $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, " "); + $feed.= " \n"; + } + $feed.= "\n"; + return $feed; + } +} + + + +/** + * RSSCreator091 is a FeedCreator that implements RSS 0.91 Spec, revision 3. + * + * @see http://my.netscape.com/publish/formats/rss-spec-0.91.html + * @since 1.3 + * @author Kai Blankenhorn + */ +class RSSCreator091 extends FeedCreator { + + /** + * Stores this RSS feed's version number. + * @access private + */ + var $RSSVersion; + + function RSSCreator091() { + $this->_setRSSVersion("0.91"); + $this->contentType = "application/rss+xml"; + } + + /** + * Sets this RSS feed's version number. + * @access private + */ + function _setRSSVersion($version) { + $this->RSSVersion = $version; + } + + /** + * Builds the RSS feed's text. The feed will be compliant to RDF Site Summary (RSS) 1.0. + * The feed will contain all items previously added in the same order. + * @return string the feed's complete text + */ + function createFeed() { + $feed = "encoding."\"?>\n"; + $feed.= $this->_createGeneratorComment(); + $feed.= $this->_createStylesheetReferences(); + $feed.= "RSSVersion."\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n"; + $feed.= " \n"; + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."\n"; + $this->descriptionTruncSize = 500; + $feed.= " ".$this->getDescription()."\n"; + $feed.= " ".$this->link."\n"; + $now = new FeedDate(); + $feed.= " ".htmlspecialchars($now->rfc822())."\n"; + $feed.= " ". $this->version()."\n"; + + if ($this->image!=null) { + $feed.= " \n"; + $feed.= " ".$this->image->url."\n"; + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->image->title),100)."\n"; + $feed.= " ".$this->image->link."\n"; + if ($this->image->width!="") { + $feed.= " ".$this->image->width."\n"; + } + if ($this->image->height!="") { + $feed.= " ".$this->image->height."\n"; + } + if ($this->image->description!="") { + $feed.= " ".$this->image->getDescription()."\n"; + } + $feed.= " \n"; + } + if ($this->language!="") { + $feed.= " ".$this->language."\n"; + } + if ($this->copyright!="") { + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->copyright),100)."\n"; + } + if ($this->editor!="") { + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->editor),100)."\n"; + } + if ($this->webmaster!="") { + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->webmaster),100)."\n"; + } + if ($this->pubDate!="") { + $pubDate = new FeedDate($this->pubDate); + $feed.= " ".htmlspecialchars($pubDate->rfc822())."\n"; + } + if ($this->category!="") { + $feed.= " ".htmlspecialchars($this->category)."\n"; + } + if ($this->docs!="") { + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->docs),500)."\n"; + } + if ($this->ttl!="") { + $feed.= " ".htmlspecialchars($this->ttl)."\n"; + } + if ($this->rating!="") { + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->rating),500)."\n"; + } + if ($this->skipHours!="") { + $feed.= " ".htmlspecialchars($this->skipHours)."\n"; + } + if ($this->skipDays!="") { + $feed.= " ".htmlspecialchars($this->skipDays)."\n"; + } + + //TODO - fix this + $feed.= ' '; + + $feed.= $this->_createAdditionalElements($this->additionalElements, " "); + + for ($i=0;$iitems);$i++) { + $feed.= " \n"; + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)),100)."\n"; + $feed.= " ".htmlspecialchars($this->items[$i]->link)."\n"; + $feed.= " ".$this->items[$i]->getDescription()."\n"; + + if ($this->items[$i]->author!="") { + if ($this->items[$i]->authorEmail!="") { + $feed.= " " . htmlspecialchars($this->items[$i]->authorEmail) . " (".htmlspecialchars($this->items[$i]->author).")\n"; + } else { + $feed.= " no_email@example.com (".htmlspecialchars($this->items[$i]->author).")\n"; + } + } + /* + // on hold + if ($this->items[$i]->source!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->source)."\n"; + } + */ + if ($this->items[$i]->category!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->category)."\n"; + } + if ($this->items[$i]->comments!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->comments)."\n"; + } + if ($this->items[$i]->date!="") { + + $itemDate = new FeedDate($this->items[$i]->date); + + $feed.= " ".htmlspecialchars($itemDate->rfc822())."\n"; + } + + + //I changed these below. The second one (the else) used to be outside and adbove the if + if ($this->items[$i]->guid!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->guid)."\n"; + } else { + $feed.= " ".htmlspecialchars($this->items[$i]->link)."\n"; + } + $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, " "); + + if ($this->RSSVersion == "2.0" && $this->items[$i]->enclosure != NULL) + { + $feed.= " items[$i]->enclosure->url; + $feed.= "\" length=\""; + $feed.= $this->items[$i]->enclosure->length; + $feed.= "\" type=\""; + $feed.= $this->items[$i]->enclosure->type; + $feed.= "\"/>\n"; + } + + + + $feed.= " \n"; + } + $feed.= " \n"; + $feed.= "\n"; + return $feed; + } +} + + + +/** + * RSSCreator20 is a FeedCreator that implements RDF Site Summary (RSS) 2.0. + * + * @see http://backend.userland.com/rss + * @since 1.3 + * @author Kai Blankenhorn + */ +class RSSCreator20 extends RSSCreator091 { + + function RSSCreator20() { + parent::_setRSSVersion("2.0"); + } + +} + + +/** + * PIECreator01 is a FeedCreator that implements the emerging PIE specification, + * as in http://intertwingly.net/wiki/pie/Syntax. + * + * @deprecated + * @since 1.3 + * @author Scott Reynen and Kai Blankenhorn + */ +class PIECreator01 extends FeedCreator { + + function PIECreator01() { + $this->encoding = "utf-8"; + } + + function createFeed() { + $feed = "encoding."\"?>\n"; + $feed.= $this->_createStylesheetReferences(); + $feed.= "\n"; + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."\n"; + $this->truncSize = 500; + $feed.= " ".$this->getDescription()."\n"; + $feed.= " ".$this->link."\n"; + for ($i=0;$iitems);$i++) { + $feed.= " \n"; + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)),100)."\n"; + $feed.= " ".htmlspecialchars($this->items[$i]->link)."\n"; + $itemDate = new FeedDate($this->items[$i]->date); + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($this->items[$i]->guid)."\n"; + if ($this->items[$i]->author!="") { + $feed.= " \n"; + $feed.= " ".htmlspecialchars($this->items[$i]->author)."\n"; + if ($this->items[$i]->authorEmail!="") { + $feed.= " ".$this->items[$i]->authorEmail."\n"; + } + $feed.=" \n"; + } + $feed.= " \n"; + $feed.= "
".$this->items[$i]->getDescription()."
\n"; + $feed.= "
\n"; + $feed.= "
\n"; + } + $feed.= "
\n"; + return $feed; + } +} + +/** + * AtomCreator10 is a FeedCreator that implements the atom specification, + * as in http://www.atomenabled.org/developers/syndication/atom-format-spec.php + * Please note that just by using AtomCreator10 you won't automatically + * produce valid atom files. For example, you have to specify either an editor + * for the feed or an author for every single feed item. + * + * Some elements have not been implemented yet. These are (incomplete list): + * author URL, item author's email and URL, item contents, alternate links, + * other link content types than text/html. Some of them may be created with + * AtomCreator10::additionalElements. + * + * @see FeedCreator#additionalElements + * @since 1.7.2-mod (modified) + * @author Mohammad Hafiz Ismail (mypapit@gmail.com) + */ + class AtomCreator10 extends FeedCreator { + + function AtomCreator10() { + $this->contentType = "application/atom+xml"; + $this->encoding = "utf-8"; + + } + + function createFeed() { + $feed = "encoding."\"?>\n"; + $feed.= $this->_createGeneratorComment(); + $feed.= $this->_createStylesheetReferences(); + $feed.= "language!="") { + $feed.= " xml:lang=\"".$this->language."\""; + } + $feed.= ">\n"; + $feed.= " ".htmlspecialchars($this->title)."\n"; + $feed.= " ".htmlspecialchars($this->description)."\n"; + $feed.= " link)."\"/>\n"; + $feed.= " ".htmlspecialchars($this->link)."\n"; + $now = new FeedDate(); + $feed.= " ".htmlspecialchars($now->iso8601())."\n"; + if ($this->editor!="") { + $feed.= " \n"; + $feed.= " ".$this->editor."\n"; + if ($this->editorEmail!="") { + $feed.= " ".$this->editorEmail."\n"; + } + $feed.= " \n"; + } + if ($this->category!="") { + $feed.= " category) . "\" />\n"; + } + if ($this->copyright!="") { + $feed.= " ".FeedCreator::iTrunc(htmlspecialchars($this->copyright),100)."\n"; + } + $feed.= " ".$this->version()."\n"; + + + $feed.= "syndicationURL). "\" />\n"; + $feed.= $this->_createAdditionalElements($this->additionalElements, " "); + for ($i=0;$iitems);$i++) { + $feed.= " \n"; + $feed.= " ".htmlspecialchars(strip_tags($this->items[$i]->title))."\n"; + $feed.= " items[$i]->link)."\"/>\n"; + if ($this->items[$i]->date=="") { + $this->items[$i]->date = time(); + } + $itemDate = new FeedDate($this->items[$i]->date); + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + + + $tempguid = $this->items[$i]->link; + if ($this->items[$i]->guid!="") { + $tempguid = $this->items[$i]->guid; + } + + $feed.= " ". htmlspecialchars($tempguid)."\n"; + $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, " "); + if ($this->items[$i]->author!="") { + $feed.= " \n"; + $feed.= " ".htmlspecialchars($this->items[$i]->author)."\n"; + if ($this->items[$i]->authorEmail!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->authorEmail)."\n"; + } + + if ($this->items[$i]->authorURL!="") { + $feed.= " ".htmlspecialchars($this->items[$i]->authorURL)."\n"; + } + + $feed.= " \n"; + } + + if ($this->category!="") { + $feed.= " items[$i]->category) . "\" />\n"; + } + + if ($this->items[$i]->description!="") { + + + /* + * ATOM should have at least summary tag, however this implementation may be inaccurate + */ + $tempdesc = $this->items[$i]->getDescription(); + $temptype=""; + + if ($this->items[$i]->descriptionHtmlSyndicated){ + $temptype=" type=\"html\""; + $tempdesc = $this->items[$i]->getDescription(); + + } + + if (empty($this->items[$i]->descriptionTruncSize)) { + $feed.= " ". $tempdesc ."\n"; + } + + $feed.= " ". $tempdesc ."\n"; + } else { + + $feed.= " no summary\n"; + + } + + if ($this->items[$i]->enclosure != NULL) { + $feed.=" items[$i]->enclosure->url ."\" type=\"". $this->items[$i]->enclosure->type."\" length=\"". $this->items[$i]->enclosure->length ."\""; + + if ($this->items[$i]->enclosure->language != ""){ + $feed .=" xml:lang=\"". $this->items[$i]->enclosure->language . "\" "; + } + + if ($this->items[$i]->enclosure->title != ""){ + $feed .=" title=\"". $this->items[$i]->enclosure->title . "\" "; + } + + $feed .=" /> \n"; + + + + } + $feed.= " \n"; + } + $feed.= "\n"; + return $feed; + } + + +} + + +/** + * AtomCreator03 is a FeedCreator that implements the atom specification, + * as in http://www.intertwingly.net/wiki/pie/FrontPage. + * Please note that just by using AtomCreator03 you won't automatically + * produce valid atom files. For example, you have to specify either an editor + * for the feed or an author for every single feed item. + * + * Some elements have not been implemented yet. These are (incomplete list): + * author URL, item author's email and URL, item contents, alternate links, + * other link content types than text/html. Some of them may be created with + * AtomCreator03::additionalElements. + * + * @see FeedCreator#additionalElements + * @since 1.6 + * @author Kai Blankenhorn , Scott Reynen + */ +class AtomCreator03 extends FeedCreator { + + function AtomCreator03() { + $this->contentType = "application/atom+xml"; + $this->encoding = "utf-8"; + } + + function createFeed() { + $feed = "encoding."\"?>\n"; + $feed.= $this->_createGeneratorComment(); + $feed.= $this->_createStylesheetReferences(); + $feed.= "language!="") { + $feed.= " xml:lang=\"".$this->language."\""; + } + $feed.= ">\n"; + $feed.= " ".htmlspecialchars($this->title)."\n"; + $feed.= " ".htmlspecialchars($this->description)."\n"; + $feed.= " link)."\"/>\n"; + $feed.= " ".htmlspecialchars($this->link)."\n"; + $now = new FeedDate(); + $feed.= " ".htmlspecialchars($now->iso8601())."\n"; + if ($this->editor!="") { + $feed.= " \n"; + $feed.= " ".$this->editor."\n"; + if ($this->editorEmail!="") { + $feed.= " ".$this->editorEmail."\n"; + } + $feed.= " \n"; + } + $feed.= " ".$this->version()."\n"; + $feed.= $this->_createAdditionalElements($this->additionalElements, " "); + for ($i=0;$iitems);$i++) { + $feed.= " \n"; + $feed.= " ".htmlspecialchars(strip_tags($this->items[$i]->title))."\n"; + $feed.= " items[$i]->link)."\"/>\n"; + if ($this->items[$i]->date=="") { + $this->items[$i]->date = time(); + } + $itemDate = new FeedDate($this->items[$i]->date); + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($itemDate->iso8601())."\n"; + $feed.= " ".htmlspecialchars($this->items[$i]->link)."\n"; + $feed.= $this->_createAdditionalElements($this->items[$i]->additionalElements, " "); + if ($this->items[$i]->author!="") { + $feed.= " \n"; + $feed.= " ".htmlspecialchars($this->items[$i]->author)."\n"; + $feed.= " \n"; + } + if ($this->items[$i]->description!="") { + $feed.= " ".htmlspecialchars( strip_tags($this->items[$i]->description) )."\n"; + + } + $feed.= " \n"; + } + $feed.= "\n"; + return $feed; + } +} + + +/** + * MBOXCreator is a FeedCreator that implements the mbox format + * as described in http://www.qmail.org/man/man5/mbox.html + * + * @since 1.3 + * @author Kai Blankenhorn + */ +class MBOXCreator extends FeedCreator { + + function MBOXCreator() { + $this->contentType = "text/plain"; + $this->encoding = "ISO-8859-15"; + } + + function qp_enc($input = "", $line_max = 76) { + $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); + $lines = preg_split("/(?:\r\n|\r|\n)/", $input); + $eol = "\r\n"; + $escape = "="; + $output = ""; + while( list(, $line) = each($lines) ) { + //$line = rtrim($line); // remove trailing white space -> no =20\r\n necessary + $linlen = strlen($line); + $newline = ""; + for($i = 0; $i < $linlen; $i++) { + $c = substr($line, $i, 1); + $dec = ord($c); + if ( ($dec == 32) && ($i == ($linlen - 1)) ) { // convert space at eol only + $c = "=20"; + } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required + $h2 = floor($dec/16); $h1 = floor($dec%16); + $c = $escape.$hex["$h2"].$hex["$h1"]; + } + if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted + $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay + $newline = ""; + } + $newline .= $c; + } // end of for + $output .= $newline.$eol; + } + return trim($output); + } + + + /** + * Builds the MBOX contents. + * @return string the feed's complete text + */ + function createFeed() { + for ($i=0;$iitems);$i++) { + if ($this->items[$i]->author!="") { + $from = $this->items[$i]->author; + } else { + $from = $this->title; + } + $itemDate = new FeedDate($this->items[$i]->date); + $feed = "From ".strtr(MBOXCreator::qp_enc($from)," ","_")." ".date("D M d H:i:s Y",$itemDate->unix())."\n"; + $feed.= "Content-Type: text/plain;\n"; + $feed.= " charset=\"".$this->encoding."\"\n"; + $feed.= "Content-Transfer-Encoding: quoted-printable\n"; + $feed.= "Content-Type: text/plain\n"; + $feed.= "From: \"".MBOXCreator::qp_enc($from)."\"\n"; + $feed.= "Date: ".$itemDate->rfc822()."\n"; + $feed.= "Subject: ".MBOXCreator::qp_enc(FeedCreator::iTrunc($this->items[$i]->title,100))."\n"; + $feed.= "\n"; + $body = chunk_split(MBOXCreator::qp_enc($this->items[$i]->description)); + $feed.= preg_replace("~\nFrom ([^\n]*)(\n?)~","\n>From $1$2\n",$body); + $feed.= "\n"; + $feed.= "\n"; + } + return $feed; + } + + /** + * Generate a filename for the feed cache file. Overridden from FeedCreator to prevent XML data types. + * @return string the feed cache filename + * @since 1.4 + * @access private + */ + function _generateFilename() { + $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + return substr($fileInfo["basename"],0,-(strlen($fileInfo["extension"])+1)).".mbox"; + } +} + + +/** + * OPMLCreator is a FeedCreator that implements OPML 1.0. + * + * @see http://opml.scripting.com/spec + * @author Dirk Clemens, Kai Blankenhorn + * @since 1.5 + */ +class OPMLCreator extends FeedCreator { + + function OPMLCreator() { + $this->encoding = "utf-8"; + } + + function createFeed() { + $feed = "encoding."\"?>\n"; + $feed.= $this->_createGeneratorComment(); + $feed.= $this->_createStylesheetReferences(); + + //changed by D + //$feed.= "\n"; + $feed.= "\n"; + + + $feed.= " \n"; + $feed.= " ".htmlspecialchars($this->title)."\n"; + if ($this->pubDate!="") { + $date = new FeedDate($this->pubDate); + $feed.= " ".$date->rfc822()."\n"; + } + if ($this->lastBuildDate!="") { + $date = new FeedDate($this->lastBuildDate); + $feed.= " ".$date->rfc822()."\n"; + } + if ($this->editor!="") { + $feed.= " ".$this->editor."\n"; + } + if ($this->editorEmail!="") { + $feed.= " ".$this->editorEmail."\n"; + } + $feed.= " \n"; + $feed.= " \n"; + for ($i=0;$iitems);$i++) { + $feed.= " items[$i]->title,"\n\r"," "))); + $feed.= " title=\"".$title."\""; + $feed.= " text=\"".$title."\""; + //$feed.= " description=\"".htmlspecialchars($this->items[$i]->description)."\""; + $feed.= " url=\"".htmlspecialchars($this->items[$i]->link)."\""; + + //print_r($this->items); + + if ($this->syndicationURL !="") { + $feed.= " xmlUrl=\"" . $this->syndicationURL . "\""; + } + + $feed.= " />\n"; + } + $feed.= " \n"; + $feed.= "\n"; + return $feed; + } +} + + + +/** + * HTMLCreator is a FeedCreator that writes an HTML feed file to a specific + * location, overriding the createFeed method of the parent FeedCreator. + * The HTML produced can be included over http by scripting languages, or serve + * as the source for an IFrame. + * All output by this class is embedded in
tags to enable formatting + * using CSS. + * + * @author Pascal Van Hecke + * @since 1.7 + */ +class HTMLCreator extends FeedCreator { + + var $contentType = "text/html"; + + /** + * Contains HTML to be output at the start of the feed's html representation. + */ + var $header; + + /** + * Contains HTML to be output at the end of the feed's html representation. + */ + var $footer ; + + /** + * Contains HTML to be output between entries. A separator is only used in + * case of multiple entries. + */ + var $separator; + + /** + * Used to prefix the stylenames to make sure they are unique + * and do not clash with stylenames on the users' page. + */ + var $stylePrefix; + + /** + * Determines whether the links open in a new window or not. + */ + var $openInNewWindow = true; + + var $imageAlign ="right"; + + /** + * In case of very simple output you may want to get rid of the style tags, + * hence this variable. There's no equivalent on item level, but of course you can + * add strings to it while iterating over the items ($this->stylelessOutput .= ...) + * and when it is non-empty, ONLY the styleless output is printed, the rest is ignored + * in the function createFeed(). + */ + var $stylelessOutput =""; + + /** + * Writes the HTML. + * @return string the scripts's complete text + */ + function createFeed() { + // if there is styleless output, use the content of this variable and ignore the rest + if ($this->stylelessOutput!="") { + return $this->stylelessOutput; + } + + //if no stylePrefix is set, generate it yourself depending on the script name + if ($this->stylePrefix=="") { + $this->stylePrefix = str_replace(".", "_", $this->_generateFilename())."_"; + } + + //set an openInNewWindow_token_to be inserted or not + if ($this->openInNewWindow) { + $targetInsert = " target='_blank'"; + } + + // use this array to put the lines in and implode later with "document.write" javascript + $feedArray = array(); + if ($this->image!=null) { + $imageStr = "". + "".

+							FeedCreator::iTrunc(htmlspecialchars($this->image->title),100).

+							"image->width) { + $imageStr .=" width='".$this->image->width. "' "; + } + if ($this->image->height) { + $imageStr .=" height='".$this->image->height."' "; + } + $imageStr .="/>"; + $feedArray[] = $imageStr; + } + + if ($this->title) { + $feedArray[] = ""; + } + if ($this->getDescription()) { + $feedArray[] = "
". + str_replace("]]>", "", str_replace("getDescription())). + "
"; + } + + if ($this->header) { + $feedArray[] = "
".$this->header."
"; + } + + for ($i=0;$iitems);$i++) { + if ($this->separator and $i > 0) { + $feedArray[] = "
".$this->separator."
"; + } + + if ($this->items[$i]->title) { + if ($this->items[$i]->link) { + $feedArray[] = + ""; + } else { + $feedArray[] = + "
". + FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)),100). + "
"; + } + } + if ($this->items[$i]->getDescription()) { + $feedArray[] = + "
". + str_replace("]]>", "", str_replace("items[$i]->getDescription())). + "
"; + } + } + if ($this->footer) { + $feedArray[] = "
".$this->footer."
"; + } + + $feed= "".join($feedArray, "\r\n"); + return $feed; + } + + /** + * Overrrides parent to produce .html extensions + * + * @return string the feed cache filename + * @since 1.4 + * @access private + */ + function _generateFilename() { + $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + return substr($fileInfo["basename"],0,-(strlen($fileInfo["extension"])+1)).".html"; + } +} + + +/** + * JSCreator is a class that writes a js file to a specific + * location, overriding the createFeed method of the parent HTMLCreator. + * + * @author Pascal Van Hecke + */ +class JSCreator extends HTMLCreator { + var $contentType = "text/javascript"; + + /** + * writes the javascript + * @return string the scripts's complete text + */ + function createFeed() + { + $feed = parent::createFeed(); + $feedArray = explode("\n",$feed); + + $jsFeed = ""; + foreach ($feedArray as $value) { + $jsFeed .= "document.write('".trim(addslashes($value))."');\n"; + } + return $jsFeed; + } + + /** + * Overrrides parent to produce .js extensions + * + * @return string the feed cache filename + * @since 1.4 + * @access private + */ + function _generateFilename() { + $fileInfo = pathinfo($_SERVER["PHP_SELF"]); + return substr($fileInfo["basename"],0,-(strlen($fileInfo["extension"])+1)).".js"; + } + +} + +?> diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/tmpl/index.html b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/view.html.php b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/view.html.php new file mode 100644 index 00000000..8030a2fe --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/view.html.php @@ -0,0 +1,42 @@ +get( 'Data'); + $content = & $this->get( 'Content'); + $menuItemArray =& $this->get('MenuItemArray'); + $this->assignRef('id', $feed->id); + $this->assignRef('title', $feed->feed_name); + $this->assignRef('type', $feed->feed_type); + $this->assignRef('sectlist', $feed->msg_sectlist); + $this->assignRef('excatlist', $feed->msg_excatlist); + $this->assignRef('fulltext', $feed->msg_fulltext); + $this->assignRef('cat', $feed->msg_sectcat); + $this->assignRef('count', $feed->msg_count); + $this->assignRef('orderby', $feed->msg_orderby); + $this->assignRef('cache', $feed->feed_cache); + $this->assignRef('description', $feed->feed_description); + $this->assignRef('renderAuthorFormat', $feed->feed_renderAuthorFormat); + $this->assignRef('renderHTML', $feed->feed_renderHTML); + $this->assignRef('renderImages', $feed->feed_renderImages); + $this->assignRef('FPItemsOnly', $feed->msg_FPItemsOnly); + $this->assignRef('numWords', $feed->msg_numWords); + $this->assignRef('imgUrl', $feed->feed_imgUrl); + $this->assignRef('contentPlugins', $feed->msg_contentPlugins); + + //TODO - add these columns if enough people request them + //$this->assignRef('ninjaRSSFeedRowPlugins', $feed->msg_ninjaRSSFeedRowPlugins); + //$this->assignRef('ninjaRSSFeedPlugins', $feed->feed_ninjaRSSFeedPlugins); + + $this->assignRef('content', $content); + $this->assignRef('menuitemarray',$menuItemArray ); + parent::display($tpl); + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/view.raw.php b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/view.raw.php new file mode 100644 index 00000000..f61046ce --- /dev/null +++ b/oss/joomla/trunk/components/com_ninjarsssyndicator/views/ninjarsssyndicator/view.raw.php @@ -0,0 +1,50 @@ +get( 'Data'); + $content = & $this->get( 'Content'); + $menuItemArray =& $this->get('MenuItemArray'); + $this->assignRef('id', $feed->id); + $this->assignRef('title', $feed->feed_name); + $this->assignRef('type', $feed->feed_type); + $this->assignRef('sectlist', $feed->msg_sectlist); + $this->assignRef('excatlist', $feed->msg_excatlist); + $this->assignRef('fulltext', $feed->msg_fulltext); + $this->assignRef('cat', $feed->msg_sectcat); + $this->assignRef('count', $feed->msg_count); + $this->assignRef('orderby', $feed->msg_orderby); + $this->assignRef('cache', $feed->feed_cache); + $this->assignRef('description', $feed->feed_description); + $this->assignRef('renderAuthorFormat', $feed->feed_renderAuthorFormat); + $this->assignRef('renderHTML', $feed->feed_renderHTML); + $this->assignRef('renderImages', $feed->feed_renderImages); + $this->assignRef('FPItemsOnly', $feed->msg_FPItemsOnly); + $this->assignRef('numWords', $feed->msg_numWords); + $this->assignRef('imgUrl', $feed->feed_imgUrl); + $this->assignRef('contentPlugins', $feed->msg_contentPlugins); + //Xipat - VH (Feb 09 2009): Remove unuse code + /* + $this->assignRef('catsInTitle',$feed->feed_catsInTitle); // default = 1 + */ + $this->assignRef('content', $content); + $this->assignRef('menuitemarray',$menuItemArray ); + + + + $doc = JFactory::getDocument(); + $doc->setMimeEncoding('application/rss+xml'); + + + + + parent::display($tpl); + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/assets/blank.png b/oss/joomla/trunk/components/com_poll/assets/blank.png new file mode 100644 index 00000000..68afa9a7 Binary files /dev/null and b/oss/joomla/trunk/components/com_poll/assets/blank.png differ diff --git a/oss/joomla/trunk/components/com_poll/assets/index.html b/oss/joomla/trunk/components/com_poll/assets/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/assets/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/assets/poll.png b/oss/joomla/trunk/components/com_poll/assets/poll.png new file mode 100644 index 00000000..46e596bf Binary files /dev/null and b/oss/joomla/trunk/components/com_poll/assets/poll.png differ diff --git a/oss/joomla/trunk/components/com_poll/assets/poll_bars.css b/oss/joomla/trunk/components/com_poll/assets/poll_bars.css new file mode 100644 index 00000000..0d0c1dfc --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/assets/poll_bars.css @@ -0,0 +1,15 @@ +/* polls Bar Colors/Formats - Follow the format to add your own. + Then update the maxcolors setting for polls in + components/com_poll/poll.php -> $polls_maxcolors +*/ + +.polls_color_1{ background-color: #8D1B1B; border: 2px ridge #B22222; } + +.polls_color_2{ background-color: #6740E1; border: 2px ridge #4169E1; } + +.polls_color_3{ background-color: #8D8D8D; border: 2px ridge #D2D2D2; } + +.polls_color_4{ background-color: #CC8500; border: 2px ridge #FFA500; } + +.polls_color_5{ background-color: #5B781E; border: 2px ridge #6B8E23; } + diff --git a/oss/joomla/trunk/components/com_poll/controller.php b/oss/joomla/trunk/components/com_poll/controller.php new file mode 100644 index 00000000..7b549f8c --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/controller.php @@ -0,0 +1,96 @@ +load( $poll_id ) || $poll->published != 1) { + JError::raiseWarning( 404, JText::_('ALERTNOTAUTH') ); + return; + } + + $cookieName = JUtility::getHash( $mainframe->getName() . 'poll' . $poll_id ); + // ToDo - may be adding those information to the session? + $voted = JRequest::getVar( $cookieName, '0', 'COOKIE', 'INT'); + + if ($voted || !$option_id ) + { + if($voted) { + $msg = JText::_('You already voted for this poll today!'); + } + + if(!$option_id){ + $msg = JText::_('WARNSELECT'); + } + } + else + { + setcookie( $cookieName, '1', time() + $poll->lag ); + + require_once(JPATH_COMPONENT.DS.'models'.DS.'poll.php'); + $model = new PollModelPoll(); + $model->vote( $poll_id, $option_id ); + + $msg = JText::_( 'Thanks for your vote!' ); + } + + // set Itemid id for links + $menu = &JSite::getMenu(); + $items = $menu->getItems('link', 'index.php?option=com_poll&view=poll'); + + $itemid = isset($items[0]) ? '&Itemid='.$items[0]->id : ''; + + $this->setRedirect( JRoute::_('index.php?option=com_poll&id='. $poll_id.':'.$poll->alias.$itemid, false), $msg ); + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/index.html b/oss/joomla/trunk/components/com_poll/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/models/index.html b/oss/joomla/trunk/components/com_poll/models/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/models/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/models/poll.php b/oss/joomla/trunk/components/com_poll/models/poll.php new file mode 100644 index 00000000..9b60459e --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/models/poll.php @@ -0,0 +1,62 @@ +getDBO(); + $poll_id = (int) $poll_id; + $option_id = (int) $option_id; + + $query = 'UPDATE #__poll_data' + . ' SET hits = hits + 1' + . ' WHERE pollid = ' . (int) $poll_id + . ' AND id = ' . (int) $option_id + ; + $db->setQuery( $query ); + $db->query(); + + $query = 'UPDATE #__polls' + . ' SET voters = voters + 1' + . ' WHERE id = ' . (int) $poll_id + ; + $db->setQuery( $query ); + $db->query(); + + $date =& JFactory::getDate(); + + $query = 'INSERT INTO #__poll_date' + . ' SET date = ' . $db->Quote($date->toMySQL()) + . ', vote_id = ' . (int) $option_id + . ', poll_id = ' . (int) $poll_id + ; + $db->setQuery( $query ); + $db->query(); + } +} diff --git a/oss/joomla/trunk/components/com_poll/poll.php b/oss/joomla/trunk/components/com_poll/poll.php new file mode 100644 index 00000000..68530fe5 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/poll.php @@ -0,0 +1,45 @@ +registerTask( 'results', 'display' ); + +// Perform the Request task +$controller->execute(JRequest::getCmd('task')); + +// Redirect if set by the controller +$controller->redirect(); diff --git a/oss/joomla/trunk/components/com_poll/router.php b/oss/joomla/trunk/components/com_poll/router.php new file mode 100644 index 00000000..4fea031c --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/router.php @@ -0,0 +1,135 @@ +getItems('componentid', $component->id); + } + + // Search for an appropriate menu item. + if (is_array($items)) + { + // If only the option and itemid are specified in the query, return that item. + if (!isset($query['view']) && !isset($query['id']) && !isset($query['catid']) && isset($query['Itemid'])) { + $itemid = (int) $query['Itemid']; + } + // Search for a specific link based on the critera given. + if (!$itemid) { + foreach ($items as $item) + { + // Check if this menu item links to this view. + if (isset($item->query['view']) && $item->query['view'] == 'poll' + && isset($query['view']) && $query['view'] != 'category' + && isset($item->query['id']) && $item->query['id'] == $query['id']) + { + $itemid = $item->id; + } + } + } + + // If no specific link has been found, search for a general one. + if (!$itemid) { + foreach ($items as $item) + { + if (isset($query['view']) && $query['view'] == 'poll' && isset($item->query['view']) && $item->query['view'] == 'poll') + { + // Check for an undealt with newsfeed id. + if (isset($query['id'])) + { + // This menu item links to the newsfeed view but we need to append the newsfeed id to it. + $itemid = $item->id; + $segments[] = isset($query['alias']) ? $query['id'].':'.$query['alias'] : $query['id']; + break; + } + } + } + } + } + + // Check if the router found an appropriate itemid. + if (!$itemid) + { + // Check if a id was specified. + if (isset($query['id'])) + { + if (isset($query['alias'])) { + $query['id'] .= ':'.$query['alias']; + } + + // Push the id onto the stack. + $segments[] = $query['id']; + unset($query['id']); + unset($query['alias']); + } + unset($query['view']); + } + else + { + $query['Itemid'] = $itemid; + + // Remove the unnecessary URL segments. + unset($query['view']); + unset($query['id']); + unset($query['catid']); + unset($query['alias']); + } + + return $segments; +} + +/** + * @param array + * @return array + */ +function PollParseRoute( $segments ) +{ + $vars = array(); + + //Get the active menu item + $menu =& JSite::getMenu(); + $item =& $menu->getActive(); + + $count = count( $segments ); + + //Standard routing for articles + if(!isset($item)) + { + $vars['id'] = $segments[$count - 1]; + return $vars; + } + + // Count route segments + $vars['id'] = $segments[$count-1]; + $vars['view'] = 'poll'; + + return $vars; +} \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/views/index.html b/oss/joomla/trunk/components/com_poll/views/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/views/poll/index.html b/oss/joomla/trunk/components/com_poll/views/poll/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/views/poll/metadata.xml b/oss/joomla/trunk/components/com_poll/views/poll/metadata.xml new file mode 100644 index 00000000..255ac9f2 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/metadata.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default.php b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default.php new file mode 100644 index 00000000..8b19e6b1 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default.php @@ -0,0 +1,22 @@ + + + + +
+params->get( 'show_page_title', 1)) : ?> +
+ escape($this->params->get('page_title')); ?> +
+ +
+ +
+
+loadTemplate('graph'); ?> +
+
diff --git a/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default.xml b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default.xml new file mode 100644 index 00000000..7dfbcbd4 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default.xml @@ -0,0 +1,16 @@ + + + + + + + + + Poll Layout + STANDARD POLL LAYOUT DESC + + + + + + diff --git a/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default_graph.php b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default_graph.php new file mode 100644 index 00000000..6677c3f8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/default_graph.php @@ -0,0 +1,65 @@ + +
+ + + + + + + +votes as $vote) : ?> + + + + + + + + + + +
+ + escape($this->poll->title); ?> +
+ text; ?> +
+ escape($vote->hits); ?>  + + escape($vote->percent); ?>% + +
+
+
+ + + + + + + + + + + + + + + +
+ + +  :  + votes[0])) echo $this->votes[0]->voters; ?> +
+ + +  :  + escape($this->first_vote); ?> +
+ + +  :  + escape($this->last_vote); ?> +
diff --git a/oss/joomla/trunk/components/com_poll/views/poll/tmpl/index.html b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/components/com_poll/views/poll/view.html.php b/oss/joomla/trunk/components/com_poll/views/poll/view.html.php new file mode 100644 index 00000000..76fc3596 --- /dev/null +++ b/oss/joomla/trunk/components/com_poll/views/poll/view.html.php @@ -0,0 +1,192 @@ +getPathway(); + + $poll_id = JRequest::getVar( 'id', 0, '', 'int' ); + + $poll =& JTable::getInstance('poll', 'Table'); + $poll->load( $poll_id ); + + // if id value is passed and poll not published then exit + if ($poll->id > 0 && $poll->published != 1) { + JError::raiseError( 403, JText::_('Access Forbidden') ); + return; + } + + // Adds parameter handling + $params = $mainframe->getParams(); + + //Set page title information + $menus = &JSite::getMenu(); + $menu = $menus->getActive(); + + // because the application sets a default page title, we need to get it + // right from the menu item itself + if (is_object( $menu )) { + $menu_params = new JParameter( $menu->params ); + if (!$menu_params->get( 'page_title')) { + $params->set('page_title', $poll->title); + } + } else { + $params->set('page_title', $poll->title); + } + $document->setTitle( $params->get( 'page_title' ) ); + + //Set pathway information + $pathway->addItem($poll->title, ''); + + $params->def( 'show_page_title', 1 ); + $params->def( 'page_title', $poll->title ); + + $first_vote = ''; + $last_vote = ''; + $votes = ''; + + // Check if there is a poll corresponding to id and if poll is published + if ($poll->id > 0) + { + if (empty( $poll->title )) { + $poll->id = 0; + $poll->title = JText::_( 'Select Poll from the list' ); + } + + $query = 'SELECT MIN( date ) AS mindate, MAX( date ) AS maxdate' + . ' FROM #__poll_date' + . ' WHERE poll_id = '. (int) $poll->id; + $db->setQuery( $query ); + $dates = $db->loadObject(); + + if (isset( $dates->mindate )) { + $first_vote = JHTML::_('date', $dates->mindate, JText::_('DATE_FORMAT_LC2') ); + $last_vote = JHTML::_('date', $dates->maxdate, JText::_('DATE_FORMAT_LC2') ); + } + + $query = 'SELECT a.id, a.text, a.hits, b.voters ' + . ' FROM #__poll_data AS a' + . ' INNER JOIN #__polls AS b ON b.id = a.pollid' + . ' WHERE a.pollid = '. (int) $poll->id + . ' AND a.text <> ""' + . ' ORDER BY a.hits DESC'; + $db->setQuery( $query ); + $votes = $db->loadObjectList(); + } else { + $votes = array(); + } + + // list of polls for dropdown selection + $query = 'SELECT id, title, alias' + . ' FROM #__polls' + . ' WHERE published = 1' + . ' ORDER BY id' + ; + $db->setQuery( $query ); + $pList = $db->loadObjectList(); + + foreach ($pList as $k=>$p) + { + $pList[$k]->url = JRoute::_('index.php?option=com_poll&id='.$p->id.':'.$p->alias); + } + + array_unshift( $pList, JHTML::_('select.option', '', JText::_( 'Select Poll from the list' ), 'url', 'title' )); + + // dropdown output + $lists = array(); + + $lists['polls'] = JHTML::_('select.genericlist', $pList, 'id', + 'class="inputbox" size="1" style="width:200px" onchange="if (this.options[selectedIndex].value != \'\') {document.location.href=this.options[selectedIndex].value}"', + 'url', 'title', + JRoute::_('index.php?option=com_poll&id='.$poll->id.':'.$poll->alias) + ); + + + $graphwidth = 200; + $barheight = 4; + $maxcolors = 5; + $barcolor = 0; + $tabcnt = 0; + $colorx = 0; + + $maxval = isset($votes[0]) ? $votes[0]->hits : 0; + $sumval = isset($votes[0]) ? $votes[0]->voters : 0; + + $k = 0; + for ($i = 0; $i < count( $votes ); $i++) + { + $vote =& $votes[$i]; + + if ($maxval > 0 && $sumval > 0) + { + $vote->width = ceil( $vote->hits * $graphwidth / $maxval ); + $vote->percent = round( 100 * $vote->hits / $sumval, 1 ); + } + else + { + $vote->width = 0; + $vote->percent = 0; + } + + $vote->class = ''; + if ($barcolor == 0) + { + if ($colorx < $maxcolors) { + $colorx = ++$colorx; + } else { + $colorx = 1; + } + $vote->class = "polls_color_".$colorx; + } else { + $vote->class = "polls_color_".$barcolor; + } + + $vote->barheight = $barheight; + + $vote->odd = $k; + $vote->count = $i; + $k = 1 - $k; + } + + $this->assign('first_vote', $first_vote); + $this->assign('last_vote', $last_vote); + + $this->assignRef('lists', $lists); + $this->assignRef('params', $params); + $this->assignRef('poll', $poll); + $this->assignRef('votes', $votes); + + parent::display($tpl); + } +} +?>