A little bit more...

Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, April 19, 2007

Knowledge on font size

声明:全部摘抄自网络资源,准确性和完整性不能保证,请读者自己辨别。

Introduction

一种字体(font)是一组字形(glyph)的集合,每一个字形代表了特定字样(typeface)的字符集(character set)里面的一个字符。

A font is a set of glyphs (images) representing the characters from a particular character set in a particular typeface. In professional typography the term typeface is not interchangeable with the word font, which is defined as a given alphabet and its associated characters in a single size. For example, 8-point Caslon is one font, and 10-point Caslon is another. Historically, fonts came in specific sizes determining the size of characters, and in quantities of sorts or number of each letter provided. The design of characters in a font took into account all these factors.

Measurement of font size

Point (pt, 磅)

在排版印刷中1pt是最小的测量单位, 12pt是1pica,具体是多长视情况而定。传统的排版印刷中1pt可能在0.18到0.4mm之间,这依赖于对foot的定义,现代的桌面出版中 (Desktop Publishing Point)1pt是1/72inch,也就是约0.3527mm,所以6pica是1inch。

Pixel(像素)

Inch(英寸)

millimeter(毫米)

Commonly used font size

9pt = 12px = 小五号

1pt = 4/3px

MS WORD中最大能定义1638pt大小的字体!

下表是字号与磅以及毫米之间的对应关系,并附以字样,以供大家在排版或调整布局时使用。

HTML和CSS中用的font size属性

Syntax: font-size: | | |
Possible Values:

*
o xx-small | x-small | small | medium | large | x-large | xx-large
*
o larger | smaller
*
* (in relation to parent element)

Both relative and absolute length units are supported in CSS1. Relative units give a length relative to another length property, and are preferred since they will better adjust to different media. The following relative units are available:

  • em (ems, the height of the element’s font)
  • ex (x-height, the height of the letter “x”)
  • px (pixels, relative to the canvas resolution)

Absolute length units are highly dependent on the output medium, and so are less useful than relative units. The following absolute units are available:

  • in (inches; 1in=2.54cm)
  • cm (centimeters; 1cm=10mm)
  • mm (millimeters)
  • pt (points; 1pt=1/72in)
  • pc (picas; 1pc=12pt)

要注意的是,相同大小的字体在不同的具体环境下显示出来的字体的真实大小可能不一样,差别比较小的可能是用px度量的大小。

关于x-height的定义可以看Typeface中的解释,简要的说是,对每一个字体都有一个假想的水平线叫baseline(想想小时候练习写英文字母的时候每一行都有三条或者四条横线那种作业本),x-height就是从baseline到字体最高处的高度。

Resources

  1. Font Size
  2. Point (typography)
  3. Typeface
  4. CSS改变字体大小而不影响网页
  5. 【知识】字体中“号”“磅”及“毫米”的关系
  6. Length Units

Technorati : , ,
Del.icio.us : , ,
Ice Rocket : , ,
Flickr : , ,
Zooomr : , ,
Buzznet : , ,

Sunday, March 04, 2007

服务器租借与托管资料收集

(本文仅仅为资料收集,不存在原创内容)

1. 名词解释

1U-4U:

U(英文中的Unit?不知道)代表架式服务器的高度,1U=1.75英寸=4.45厘米。同样的2U=4*1.75英寸=4*4.45厘米,以此类推。

机柜:

一般多个机架服务器安装在一个机柜内,一个普通机柜的高度是42U。

ICP:

ICP(Internet Content Provider)证的全称:《中华人民共和国电信与信息服务业务经营许可证》即ICP证,通过互联网向上网用户提供有偿信息、网上广告、代制作网页、电 子商务及其它网上应用服务的公司必须办理的网络经营许可证。国家对经营性网站实行ICP证制度,注册资金应在100万或者100万以上的公司才能办理 ICP证,一经办理一般能在该省的通信管理局的网站查询到。同时对从事非经营性活动的网站要进行ICP备案,简称为ICP备。

2. 服务器的种类

