2011/02/19

How to Add a Random Post Gadget in Blogger

中文版:如何在Blogger新增隨機文章

Many bloggers used the service provided by stuffablog for the random posts. However, I found lots of pages could not be shown in this widget. It may show only part of pages in your blog.

Another solution provided by bloggodown is that they use feeds of google blogger as the source of random posts. This program works fine for me at first.  Nevertheless, when my blog reaches more than 500 pages, this program uses only the last 500 pages as the source of random posts due to the limit  of max-results parameter in feeds. That is, part of elder pages will not show anymore.

Consequently, I decide to write a program to resolve the problems mentioned above. The main idea is the same as the one provided by bloggodown. I adopt the blogger post list function provided by Google. This results in the fast speed of pages loading. Moreover, my program acquire as least information as we need in the random posts function while bloggodown retrieve all pages in the blog. Therefore, my program works faster and relieve the loading of server. Most importantly, it functions well even if your blog contains more than 500 pages.

What's more, I also add a refresh button (https://lh4.googleusercontent.com/-HTmwWoE-gPI/TgXEh3aHJBI/AAAAAAAACwc/zYVFCKsc0as/RefreshButton.png) in order to let readers make a refresh for the random post list manually. It make your blog acquire more traffic.

The outcome of my program looks like:

image

 

How to use it?

1. Go to Dashboard->Design->Page Elements.

csietw.blogspot.com21

2. Add a Gadget.

csietw.blogspot.com12

3. Add a HTML/JavaScript Gadget.

csietw.blogspot.com22

4. Type the title and the program.

  csietw.blogspot.com32

The program is shown below.

<script type="text/javascript" src="http://sites.google.com/site/csietw123/randomPost.js"></script>
<script type="text/javascript">
numofpost=3;
borderSize=0;
buttomLineSize=1;
refresh_period=-1;
RandomPost();
</script>

The parameter numofpost is the number of random posts shown at once.

The parameter borderSize is the width of border. If you set borderSize as 0, no border would be shown.

The parameter buttomLineSize is the width of dotted line at the buttom of each post. Set buttomLineSize as 0, if you don't like it.

The parameter refresh_period is the period time of automaitc list refresh. If you would like this function off, just set refresh_period as -1.

 image

 image

numofpost=3;
borderSize=0;
buttomLineSize=0;

numofpost=3;
borderSize=2;
buttomLineSize=0;

image 

image

numofpost=3;
borderSize=0;
buttomLineSize=1;

numofpost=3;
borderSize=2;
buttomLineSize=1;

The program is tested with Firefox 3.6、Firefox 4.0、Firefox 5.0、IE 6、IE 7、IE 8、Chrome 5、Opera 10. It works well in terms of speed and compatibility. Feel free to use it!

中華電信研究院面試(口試)經驗

今天去中華電信研究院參加面試。第一階考試段為英文+電信通識,第二階段為口試部份。
英文考題部分為中文翻譯英文,大多是一些辦公室對話,比如:
1. 你有遇到問題時,請聯絡我
2. 他今天不在辦公室,但明天會來
電信通識我聽過有FTTx、ADSL、Chunghwa Telecom等。
而第二階段為主管口試,主要分為2個關卡
第一關基本上是說個人專業的部份。有4個主管聽你使用ppt簡報你自己的工作經驗、專長等等,他們會從中提出問題。比如:你有什麼擅長的技術、你的優缺點、你應徵的職務是否符合專長等等。時間只有15分鐘。
如果你過了第一關,恭喜可以獲得餐盒一個,否則就bye-bye了。給我餐盒的阿姨說下一關是看你的人格特質,記得要微笑。
第二關有2個更高階的主管,會要你念一段英文,並且翻譯成中文。並且問我有什麼「創新」的idea?以及休閒活動在幹麻?如果錄取了要住哪?如果同辦公室你工作最多,那你會怎樣?最後問我有什麼第一關還沒說清楚或問清楚的問題。我問了一些出國受訓的事情。只要表現得好,就有機會到國外大學受訓個半年,或者參與電信規格會議。

最後,就是跟HR談薪水待遇啦!

交通方面,可搭火車到中壢站再搭計程車到中華電信研究所,車程20分鐘,跳表220元。
地址如下:中華電信研究所地址:32601桃園縣楊梅市電研路99號
有興趣的話可以到:中華電信研究所招募/招考/徵才
中華電信研究所宿舍也在園區裡面,單身宿舍(雅房),大概1000多。如果要在附近的中央大學租房子,大概5000元,車程10分鐘左右。
中華電信研究所 松樹林

中華電信研究所 湖景

中華電信研究所 松樹林

中華電信研究所 正門馬路

2024年React state management趨勢

輕量化 在過去Redux 是 React 狀態管理的首選函式庫。 Redux 提供了強大的功能和靈活性,但也帶來了一定的學習成本和複雜度。 隨著 React 生態的不斷發展,越來越多的開發者開始追求輕量化的狀態管理函式庫。 Zustand 和 Recoil 等庫以其簡單易用、性...