Monthly Archives: October 2006

Label Cloud for Blogger beta

再次感謝Chagg詳細的教學,
我已經將文章分類換成Label Cloud了~

不過我有修改預設的顏色,
參考了phydeaux3的Label Cloud顏色,
將顏色換成
var maxColor = [85,107,47]
var minColor = [218,165,62]

色碼請參考RGB Color Code Chart

語法如下:

不用Expand Widget Templates
插入
/* Label Cloud Styles
----------------------------------------------- */
#labelCloud {text-align:center;font-family:arial,sans-serif;}
#labelCloud .label-cloud li{display:inline;background-image:none !important;padding:0 5px;margin:0;vertical-align:baseline !important;border:0 !important;}
#labelCloud ul{list-style-type:none;margin:0 auto;padding:0;}
#labelCloud a img{border:0;display:inline;margin:0 0 0 3px;padding:0}
#labelCloud a{text-decoration:none}
#labelCloud a:hover{text-decoration:underline}
#labelCloud li a{}
#labelCloud .label-cloud {}
#labelCloud .label-count {padding-left:0.2em;font-size:9px;color:#000}
#labelCloud .label-cloud li:before{content:"" !important}

第二步,插入
]]></b:skin><script type='text/javascript'> // Label Cloud User Variables
var lcBlogURL = 'http://
YOURBLOG.blogspot.com';
var maxFontSize = 20;
var maxColor = [0,0,255];
var minFontSize = 10;
var minColor = [0,0,0];
var lcShowCount = false;
</script>
</head>

紅色的部分換成你的ID

第三,找
<b:widget id='Label1' locked='false' title='Labels' type='Label'/>

將它換成
<b:widget id='Label1' locked='false' title='Label Cloud' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>

<div class=’widget-content’>
<div id=’labelCloud’/>
<script type=’text/javascript’>

// Don’t change anything past this point —————–
function s(a,b,i,x){
if(a>b){
var m=(a-b)/Math.log(x),v=a-Math.floor(Math.log(i)*m)
}
else{
var m=(b-a)/Math.log(x),v=Math.floor(Math.log(i)*m+a)
}
return v
}

var ta=0
var c=[];
var labelCount = new Array();
var ts = new Object;
<b:loop values=’data:labels’ var=’label’>
var theName = “<data:label.name/>”;
ts[theName] = <data:label.count/>;
</b:loop>

for (t in ts){
if (!labelCount[ts[t]]){
labelCount[ts[t]] = new Array(ts[t])
}
}
tz = labelCount.length-1;
lc2 = document.getElementById(‘labelCloud’);
ul = document.createElement(‘ul’);
ul.className = ‘label-cloud’;
for(var t in ts){
for (var i=0;3 > i;i++) {
c[i]=s(minColor[i],maxColor[i],ts[t]-ta,tz)
}
var fs = s(minFontSize,maxFontSize,ts[t]-ta,tz);
li = document.createElement(‘li’);
li.style.fontSize = fs+’px’;
li.style.lineHeight = ‘1’;
a = document.createElement(‘a’);
a.title = ts[t]+’ Posts in ‘+t;
a.style.color = ‘rgb(‘+c[0]+’,’+c[1]+’,’+c[2]+’)’;
a.href = lcBlogURL+’/search/label/’+encodeURIComponent(t);
if (lcShowCount){
span = document.createElement(‘span’);
span.innerHTML = ‘(‘+ts[t]+’) ‘;
span.className = ‘label-count’;
a.appendChild(document.createTextNode(t));
li.appendChild(a);
li.appendChild(span);
}
else {
a.appendChild(document.createTextNode(t));
li.appendChild(a);
}
ul.appendChild(li);
abnk = document.createTextNode(‘ ‘);
ul.appendChild(abnk);
}
lc2.appendChild(ul);
</script>

