Favor Soup | 反胃书屋

斯是陋室,惟吾德馨。
posts - 34, comments - 18, trackbacks - 0, articles - 0
  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

        Flash动画是一种矢量动画格式,它是用Macromedia公司的Flash软件编辑而成,具有体积小、兼容性好、直观动感、互动性强大、支持MP3音乐等诸多优点,是当今最流行的Web页面动画格式。 
        fla文件我们通常称之为源文件,我们可以在Flash中打开,编辑和保存它,它在Flash中的地位就象PSD文件在Photoshop中的地位一样,我们所有的原始素材都保存在fla文件中,由于它包含所需要的全部原始信息,所以体积较大,fla文件是千万不能丢失的,否则一切都要重新来做。
        swf文件全称shackwave file,是由fla文件在Flash中编辑完成后输出的成品文件,也就是我们通常在网络上看见的Flash动画,swf文件可以由Flash插件来播放,也可以制成单独的可执行文件,无须插件即可播放。swf文件只包含必需的最少信息,经过最大幅度的压缩,所以体积大大缩小,便于放在网页上供人浏览。swf文件受作者版权保护,不能再被Flash编辑。

posted @ 2007-05-10 13:17 D主 阅读(1097) | 评论 (0)编辑 收藏

cygwin中访问windows分区
cygwin中有个隐藏目录 /cygdrive
通过这个目录就可以访问到windows的各个分区了
cygwin设置程序脚本自动运行
修改/home/~yourname/.bash_profile

posted @ 2007-04-20 14:04 D主 阅读(140) | 评论 (0)编辑 收藏

题目:
小明和小强都是张老师的学生,张老师的生日是M月N日,2人都知道张老师的生日是 下列10组中的一天,张老师把M值告诉了小明,把N值告诉了小强,张老师问他们知道 他的生日是哪一天
3月4日 3月5日 3月8日
6月4日 6月7日
9月1日 9月5日
12月1日 12月2日 12月8日
小明说:如果我不知道的话,小强肯定也不知道
小强说:本来我也不知道,但是现在我知道了
小明说:哦,那我也知道了

 

请根据以上对话推断出张老师的生日是哪一天 请大家推推答案是哪一天,下面是我分析推导的过程。

分析:
乍一看不知道从何处入手,条件就是三句对白,遇到这种题目我们应该怎么办呢,首先别慌,然后再一个条件一个条件地分析。
1. 小明说:如果我不知道的话,小强肯定也不知道
通过这个条件,我们可以看是不是可以排除掉某个月份,因为小明知道的是月份;如果小明得到的月份是3,小强的选择有三个,分别是3.4,3.5或者3.8,再看这三个日期的日部分,4,5,8,都是有重复的,说明满足小明的条件(如果我不知道的话,小强肯定也不知道);同理再看6月份,有4日和7日两个日期,所有日期中日为7的只有一个,这说明6月份是不满足小明的条件的,可以排除掉了;9月份的两个日期的日部分也是有重复的,说明有可能是9月份;再看12月,12月2日是没有重复的,这说明12月也可以被排除了。

2. 小强说:本来我不知道,但是现在我知道了
小强在小明条件的前提下说本来我不知道,但是现在我知道了,通过我们上面的分析小明的条件可以排除掉6月份和12月份,我们要在剩下的3月份和9月份的日期中去推。
3月4日 3月5日 3月8日
9月1日 9月5日
这几个日期中的日有:4,5,8,1,而且日期日部分是5的有两个,所以3月5日和9月5日也可以排除了,因为如果小强知道的数字是5的话他就没有办法知道是3月5日还是9月5日。

3. 小明说:哦,那我也知道了
通过条件1,2现在剩下的日期是:
3月4日 3月8日
9月1日
而现在小明说他也知道了,就说明他的条件月份肯定是9了,如果是3的话,他就不能确定是4日还是8日,所以最后答案是9月1日。

呵呵,你答对了没有。

posted @ 2007-04-17 09:51 D主 阅读(333) | 评论 (1)编辑 收藏

XML Schema is an XML-based alternative to DTD.
An XML schema describes the structure of an XML document.
The XML Schema language is also referred to as XML Schema Definition (XSD).


What is an XML Schema?