首先,我们必需了解何谓PC服务器?所谓PC服务器(下文讨论的多为PC服务器),即是Intel架构服务器,与一些大型服务器如 Mainframe, Unix架构服务器等不同,前者大多运行Windows或Linux等操作系统,使用较为普遍,后者多为专业用途,如银行,大型制造业,物流业,证券…等 行业使用,一般人较少有机会接触到.

可以按照各种标准进行分类,按应用层次分为:入门级服务器、工作组级服务器、部门级服务器和企业级服务器;按处理器架构分为:CISC (Complex Instruction Set Computer)架构服务器、RISC(Reduced Instruction Set Computing)架构服务器和VLIW(Very Long Instruction Word超长指令集架构)架构服务器;按用途分为:通用型服务器和专用型服务器,或者WEB服务器、E-mail服务器、数据服务器、DNS服务器等等; 按机箱结构分为:台式(塔式)服务器、机架服务器、机柜服务器和刀片式(bladed)服务器。

2.1 塔式服务器

优点:服务器的主板扩展性较强、插槽也多,可以进行硬盘和电源的冗余扩展,对环境要求较低,原则上不用和机柜搭配使用,价格也相对较低,集多种常见的服务和应用于一身。

缺点:塔式服务器长得跟我们平时用的台式机一样,占用空间比较大,适合小型企业自己维护,不适合放在服务器托管商那里托管,独立性太强,协同工作在空间占用和系统管理上都不方便,在一些应用要求较高的企业中,这种单机服务器无法满足要求。

2.2 机架服务器

机架式(RACK)服务器长得像卧着的台式机,可以一台一台地放到固定机架上,因此而得名。机架服务器一般采用标准19英寸的宽度设计,其高度按照一定的单位高度的设计,其单位为U,约为4.54cm。

优点:机架是服务器的机箱宽度都是相同的,可以在标准的机柜中存放服务器,减少服务器产品对空间的要求,易于服务器的集中管理。所以机架服务器便于放在服务器托管商那里托管。

缺点: 购买价格相对较高,比同等配置的塔式服务器价格要高20%-30%,1U以上服务器服务器托管费用较高。由于在空间上非常紧凑,所以在扩展性和散热方面上具有一定限制,一般无法实现太完整的设备扩展,所以单机性能相对比较有限。

2.3 刀片式服务器

3. 服务器的购买和租借

一般服务器或者自行购买然后放到IDC(Internet Data Center)服务提供商的机房托管,或者租借IDC服务商的。租借的服务器一般IDC服务提供商都会负责托管,租借又分为送产权和不送产权两种,送产权 的即租用一定时间(如1年或者2年)后服务器的产权归用户。需要指出的是租用的服务器大多数不是新的服务器,而是旧的组装服务器,当然也有宣称租用品牌服 务器的IDC服务商。

下面主要说说PC服务器的基本硬件配置常识。主要的服务器国际生产商有:IBM,HP,Dell,Sun(最近也推出X86服务器产品),超微等; 国内生产商主要有:曙光、联想、浪潮、方正、清华同方、华硕等;服务器芯片生产商主要是:Intel和AMD;服务器芯片主要有:Pentium 4(单路)、Itanium(安腾,64位,Dual-Core)Xeon(至强,双路)、XeonMP(Multi Processing Platform,四路)、AthlonMP(速龙MP)、Opteron(皓龙,64位,100系列是单路,200系列是双路,800系列是四路和八 路)。

4. 托管服务器的流程

4.1 选择托管服务器的类型

购买全新服务器,或向服务器托管商租借。

4.2 选择服务器托管商

考察服务商、机房,最好能去现场考察,以检查其设施是否齐全。

4.3 签订托管合同

如果是自己购买的服务器,则需要运送服务器到托管商指定的机房,最后签订详细的托管合同。

5. 经验

5.1 最好不要异地托管

如果是自己购买的服务器最好不要找异地托管,因为时候要对服务器进行本地维护。

5.2 带宽保证

