Monday, October 28, 2013

PHP array to xml

<?php
#echo strtotime('2013-10-27 19:30:00');


$arr = array();

$arr['news'] = array(
array('nid' => 1, 'title' => 'test'),
array('nid' => 2, 'title' => 'test'),
);

$arr['news2'] = array(
array('nid' => 3, 'title' => 'test'),
array('nid' => 4, 'title' => 'test'),
);

try
{
$xml = new array2xml('root');
$xml->createNode( $arr );
echo $xml;
}
catch (Exception $e)
{
echo $e->getMessage();
}

/**
*
* Array 2 XML class
* Convert an array or multi-dimentional array to XML
*
* @author Kevin Waterson
* @copyright 2009 PHPRO.ORG
*
*/
class array2xml extends DomDocument
{

public $nodeName;

private $xpath;

private $root;

private $node_name;


/**
* Constructor, duh
*
* Set up the DOM environment
*
* @param string $root The name of the root node
* @param string $nod_name The name numeric keys are called
*
*/
public function __construct($root='root', $node_name='node')
{
parent::__construct();

/*** set the encoding ***/
$this->encoding = "utf-8";

/*** format the output ***/
$this->formatOutput = true;

/*** set the node names ***/
$this->node_name = $node_name;

/*** create the root element ***/
$this->root = $this->appendChild($this->createElement( $root ));

$this->xpath = new DomXPath($this);
}

/*
* creates the XML representation of the array
*
* @access public
* @param array $arr The array to convert
* @aparam string $node The name given to child nodes when recursing
*
*/
public function createNode( $arr, $node = null)
{
if (is_null($node))
{
$node = $this->root;
}
foreach($arr as $element => $value)
{
$element = is_numeric( $element ) ? $this->node_name : $element;

$child = $this->createElement($element, (is_array($value) ? null : $value));
$node->appendChild($child);

if (is_array($value))
{
self::createNode($value, $child);
}
}
}
/*
* Return the generated XML as a string
*
* @access public
* @return string
*
*/
public function __toString()
{
return $this->saveXML();
}

/*
* array2xml::query() - perform an XPath query on the XML representation of the array
* @param str $query - query to perform
* @return mixed
*/
public function query($query)
{
return $this->xpath->evaluate($query);
}

} // end of class

Wednesday, October 23, 2013

How to find the mysql data directory from command line

mysql> SHOW variables WHERE variable_name LIKE '%dir%'

Sunday, October 20, 2013

pep talk 精神喊話

pep talk 精神喊話

spam control image code

A CAPTCHA is a challenge-response test most often placed within web forms to determine whether the user is human. The purpose of CAPTCHA is to block form submissions by spambots, which are automated scripts that post spam content everywhere they can. The CAPTCHA module provides this feature to virtually any user facing web form on a Drupal site.

https://drupal.org/project/captcha

Tuesday, October 15, 2013

create rounded corners with CSS

The CSS3 border-radius property allows web developers to easily utilise rounder corners in their design elements, without the need for corner images or the use of multiple div tags, and is perhaps one of the most talked about aspects of CSS3.
Since first being announced in 2005 the boder-radius property has come to enjoy widespread browser support (although with some discrepancies) and, with relative ease of use, web developers have been quick to make the most of this emerging technology.
Here’s a basic example:
This box should have a rounded corners for Firefox, Safari/Chrome, Opera and IE9.
The code for this example is, in theory, quite simple:
#example1 {
border-radius: 15px;
}
However, for the moment, you’ll also need to use the -moz- prefix to support Firefox (see the browser support section of this article for further details):
#example1 {
-moz-border-radius: 15px;
border-radius: 15px;
}

How it Works

Rounder corners can be created independently using the four individual border-*-radius properties (border-bottom-left-radius, border-top-left-radius, etc.) or for all four corners simultaneously using the border-radius shorthand property.
We will firstly deal with the syntax for the individual border-*-radius properties before looking at how the border-radius shorthand property works.

border-bottom-left-radius, border-bottom-right-radius, border-top-left-radius, border-top-right-radius