The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.
An XML Schema:

  • defines elements that can appear in a document
  • defines attributes that can appear in a document 
  • defines which elements are child elements 
  • defines the order of child elements
  • defines the number of child elements
  • defines whether an element is empty or can include text
  • defines data types for elements and attributes 
  • defines default and fixed values for elements and attributes

XSL

It started with XSL and ended up with XSLT, XPath, and XSL-FO.

It Started with XSL

XSL stands for EXtensible Stylesheet Language.

The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML-based Stylesheet Language.

CSS = HTML Style Sheets

HTML uses predefined tags and the meaning of the tags are well understood.
The <table> element in HTML defines a table - and a browser knows how to display it.
Adding styles to HTML elements is simple. Telling a browser to display an element in a special font or color, is easy with CSS.


XSL = XML Style Sheets

XML does not use predefined tags (we can use any tag-names we like), and the meaning of these tags are not well understood.
The <table> element in HTML defines a table - and a browser knows how to display it.
Adding styles to HTML elements is simple. Telling a browser to display an element in a special font or color, is easy with CSS.

XSL - More Than a Style Sheet Language

XSL consists of three parts:

  • XSLT - a language for transforming XML documents
  • XPath - a language for navigating in XML documents
  • XSL-FO - a language for formatting XML documents


 

posted @ 2007-04-04 16:37 D主 阅读(179) | 评论 (0)编辑 收藏

XML was designed to describe data and to focus on what data is while HTML was designed to display data and to focus on how data looks.
XML was designed to describe data, its tags are not predefined. You must define your own tags. XML uses a Document Type Definition (DTD) or an XML Schema to describe the data.
Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store and to send information.

XML Namespaces provide a method to avoid element name conflicts.
Since element names in XML are not predefined, a name conflict will occur when two different documents use the same element names.
EXAMPLES:
This XML document carries information in a table:
<table>
   <tr>
       <td>Apples</td>
       <td>Bananas</td>
   </tr>
</table>
This XML document carries information about a table (a piece of furniture):
<table>
    <name>African Coffee Table</name> 
    <width>80</width> 
    <length>120</length>
</table>
If these two XML documents were added together, there would be an element name conflict because both documents contain an element with different content and definition.

Solving Name Conflicts Using a Prefix

This XML document carries information in a table:
<h:table>
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>

</h:tr>
</h:table>
This XML document carries information about a piece of furniture:
<f:table>
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>

<f:length>120</f:length>
</f:table>
Now there will be no name conflict because the two documents use a different name for their <table > element ( <h:table > and < f:table >). By using a prefix, we have created two different types of < table > elements.

Using Namespaces

This XML document carries information in a table:

<h:table xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>

<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>

This XML document carries information about a piece of furniture:

<f:table xmlns:f="http://www.w3schools.com/furniture">
<f:name>African Coffee Table</f:name>
<f:width>80</f:width>
<f:length>120</f:length>

</f:table>

Instead of using only prefixes, we have added an xmlns attribute to the <table> tag to give the prefix a qualified name associated with a namespace.

The XML Namespace (xmlns) Attribute

The XML namespace attribute is placed in the start tag of an element and has the following syntax:

xmlns:namespace-prefix="namespaceURI"

When a namespace is defined in the start tag of an element, all child elements with the same prefix are associated with the same namespace.

Note that the address used to identify the namespace is not used by the parser to look up information. The only purpose is to give the namespace a unique name. However, very often companies use the namespace as a pointer to a real Web page containing information about the namespace.

 

Uniform Resource Identifier (URI)

A Uniform Resource Identifier (URI) is a string of characters which identifies an Internet Resource.
The most common URI is the Uniform Resource Locator (URL) which identifies an Internet domain address. Another, not so common type of URI is the Universal Resource Name (URN). In our examples we will only use URLs.

Default Namespaces

Defining a default namespace for an element saves us from using prefixes in all the child elements. It has the following syntax:

xmlns="namespaceURI"

This XML document carries information in a table:

<table xmlns="http://www.w3.org/TR/html4/">

<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>

This XML document carries information about a piece of furniture:

<table xmlns="http://www.w3schools.com/furniture">
<name>African Coffee Table</name>
<width>80</width>