<noscript>
<ul>
<b:loop values=’data:labels’ var=’label’>
<li>
<b:if cond=’data:blog.url == data:label.url’>
<data:label.name/>
<b:else/>
<a expr:href=’data:label.url’><data:label.name/></a>
</b:if>
(<data:label.count/>)
</li>
</b:loop>
</ul>
</noscript>
<b:include name=’quickedit’/>
</div>

</b:includable>
</b:widget>

Ok,完工!

Advertisements

如何在Blogger beta "繼續閱讀"

感謝Chagg,
我現在終於可以在Blogger將不要在首頁顯示的文章隱藏起來了。

先去Template → Edit HTML → 在Expand Widget Templates前面打勾,

<b:include data='blog'name='all-head-content'/>
<title><data:blog.pageTitle/></title>


<b:skin><![CDATA[/*
之間,插入
<script type="text/Javascript">
function hidePost(postUrl)
{
var label=document.getElementById("fullpost");
if(label!=null){
eA = document.createElement("a");
eA.setAttribute("href",postUrl);
eA.setAttribute("title","Read More");
eA.appendChild(document.createTextNode("...Read More"));
eB = document.createElement("p");
eB.setAttribute("id","read-more");
eB.appendChild(eA);
label.parentNode.appendChild(eB);
label.parentNode.removeChild(label);}
}
</script>

再往下找,將
<p><data:post.body/></p>
換成
<p><data:post.body/></p>
<b:if cond='data:blog.pageType != "item"'>
<b:if cond='data:post.url'>
<script type='text/javascript'>hidePost('<data:post.url/>');</script>
</b:if>
</b:if>

這樣就修改完HTML的部份了!
以後,若文章太長,
便可以在打好文章內容後,將編輯視窗切換到Edit Html,
將不想在首頁出現的部份,
放在<div id=”fullpost”>和</div>之間。


ex6.do

備忘用的 ex6.do (Stata)

*利用cd指定資料所在之工作目錄
cd c:\data\

*用insheet指令讀取文字檔資料
insheet using ex6.txt, clear

*用label data 來為資料檔命名
label data “2003期中考成績”

*用label var 來為變數命名
label var sn “serial number”
label var classyr “年級”
label var gender “性別”
label var depart “科系”
label var h1 “作業一成績”
label var h2 “作業二成績”
label var h3 “作業三成績”
label var h4 “作業四成績”
label var stat “統計成績”
labe var lab “電腦操作成績”

label define gender 1 “male” 0 “female”
label value gender gender

generate female = 1 if gender==0
replace female = 0 if gender==1

label define female 1 “女性” 0 “男性”
label value female female

drop if sn==.


不得閒

真是不得閒,只能休息一天,
現在要先趕出社統作業來,
之前為了準備GRE,社統課本都沒看,
要一面補閱讀進度、一面完成作業。

還有傲慢與偏見,上禮拜的進度我偷懶,讀了中文版的,
不過還好老師還停在Chapter XVI

普統心理學 幾乎完全沒看,
但兩個禮拜後就要考試了。

Is this post-GRE period?

(我的社統課本)


[Fwd] Postapocalypse Now

From October 23, 2006 Vol. 168 No. 17

Continue reading


[Fwd] Postapocalypse Now

From October 23, 2006 Vol. 168 No. 17

Postapocalypse Now
Pop culture’s latest visions of mass destruction feel eerily intimate


By JAMES PONIEWOZIK
Posted Wednesday, Oct. 25, 2006

Does anyone really fear dying in a nuclear blast? In my atomic nightmare, my family survives. A flash of light across the East River in Manhattan; a tremor and roar; a column of flame. Then the questions. Do we pack up the kids and flee? Duct tape the windows and hope for help? How much food is in the pantry? How strong are the locks on the doors?

This morbid fantasy just became a little more plausible. Pariah state North Korea’s purported test of a small A-bomb spotlighted the morbid fantasy of our age: the small-scale, survivable Armageddon.

Even a relatively tiny bomb by nuclear standards might kill hundreds of thousands. But it could leave millions in the same city alive, panicked and beset, and the U.S. changed irrevocably.

And not only neurotic urbanites are willing to imagine what comes after; high and mass culture are on a postapocalyptic kick. Cormac McCarthy’s novel The Road is an unflinching tour of an America rendered barbaric by a fiery cataclysm that ends most life on earth. NBC’s Heroes depicts Manhattan destroyed; on Sci Fi network’s Battlestar Galactica, billions die in a nuclear attack. And the most unlikely fall hit, CBS’s Jericho, has more than 11 million people a week tuning in to visit a Kansas town that survives a nuking that has incinerated untold U.S. cities (taking, presumably, your local CBS affiliate with them).

If there’s a common thread to these disparate works, it’s their intimacy. Jericho, for instance, gives us doomsday as soap opera. The postapocalyptic tales of the cold war–On the Beach, A Canticle for Leibowitz, The Day After, Threads–were books and movies that had conclusions; a TV series is open-ended, like life. Jericho doles out its horror in doses–flickering TV images of ruined cities, radiation victims dead by a lake–and softens it with soap-opera B-plots. The survivors have affairs and family fights; teenagers flirt and throw parties. Chicago may be burning, but somewhere on the Great Plains, The O.C. lives.

Still, Jericho is trying to do something serious: to ask what apocalypse would do to the humanity of us who survive. That is also the question of The Road; its answer is tougher to take. A father and son trudge across a wasteland of burnt trees and skeletons, evading murderers and cannibals. The evil control most of the weapons and scant provisions; the good have, literally, been eaten away. Grim as The Road is, it’s more anguishing emotionally, as the ailing father struggles, out of a febrile love for his son, to keep the boy and hope alive. As opposed to The Road Warrior, it’s heartrendingly realistic, a masterpiece but nearly unbearable. It is also No. 4 on the New York Times best-seller list.

Clearly there’s a hunger for insight, however painful, on the end-time fears particular to our time. The cold war stories could pin the disaster on a simple East-West showdown. The new apocalypses are more shadowy, less ideological. In Jericho, we do not know who attacked or why. In The Road, the cataclysm may have been war, or it may have been an asteroid strike. Who would do this? you might ask these works. Terrorists? A superpower? Americans? God? Their unspoken shrug: Any. All. None. Pick a number.

Here is, I hope, a kind of pack-a-go-bag practicality to this mini-craze. Mass destruction, after all, has been the animating bogey of American politics for more than five years, but we haven’t really thought through what, on a human and social level, it would mean. Could we survive? Would we want to? Would we pull together or feed on one another? That millions can handle the question, in literature or a soft-focus made-for-CBS version, may be testament to our willingness to face the times–to put ourselves mentally, for a while, where Dick Cheney lives 24/7.


That’s the charitable explanation. The more disturbing one is curiosity, fatalism, even, at some level, a measure of acceptance. We need to face our darkest possibilities. And yet, looking at Jericho’s ratings, I have to wonder: Do I want America to be this comfortable with the apocalypse? In Jericho’s yet-unseen outside world, millions of people in cities like mine could be incinerated, starving or in anarchy. But in at least one small town, life goes on, to a pop sound track, without us–without, in fact, much time or verbiage spent mourning us. Sitting in sight of the Manhattan skyline, I would say that’s the scariest story of all.


Termination or Commencement

明天要考試了,今天要來早點睡,不可以再熬夜了,
睡飽明天才有精神,不過應該是睡不飽的。

準備了快一年,終於要上戰場了,
又緊張又興奮,已經開始盤算考完要怎麼犒賞自己一下。

10/28,是個開始,也是個結束,
commencement termination (複習一下)
話說我很喜歡termination這個字,包含開始和結束的意思 (主要還是偏開始)
考完GRE,更多東西等著我忙,
會像當時考完AWA一樣吧,又會有一種茫然的感覺,
太多事情了:要開始準備期中考、托福、預官、申請學校。

一件一件完成吧!
先完成明天的GRE再說。