The border-*-radius properties can each accept either one or two values, expressed as a length or a percentage (percentages refer to the corresponding dimensions of the border box).
The Syntax:
border-*-*-radius:  | <%> ] [  | <%> ]?
Examples:
border-top-left-radius: 10px 5px;
border-bottom-right-radius: 10% 5%;
border-top-right-radius: 10px;
Where two values are supplied these are used to define, in order, the horizontal and vertical radii of a quarter ellipse, which in turn determines the curvature of the corner of the outer border edge.
Where only one value is supplied, this is used to define both the horizontal and vertical radii equally.
The following diagram gives a few examples of how corners might appear given differing radii:
border-radius-diagram-1
If either value is zero, the corner will be square, not round.

border-radius

The border-radius shorthand property can be used to define all four corners simultaneously. The property accepts either one or two sets of values, each consisting of one to four lengths or percentages.
The Syntax:
 |  ]{1,4} [ / [  |  ]{1,4} ]?
Examples:
border-radius: 5px 10px 5px 10px / 10px 5px 10px 5px;
border-radius: 5px;
border-radius: 5px 10px / 10px;
The first set of (1-4) values define the horizontal radii for all four corners. An optional second set of values, preceded by a ‘/’, define the vertical radii for all four corners. If only one set of values are supplied, these are used to determine both the vertical and horizontal equally.
For each set of values the following applies:
If all four values are supplied, these represent the top-left, top-right, bottom-right and bottom-left radii respectively. If bottom-left is omitted it is the same as top-right, if bottom-right is omitted it is the same as top-left, and if only one value is supplied it is used to set all four radii equally.

Browser Support

At present Opera (version 10.5 onward), Safari (version 5 onward) and Chrome (version 5 onward) all support the individual border-*-radius properties and the border-radius shorthand property as natively defined in the current W3C Specification (although there are still outstanding bugs on issues such as border style transitions, using percentages for lengths, etc.).
Mozilla Firefox (version 1.0 onward) supports border-radius with the -moz- prefix, although there are some discrepancies between the Mozilla implementation and the current W3C specification (see below).
Update:Recent Firefox nightly versions support border-radius without the -moz- prefix.
Safari and Chrome (and other webkit based browsers) have supported border-radius with the -webkit- prefix since version 3 (no longer needed from version 5 onward), although again with some discrepancies from the current specification (see this article for further details of how older versions of Webkit handle border-radius).
Even Microsoft have promised, and demonstrated in their recent preview release, support for border-radius from Internet Explorer 9 onward (without prefix).

The -moz- prefix

Mozilla’s Firefox browser has supported the border-radius property, with the -moz- prefix, since version 1.0. However, it is only since version 3.5 that the browser has allowed elliptical corners, i.e. accepting two values per corner to determine the horizontal and verical radii independently. Prior to version 3.5, the browser only accepted one value per corner, resulting in corners with equal horizontal and vertical radii.
The syntax, from Firefox 3.5 onwards, for the main part follows the current W3C specification, as described throughout this article, prefixed by -moz-. The only major difference is in the naming of the individual border-*-radius properties, with the -moz- prefixed properties following a slightly different naming convention as follows:
W3C SpecificationMozilla Implementation
border-radius-moz-border-radius
border-top-left-radius-moz-border-radius-topleft
border-top-right-radius-moz-border-radius-topright
border-bottom-right-radius-moz-border-radius-bottomright
border-bottom-left-radius-moz-border-radius-bottomleft
The Mozilla implementation also behaves slightly differently from the specification when percentages are supplied. You can read more on the Mozilla Developer Center here.

Cross Browser Examples

Here’s a few basic examples that should work in current versions of Firefox, Safari/Chrome, Opera and even IE9:
A
B
C
D
E
F

#Example_A {
height: 65px;
width:160px;
-moz-border-radius-bottomright: 50px;
border-bottom-right-radius: 50px;
}
#Example_B {
height: 65px;
width:160px;
-moz-border-radius-bottomright: 50px 25px;
border-bottom-right-radius: 50px 25px;
}
#Example_C {
height: 65px;
width:160px;
-moz-border-radius-bottomright: 25px 50px;
border-bottom-right-radius: 25px 50px;
}
#Example_D {
height: 5em;
width: 12em;
-moz-border-radius: 1em 4em 1em 4em;
border-radius: 1em 4em 1em 4em;
}
#Example_E {
height: 65px;
width:160px;
-moz-border-radius: 25px 10px / 10px 25px;
border-radius: 25px 10px / 10px 25px;
}
#Example_F {
height: 70px;
width: 70px;
-moz-border-radius: 35px;
border-radius: 35px;
}

Additional Notes & Further Reading

