头疼,我搞不懂网页中空格的使用了

  空格在编程类的网站上比较重要,例如:代码缩排,今天,在网上看了一下有关css样式表的知识。有如下收获:

  1、网页中连续的空格在网页上只显示一个;

  2、html文件中的<font face="宋体">宋体字</font>在css文件中相当于{font-family:"宋体"};

  但是,处理“学习日记”上的空格把我搞昏了,只得暂时放弃,情况如下:

  1、原来,把文章格式化成html格式的内容是每行的前导空格用转义字符“&nbsp;”替换,行中的空格不变,这样,行中如果有超过1个的空格在网页中只会显示一个空格;但是,如果把所有的空格用“&nbsp;”替换,整个网页中的表格无论是在IE6或Mozilla 1.7中都会严重变形!搞不懂;

  2、如果把网页的样式单独写成一个css文件,然后在jsp文件中link这个文件,在IE6.0中空格的宽度就会小于一个英文字符的宽度,而在Mozilla 1.7中的两个宽度是一样的;而如果把css样式直接写在jsp文件的<head>与</head>之间,在IE6.0中空格的宽度又和一个英文字符的宽度一样了!搞不懂;

  头疼,暂时不去管这个事情了,以后有机会找朋友帮忙看看是怎么样一回事。

动态输出网站的文章(以xml格式),定期发布网站数据库

  为了方便朋友再加工自己的文章,和方便朋友使用本站的资料,可以添加动态输出xml格式的网站文章的功能。例如:一篇日记及其所有评论,一个目标及其所有日记、评论,用户加入的目标的所有自己的日记和相应的评论...。

  定期发布网站的数据库,可以仿照delphibbs.com(大富翁)的做法,以后开发一款学习日记自己的离线浏览器。

(转帖)什么是Podcast?

转自:http://tech.blogchina.com/140/2005-04-14/364318.html

在rss相关名词中,我发现podcast出现的频率非常之高,但不知道是什么意思,现在看来,好像就是资源的个性聚合,例如:把其它任意多个blog的相关链接合在一起,形成自己需要的。也不知道正不正确。

                          正文

×××××××××××××××××××××××××××××××××××××××××××××××××××

您的位置: 博客网 -> 科技频道 -> 社会软件什么是Podcast?

作者:郑雅钦 | 2005年04月14日 20:04 | 原始出处: 博客中国    【内容提要】:  Podcast,中文译名尚未统一,但最多的是将其翻译为“播客”。它是数字广播技术的一种,出现初期借助一个叫“iPodder”的软件与一些便携播放器相结合而实现。Podcasting录制的是网络广播或类似的网络声讯节目,网友可将网上的广播节目下载到自己的iPod、MP3播放器或其它便携式数码声讯播放器中随身收听,不必端坐电脑前,也不必实时收听,享受随时随地的自由。更有意义的是,你还可以自己制作声音节目,并将其上传到网上与广大网友分享。

    就像博客颠覆了被动接受文字信息的方式一样,播客颠覆了被动收听广播的方式,使听众成为主动参与者。有人说,播客可能会像博客(Blog)一样,带来大众传媒的又一场革命。 

   关于Podcast的定义目前仍在争论中,比较有代表性的说法有以下三种:

   一.Podcast的推动者Doc Searls给出的定义:

   PODcasting,Personal Optional Digital casting。PODcasting是自助广播,是全新的广播形式。收听传统广播时我们是被动收听我们可能想听的节目,而PODcasting则是我们选择收听的内容、收听的时间以及以何种方式让其他人也有机会收听。 戴维·温纳(Dave Winer)的Morning Coffee Notes:人各有所专,所以理论上人人播客是可能的。

  二.Dave Shusher在其“Podcasting的定义”一文中的定义:

    他提出Podcasting必须具备三个要件:

    1.必须是一个独立的、可下载的媒体文件;

    2.该文件的发布格式为RSS2.0 enclosure feed;

    3.接收端能自动接收、下载并将文件转至需要的地方,放置于播放器的节目单中。

   他认为可下载MP3 不是波刻(Podcast)――这是充分但不是必要条件。“能下载固然不错,但能自动出现供你播放而无需你关照才是关键。这才是Podcasting。”

    三.Wikipedia的定义:

    像WIKI这样的定义是开放、动态的,到2004年12月13日为止,其定义为:      Podcasting源于iPod,兼具broadcasting和webcasting 之意。Podcasting 与TiVo相似, 只是Podcasting是用于声讯节目而且目前免费。但是应该注意,该技术能把任何文件“拉”过来,包括软件更新、照片和视频。

【 收藏此页到博采| 推荐给朋友 | 大 中 小 | 打印本文 | 关闭本页】

