Jun
29
2004
You may find out there is one more “blogtimes” picture at the top-right corner recently, I have already adapted Nilesh’s BlogTimes plugin into this site. This is a funny plugin, let the author(and readers) know how many posts you wrote in +hours of days every month+. Unfortunately, there is one limitation: You can NOT give a customized filename like demo part in Nilesh’s page, becuase MT doesn’t support nested tag attribution assignment. How do I solve this problem?
Answer:
1. Do a little hack. Install Kalsey’s Expressions plugin into blog/extlib/MTPlugins (create this directory if it doesn’t exist).
2. Patch blogtimes.pl like this:
— blogtimes.pl.orig Tue Jun 29 13:42:33 2004
+++ blogtimes.pl Tue Jun 29 13:54:52 2004
@@ -33,6 +33,7 @@
use MT::Template::Context;
use MT::Util qw(days_in offset_time);
use GD;
+use MTPlugins::Expressions;
MT::Template::Context->add_container_tag(BlogTimes => \&BlogTimes);
MT::Template::Context->add_tag(BlogTimesWidth => \&BlogTimesWidth);
@@ -43,6 +44,11 @@
sub BlogTimes {
my ($ctx, $args) = @_;
+
+ my $tokens = $ctx->stash(’tokens’);
+ my $builder = $ctx->stash(’builder’);
+ $args = MTPlugins::Expressions::process($ctx, $args);
+
# Default Values
my $chart_type = $args->{style} || ‘bar’;
my $blog = $ctx->stash(’blog’);
@@ -134,8 +140,8 @@
print CHART $img->png;
close CHART;
- my $tokens = $ctx->stash(’tokens’);
- my $builder = $ctx->stash(’builder’);
+# my $tokens = $ctx->stash(’tokens’);
+# my $builder = $ctx->stash(’builder’);
local $ctx->{__stash}{BlogTimesWidth} = $scale_width;
local $ctx->{__stash}{BlogTimesHeight} = $scale_height;
- Call your blogtimes template, note that change the name part:
<MTBlogTimes
textcolor=”#FFFFFF”
linecolor=”#cccccc”
width=”220″
height=”14″
save_dir=”images”
show_text=”on” name=“[MTDate format='blogtimes-%Y-%b']“>
Now it gives a blogtimes file named “blogtimes-2004-Jun.png” as you see, happy ending. Thank you Nilesh and Kalsey to bring these useful plugins to us!
Jun
27
2004
無聊的時候翻翻 server log, 發現這一段怪異的錯誤訊息:
Byte order is not compatible at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al) line 363, at /da1/www/data/blog/lib/MT/PluginData.pm line 28, referer: http://www.fomokka.net/foxfair/
然後就去查了 PluginData.pm, 才發現了這個問題原來是從 Storable.pm 這邊來的(man Storable):
64 bit data in perl 5.6.0 and 5.6.1
This section only applies to you if you have existing data written out by Storable 2.02 or earlier on perl 5.6.0 or 5.6.1 on Unix or Linux which has been configured with 64 bit integer support (not the default). If you got a precompiled perl, rather than running Configure to build your own perl from source, then it almost certainly does not affect you, and you can stop reading now (unless you’re curious). If you’re using perl on Windows it does not affect you.
於是乎,拜請搜尋引擎的神力加持後,我在 TextDrive 的討論版上看到解法了,所以有了這個 diff:
— lib/MT/PluginData.pm.orig Sun Jun 27 21:45:50 2004
+++ lib/MT/PluginData.pm Sun Jun 27 21:50:37 2004
@@ -7,6 +7,7 @@
use strict;
use Storable qw( freeze thaw );
+$Storable::interwork_56_64bit = 1;
use MT::Object;
@MT::PluginData::ISA = qw( MT::Object );
簡單說:就是修正完畢了,但怕我記姓不好所以再把解法放在這裡
ps: TextDrive 跟他的母 project: TextPattern概念不錯,或許 TextDrive 早有人知道,或把他當成是 MT 跟 TextPad 的競爭者也不一定, 但今天偶然發現它,覺得還不錯. 只不過因為早已先用了 MT, 也沒其他力氣跟時間去試用看看就是了。
ps2: Wiki link note: WikiEngines, 裡面好多有關 wiki 的東西,慢慢看啊!
Jun
26
2004
一顆買了不到一年的 SCSI hdd 竟然在昨天陣亡, 連讓我備份資料的機會都沒有,現在只能賭賭運氣看哪時候 boot 可以成功,趕快從裡面挖資料了。得到的一個教訓就是:別貪小便宜買拍賣的HDD,尤其 SCSI HDD 應該可以撐比較久才對,虧我還拿小風扇對著它吹!
這個月薪水袋肥了一點,因為總公司在國外 IPO 了,所有海外員工不能認股,但是加發薪水(一次性). 雖然這樣講很沒前瞻性,但是我想,直接發錢比較實在啦!
我有 Gmail account 了,等著看哪時候可以開始邀請人囉!
Jun
24
2004
溝通障礙之一:拒絕溝通(廢話),比如說自以為總是對的,或是 “懶得跟你說了” 這種心態,都屬於這一類.
溝通障礙之二:你先聽我說!成功的溝通最大的要領是:先聽別人說,瞭解了對方的想法跟看法才知道為什麼需要溝通,如果只是要別人先聽你說,去找清晨遛鳥的老人家幫忙就好,請他把鳥籠跟裡面的小鳥借給你,一口氣把話講完就好,何需溝通?
溝通障礙之三:先行阻絕溝通管道。比如說講到一半的電話被掛掉了,我還沒有那麼好的修養再打一次去問他還有什麼沒講完的嗎?(這不叫溝通,這叫討罵,自己犯賤)
溝通障礙之四:絕不讓步。隨著溝通而來的是某方要妥協,如果雙方都不退讓,那馬上會形成溝通過程中的一道阻礙.
溝通障礙之五:每個人都不主動打破僵局。為什麼一定要是犯錯的一方先啟動溝通的動作?為什麼一定是員工要找老闆溝通?為什麼吵架的情侶一定要有人先道歉?
Jun
09
2004
這段話真是深得我心呀!from horance:
生活就像是被強姦..你要嘛反抗..要嘛就享受…. *
工作就像是在賣春..如果你不行..就換另外一個人來做…. *
社會就像是手淫..全部的事情都要靠著自己的雙手去解決…. *
發薪水就像是月經..一個月不來那麼一次總覺得不能安心!!! *