The W3C Backgrounds and Borders Specification goes into further detail on how the corner is shaped (especially in circumstances where two adjoining border have different widths), the effect of border-radius on background images, color and style transitions, what happens when curves overlap and the effect of border-radius on tables.
This is best explained in the following sections of the specification:

Reference:
http://www.css3.info/preview/rounded-border/

Friday, October 11, 2013

What Are False Positives and False Negatives?

While many of today's medical tests are accurate, false negative or positives do occur. What causes these erroneous results?

A false negative is a test result that indicates a person does not have a disease or condition when the person actually does have it, according to the National Institute of Health (NIH). False negative test results can occur in many different medical tests, from tests for pregnancy , tuberculosis or Lyme disease to tests for the presence of drugs or alcohol in the body.

Correspondingly, a false-positive test result indicates that a person has a specific disease or condition when the person actually does not have it. An example of a false positive is when a particular test designed to detect melanoma, a type of skin cancer , tests positive for the disease, even though the person does not have cancer.

http://www.livescience.com/32767-what-are-false-positives-and-false-negatives.html

Wednesday, October 9, 2013

Now with css3 you could try to use calc() to calculate the height

Now with css3 you could try to use calc() to calculate the height

.main{
height: calc(100% - 111px);
}

Monday, October 7, 2013

一個已婚男人的經驗之談

我的婚姻很幸福,我也有把握延續這種幸福。我寫這篇文章的目的,就是希望有更多的人能把握自己的婚姻。就算我說的都是廢話,如果能引起朋友們在婚前對婚姻多一些思考,也算是達到目的了。

今天晚上,得知我最好的朋友離婚了。孩子才1歲,同樣身為父親的我感到難過,離婚對孩子來說影響太大。所以想勸勸還沒結婚的兄弟對待婚姻再慎重一些。本來,我結婚也沒幾年,沒資格以過來人的身份說這些。不過,至少我的婚姻很幸福,我也有把握延續這種幸福。我寫這篇文章的目的,就是希望有更多的人能把握自己的婚姻。就算我說的都是廢話,如果能引起朋友們在婚前對婚姻多一些思考,就達到目的了。

每個人對婚姻的態度都是不同的,隨便找個人湊合過日子的,找個女人幫自己生孩子的,找個過夜不收錢的,這些所謂的「婚姻」就不在討論範圍了,這裡和大家討論的,是高質量的婚姻。

什麼是高質量的婚姻?每個人的理解都不一樣,在我看來,婚姻的狀態有很多種,但是讓人舒服的婚姻,一定都是有愛的。所以,我給還沒結婚的兄弟第一個忠告:如果想擁有幸福的婚姻,一定要相信愛情。

有人說,愛情是有保質期的。我說,有保質期的不叫愛情。那叫激情,激情夾雜的東西太多,性慾、感動、內疚、憧憬,有太多太多的雜質,這樣的情感確實難以持久。何況,激情往往是精心呵護起來的,一旦丟失了精心呵護的動力,褪色太快。

泡妹的時候,激情是最好的工具。然而面臨結婚選擇時,作為男人,一定要理清自己的頭腦,祛除激情的成分。這個思考的過程非常重要,婚姻是沒有回頭路的。別以為大不了還可以離婚。離婚不是解脫,是又一個麻煩的開始。

愛情是雙方面的,先說說男人對女人的。和一個自己不愛的女人過一輩子。絕對是折磨。

如何確定自己愛不愛一個女人,這是非常關鍵的一步。別以為這是廢話,我很肯定的說,很少男人清楚這個問題。男人的生理天性決定了對女人的選擇很大因素是外貌。但是婚姻是反人類天性的。所以當男人選擇了婚姻,就注定要克服自己的生理天性。

男人的生理天性,說白就是希望保質保量的遺傳自己的基因,比如盡可能的和更多女人上床,盡可能的選擇更漂亮,基因更優秀的女人上床。而婚姻,恰恰相反,男人只能選擇一個女人。而且要知道,眼前這個將要嫁給自己的美女,不幾年就會生孩子,眼角會有皺紋,乳房會下垂,乳頭會變的很黑,屁股會變形,小肚子會出來,還會有難看的斑紋。更可怕的是,男人的生理天性決定了男人老和同一個女人上床,是會膩的。所以,沒有愛的婚姻是危險的。因為沒有克服生理慾望的信念。

