千手观音

By , January 12, 2015 8:05 pm

咪咪带着球球去博物馆。球球看到一座千手观音的雕像,就问:“妈妈,为什么这个人要长这么多手?”

妈妈解释说:“她是个菩萨。她到世上来要救很多人,所以要长很多手。”

球球听了说:“我只要帮爸妈妈妈就好了,所以不用长这么多手。”

真是个乖娃娃。

白雪公主

By , December 21, 2014 2:21 pm

wanqing_snowwhite_01

wanqing_snowwhite_02

《白雪公主》
蒋婉清,10岁

月亮

By , December 21, 2014 2:19 pm

yunshu_moon_01

yunshu_moon_02

《月亮》
蒋云舒,4 岁

Full Text Search: Sphinx on Ubuntu 14.04

By , December 5, 2014 4:08 am

Below is some quick notes on how to setup a simple PHP based website with full text search capability. The content to be searched is stored in a MySQL database, and the full text search engine is Sphinx.

Step 1 – Launch an EC2 instance on AWS, the operating system is Ubuntu 14.04.

Step 2 – SSH into the EC2 instance, install MySQL server and set up a test database. In this demo, our test database have one table “document” with three columns id, uuid, and content. Sphinx will create a search index based on the information stored in the “document” table.

$ sudo apt-get update
$ sudo apt-get install mysql-server
$ mysql -u root -p
Your MySQL connection id is 43
Server version: 5.5.40-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database test;
Query OK, 1 row affected (0.00 sec)

mysql> use test;
Database changed
mysql> create table document (id int, uuid varchar(80), content text);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into document (id, uuid, content) values (1, 1234567890, 'cloud computing');
Query OK, 1 row affected (0.00 sec)

mysql> insert into document (id, uuid, content) values (2, 1234567891, 'expensive cloud computing');
Query OK, 1 row affected (0.01 sec)

mysql> insert into document (id, uuid, content) values (3, 1234567892, 'green expensive cloud computing');
Query OK, 1 row affected (0.00 sec)

mysql> insert into document (id, uuid, content) values (4, 1234567893, 'scheduling algorithm green expensive cloud computing');
Query OK, 1 row affected (0.00 sec)

mysql> exit
Bye

Step 3 – Install Sphinx

$ sudo apt-get install sphinx search
$ cd /etc/sphinxsearch
$ sudo cp sphinx.conf.sample sphinx.conf

Edit /etc/sphinxsearch/sphinx.conf to reflect your MySQL username and password. Also, find the following SQL statement

       sql_query               = \
               SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content \
               FROM documents

and replace it with the following SQL statement (because in our test database, our “document” table only contains three columns: id, uuid, and content.

        sql_query               = \
                SELECT id, uuid, content FROM document

Also, comment out the following two lines in /etc/sphinx/sphinx.conf, because we do not have these two columns (group_id, date_added) in our test database:

# sql_attr_uint         = group_id
# sql_attr_timestamp    = date_added

Then, edit /etc/default/sphinxsearch, change “START=no” to “START=yes“. Then start sphinx:

$ sudo indexer --all 
$ sudo service sphinxsearch start

STEP 4 – Install Apache and PHP

$ sudo apt-get install apache2 php5 php5-mysql
$ cd /var/www
$ sudo chown -R ubuntu:ubuntu html

Step 5 – A Quick Demo PHP Page

Create the following PHP page /var/www/html/sphinx.php, with the following content:

<?php
$conn = new mysqli('127.0.0.1', "", "", "", 9306);
if ($conn->connect_error) 
{
        throw new Exception('Connection Error: ['.$conn->connect_errno.'] '.$conn->connect_error, $conn->connect_errno);
}
 
$resource = $conn->query("select * from test1 where match('green computing')");
$results = array();
while ($row = $resource->fetch_assoc()) 
{
        $results[] = $row;
}
$resource->free_result();
 
var_dump($results);
?>

科里欧迪娜

By , November 30, 2014 6:25 pm

在芬尼安人统治爱尔兰的时代,阿尔斯特的王子,卷发的恰尔班,曾经去过马楠楠的国度

那时,恰尔班是世界上最英俊的男子。他的美貌赛过一切其他王子,就像月亮赛过一切星星。爱尔兰所有已婚和未婚的女人都爱慕他,但是爱尔兰的贵族都憎恨他。芬尼对恰尔班宠爱有加,但是考虑到贵族们强烈的妒忌心,他只好将恰尔班放逐到爱尔兰之外。

恰尔班离开阿尔斯特,一直来到Cairn的海边。在那里,恰尔班独自登上一条细尾的小船。随从们问他:“恰尔班,您这是打定主意要离开爱尔兰了吗?”恰尔班回答说:“是的。在爱尔兰已经没有我的容身之地了。”随从们看着渐渐远去的恰尔班痛哭不止,就像是失去了自己的亲人一样。

恰尔班乘船在海上航行。滔天的波浪在船的两侧此起彼伏。大浪甚至把海地的鲑鱼和卵石都抛到空中。恰尔班的心里感到恐惧,心里暗自说道:“如果在陆地上的话,我肯定可以设法躲过难关。现在可怎么办呢?”

就在他惶恐不安的时候,一位骑手骑着一匹戴着金辔头的黑马朝他飞奔过来。大浪一次又一次地将骑手淹没,但是浪头过去之后,他的身上一点都没有湿。骑手向恰尔班问道:“如果我把你救出来的话,你怎么样答谢我呢?”恰尔班苦笑着说:“我现在两手空空,哪里还有什么东西能够给你呢?”骑手说:“如果我救了你,你要侍奉我。”恰尔班表示同意,骑手就把他拉上马去。他们拖着恰尔班的小船,一直来到应许之地的Tir Tairngaire。在那里他们下了马,经过矮人湖来到马楠楠的领地。人们为恰尔班准备了丰盛的筵席。英俊的僮仆戴着光滑的牛角来往穿梭,他们在竖琴上奏出甜美的音乐充满了整个宫殿。

宴会上来了很多杂耍艺人,有人长着长鼻,有人踩着高跷,有人光着脑袋,有人满脸通红。其中一个杂耍是一个人单腿站立将九根柳木棍高高扔起,然后用一只手把它们一一接住。杂耍艺人们都觉得没有其他人能够完成这个动作。有时他们还故意邀请陌生人来尝试一下,等着看他们出洋相。这一晚,他们表演完后也请一位客人来做同样的表演。他们看见恰尔班在所有人当中相貌出众,举止非凡,就把九根柳木棍塞到恰尔班手里。恰尔班从容地走到屋子中间,无师自通地把这个杂技表演了一遍。

马楠楠的首席魔术师格班有个女儿,也就是银发的科里欧迪娜。科里欧迪娜没有爱上过任何男人,却对恰尔班一见钟情。第二天,她和恰尔班偷偷地乘上小船返回爱尔兰。他们回到爱尔兰南部的Teite海滩。恰尔班首先上岸寻找一只躲藏在森林里的小鹿,把科里欧迪娜一个人留在船里。这时马楠楠的人驾着四十条船追了上来。Iuchnu登上科里欧迪娜的小船,用音乐将科里欧迪娜催眠。一阵巨浪打上岸来,将科里欧迪娜连人带船一起卷走了。

从此,这里的大浪就叫做银发科里欧迪娜的海浪。

Panorama Theme by Themocracy