表情符号

12:00:00 PM 0 Comments

常用的表情和含义
:-D 开心 :-( 不悦
:-P 吐舌头 :-* 亲吻
 ;-) 眨眼 :-x 闭嘴
<※ 花束 :-O 惊讶
$_$ 见钱眼开 @_@ 困惑
>_< 抓狂 T_T 哭泣
= =b 冒冷汗 >3< 亲亲
≧◇≦ 感动 = =# 生气
(×_×) 晕倒 |(-_-)| 没听到
(︶︿︶) 不满 (=^_^=) 喵喵
( ̄﹁ ̄) 流口水 (T_T) 哭泣
╮( ̄▽  ̄)╭ 两手一摊 ╭(╯_╰)╭ 路过
(*+﹏+*)~@ 受不了 *\(^_^)/* 为你加油
づ ̄ 3 ̄)づ 飞吻 b( ̄▽ ̄)d 竖起大拇指
( ̄(工) ̄) 大狗熊 ^(oo)^ 猪头
无可奈何的脸 Orz 我服了你

 

 

 

:-)          这是最普通的基本笑脸,通常加在句尾或文章结束的地方。
             表示开玩笑的意思。其中两点是眼睛,"-"是鼻子,")"是笑的小嘴巴,看
             懂了吗?笑声的强度大约是微笑的"Ha HA"。

:-D          非常高兴地张开嘴大笑。

:->          嘿...嘿...瞧这张邪恶戏虐的嘴脸!(可简化成":>")

8-)          这是眼睛族专用的笑脸。

;-)          抛媚眼耶!含有别意哦!

:-0          哇...

:-( )         更大的哇...

:-o          有什么精彩的?怎么目瞪口呆的!

|-)          这是眯着眼睛笑还是回信回得快睡着了?

|-D          Ho Ho笑。

|-P          捧腹大笑。

:-<          难过时候的苦笑。

8:-)         把眼镜推到头顶上才够帅!但有另一说,是个头上打了个蝴蝶结的漂亮女生
             ,得小心看看信件内容,可别表情错罗。

-(           哼,不看我,受不了的酷......

!-)          哇,是大眼瞪小眼,还是睁一只眼闭一只眼?

#--)         刚参加了一个疯狂Party一夜没睡了,眼睛都皱成一团了!

#:-)         嘻,这是个大而化之的User,随时保持头发的乱度,决不轻易梳头的。

:-9          笑的一种(舌头还舔着嘴唇)。

%-)         哇,跌破眼镜!或者表示额前有着一小摄迷人的刘海。

%-}         呵呵呵...我没醉...呵呵呵...

:-{          抿着嘴,一副如泣如诉的神情。

':-)          早上没睡好,刮胡子把眉毛也剃掉一边了。

(-)          嘻,头发也盖住眼睛了,我也该去理发了。

&:-)         我是头发可是自然卷的喔!

{:-)         中分的发型,帅不帅?

(-:          写信的是个左撇子。

(-_-)        神秘的笑容,这不用转头看。

(:)-)         哈哈,是一个小蛙人,戴着潜水镜在偷笑。

(:-$         这暗示这个人正在生病,反胃。

(:-&         这暗示这个人正在生气喔!

(:-(          紧皱眉头,又愁眉苦脸,不晓得又发生了什么事了。

(:-)          这是一张大笑脸,也有人说这是一个大光头。

(:-*         Kiss...

(:-...         哇!心碎。

(:-D         真是大嘴巴,多嘴!

(:-|k-        嗯,打着领结,带着礼帽,大概是要参加什么重要的约会。

(:<)         吹牛大王。

(:>>-<       "这是抢劫,把手举起来!"

(:I           理论家(说话很"臭屁"的样子)

(:^(         跟谁打架了,鼻子都被打歪了?

(0--<        怎么了,面无表情目光呆滞的...

*-(          闭着眼睛的独眼巨人(希腊神话)

o-)          睁着眼睛的独眼巨人(希腊神话)

@-)         这个是不是更象独眼龙?

*:**         这是个不修边幅的人,你看连头发、胡子都乱七八糟的。

*:o)         小丑耶!

*<|:-)        圣诞老人(Ho Ho Ho)

+-(:-)        写封信的可是主教耶!

+:-)         神父正在向你微笑喔,还不正经一点?

+<:-|        哇,这是修女还是神父?

,-)          嘘!这是我们之间的秘密喔,千万别跟别人讲。

,-}          嗯,嘴歪眼斜的,是在打什么PASS?

.-)          写这封信的可是独眼龙喔!

...---...      SOS求救

0-)          写信的人戴了副面具,这也代表电焊工和潜水员。

3:=9        Mooo...这是一头牛。

8:-I         魔术师,不过也象卡通画的食人族。

8:]          嘻,这个笑容象不象大猩猩?

: {          哇...悲伤的小朋友...

:%)%        满脸的青春痘

:*)          是喝醉了还是被老婆修理了,鼻子红通通的。

:-!          带着一点不屑的笑容,

:-"          嘟哝着一张嘴。

:-#          抱歉,这是秘密,我答应人家不说的,我嘴巴被贴上封条了。

:-#|          这张笑脸上有着浓密的胡须。

:-$          西谚:Put Your Money Where Your Mouth is.

:-%         银行家、股票玩家用的笑。

:-&         我的舌头被打结了,不可以告诉你。

:-')          哈,睡觉不盖被子,所以感冒了。

:-'|          我感冒了,妈妈不许我出去玩。

:-(          悲伤或者生气的脸。

:-(*)         恶心,想吐。

:-(=)        我的大门牙帅不帅?

^o^         这是一个不必转头就可以看的笑脸,象不象无尾熊啊?

:-)'          哇,都流口水了,这是正干什么嘛!

:-)-{8       咳,这...这...这是一个"波霸"。

:-)8         打个领结的笑脸,是不是帅多了?

:-*          生气了?怎么嘟着嘴巴?

:-/           犹豫不决的笑容。

:-0          演说家的笑容。

:-1          平淡无味的笑。

:-6          刚吃了酸东西的笑容。

:-7          火冒三丈,已经快要吃人了,还不快闪开。

:-8(         象不象"澎嚓嚓"的脸?

:-{)         留着胡子的笑脸。

:-})         很迷人的翘胡子耶。

:-<)         留着八字胡的笑容。

:-=)         留着日本式的胡子。

:-@         还留着络腮胡子耶。

:-?          喔,还抽着烟斗呢。

:-q          老烟枪。

:-e          失望的笑容。

:-I          Hmm...

:-i           呼,这是吸烟族的标志。

:-j           暧昧的笑容。

:-P          吐舌头。

:-Q          向您吐舌头啦。

:-x          嘴唇被封起来了。

:-X          打着领结。

:-[          带着吹毛求疵的嘲讽式微笑。

:-\           卜派式的笑脸。

:-]          傻笑。

:-`          嚼着烟草时溅出口水的样子。

:-{#}        还戴着牙齿矫正架,真不好意思。

:-{~         午餐前看了太多烂文章,真反胃。

:-|           面无表情,你可别招惹他喔!

:-}          涂上口红的漂亮红唇。

:<|          写信的是个常春藤盟校的学生。

:=)          嘻,怎么长着两个鼻子?

:=|          你看象什么,啊,是一只狒狒。

:>)          哇,好大的鼻子啊。

:~)          喜极而泣,笑出泪水来了。

;-\          既抛媚眼,又撇嘴角的,不怕抽筋啊?

<:-)<<|      哇,这封信来自火箭里的宇航员耶。

<:I          小傻瓜。

<<:>>==    象不象乌贼?还是忍者?木乃伊?

<<<<(:-)     嘻,我是帽子推销员,想不想来顶高帽子?

>-r          哈,他在跟你扮鬼脸。

=:-)         庞克族的笑脸。

=:-(         典型的酷庞克族,说不笑说不笑。

=:-#}        留着胡子的庞克族。

>:-<         哇,眉毛都竖起来了,已经快发狂、要气炸了。

>>-(        哇,他真的要杀人了,你千万别再惹他了。

~:-(         极其愤怒,都快爆炸了。

?-(          被谁扁了,眼圈都变黑了。

@%&$%&  这你知道是什么意思了吧?提示一下:和三字经有关。

@:-)        他有着一头卷发耶。

@=         哇,这是原子弹爆炸时的蘑菇云啊。

@>>--->---- 请收下这束漂亮的一玫瑰。

0-)          这是啥呢?一个焊接工啦。

B-)         哇,酷死了,上BBS还带着墨镜....(也有人说象蝙蝠侠)

E-:-I        这是火腿族的标志喔。

i-)          独具慧眼的侦探。

x-<         好惨,真是惨不忍睹。

[:-)          这位大哥在戴耳机在听音乐。

[:|]          机器人。

{(:-)         嘻,这位仁兄还戴着假发呢。

}(:-(         戴着卷卷的假发。

}:-)         这位仁兄有着翘起的头发。

|-(           他正在打坐练功。

12款浏览器兼容性测试工具推荐

9:57:00 PM 0 Comments

对于前端开发工程师来说,确保代码在各种主流浏览器的各个版本中都能正常工作是件很费时的事情,幸运的是,有很多优秀的工具可以帮助测试浏览器的兼容性,让我们一起看看这些很棒的工具。

Spoon Browser Sandbox

点击你需要测试的浏览器环境,安装插件就可以进行测试了。帮助你测试网页在Safari、Chrome、Firefox和Opera浏览器中是否正常,IE以前也有的,网站上说应微软的要求去掉了。
 
Superpreview

这是为微软自己发布的跨浏览器测试工具,您可以同时查看您的网页在多个浏览器的呈现情况,对页面排版进行直观的比较。



IETester

专门用于测试网页在IE浏览器各个版本中兼容性的工具,版本包含IE5.5至IE9的各个版本,很不错的一款工具,推荐。
 
BrowserShots

BrowserShots 是一款免费的跨浏览器测试工具,捕捉网站在不同浏览器中的截图。这是最有名,也是最古老的浏览器兼容性测试工具。
塔防游戏:tdplayer.cn 
Multiple IEs

这款工具同样用于测试网页在IE浏览器各个版本的兼容性。
塔防游戏:tdplayer.cn 
IE netrenderer

Netrenderer 也是用于检查你的网站在IE浏览器中的呈现情况,包括各个常用版本的检测。
塔防游戏:tdplayer.cn 
Viewlike.Us!

Viewlike 是一款新推出的工具,帮助你检查浏览器在不同分辨率下得呈现情况。
塔防游戏:tdplayer.cn 
BrowserSeal

这款工具的两个主要特色是独立的浏览器支持和带有自动化脚本的命令行界面。
塔防游戏:tdplayer.cn 
Browsera

Browsera 是一个可测试您的网站的跨浏览器布局的工具,您会看到您网站上存在的兼容性错误。
塔防游戏:tdplayer.cn
WebDevLab

这款工具专门用于测试你的网站在苹果Safari浏览器中是什么样子的。
塔防游戏:tdplayer.cn 
Litmus

这个工具可以帮助你检查你的网站在多个浏览器中的呈现情况,跟踪Bug并创建报告。
塔防游戏:tdplayer.cn 
Browsercam

最后这款工具是要付费的,可以帮助你检查 Javascript 和 DHTML,提供不同的测试环境平台。
塔防游戏:tdplayer.cn

JVM Memory Structure

1:15:00 PM 0 Comments

JVM Memory Structure

Can't find your answer? Please refer to documentation and demos, ask your question in forum, orcontact support.

As experience has shown, sometimes a sort of uncertainty may arise on the subject of Java Virtual Machine (JVM) memory structure and other related aspects such as sizes of various kinds of memory, live and dead objects, etc.

In this article, we shall try to illuminate these issues to clear up the point.

Heap and Non-Heap Memory

The JVM memory consists of the following segments:

  • Heap Memory, which is the storage for Java objects
  • Non-Heap Memory, which is used by Java to store loaded classes and other meta-data
  • JVM code itself, JVM internal structures, loaded profiler agent code and data, etc.



Heap

The JVM has a heap that is the runtime data area from which memory for all class instances and arrays are allocated. It is created at the JVM start-up.

The heap size may be configured with the following VM options:

  • -Xmx<size> - to set the maximum Java heap size
  • -Xms<size> - to set the initial Java heap size


By default, the maximum heap size is 64 Mb.

Heap memory for objects is reclaimed by an automatic memory management system which is known as a garbage collector. The heap may be of a fixed size or may be expanded and shrunk, depending on the garbage collector's strategy.

Non-Heap

Also, the JVM has memory other than the heap, referred to as non-heap memory. It is created at the JVM startup and stores per-class structures such as runtime constant pool, field and method data, and the code for methods and constructors, as well as interned Strings.

Unfortunately, the only information JVM provides on non-heap memory is its overall size. No detailed information on non-heap memory content is available.

The abnormal growth of non-heap memory size may indicate a potential problem, in this case you may check up the following:

  • If there are class loading issues such as leaked loaders. In this case, the problem may be solved with the help of Class loaders view.
  • If there are strings being massively interned. For detection of such problem, Allocation recording may be used.


If the application indeed needs that much of non-heap memory and the default maximum size of 64 Mb is not enough, you may enlarge the maximum size with the help of -XX:MaxPermSize VM option. For example, -XX:MaxPermSize=128m sets the size of 128 Mb.

Heap and non-heap memory usage telemetry is shown on the "Memory" tab:


Allocated and Used Memory

Allocated and used memory sizes are shown on the graphs for both heap and non-heap.

The allocated memory is an overall amount of memory allocated by the JVM, while used memory is the amount of memory which is actually in use.

Obviously, the allocated memory cannot be less than the used memory. The exact amount of allocated memory is determined by the JVM internal strategies.

Used Heap Memory: Live and Dead Objects

Used heap memory consists of live and dead objects.

Live objects are accessible by the application and will not be a subject of garbage collection.

Dead objects are those which will never be accessible by the application but have not been collected yet by the garbage collector. Such objects occupy the heap memory space until they are eventually collected by the garbage collector.

Note that Class list view in memory telemetry shows both live and dead objects. You may observe the decreasing number of objects when garbage collection occurs automatically or it is forced with the help of the corresponding toolbar button.


Object Sizes in Memory Snapshots

In memory snapshots, all views show only live objects. And all the sizes you deal with are of the live objects, too. The exception is Dead Objects view.

Objects size in "Memory" tab can be less than the used memory shown in "Telemetry". This may be due to:

  • Used memory consists of both live and dead objects. While only live objects are shown in "Memory" tab.
  • By default, all objects which are only weak- or soft-referenced are treated as dead objects. Please consider the corresponding Help topic.


Shallow and Retained Sizes

All individual objects, as well as sets of objects have their shallow and retained sizes.

Shallow size of an object is the amount of allocated memory to store the object itself, not taking into account the referenced objects. Shallow size of a regular (non-array) object depends on the number and types of its fields. Shallow size of an array depends on the array length and the type of its elements (objects, primitive types). Shallow size of a set of objects represents the sum of shallow sizes of all objects in the set.

Retained size of an object is its shallow size plus the shallow sizes of the objects that are accessible, directly or indirectly, only from this object. In other words, the retained size represents the amount of memory that will be freed by the garbage collector when this object is collected. In general, retained size is an integral measure, which helps to understand the structure (clustering) of memory and the dependencies between object subgraphs, as well as find potential roots of those subgraphs.

Dead objects are shown only with shallow size, as they do not actually retain any other objects.

Getting started with HTML5

1:05:00 PM 0 Comments

HTML5 is the latest revision of HTML, with the goal to make it easier to develop web applications. HTML5 has much simple syntax compared to HTML 4 and it offers lots of new features. This articles gives introduction to HTML5.

What you can do with HTML5?

- Offline Applications with Application Cache

With the HTML5, it is possible to make your web applications run offline as well. HTML5 offers offline storage feature called application cache, or AppCache to store the files in a cache, so that when the user is offline, the browser still has access to the necessary files. These files can be HTML, CSS, Javascript or any other resources the web page needs to run.

- Drag and Drop

HTML5 offers a native drag and drop feature, which allows to design interactive applications. Through Drag and Drop feature you can drag any element and drop it to the desired location.

- Add Geolocation

The HTML5′s geolocation API lets you share your location with the trusted websites.
Priavcy is a major concern with the geolocation feature. W3.org states:

User agents must not send location information to Web sites without the express permission of the user.

So for example if a user visits a web page which has implemented geolocation, using Firefox web browser.  The browser will ask for permission if the user want to share his location. If the user consent, Firefox gathers information about nearby wireless access points and visitor's computer IP address, sends this information to Google Location Services whihc is default geolocation service in Firefox. That location estimate is then shared with the requesting website.

- Audio and Video

Currently HTML lacks the necessary features to embed the multimedia files. Therefore multimedia files are embedded in HTML using various plugins. For example, Flash is widely used to embed audio and video files. However this can be done very easily in HTML5 using audio and video elements, without using any pligins.

- Form Inputs

HTML5 provides several new elements for the input type attribute, such as pop-up calendars, color selectors, number spinners and many more. These input features help building very efficient forms with better input control and validation.

Simplified Syntax

Doctype:

The doctype declaration is the first thing to do in an HTML document. It tells the web browser about what version of the markup language the page is written in.
For example, HTML 4.01 Transitional doctype is specified as:

1
2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

The XHTML 1.0 Transitional doctype is:

1
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

In HTML5, the doctype declaration is much simple, and is just:

1
<!doctype html>

Character Encoding:

To validate or display an HTML document, a program must choose a character encoding.
Character encoding tells the browser and validator what set of characters to use when converting the bits to characters.
Following is example of UTF-8 Character encoding declaration in HTML 4.01:

1
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

The XHTML

1
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

The character encoding syntax is very simple in HTML 5, and that is:

1
<meta charset="UTF-8">

So our very basic HTML5 document can be:

1
2
3
4
5
6
7
8
9
10
<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Example document</title>
  </head>
  <body>
    <p>Hello, World</p>
  </body>
</html>

The <script> tag:

The <script> tag is used to define a client-side script, such as a JavaScript. In HTML 4. the type attribute is required, but it is optional in HTML5.
For example, In HTML4, the script tag is used as following:

1
<script type="text/javascript" src="file.js"></script>

and in HTML5:

1
<script src="code.js"></script>

HTML5 has added a new optional attribute 'async' to the script tag. which tells the browser to execute the script asynchrously with the rest of the page, so the script will be executed while the page continues to load. This can be used as following:

1
<script src="code.js" async></script>

or

1
<script src="code.js" async="async"></script>

The <link>tag:

The <link> tag defines the relationship between a document and an external resource. This tag is commonly used to include the CSS files. For example,

1
<link rel="stylesheet" type="text/css" href="style.css" />

In HTML5, the type attribute is not required for the <link> tag, similar to <script>. For example:

1
<link rel="stylesheet" href="style.css">

New elements in HTML5

HTML5 has added some very interesting and useful tags for structuring the markup and simplifying the developement.  Some of the important tags are:

<header>
The header tag contains the header of the web page, which is typically on the top of a page containing logo and some other information such as slogan and menu etc. Instead of using <div id="header">, it can be used as <header>.

<nav>
The <nav> tag is used for the navigation menu. For example, Instead of using <div id="nav"> for the navigation, you can use <nav>.

<article>
The <article> tag represents independent, self-contained content. Examples of possible articles can be blog posts, news article, forum post, or user comment etc.

<section>
The <section> tag is used to separate the different parts of the page.
A section is a grouping of content, typically preceded by header, possibly with a footer after. sections can be nested inside of each other, if needed, and can hold any amount of typical markup.

<aside>
The <aside> tag specifies a section of the page having content that is tangentially related to the content around it. The <aside> tag can be used for sidebars or any other content that we can consider separate from the main content of the page.

<figure>
The <figure> tag is used for annotating illustrations, diagrams, photos, and code listings, etc. The<figcaption> is used inside the <figure> tag for the caption of the figure.

<footer>
The <footer> tag is used to represent the footer section and is typically located at the bottom of a page. The <footer> usually contains information such as the author, copyright information, links to terms of use, and privacy policy, etc. The contact information within a <footer> tag should be marked up using the <address> tag.

Modified elements

<a>
The <a> tag in HTML5 allows to wrap multiple emements in a single a element. For example,

1
2
3
4
5
<a href="news.html">
   <h3>Iceland's Grimsvotn volcano erupting</h3>
   <p>The eruption had begun at the Grimsvotn volcano.</p>
   <p>Read more</p>
</a>

In HTML 4.01, the <a> tag could be either a hyperlink or an anchor, but in HTML5, the <a> tag is always a hyperlink. If no any href attribute is specified, it is only a placeholder for a hyperlink.

<b>
The <b> tag is generally used to specify the bold text. However in HTML5, the intention with this tag is to markup text as bold without conveying any extra importance.

<hr>
In HTML5, the <hr> tag displays a horizontal rule, and defines a change in the content, while in HTML 4.01 it just displayes a horizontal rule.

<i>
The <i> tag is not exclusively for italic style of text in HTML5 (although it can be italic). It now represents the text that is in an alternate voice or mood or otherwise offset from the normal prose'.

6. Removed elements

In addition to the new and modified elements, there are some of the elements that are no longer supported in HTML5. Some of the removed elements are:

<frame><frameset> and <noframes>: The frame elements such as <frame><frameset> and<noframes> have been removed from HTML5.

<font> The <font> element was used to define font face, font size, and font color of text.
<s> and <strike>: The <s> and <strike> elements were used to define strikethrough text. Use<del> instead.
<u> This element was used to define underlined text.
<center> The <center> was used to center align text and content.
<big> It was used to make text bigger.
<applet> The <applet> was used to define an embedded applet. HTML5 encourages the use of the<object> tag instead.
<acronym> The <acronym> tag was used to define acronyms in HTML 4.01. An acronym can be spoken as if it were a word, example NATO, NASA, ASAP, GUI.

Putting all together

Here is complete code for a very basic HTML5 page:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Example document</title>
  </head>
 
  <body>
 
    <header>
      <h1><a href="#">Welcome to my page</a></h1>
    </header>
 
    <nav>
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </nav>
 
    <section>
 
      <article>
        <header>
          <h3><a href="#">Article 1</a></h3>
        </header>
        <section>
          <p>Lorem ipsum...</p>
        </section>
      </article>
 
      <article>
        <header>
          <h3><a href="#">Article 2</a></h3>
        </header>
        <section>
          <p>Lorem ipsum...</p>
        </section>
      </article>
 
    </section>
 
    <aside>
    <h1><a href="#">Aside content</a></h1>
    Lorem ipsum dolor sit amet..
  </aside>
 
    <footer>
      <address>
        Contact us at:<br />
        <a href="www.gazpo.com">Gazpo.com
        </address>
    </footer>
 
  </body>
</html