Leo Wang's Notepad

XML入门

 翻译自:http://www.w3schools.com/xml/xml_whatis.asp


 

XML用来传输和存储数据。

HTML用来显示数据。


你应该已经具备什么知识?

在你继续学习XML之前,你应该对下列知识有基本的了解:

  • HTML
  • JavaScript

如果你想先学习这些知识,请参考学习指导。


XML是什么?

  • XML eXtensible Markup Language 的缩写。
  • XML是一种标记语言,像HTML一样。
  • XML用来传输数据,不是用来显示数据。
  • XML是自描述性质的。
  • XMLW3C的推荐标准。

(更多…)

怎样写一篇完美的GRE Analytical Writing文章?


by Lea Barton June 28,2007(翻译自本链接)

GRE AW是我的专长。写一篇完美的GRE AW不是件容易的事,事实上挺难的,只有4%的GRE考生能写出这样的文章。在本文中,我将一步步地说明我是怎样在GRE AW中取得完美的分数的。照这样做你也能写出好文章。

第一步:仔细阅读题目,至少读上三遍,把题理解透。GRE的AW由两部分构成,在第一部分中你可以在两篇(issue)中选一篇写,第二部分(argument)你就没得选了。不管写哪一部分,都要仔细读题。

第二步:写正确,审慎,完整的主题陈述(thesis statement)。还记得初中时候写的那些么?跟那差不多,别发挥创造力或者用什么华丽辞藻,也别太掉书袋。直奔主题就是了。如果问题是关于1700年代法国民族主义的变化和延续性的,要保证你的主题陈述写成这样子:"In the 1700s in France, nationalism caused changes such as [插入变化的例子], while many continuities such as [插入延续性的例子] balanced the system on the whole, setting the stage for future revolution."把主题陈述放在文章开头第一段,点出”changes“和”continuity“——最重要的是每个方面都附带一两个例子——所有这些都写在一个句子中,然后围绕这个主题展开。

怎样学习线性代数

本文翻译自《Linear Algebra and Its Applications》的作者 David C.Lay 的网站上的一篇文章(pdf)How to learn linear algebra.

 国内机械工业出版社出版了本书中文版《线性代数及其应用》。实在是难得的好书。

红色部分为重点,普遍适用于一般的线性代数学习。其余部分和该书配套的 Study Guide有关。

怎样学习线性代数

 

线性代数跟之前所有的数学课都非常不同。学习的重点从学习计算过程转移到消化并掌握这些计算的原理。要想坚持下去,你可能需要掌握某种学习数学的新方法。这就是我写作这本Study Guide的原因——教你怎样学好这门课,并介绍一些工具。

 

因为你可能会在以后的工作中用到线性代数,你需要把相关的知识学到某种水平,而不只是为了期末考试及格。我相信下面的一些策略对达到该目标是至关重要的。 

1.  在你开始做练习之前先认真学习很多同学在线性代数之前的数学课上并不这么做。当他们做不出来的时候就去看前面的例题。这招在线性代数里可不管用。如果你照搬一个例题(有必要的修改),你以为你理解了题目,其实你没学到什么。(最终你会在考试的时候发现这个问题。)对这门课来说,除了要学会怎么进行某种运算外,你必须学会什么时候该使用这种运算,还有(更重要的是)为什么它管用。

 

     要做好家庭作业,先把课本这一节看一遍,也许要做一些笔记。然后阅读Study Guide里面本节的Key Ideas 或                  者Study Notes 。然后开始做作业。长远来看,这样做会让你做得更好还会节省你的时间。花在这方面的准备时间            会大大减少你用来准备考试的时间。

2.  像学某门语言一样为每一节课做准备。掌握这门课要求你掌握大量的词汇。现在你的目标成了熟悉这些概念,并在口头和书面中自如(而且正确)地运用。做作业的时候,试着写完整的句子,你会在Study Guide中发现解决方法。也要注意这里提到的术语的误用问题。

为了给全班讨论做准备,这门课还包括语言课程,以防止掉队。几乎本书所有的章节都基于它之前的章节,如果你落下了,想赶上全班的进度是很难的。事实上,因为一些概念看似“简单”而把课拖到周末,你拖不起。作业可能会比你想象的要难。我能给你的最有价值的建议就是赶上全班的进度。 (更多…)

独立宣言

1776年7月4日,于国会内

 