不管是独享带宽还是共享带宽,实际使用的带宽一般不会超过10M,甚至5M甚至更低,各地的IDC都会有限制。

5.3 ICP证

一定要检查托管商是否有ICP证。

6. 业界案例

豆瓣网,土豆网,劲舞团等等。

7. 上海的服务商简介

中国E动网www.edong.com

8. 其他

www.linkwan.com/vr ,用来测试机房速度和当前连接的路由节点。

参考资料:

  1. 首次托管服务器经验
  2. 服务器结构中的1U 2U 3U是什么意思?
  3. 机架式服务器和塔式服务器的区别
  4. 服务器有哪些种类?
  5. 典型用户案例
  6. 什么是机架式服务器?
  7. BananaSkin(持续关注IDC方面的博客)
  8. 服务器有关的Post(123)(豆瓣blog
  9. 如何挑选服务器?哪个牌子的最好?(1万元以下的)
  10. 关于”个人网站申请备案”经验
  11. 业内人士教您如何选择IDC
  12. 服务器托管—你会选1U还是2U服务器?
  13. ICP专栏:介绍ICP相关知识,ICP申请、ICP备案流程及所须资料等
  14. 【转载】教你如何租服务器和选择机房
  15. 差价缩小:现在你考虑1U还是2U?
  16. 中国IDC产业发展调查暨年度大典官方网站
  17. 找小说网正式拥有属于自己的服务器

Saturday, January 20, 2007

DOM Level 3 Load and Save

1. Introduction

Defined by w3 consortium, just as its name indicates, it serves as interfaces to objects that dealing with loading and saving DOM objects.

It’s noteworthy that various specific implementations doesn’t always fully support.

With java, it is well supported, though, some optional specifications are not supported (at least not always workabe from my experience). However, for web developers, there’s a quote from a book for you:

Now that XMLHttpRequest is being standardized, it seems likely that LSParser will never be supported by most browsers.

In addition, with java, you can also selectively use javax.xml.transform to deal with loading and saving DOM objects.

2. Breakdown

Cite from org.w3c.dom.ls:

DOMImplementationLS
DOMImplementationLS contains the factory methods for creating Load and Save objects.

LSInput
This interface represents an input source for data.

LSLoadEvent
This interface represents a load event object that signals the completion of a document load.

LSOutput
This interface represents an output destination for data.

LSParser
An interface to an object that is able to build, or augment, a DOM tree from various input sources.

LSParserFilter
LSParserFilters provide applications the ability to examine nodes as they are being constructed while parsing.

LSProgressEvent
This interface represents a progress event object that notifies the application about progress as a document is parsed.

LSResourceResolver
LSResourceResolver provides a way for applications to redirect references to external resources.

LSSerializer
A LSSerializer provides an API for serializing (writing) a DOM document out into XML.

LSSerializerFilter
LSSerializerFilters provide applications the ability to examine nodes as they are being serialized and decide what nodes should be serialized or not.

3. Examples

a. Write an instance of Document to a file with org.w3c.dom.ls:

DOMImplementationLS domImpl = (DOMImplementationLS)doc
.getImplementation();
LSSerializer serializer = domImpl.createLSSerializer();
LSOutput output = domImpl.createLSOutput();
output.setCharacterStream(new PrintWriter(fileName));
serializer.write(doc, output);

b. Write an instance of Document to a file with javax.xml.transform:

StreamResult sr = new StreamResult(new File(fileName));
Transformer t = TransformerFactory.newInstance().newTransformer();
t.transform(new DOMSource(doc), sr);

Note: it seems, from my experience, that example b can’t preserve the print friendly presentation.

Resources:

  1. Document Object Model (DOM) Level 3 Core Specification Version 1.0
  2. Document Object Model (DOM) Level 3 Load and Save Specification Version 1.0
  3. DOM Level 3
  4. Java Impl. Package org.w3c.dom.ls (src, api spec)

About Me

My photo
I'm finishing my master degree in Software Engineering, Computer Science. I believe and have been following what Forrest Gump's Mam said: you have to do the best with what god gave you.