據我觀察,很多失敗婚姻的元兇就是性!性對男人的誘惑是致命的,不少男人就是因為和女人上了床就順理成章的結婚了。是好是壞全看運氣。壓根不思考有沒有共同語言,遇到問題雙方的溝通方式彼此能否接受,這些關鍵的問題不去想。就因為上了床就結婚。這是很多悲劇的來源。用人性本能來適應反人性本能的婚姻制度。這是非常愚蠢的。更愚蠢的是很多女人以性為工具來對待婚姻。

說到這裡才發現,婚姻實在是個大話題。每個人去領證的時候,都沒想過有一天會離婚。可惜,離婚的人越來越多。一個男人,只有把性慾、感動等因素全拋開,才能真正認識自己對一個女人的感情是不是愛。愛不能解決所有問題,但是能給男人解決問題的動力。沒有動力經營的婚姻,麻煩很多。因為婚姻的問題很多。

千萬別把結婚看成是好事。結婚對男人而言,純粹是責任。有了承擔責任的決心,才敢談婚姻,所以,結婚一定要找一個自己愛的女人,湊合不得。自己餘下的生命全部為之付出的家庭,女主人不是自己真正愛的,太悲劇了。因為婚姻唯一能回報給男人的,僅僅是一隻能牽著自己走向死亡的手。千萬別奢望婚姻回報給自己什麼,任何奢望只會添加雙方的壓力。做好丈夫該做的,自然得到應得的。

選擇結婚對象,我覺得有幾點一定要仔細思考:

1、雙方溝通方式彼此能否接受
這是最重要的一點,不是平時有沒有共同語言,而是有分歧和問題的溝通。說白了,如果男人是個講道理的人,女人也得是個懂道理的人;如果男人是個喜歡用拳頭說話的人,女人也得是個肯挨拳頭的人;女人如果喜歡嘮叨,男人就得聽得慣。總之,兩個人必須得有個拿出統一意見的程序,且雙方都能接受。最好是都樂意接受。其實這一條對於真正相愛的人來講不是問題,真正相愛的兩個人永遠是站在對方立場思考問題的。

夫妻意見的統一,是家庭和睦的基石。

2、兩人結合帶來的壓力是否可控
有情飲水飽,可惜只飽一頓。男人沒結婚,是瀟灑的,一結婚,負擔就來了。兩個人的結合所帶的壓力肯定是巨大的,必須要考慮雙方的承受能力,自己沒有能力負擔,就不要害人害己了。女朋友如果喜歡錢,有錢就娶,沒錢就不要砸鍋賣鐵娶回家了。有些負擔,背上就是一輩子的。對婚姻而言,肯陪自己一起奮鬥的女人,才真正應該珍惜。單單是兩個人一起改善生活的過程,就已經是婚姻寶貴的財富了。別說現在這樣的女人少,不少。老盯著花枝招展想靠嫁人改變命運的年輕女人,就別怪女人現實。自己從未規劃過未來,就別怪女人不肯陪自己一起奮鬥。

性生活得到滿足的男人,才更容易發現女人其他的魅力。而現實的情況是,不少好女人還剩著,男人卻在追逐性的過程中迷失了自己。因色而結合,出了問題湊合,女人色衰之後,沒本事的男人繼續湊合,有本事的換個女人湊合。這樣的風氣還有個很煩的影響,女人越來越在意自己的形象,化妝時間越來越長,衣領越來越低,裙子越來越短。而充電的時間越來越少,獨立意識越來越淡。男人一邊追逐女色,一邊抱怨女人素質越來越低。女人呢?一邊抱怨男人膚淺,一邊不斷迎合膚淺的審美。

3、雙方是否是對方的助力
婚姻不是人生的全部,兩個人攜手一生,相助則利,相阻則損。性格互補也好,志同道合也好,彼此成為對方的助力,真的很重要。如果和一個女人婚前就感覺疲憊,相信我,別接了。家是港灣,是一個讓男人快到家門就會不自覺加快腳步的地方。是一個一回家就會徹底放鬆,卸下所有偽裝的地方。是一個所有笑容都發自真心的地方。

結婚,一定娶一個讓自己感到輕鬆的女人。真的!

說了這麼多,肯定有兄弟說這麼多條件的女人難找。其實真的不難,第一條和第三條,只要女人愛你都不是問題。第二條,只要在和自己同一層次的女人中間找也不是問題。