【郑重声明】博客网刊载此文不代表同意其说法或描述,仅为提供更多信息,也不构成任何投资或其他建议。转载需经博客网同意并注明出处。本网站有部分文章是由网友自由上传。对于此类文章本站仅提供交流平台,不为其版权负责。如果您发现本网站上有侵犯您的知识产权的文章,请联系我们

【本文网址】http://tech.bokee.com/140/2005-04-14/364318.html

rsslibj生成rss2.0搞不定,换了rome0.8来试试

  在rsslibj中生成rss2.0用getFeed("2.0")用下载的binary不行,用cvs库中的文件更不行,老是报告nullpoint错误,而且,文档和源程序混乱。

  试用了rome,感觉更正规一些,文档丰富,设计上好像要全面一些。毕竟,它是后来者,而rsslibj在2003年就停止发布了。

  rome自身带的例子已经比较全面,可以来它来写出基本功能的rss文件,下面附网上一篇完整的例子:

转自:http://kb.csdn.net/java/Articles/200512/10b9356d-85cd-4fe0-b8ae-3eece6cdb928.html

How To Generate RSS With ROME

作者: ∣来源:JavaLobby∣原文地址∣2005-12-30

Many people have asked how I implemented RSS in Fatima (JavaPress) on Java.net since the object model for Suns Rome API is a little.. dense, and suited more for abstract aggregation in your applications like Technorati. However, Rome is extremely powerful and offers lots of transformation and organization of your RSS feeds (no matter if you generate them or you grab them). Well, below is a general class that implements everything you would need to start generating your own RSS feeds using the ROME API, and for everyone that wants to get started quick this example should help you out.

doSyndication() is where youll want to focus your attention.

NOTE: This generates both regular RSS and shows you how to generate RSS with the embed tag for Podcasts!

package net.thepostmodern.fatima.rss;

 

import com.sun.syndication.feed.synd.*;

import com.sun.syndication.io.SyndFeedOutput;

import java.io.FileWriter;

import java.io.Writer;

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.util.ArrayList;

import java.util.List;

import java.sql.*;

 

import net.thepostmodern.fatima.blog.*;

import net.thepostmodern.fatima.sql.ConnectionFactory;

 

 

/**

 * @author   bbjwerner

 */

public class GenerateRSS {

private static final DateFormat DATE_PARSER = new SimpleDateFormat("yyyy-MM-dd");

private static String fileName = null;

private static String feedType = null;

    private final List entries = new ArrayList();

private final List categories = new ArrayList();

    SyndEntry entry;

    SyndContent description;

SyndCategory category;

 

/**

* This method generates a seperate RSS feed for all categories in blog

* @param feedType The type of feed you wish to generate (RSS2.0, atom, ect.).

* @param fileName Filename will be category.xml, and this entry does nothing to override this.

*/

public void generateCategoryRSS(String Type, String Name) {

feedType = Type;

fileName = Name;

populateCategoryArray();

}

/**

* This method generates the RSS feeds for a complete blog with categories

* @param Type The type of feed you wish to generate (RSS2.0, atom, ect.).

* @param Name The filename to write out the format to.

*/

public void generateBlogRSS(String Type, String Name) {

feedType = Type;

fileName = Name;

this.populateArray();

}

       

        /**

* This method generates the RSS feeds for podcasting based on category (i.e. Podcast)

* @param Category The category to run as containing podcast content.

* @param Name The filename to write out the format to.

*/