<length>120</length>
</table>

posted @ 2007-04-04 16:20 D主 阅读(139) | 评论 (0)编辑 收藏

  1. 使用图像切片时,如果在包含每块切片的表格单元格<td>与图片元素<img>之间有换行,图片下方会莫名其妙的多出一块留白。此时设置valign="top"也不起作用,最简单的办法是尽量连着写:<img src=""></td></tr>
  2. 使用内联框架做导航的时候,链接<a>一定要加上target="_top"属性;当需要获取包含iframe的页面的href时,使用parent.location.href;需要获取iframe自身页面href时使用window.loaction.href。
  3. javascript的获取子字符串的方法既有substr(start, length),也有subsring(start, end),注意区别。
  4. 关于页面编码的问题,当页面选定某种编码方式charset=xxx,最好在ultraEdit等一类编辑器中手动选择一下编码格式,使之与设定的xxx相同,防止出现乱码。建议xxx使用utf-8。
  5. 中文字体大小最好在12px,最大不宜超过16px,否则非常难看,而font-family建议选择Arial一族,不要选择在英文版或其他版本操作系统上可能没有的中文字体。

posted @ 2007-04-03 10:35 D主 阅读(134) | 评论 (0)编辑 收藏

此文专门记录本人在网页设计中遇到的IE和FF兼容问题以及解决办法。

1. 要将鼠标移到某块内容之上的形状设为手型,在IE下可以直接使用以下代码:
document.getElementById(id).style.cursor='hand'
然而这行代码在FF下面没有作用,需要更改为:
document.getElementById(id).style.cursor='pointer'
这样在IE和FF下都可以奏效。

2. 在IE下可以这样:
document.all.Layer1.style.
来设置某个ID为Layer1的元素的CSS属性,然而在FF下面这样做没有任何效果。应该采取以下通用写法:
document.getElementById('Layer1').style.

3. 待续...

posted @ 2007-03-29 14:38 D主 阅读(172) | 评论 (0)编辑 收藏

今天,我总算搞清楚“回车”(carriage return)和“换行”(line feed)这两个概念的来历和区别了。

在计算机还没有出现之前,有一种叫做电传打字机(Teletype Model 33)的玩意,每秒钟可以打10个字符。但是它有一个问题,就是打完一行换行的时候,要用去0.2秒,正好可以打两个字符。要是在这0.2秒里面,又有新的字符传过来,那么这个字符将丢失。

于是,研制人员想了个办法解决这个问题,就是在每行后面加两个表示结束的字符。一个叫做“回车”,告诉打字机把打印头定位在左边界;另一个叫做“换行”,告诉打字机把纸向下移一行。

这就是“换行”和“回车”的来历,从它们的英语名字上也可以看出一二。

后来,计算机发明了,这两个概念也就被般到了计算机上。那时,存储器很贵,一些科学家认为在每行结尾加两个字符太浪费了,加一个就可以。于是,就出现了分歧。

Unix系统里,每行结尾只有“<换行>”,即“\n”;Windows系统里面,每行结尾是“<换行><回车 >”,即“\n\r”;Mac系统里,每行结尾是“<回车>”。一个直接后果是,Unix/Mac系统下的文件在Windows里打开的话,所有文字会变成一行;而Windows里的文件在Unix/Mac下打开的话,在每行的结尾可能会多出一个^M符号。

posted @ 2007-03-14 13:11 D主 阅读(251) | 评论 (0)编辑 收藏

 
                      同一个类           同一个包       不同包的子类      不同包的非子类

private               yes

default               yes                  yes

protected           yes                  yes                   yes
   
public                 yes                  yes                   yes                    yes

posted @ 2007-03-09 10:41 D主 阅读(1249) | 评论 (2)编辑 收藏

     摘要: 在 Java 中通过 Observable 类和 Observer 接口实现了观察者模式。一个 Observer 对象监视着一个 Observable 对象的变化,当 Observable 对象发生变化时, Observer 得到通知,就可以进行相应的工作。例如在文档 / 视图结构中,文档被修改了,视图...  阅读全文

posted @ 2007-03-08 14:28 D主 阅读(199) | 评论 (0)编辑 收藏

仅列出标题
共4页: 1 2 3 4