有朋友問到區分激情和愛情,其實很好區分的,當你不見她時茶飯不思,是激情。老想見到她,想和她一起玩,一起上床,一起做白日夢,是激情。每天短信電話多的沒完,是激情。為了生日節日費盡心思想浪漫的點子,是激情。當你和她在一起時腦子裡不自覺的規劃實實在在的將來,是愛情。當你們爭吵到很凶,火很大時,也不忍心說一句傷害她的話,是愛情。當你們有分歧時,你總是能清楚的知道她是怎麼想的,能理解她的初衷,是愛情。

現在很多人談戀愛很短時間就結婚了,當然,不是說時間短就不好。而是要清楚的知道,婚前的考察對這一生的影響。失敗的家庭是任何成功都彌補不了的。縱然是家產萬貫,頂一頂綠帽子也是沒臉的事。再大的房子,妻離子散的日子也難過。人,一旦離過一次婚,再尋找幸福的難度就更大了。因為,離過婚的人更難相信愛情。更何況離婚對子女的影響,太大太大。人,真正能留在這個世界上的,也就是子女這點血脈而已。為子女營造一個好的成長環境,是父親的責任。

前面說這麼多其實都是說面對婚姻的態度要理性,要慎重。

態度端正以後,技巧也有很多需要注意的地方。明明相愛的兩個人互相傷害的事情太多了。如果犯錯,也要積極想辦法補救爭取。

傷心散伙的也多,而且婚姻生活,男人還有個重要技術要掌握,就是老媽與老婆的關係。

婚後生活瑣碎的事情太多,先說說處理婆媳關係。所有還沒結婚的兄弟一定不要把這不當一回事。一邊是生你養你為你付出所有的母親,一邊是將要相伴你一生的老婆。雙方都有責任要照顧。這個關係弄順了,少很多麻煩。

有人說男人在婆媳之間是雙面膠,夾在中間兩面討好。這是錯的。男人必須是一手拿棒一手拿潤滑油。小事居中調節,原則問題對事不對人,道理絕不能歪,既不能縱容媳婦,也不能慣壞了老媽。堅決不要在老媽面前說媳婦不對,多包涵之類,也不能在媳婦面前說,這都是縱容。把握一個原則,絕不允許媳婦在自己面前說老媽的壞話,有事說事。該怎麼解決怎麼解決,是老媽不對也要和老媽把事情講清楚,同樣的,老媽說自己媳婦的時候也要分清是非。居中討好的後果是兩面不是人,矛盾還越來越深。