        public void generatePodcastRSS(String Category, String Name) {

feedType = "rss2.0";

fileName = Name;

this.populatePodcastArray(Category);

}

public GenerateRSS() {

   

}

private void populateArray() {

 

    final ConnectionFactory thisFactory = new ConnectionFactory();

ResultSet blogEntries = null;

ResultSet blogInfo = null;

    try {

blogEntries = thisFactory.executeStatement("SELECT * FROM blog_entry ORDER BY id DESC");

blogInfo = thisFactory.executeStatement("SELECT * FROM blog_info");

blogEntries.first();

blogInfo.first();

while (!blogEntries.isAfterLast()) {

   

  this.addEntry(blogEntries.getString("title"),blogInfo.getString("url") + "/blog/BlogEntry.jsp?id=" + blogEntries.getString("id"), blogEntries.getString("date"), blogEntries.getString("teaser"), CategoryBean.getCategory(blogEntries.getString("category")), blogEntries.getString("author"));

  blogEntries.next();

}

this.doSyndication(blogInfo.getString("name"), blogInfo.getString("url") + "/blog", blogInfo.getString("description"), blogInfo.getString("copyright"),fileName);

System.out.println("Did Syndication");

}

catch (Exception ex) {

System.out.println("SQLException: " + ex.getMessage());

}

finally {

   

    try {blogEntries.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    try {blogInfo.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    thisFactory.Close();

}

}

private void populateCategoryArray() {

 

    final ConnectionFactory thisFactory = new ConnectionFactory();

ResultSet blogEntries = null;

ResultSet blogInfo = null;

ResultSet blogCategories = null;

try {

blogCategories = thisFactory.executeStatement("SELECT * FROM blog_categories");

blogInfo = thisFactory.executeStatement("SELECT * FROM blog_info");

blogInfo.first();

blogCategories.first();

while (!blogCategories.isAfterLast()) {

   

    blogEntries = thisFactory.executeStatement("SELECT * FROM blog_entry WHERE category = '" + blogCategories.getString("id") + "' ORDER BY id DESC");

blogEntries.first();

System.out.println("************ Doing category: " + CategoryBean.getCategory(blogCategories.getString("id")));

while (!blogEntries.isAfterLast()) { 

  this.addEntry(blogEntries.getString("title"),blogInfo.getString("url") + "/blog/BlogEntry.jsp?id=" + blogEntries.getString("id"), blogEntries.getString("date"), blogEntries.getString("teaser"), CategoryBean.getCategory(blogEntries.getString("category")), blogEntries.getString("author"));

  blogEntries.next();

}

final String XMLfile = ((fileName + blogCategories.getString("category")) + ".xml");

this.doSyndication(blogCategories.getString("title"), blogInfo.getString("url") + "/blog/BlogbyCategory.jsp?id=" + blogCategories.getString("id"), blogCategories.getString("description"), blogInfo.getString("copyright"), XMLfile);

this.entries.clear();

blogCategories.next();

}

}

catch (Exception ex) {

System.out.println("Category SQLException: " + ex.getMessage());

}

finally {

   

    try {blogEntries.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    try {blogInfo.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    try {blogCategories.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    thisFactory.Close();

}

}

private void populatePodcastArray(String category_string) {

   

    final ConnectionFactory thisFactory = new ConnectionFactory();

ResultSet podEntries = null;

ResultSet blogInfo = null;

    try {

    podEntries = thisFactory.executeStatement("SELECT * FROM podcasts");

blogInfo = thisFactory.executeStatement("SELECT * FROM blog_info");

podEntries.first();

blogInfo.first();

while (!podEntries.isAfterLast()) {

   

  this.addPodCast(podEntries.getString("title"),blogInfo.getString("url") + "/blog/radio/" + podEntries.getString("filename"),podEntries.getString("date"), podEntries.getString("description"), category_string, podEntries.getString("author"));

  podEntries.next();

}

this.doSyndication(blogInfo.getString("name"), blogInfo.getString("url"), blogInfo.getString("description"), blogInfo.getString("copyright"),fileName);

System.out.println("Did Syndication");

}

catch (Exception ex) {

System.out.println("SQLException: " + ex.getMessage());

}

finally {

   

    try {podEntries.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    try {blogInfo.close(); } catch (Exception ex) { System.out.println("SQLException: " + ex.getMessage()); }

    thisFactory.Close();

}

}

 

/**

* This method adds an entry to the ArrayList() which will be published when GenerateRSS()

* is called.

* <p>

* @param title The title of the blog entry (not the blog itself)

* @param link The PermaLink that will point to your entry

* @param date The date of the blog entry

* @param blogContent The content or synopsis you wish to publish

* @param cat The category of the entry. This has been added to integrate

*        with Technorati and match WordPress functionality

* @param author The author of the entry to be published.

*

*/

private void addEntry(String title, String link, String date, String blogContent, String cat, String author) {

try {

 

        entry = new SyndEntryImpl();

    entry.setAuthor(author);

        entry.setTitle(title);

        entry.setLink(link);

        entry.setPublishedDate(DATE_PARSER.parse(date));

        description = new SyndContentImpl();

        description.setType("text/plain");

        description.setValue(blogContent);

        entry.setDescription(description);

    category = new SyndCategoryImpl();

category.setName(cat);

categories.add(category);

entry.setCategories(categories);

categories.remove(category);

entries.add(entry);

}

        catch (Exception ex) {

            ex.printStackTrace();

            System.out.println("ERROR: "+ex.getMessage());

                             }

}

private void addPodCast(String title, String mp3link, String date, String blogContent, String cat, String author) {

try {

 

        entry = new SyndEntryImpl();

entry.setAuthor(author);

        entry.setTitle(title);

        entry.setLink(mp3link);

        entry.setPublishedDate(DATE_PARSER.parse(date));

        description = new SyndContentImpl();

        description.setType("text/plain");

        description.setValue(blogContent);

        entry.setDescription(description);

    category = new SyndCategoryImpl();

category.setName(cat);

categories.add(category);

entry.setCategories(categories);

categories.remove(category);

entries.add(entry);

}

        catch (Exception ex) {

            ex.printStackTrace();

            System.out.println("ERROR: "+ex.getMessage());

                             }

}

/**

* This method is called last after you have added all your entries and have specified your

* feed type and filename. This actually does the work

* <p>

* NOTE: This has static content entered in to the fields! You must have access to the source

* code edit this method or else you will be publishing content as the Post Modern Banter Blog

* Yes, I should change this immediately. Ideally, it would take values from the web.xml file itself.

* <p>

* @throws Exception

*/

private void doSyndication(String title, String link, String description_loc, String copyright, String xml) {

 

            try {

 

                final SyndFeed feed = new SyndFeedImpl();

                feed.setFeedType(feedType);

 

                feed.setTitle(title);

                feed.setLink(link);

                feed.setDescription(description_loc);

   feed.setCopyright(copyright);

                feed.setEntries(entries);

  

 

                final Writer writer = new FileWriter(xml);

                final SyndFeedOutput output = new SyndFeedOutput();

                output.output(feed,writer);

                writer.close();

 

                System.out.println("************* The feed has been written to the file ["+xml+"]");

 

            }

            catch (Exception ex) {

                ex.printStackTrace();

                System.out.println("ERROR: "+ex.getMessage());

                                 }

       

}

 

}

--------------------------------------------------------------------------------

作者的其他文章

Atlas 实现机制浅析 [3]

Atlas 实现机制浅析 [3]

live messenger与稀疏文件—Sparse File Bit

live messenger与稀疏文件—Sparse File Bit

又开学了!

自己制作的Rss阅读器(1)

代码整理

DNN中的Skinning系统

DNN中的Skinning系统

Windows Defender (Beta 2)

more..

其他相关文章

more... 搜索

本文关键字

技术: "JSP" "XML"

产品:

人物:

企业:"SUN"

热门关键字

技术

  数据库  XML  JSP  模式

  测试  Servlet

产品

  Tomcat  Struts

  WebLogic  Eclipse  Ant

企业

  SUN  Apache  IBM  Oracle

  microsoft

热点文章

JSF and AJAX

Java 5.0 多线程编程实践

Hibernate; Easy, Scalable Paging of Large Data

使用AJAX和J2EE创建功能强大的瘦客户端

开源数据库系统

J2EE中使用Spring AOP框架和EJB组件

Get Started with Multithreading in .NET

Exadel宣布AJAX在Studio Pro 3.5中支持JSF

IntelliJ IDEA: Detecting Probable NPEs

IntelliJ IDEA: i18n support

Java J2EE Lite with Spring Framework

比较完整全面的分页

甲骨文曾试图收购MySQL 继续其开源之路

Four Ways to Use Excel as an Internet Reporting Tool

关于权限模块的设想

最新文章

Exadel宣布AJAX在Studio Pro 3.5中支持JSF

Oracle收购BerkeleyDB

BEA宣布开放Kodo源代码—Java持久化API

甲骨文曾试图收购MySQL 继续其开源之路

利用J2EE部署CRM BEA和Siebel共推SOA

Java Web Application开发日志之二--“Ignore how they were created”,工厂方法模式应用

比较完整全面的分页

OSGi Alliance开设面向公众的邮件列表

关于权限模块的设想

oscache使用和研究

开源产品学习方法论

Rife的Continuations

eXtremeComponent在中文环境下的使用

webwork 2.2 中如何给Collection赋值

Get Started with Multithreading in .NET

It seems that I have lost the motive of learning english

  I only hear the common conversation sentences in Lp5800 on the way go to work  in some mornings.It was less than ten minutes the time for learning it.

  I have lost the motive of learning english.

  For me,english was only a tool before.How can I turn it into a interesting thing of mine?Maybe,it should be a window for me to view outside world?

  However,I must learn it persistently.

一篇日记可以属于不同的目标

  例如,我有一篇日记“在eclipse中改变文件的binary/ascii属性”http://www.learndiary.com/disDiaryContentAction.do?searchDiaryID=1482&goalID=1482&naviStr=a10ag419a0419,里面是讲在eclipse里的cvs设置,涉及到“jsp图形开发环境的学习”http://www.learndiary.com/disGoalContentAction.do?goalID=419&naviStr=a10

和“学习cvs”http://www.learndiary.com/disGoalContentAction.do?goalID=398&naviStr=a10ac0ae0

两个学习目标。

  一篇日记按道理来讲是可以属于不同的目标的,怎么样恰当而系统的实现它,实现它有没有意义?这些需要进一步的思考。