美洲十三合众州全体一致宣告

 

  此时此刻,于人事发展进程中,斯属必要者,业为解消一群人民与他群间之政治捆缚,并视其地位─基于自然律与造物主之赐─于尘世诸政权间为互不隶属且相互平等,适切尊重人类宣告独立的目标理想之需求。

 

  前言

 

  我等之见解为,下述真理不证自明:凡人生而平等,秉造物者之赐,拥诸无可转让之权利,包含生命权、自由权、与追寻幸福之权(原意为:pursuit of happiness,追求快乐)。

 

  兹确保如此权力,立政府于人民之间,经受统治者之同意取得应有之权力;特此,无论何种政体于何时坏此标的,则人民有权改组或弃绝之,并另立新政府,本此原则,以成此型式之政权,因其影响人民之安全幸福至巨。

 

  深思熟虑后,当得此论,即建立长久之政府,不应以无足轻重之理由改组,而基于已知之过往,世人宁可容忍积重难返之邪僻。然当连串之滥权者与篡夺者执迷不悟,迫人民屈伏于绝对专制下时,推翻此政府,是其权利,是其义务,并为未来之安稳提供新保障。

 

The Declaration of Independence

IN CONGRESS, JULY 4, 1776
The unanimous Declaration of the thirteen united States of America
 

When in the Course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature’s God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness. — That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, — That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn that mankind are more disposed to suffer, while evils are sufferable than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security. — Such has been the patient sufferance of these Colonies; and such is now the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.


He has refused his Assent to Laws, the most wholesome and necessary for the public good.

He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; and when so suspended, he has utterly neglected to attend to them.

He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, a right inestimable to them and formidable to tyrants only.

He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their Public Records, for the sole purpose of fatiguing them into compliance with his measures.

He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.

He has refused for a long time, after such dissolutions, to cause others to be elected, whereby the Legislative Powers, incapable of Annihilation, have returned to the People at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.

He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage their migrations hither, and raising the conditions of new Appropriations of Lands.

He has obstructed the Administration of Justice by refusing his Assent to Laws for establishing Judiciary Powers.

He has made Judges dependent on his Will alone for the tenure of their offices, and the amount and payment of their salaries.

He has erected a multitude of New Offices, and sent hither swarms of Officers to harass our people and eat out their substance.

He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.

He has affected to render the Military independent of and superior to the Civil Power.

He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; giving his Assent to their Acts of pretended Legislation:

For quartering large bodies of armed troops among us:

For protecting them, by a mock Trial from punishment for any Murders which they should commit on the Inhabitants of these States:

For cutting off our Trade with all parts of the world:

For imposing Taxes on us without our Consent:

For depriving us in many cases, of the benefit of Trial by Jury:

For transporting us beyond Seas to be tried for pretended offences:

For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at once an example and fit instrument for introducing the same absolute rule into these Colonies

For taking away our Charters, abolishing our most valuable Laws and altering fundamentally the Forms of our Governments:

For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.

He has abdicated Government here, by declaring us out of his Protection and waging War against us.

He has plundered our seas, ravaged our coasts, burnt our towns, and destroyed the lives of our people.

He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation, and tyranny, already begun with circumstances of Cruelty & Perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.

He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands.

He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions.

In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. A Prince, whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.

Nor have We been wanting in attentions to our British brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, and we have conjured them by the ties of our common kindred to disavow these usurpations, which would inevitably interrupt our connections and correspondence. They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.

We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these united Colonies are, and of Right ought to be Free and Independent States, that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish Commerce, and to do all other Acts and Things which Independent States may of right do. — And for the support of this Declaration, with a firm reliance on the protection of Divine Providence, we mutually pledge to each other our Lives, our Fortunes, and our sacred Honor.

— John Hancock

New Hampshire:
Josiah BartlettWilliam WhippleMatthew Thornton

Massachusetts:
John HancockSamuel AdamsJohn AdamsRobert Treat PaineElbridge Gerry

Rhode Island:
Stephen HopkinsWilliam Ellery

Connecticut:
Roger ShermanSamuel HuntingtonWilliam WilliamsOliver Wolcott

New York:
William FloydPhilip LivingstonFrancis LewisLewis Morris

New Jersey:
Richard StocktonJohn WitherspoonFrancis HopkinsonJohn HartAbraham Clark

Pennsylvania:
Robert MorrisBenjamin RushBenjamin FranklinJohn MortonGeorge ClymerJames SmithGeorge TaylorJames WilsonGeorge Ross

Delaware:
Caesar RodneyGeorge ReadThomas McKean

Maryland:
Samuel ChaseWilliam PacaThomas StoneCharles Carroll of Carrollton

Virginia:
George WytheRichard Henry LeeThomas JeffersonBenjamin HarrisonThomas Nelson, Jr.Francis Lightfoot LeeCarter Braxton

North Carolina:
William HooperJoseph HewesJohn Penn

South Carolina:
Edward RutledgeThomas Heyward, Jr.Thomas Lynch, Jr.Arthur Middleton

Georgia:
Button GwinnettLyman HallGeorge Walton

一道GRE填空题

做陈圣元GRE填空的时候,看到这样一道题:

In sharp contrast to the intense ___ of the young republic, with its Utopian faith in democracy and hopes for eternal human progress, rencent developments suggest a mood of almost unrelieved ___.