總之,絕對的公平是處理婆媳關係的唯一方式,委屈任何一方,都會使矛盾激化。媽也好,老婆也好,底線都給她們畫好。人都是有選擇性的,既然要不到特權,自然會注意彼此相處。一開始可能男人日子不太好過,兩邊都要鬥上幾次。但是慢慢的,家庭秩序就會走上正軌。如果一開始圖省心,哄過去,兩邊脾氣都養大了就夠自己受了。(前面忘了說了,找女人一定要找個聰明的,笨女人大多麻煩,聰明的女人自己會處理,自己只用打打下手,關係就處的很好了。

還有個問題,就是子女,現在的孩子才真叫一個寶貝,一大家人圍著轉,各有各的主意,很多矛盾都是因此而起,在這一點上,男人一定要強硬,從一開始就絕對不能讓步,要給出明確的信號,孩子是自己的。雙方父母肯幫忙,感謝。但是涉及孩子的一切決定,必須是自己拿主意。(這一點背地裡可以多聽老婆的,畢竟,媽媽是最愛孩子的。)這一點申明尤其重要,相當於自己一個人把所有炮火攬了。否則,孩子一點點小感冒家裡可以鬧翻天。(我那今天離婚的朋友就是因為這個)。

婚姻確實是個大話題,一時反而不知道說什麼好了,我是真心想和大家交流一下。因為我自認為自己的婚姻真的是種幸福。我是真心希望有更多的人能愉快的享受婚姻。有人說不吵架不算夫妻,說真的,我和我老婆真還吵不起來架,就像我前面說的,傷彼此的話確實不忍心講出口。何況一旦清楚彼此都是出於愛,又有什麼好吵的?有幾次剛進入狀態,看見彼此裝腔作勢生氣的樣子就都笑了。

戀人時刻只有甜蜜和浪漫,而婚姻則更多是責任和平淡,這個轉化的過程,是需要雙方有充足思想準備的。其實只要兩個人肯一起面對,婚姻生活平淡中的幸福並不輸給熱戀時的浪漫。

願意花時間看這文章的男生女生們,光是這一點就足以說明你們對待婚姻對待愛情的態度是充滿誠意的。有這樣的態度你們一定會收穫屬於你們的幸福。真心的。

http://myshare.url.com.tw/note/587875

Omit Zeros from the Average Function/Formula

Omit Zeros from the Average Function/Formula

Back to Excel Formulas . Got any Excel Questions? Free Excel Help
Excel Average Without Zeros
Excel has a built in formula/function that makes averaging a range of cells easy. If we assume your numbers are in A1:A100 you would simply use the Average formula like shown below;
=AVERAGE(A1:A100)
There is however, one draw-back with this. That is, it includes cells that contain 0 (zeros). This can give you unexpected results. While the sum of values is not effected, the count of them is. Average is the sum of numbers divided by the count of numbers. So how do we omit zeros from our average?
SUMPRODUCT & SUM
=SUM(A1:A100)/(SUMPRODUCT((A1:A100<>0)*1))
This method is the most generic in that it ignores blank cells and will include negative numbers.
COUNTIF & SUM
By far the most efficient method is to use the SUM formula and COUNTIF formula as shown below;
=SUM(A1:A100)/COUNTIF(A1:A100,">0")
This method will not work should you have negative numbers unless you change ">0" to "<>0" The drawback is it will then count blank cells. Where as the one below wont.
=SUM(A1:A100) / (COUNT(A1:A100) - COUNTIF(A1:A100,0))
=SUMIF(A1:A100,">0")/COUNTIF(A1:A100,">0") Will also exclude negatives unless you use "<>0". However, it will then count blank cells.
If you do have negative numbers, and no blank cells, use;
=SUM(A1:A100)/COUNTIF(A1:A100,"<>0")
DAVERAGE
The other method is via the DAVERAGE function. This function is part of the Database functions and all are extremely useful when/if you need specify multiple criteria. The DAVERAGE , in the case of numbers being in A2:A100 (A1 should be a heading) we could use the DAVERAGE like below;
=DAVERAGE($A$1:$A$100,1,$B$1:$B$2)
Where "1" represents the relative column position to average in the range A1:A100
B1 has an exact copy of your heading in A1
B2 houses the expression >0
Array Average
This method is the least efficient. By creating an array formula we can use the Average formula as shown below to omit zeros;
=AVERAGE(IF($A$1:$A$100,$A$1:$A$100))
=AVERAGE(IF($A$1:$A$100 <>0,$A$1:$A$100))
As these are array formulas they MUST be entered via Ctrl+Shift+Enter.

http://www.ozgrid.com/Excel/average-without-zero.htm

Sunday, October 6, 2013

Redo Backup and Recovery

Redo Backup and Recovery is so simple that anyone can use it. It is the easiest, most complete disaster recovery solution available. It allows bare-metal restore. Bare metal restore is not only the best solution for hardware failure, it is also the ultimate antivirus: Even if your hard drive melts or gets completely erased by a virus, you can have a completely-functional system back up and running in as little as 10 minutes.

http://redobackup.org/

Thursday, October 3, 2013

第34章 要教會孩子學會堅持,不輕易認輸

俗話說:「天道酬勤。」命運掌握在那些勤勤懇懇地工作的人手中。天賦過人的人,如果沒有毅力和恆心做基礎,他只會成為轉瞬即逝的火花;許多意志堅強、持之以恆而智力平平乃至稍稍遲鈍的人,都會超過那些只有天賦而沒有毅力的人。正如一句西方民諺所云:「走得慢且堅持到底的人,才是真正走得快的人。」

人人都渴望成功,人人都想得到成功的秘訣,然而成功並非唾手可得。我們常常忘記,即使是最簡單最容易的事,如果不能堅持下去,成功的大門絕不會輕易地開啟。那些最能持之以恆、忘我工作的人往往是最成功的。因此,一定要讓孩子充分認識到:除了堅持不懈,成功並沒有其他秘訣!如果暫時面對不利的局面,只要不放棄努力,就不算輸。

阿邁爾參加紐約市的演講比賽,沒能進入決賽,爸爸和媽媽一起去接他回家。

一見面,爸爸就問他:「你是輸了?還是沒有贏?」

阿邁爾不解地說:「這有什麼分別?」

爸爸沒有回答他的問題,只是再次問道:「下星期在史泰登島的另一場比賽,你還打算參加嗎?」

阿邁爾十分堅決地說:「當然要參加!」

爸爸說:「那麼,你今天只是沒有贏,而不是輸了!」

一個輸了的人,如果繼續努力,打算贏回來,那麼他今天的輸,就不是真輸,而是「沒有贏」;相反的,如果他失去了再戰鬥的勇氣,那就是真輸了!

海明威的名著《老人與海》裡面有這樣一句話:「英雄可以被毀滅,但是不能被擊敗。」

尼采說過這樣一句名言:「受苦的人,沒有悲觀的權利。」

英雄的肉體可以被毀滅,但是精神和鬥志不能被擊敗。受苦的人,因為要克服困境,所以不但不能悲觀,而且要比別人更積極!

據說徒步穿過沙漠,唯一可能的辦法,是等待夜晚,以最快的速度走到有蔭庇的地方一站,中途不論多麼疲勞,也不能倒下。否則,第二天烈日昇起,加上沙上炙人的輻射,只有死路一條。

在冰天雪地中歷險的人,也都知道,凡是在中途說「我撐不下去了,讓我躺下來喘口氣」的同伴,必然很快就會死亡,因為當他不再走、不再動,他的體溫迅速降低,跟著就被凍死。

一位著名的西方學者說:「在通往目標的歷程中遭遇挫折並不可怕,可怕的是因挫折而產生的對自己能力的懷疑。」其實,挫折並不能證明什麼,因為我們是人而不是神,我們不可能十全十美。相反,我們能力的大小,只有在經受了各種各樣的考驗之後方能證實。挫折就是這樣一種必須經受的考驗,它可以提醒我們去尋找和發現我們自身的不足之處,然後對它們進行彌補和改善。挫折使我們有了這樣一種機會:讓我們清醒地認識到事情是如何朝著失敗的方向轉變的,以使我們在將來能夠避免因重蹈覆轍而付出更加高昂的代價。

最重要的是,挫折還使我們看清了自己在通往目標的道路上一個必須去加以征服的敵人,這個敵人不是別人,他通常就是我們自己,人類最傑出的成就經常是在戰勝自我的同時被創造出來的,人類最崇高的目標也經常是在徹底戰勝自我的同時到達的。

艱難困苦對生活的強者來說,猶如通向成功之路的層層階梯;而對生活的弱者來說卻是萬丈深淵。生活告訴我們這樣的一個哲理:「在人類的歷史上成就偉大事業的往往不是那些幸福之神的寵兒,卻反而是那些遭遇諸多不幸卻能奮發圖強的苦孩子。」

古往今來有許多這樣的例子。德國大作曲家貝多芬由於貧困沒能上大學,17歲時得了傷寒和天花;這之後,肺病、關節炎、黃熱病、結膜炎又接踵而至;26歲時不幸失去了聽覺,在愛情上他也屢屢不順。在這種境遇下,貝多芬發誓「要扼住命運的咽喉」。在與命運的頑強搏鬥中,他的意志佔了優勢,在樂曲創作事業中,他的生命重新沸騰了。英國詩人勃朗寧夫人15歲就癱瘓在病床,後來靠著精神的力量同病魔頑強搏鬥,39歲時終於從病床上站了起來。她寫的《勃朗寧夫人十四行詩》一書馳名於世界各國。

一個人可能會由於家庭、身體等種種原因而感到失意,但只要他內心深處堅信自己是能夠有所作為、幹一番事業的,這樣,他就會產生戰勝困難、向命運挑戰的巨大勇氣,而他的社會價值,也終會在所從事的事業中實現。18世紀德國詩人歌德,用26年的時間完成了一部不朽名著《浮士德》。作品完成後,他的秘書請他用一兩句話概括作品的主旨,他引用浮士德的話說:「凡是自強不息者,終能得救!」

要讓人孩子懂得,在人生的戰場上,我們不但要有跌倒之後再爬起的毅力,拾起武器再戰的勇氣,而且從被擊敗的一刻,就要開始下一波的奮鬥,甚至不允許自己倒下,不准許自己悲觀。那麼,我們就不是徹底輸,只是暫時地「沒有贏」了!最偉大的成就,常屬於那些在大家都認為不可能的情況下,卻能堅持到底的人。

http://www.nwp.cn/book/352_18057.shtml

Tuesday, October 1, 2013

堅持到底的道路看起來很遙遠,卻是達成目標最近的路

秋風漸涼,突覺時光匆匆,倏忽地的時間偶然會搖醒沉默不改變的心。

今時今日,每個人最關心的還是要如何讓自己在固定的收入外,多存一些錢好規劃未來的日子。而我也不能例外地比從前更加關心自己的未來,也許是更年長了,很多事讓人感受到不確定,於是,想要穩穩地抓住些什麼來讓自我安心。

成長有時真讓人覺得寂寞。原本會談心、固定一段時日會見面的朋友,因為事業忙、或遠在他鄉而變得不太聯絡。從前的夢想,因為現實不得不做妥協…。

最近靜下心來的時候,閱讀了一些書,裡頭有些句子給我很大的啟發。比如說:
「堅持到底的道路看起來很遙遠,卻是達成目標最近的路。」
「不要小看不起眼的事物,有時候反而是新的契機。」
「跨出去不見得有收穫,但不跨出去你永遠不會有機會。」

我一直覺得”堅持到底”是一種很高貴的情操,它真的很難,因為你想要看到的那個目標往往很遠。中途有太多未知,過程艱辛萬苦。而我也覺得,當你因為一些挫折而放棄一件事,那件事不是你能力未及、就是你根本還沒這麼想要它。從我一個人勇闖天涯回國後,我對自己的信心又多了一分。雖然也許許多人都做過這樣的事,但對我而言,真的是跨出去了第一步。過去,也許對自己要求太高,做不到時很打擊自我信心。但是,每建立一次小信心,對自我的觀感又更不同。現在,我也開始學起金融理財的常識。我一直很再意心中的理想不能實現,但前陣子遇上生涯瓶頸,決心出國好好想一想。回來後,我多了很多心得。

「只要從來沒有忘記心中那份夢想,儘管偶而要屈就現實,但不代表就永遠放棄。」心是這樣對著自己說。雖然我常覺得沮喪,但仔細想想,我也許努力還不夠、我花的心還不夠,那我又怎麼會得到我想要的收穫??

在情感上也一樣,一個人真的很在乎妳,他就不會輕易地放棄。「路遙知馬力,日久見人心。」以上的道理套用在我自己身上,突然打開我糾結已久的心。要明白過去的那個人已然離開的事實,時間會証明一切;一個不值得再執著的感情,某天會因為另一個人真心對妳關懷才會恍然明白。那樣的過程很痛苦,但我希望痛的感覺不是因為時間太長而習慣了痛,而是真的要對自己好,也不要讓愛自己的人擔心。讓自己活在愛中才是最大的祝福。

就像我一直覺得,為什麼我總要為著現實而不能再執著我的夢想。我想把文學學得透徹,現在卻得去學商業知識,一切只為了能變得更有錢??可是,我想起同學跟我說的一句話。「當時我在做這份工作時,我告訴自己,這只是暫時,我在這段期間好好培養能力,最後我還是可以到達我想要的地方。」沒人可以讓自己放棄,除非是自己要放棄。我想,用在許多事上,都很有用。

覺得湖比海洋更能沉澱心思。在英國的時候,當我坐在石頭上、對著湖中城堡冥思,心裡潮思翻湧。有多少個夜我為了一些刻骨銘心的往事失眠,當別人看我在不到五度的氣溫下凝望著湖水,多少人會知道我當時的心情,是心酸的、也是喜悅般的複雜?有些人表面很平靜、面容之下卻澎湃洶湧,當你願意去懂一個人的時候,所有的起伏他/她都會明白。當你願意去等待一個人的時候,你便不會輕易放棄,直到你明白,你等待的是一個錯的人時,不消太長時日,你便自然而然地放棄。

用心在一個錯的人會讓你傷心,但用心在一件你一直想完成的事並不會讓你傷心。何必跟自己過不去?我告訴自己。並不是沒有做到就要懷憂喪志,重要的是它是否值得你繼續花心思下去。若是值得,「堅持到底的道路看起來很遙遠,卻是達成目標最近的路。」就努力去超越自己。

我很高興,因著這次的決定,我得到了寶貴的心得。失去亦或是得到,真的是很難說。那又何需想得太多,凡事順其自然吧!

去了歐洲,很羡慕歐洲人那種人生短暫、當及時行樂的瀟瀟。我想,我是需要這種灑脫的,這樣反而不會讓自己礙手礙腳。

我還是喜歡認真,只不過,這一次,讓自己沒有阻礙地向前進吧!

http://www.wretch.cc/blog/yuczhen29/2207752