A. idealism .. cynicism

B. individualism .. escapism

C. sectarianism .. recklessness

D. assertiveness .. ambition

E. righteousness .. egalitarianism

作为天朝出来的,我知道答案为:A。

WordPress自定义页面模板显示分类日志

参考来源:http://blog.chinaunix.net/u2/74256/showart_1131108.html

在wordpress主页上,一般模板都会自带两个Tab一样的分页,Home 和 About Me,如果想添加更多的类似页面用来显示分类文章怎么办?

1.自定义页面模板。

在你的当前所用的theme所在的文件夹中,找到index.php文件,将它下载到本地,打开之后,在代码开始处添加如下代码:

<?php
/*
Template Name: mytemp
*/
?>

其中mytemp是你自己要定义的模板的名字。

在<?php if (have_posts()) : ?>

上边加上一段代码:

<?php query_posts('cat=8&showposts=5'); /* 设置调用分类ID为8,显示5篇日志*/ ?>

cat是你所想显示的分类的id,showposts为想要显示的文章数量。具体的分类id可以在wordpress后台的dashboard(控制面板)Post-Categories处查看。

2.将文件另存为mytemp.php(也可用其它文件名),然后将该文件上传到你当前所用theme的文件夹中。

3.在后台新建page时选择对应的模板即可在该page显示对应category的文章了。

【转载】WordPress初级教程之安装篇

文章来源:http://paranimage.com/install-wordpress/

我就是按照他上面的步骤一步步建起来的。

经过上一节选购主机和域名的介绍, 你现在已经拥有了自己的虚拟主机空间和独立域名了. 让我们正式开始安装, 在安装之前, 我们先假设一组帐号:

域名: paranimage.com FTP根目录: /public_html FTP帐号: admin@paranimage.com FTP密码: 123456 MySQL数据库名: 帕兰映像_severname MySQL数据库用户名: 帕兰映像_ severuser MySQL数据医密码: 987654

下面, 我们就将用这组帐号来模拟如何安装wordpress, 你在安装的过程中把相应的帐号和密码换成自己的就可以了.

下载Wordpress档案

1. 到WordPress官方博客的下载区, 下载最新版本的Wordpress, 目前最新版本是2.5.1. 注意: 在这个页面里, 最新的Wordpress的下载地址都是http://wordpress.org/latest.zip, 请不要用firefox或是迅雷等工具进行下载, 否则可能下载到的可能并不是最新版. 2. 如果担心下载到的不是最新版本, 或者是你想要下载Wordpress的历史版本, 可以到”WordPress版本存档区” 进行下载, 里面列出了所有Wordpress发布过的版本下载, 包含RC版本, Beta版本, 正式版本等等. 你可以选择下载zip格式或是tar.gz格式. 3. WordPress官方只提供英文版下载. 但之前我们也说过, 有无数的爱好者对Wordpress进行了翻译和本土化, 如果你想要下载中文版, 可以通过这份多国语言Wordpress版本列表查看. : 说几句闲话. 国内有很多人在搞Wordpress的中文版, 这为那些英语不是太好的朋友带来了极大的方便. 但帕兰个人建议, 不管英文好不好, 都使用英文版. 其实Wordpress后台的英文也并不多, 使用一段时间后就能完全掌握. 当然, 如果你的Wordpress博客是开放注册的形式, 那还是使用中文版比较好. 4. 下载后会得到一个压缩包, 解压后会得到一个wordpress文件夹, 要查看下载的Wordpress是否为最新版, 只需要打开里面的readme.html文件即可看到版本号. 认识Wordpress文件夹和文件的功能 在上传之前, 帕兰先向你介绍一些重要的Wordpress文件夹和文件所对应的功能. 解压缩后得到wordpress文件夹, 打开, 你将会看到一些文件和3个核心文件夹: wp-admin: 这里面包含Wordpress后台的所使用的PHP文件, CSS样式表, JS脚本和许多后台的功能文件. 在你还没有成为一个Wordpress高手之前, 不要碰它, 通常也不需要碰. wp-content: WordPress博客的主要内容都在这里面, 它包含三个子文件夹:

  • themes(模板目录, 你如果要安装新主题, 需要上传到这个文件夹里面)
  • plugins(插件目录, 你如果要安装新插件, 需要上传到这个文件夹里面)
  • uploads(这是Wordpress默认的上传文件保存路径, 当你发布文章时, 所上传的图片等文件都会保存在这个文件夹里面. 这个路径是可以修改的, 但一般也没必要修改.)

wp-includes: 这里面包含了一些核心的Wordpress功能文件, 基本上也用不到修改. 除了这3个子文件夹, wordpress文件夹里面还有一些php文件, 其它都不用管. 认识一下wp-config-sample.php就可以了.wp-config-sample.php是安装Wordpress所必需要的配置文件.

(更多…)