2022年9月25日 星期日

20220922夢紀錄

 紀錄做過的特別的夢。


不知為何一群人跑到我家做事,一個公用辦公室的概念。

我喜歡的K氏也在裡面,我安排單獨的房間給她。

偶而經過瞄一下,似乎在修著什麼東西。

轉眼間到了傍晚,人漸漸離開,我坐在客廳沙發上翹著腿看電視。

K出來了,坐下來背對著我,把一個東西放桌上,似乎是沒修好,不太開心的樣子。

我把東西拿起來看了一下,說「這把*****換一下就可以了,我來處理」,接著我轉頭喊她

「K」

K沒理我,我也沒出聲,就這樣讓空間維持靜默

過了一段時間,K轉身倒向我,我順勢抱住她,她開始在我懷裡扭動,同時抱怨著已經盡力了但大家還是有意見云云

我聽著,同時享受她在我懷裡的觸覺,逮到機會親了她的額頭,接著是太陽穴、臉頰、下顎、頸項,最後稍微強硬地將她轉身,準備奪取她的嘴唇。

K輕微反抗了一下,但無路可逃,只能接受我輕輕一啄。

接著她撇過頭,離開我的唇,幽幽地說了句

「只有這一次而已喔」

「好,只有這次」

彷彿要將兩人融為一體般,我用力地將她抱個滿懷。


然後我就醒了。

20220913夢之二

 紀錄做過的夢


情境似乎是我離職待業中,到朋友的公司串門子兼幫忙

場景有3個人,前男性同事PY氏,很久以前的女性同事SL氏,還有一個我不認識的屁孩

這個屁孩對我很不友善,常常出言嘲笑我,後來我覺得與其在這邊招人討厭,不然離開好了

這個時候他們三人坐在一張大工作桌上做事。

就在我離開經過他們的時候,忽然屁孩拿一個硬幣丟我,我一下子怒上心頭,把硬幣撿起來丟回去,順便罵了一句國罵。

那個屁孩似乎覺得很有趣,又把硬幣拿起來丟我。

就這樣來來回回好幾次,我每次砸回去都罵一句國罵,而且一次比一次難聽,最後那個屁孩被我罵到哭出來。

然後我就醒了...。

這個過程中另外兩個人都無動於衷。


20220913 夢之一

 紀錄做過的夢-20220913


這天沒睡好,半夜2點多才睡

在將睡要睡時,忽然有種房間有人的感覺

接著感覺到床鋪有動作,似乎有人坐到床沿上

從側睡的姿勢回頭看,看到一個短髮女性的輪廓面向我這邊,臉像是黑霧一般看不清楚

那種感覺像是家人坐在床邊看著你或是要幫你蓋被子時的感覺

不過我知道房子裡只有我一個人,於是我不管他,轉回來埋頭繼續睡...

2014年5月27日 星期二

到不了



范瑋琪寫給前男友的歌,聽說黑人為此吃醋不已。

旋律簡單好學,可以歸類為芭樂歌,但歌詞意境卻相當扣人心弦。
最喜歡的歌詞是前兩句
「你眼睛會笑    彎成一條橋」
每次看見她的笑容,就會想到這句歌詞

2014年5月22日 星期四

淚眼矇矓

還是相聲瓦舍20年大劇-鄧力軍的插曲
這次是第二幕結尾曲
「中場休息15分鐘~」

淚眼朦朧  窗外明月是那樣的溫柔
彷彿是你用溫暖的雙手  哦  將我輕輕碰
四處飄泊  我用情一生卻換來寂寞
而歲月不知不覺地走過  問我留下些什麼
出現在夢中  終於明白對你的愛依舊
是折磨  還躲在傷心絕望的角落
與你再相逢  是我日夜期待已久的夢
又錯過  原來情緣早已消散風中
淚眼朦朧  窗外明月是那樣的溫柔
彷彿是你用溫暖的雙手  哦  將我輕輕碰
四處飄泊  我用情一生卻換來寂寞
而歲月不知不覺地走過  問我留下些什麼

2014年5月20日 星期二

斷橋

照樣是相聲瓦舍20年大劇-鄧力軍的插曲
這是第二幕開場插曲
「來來來,唱完這首歌,再說吧」

與君一席酒  飲畢話別休
燃燭又見瘦  夢醒孤鵲樓
此情難長久  曲畢又三秋
憐影還拂袖  不忍上心頭

窗外懸一輪明月  映落在澄鏡湖面  微風切
切過那垂柳河邊  斑剝鳴咽
我聽見  我無言  還想著分手那夜
望著你消失不見  我的心痛徹撕裂

想起你哭泣的臉  又燃起無盡思念
這些年  你不在我的身邊  是否如願
我站在河堤邊  斷橋上望著秋月
遠方的飄落殘葉隨風層疊  說離別

2014年5月16日 星期五

弄堂

第一次是在相聲瓦舍的相聲劇大作-鄧力軍裡聽到
該劇全部的音樂歌曲皆由張穆庭製作
這首是片尾曲
Youtube上可以搜出好幾個結果,但我最喜歡這個
當然是因為洪瑞襄的緣故

繁華散盡 落葉飄
徒然一身幽居嘆寂寥
迎風身影燈火照 但求醉臥在今宵
不知何時才能 與你再相逢 也許是多年以後
此情忘不了 深藏在心中 但願你會記得我
如果不能與你長相守 只願我能化成飛煙隨你走
就在夢中一笑別離後 淚珠滑落臉龐 更心痛
如果不能與你長相守 只願我能化成飛煙隨你走
多年以後往事再回首 笑我一生孤獨 全成空

2014年5月10日 星期六

多組RadioButtonList互斥

一個同事的發問...

他在畫面上放了 3 組 RadioButtonList,希望其中一組選到時,另兩組可以自動清空選擇,於是我寫了這個範例

基本上兩種做法,偷懶的做法是放個 UpdatePanel,把 RadioButtonList 們都扔進去,比較好的做法是用 javascript 在 client 上處理。

首先是偷懶的做法
這是 aspx,有 3 個 RadioButtonList,都設定 SelectedIndexChanged 事件和設定 AutoPostBack=true
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:RadioButtonList ID="rbl1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
                OnSelectedIndexChanged="rbl1_SelectedIndexChanged" AutoPostBack="true">
                <asp:ListItem>Car</asp:ListItem>
                <asp:ListItem>Motocycle</asp:ListItem>
                <asp:ListItem>Bicycle</asp:ListItem>
            </asp:RadioButtonList>
            <br />
            <br />
            <asp:RadioButtonList ID="rbl2" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
                OnSelectedIndexChanged="rbl2_SelectedIndexChanged" AutoPostBack="true">
                <asp:ListItem>Apple</asp:ListItem>
                <asp:ListItem>Mango</asp:ListItem>
                <asp:ListItem>Pineapple</asp:ListItem>
            </asp:RadioButtonList>
            <br />
            <br />
            <asp:RadioButtonList ID="rbl3" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow"
                OnSelectedIndexChanged="rbl3_SelectedIndexChanged" AutoPostBack="true">
                <asp:ListItem>Frog</asp:ListItem>
                <asp:ListItem>Cat</asp:ListItem>
                <asp:ListItem>Dog</asp:ListItem>
            </asp:RadioButtonList>
        </ContentTemplate>
    </asp:UpdatePanel>
</form>
然後這是 aspx.cs
protected void rbl1_SelectedIndexChanged(object sender, EventArgs e)
{
    RadioButtonList radioButtonList = sender as RadioButtonList;
    if (radioButtonList.SelectedIndex > -1)
    {
        rbl2.SelectedIndex = -1;
        rbl3.SelectedIndex = -1;
    }
}

protected void rbl2_SelectedIndexChanged(object sender, EventArgs e)
{
    RadioButtonList radioButtonList = sender as RadioButtonList;
    if (radioButtonList.SelectedIndex > -1)
    {
        rbl1.SelectedIndex = -1;
        rbl3.SelectedIndex = -1;
    }
}

protected void rbl3_SelectedIndexChanged(object sender, EventArgs e)
{
    RadioButtonList radioButtonList = sender as RadioButtonList;
    if (radioButtonList.SelectedIndex > -1)
    {
        rbl2.SelectedIndex = -1;
        rbl1.SelectedIndex = -1;
    }
}

接著我們用 jquery 來做
一樣在 aspx 上放 3 個 RadioButtonList,然後把所有的 radio 都註冊 click 事件,當一個 radio 被 checked 時,往上找該 radio 的容器,然後把另兩個容器裡的 radio 都 uncheck
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestRadioButtonListExclusive.WebForm1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>用 jquery</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript">
        //註冊所有 radio 的 click 事件
        $(document).ready(function(){
            var containers=["<%=rbl1.ClientID %>","<%=rbl2.ClientID %>","<%=rbl3.ClientID %>"];

            for(var i=0;i<containers.length;i++){
                $("#"+containers[i]+" :radio").each(function(){
                    $(this).click(function(event){
                        SetOtherRadioButtonListUncheck(this);
                    });
                });
            }
        });
        
        function SetOtherRadioButtonListUncheck(rObj){
            var containers=["<%=rbl1.ClientID %>","<%=rbl2.ClientID %>","<%=rbl3.ClientID %>"];
            
            //抓上層容器, RepeatLayout=Flow的話抓最近的span, RepeatLayout=Flow的話抓最近的table
            //var parentObj=$(rObj).closest("span"); //RepeatLayout=Flow
            var parentObj=$(rObj).closest("table"); //RepeatLayout=Table
            var parentId=parentObj.get(0).id;
            
            for(var i=0;i<containers.length;i++){
                //若不是觸發事件的容器, 則將該容器裡的radio uncheck
                if(containers[i]!=parentId){
                    $("#"+containers[i]).find(":radio").each(function(){
                        this.checked=false;
                    });
                }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:RadioButtonList ID="rbl1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table">
            <asp:ListItem>Car</asp:ListItem>
            <asp:ListItem>Motocycle</asp:ListItem>
            <asp:ListItem>Bicycle</asp:ListItem>
        </asp:RadioButtonList>
        <br />
        <br />
        <asp:RadioButtonList ID="rbl2" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table">
            <asp:ListItem>Apple</asp:ListItem>
            <asp:ListItem>Mango</asp:ListItem>
            <asp:ListItem>Pineapple</asp:ListItem>
        </asp:RadioButtonList>
        <br />
        <br />
        <asp:RadioButtonList ID="rbl3" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table">
            <asp:ListItem>Frog</asp:ListItem>
            <asp:ListItem>Cat</asp:ListItem>
            <asp:ListItem>Dog</asp:ListItem>
        </asp:RadioButtonList>
    </form>
</body>
</html>

2014年4月29日 星期二

使用匿名方法賦值給匿名類別的屬性

好繞口... 

以北風資料庫的Products table 為例,假設我想做一個某家供應商的產品List,並把價格提高10%,於是我這麼寫...
var v = from product in dtNorthwindProduct.AsEnumerable()
        where product.Field<int>("SupplierID") == 1
        select new
        {
            pid = product.Field<int>("ProductID"),
            //以匿名方法重新計算價格
            price = () =>{ return product.Field<decimal>("UnitPrice") * 1.1M }
        };
.NET很乾脆地給我錯誤...

因為初始匿名型別的屬性有兩個限制
  1. 不能是null
  2. 不能用匿名方法賦值
所以要這麼寫...
var v = from product in dtNorthwindProduct.AsEnumerable()
        where product.Field<int>("SupplierID") == 1
        select new
        {
            pid = product.Field<int>("ProductID"),
            //以匿名方法重新計算價格
            price = new Func<decimal>(() => { return product.Field<decimal>("UnitPrice") * 1.1M; }).Invoke()
        };
就可以了...

參考連結
C#/.NET Little Wonders: The Joy of Anonymous Types
Assigning property of anonymous type via anonymous method

2014年4月24日 星期四

以 regular expression 驗證 Email 格式

筆記用...

檢查字串
/^.+@.+\..+$/

C#
public bool CheckEmailFormat(string email)
{
    //c#裡要把前後的斜線拿掉
    string emailFormat = @"^.+@.+\..+$";
    System.Text.Reqex reg = new System.Text.Regex(emailFormat);
    return reg.IsMatch(email);
}

Javascript
function IsEmail(value) {
    var objRegExp = /^.+@.+\..+$/;

    if (!objRegExp.test(value))
        return false;
    return true;
}

2014年3月17日 星期一

Supercell-ヒーロー


2014年3月12日 星期三

Supercell-君の知らない物語


每回聽這首歌就會想到戰場原的告白,然後眼睛就流汗了啊!!

2014年3月6日 星期四

使用ODP.NET連線出現 "Connection must be open for this operation" 錯誤

但其實不是connection沒開的問題,ODP.NET根本在整人...

2014年2月28日 星期五

Epic Split

一切都起源於這個Volvo廣告


接著宇宙最強的男人在聖誕節前後發表了這個惡搞版

基於是宇宙最強的男人,我想這還是可能的

最新消息,尚克勞德范達美不甘示弱

宇宙最強的男人會怎麼回應呢?讓我們看下去...

Let It Go - Demi Lovato


"Let It Go"
Let it go, let it go
Can't hold it back anymore
Let it go, let it go
Turn my back and slam the door

The snow glows white on the mountain tonight,
Not a footprint to be seen.
A kingdom of isolation and it looks like I'm the queen.
The wind is howling like this swirling storm inside.
Couldn't keep it in, Heaven knows I tried.

Don't let them in, don't let them see,
Be the good girl you always had to be.
Conceal, don't feel, don't let them know.
Well, now they know.

Let it go, let it go
Can't hold it back anymore
Let it go, let it go
Turn my back and slam the door
And here I stand and here I'll stay
Let it go, let it go
The cold never bothered me anyway

It's funny how some distance makes everything seem small
And the fears that once controlled me can't get to me at all.
Up here in the cold thin air I finally can breathe.
I know I left a life behind but I'm too relieved to grieve.

Let it go, let it go
Can't hold it back anymore
Let it go, let it go
Turn my back and slam the door
And here I stand, and here I'll stay
Let it go, let it go
The cold never bothered me anyway

Standing frozen
In the life I've chosen.
You won't find me.
The past is all behind me
Buried in the snow.

Let it go, let it go
Can't hold it back anymore
Let it go, let it go
Turn my back and slam the door
And here I stand, and here I'll stay
Let it go, let it go
The cold never bothered me anyway, yeah, whoa
(Na na, na na, na na na na) [4x]
Let it go yeah
Na, na.
Here I stand.
Let it go, let it go, oh
Let it go.

Let It Go - Idina Menzel



Let It Go


The snow glows white on the mountain tonight
Not a footprint to be seen
A kingdom of isolation,
And it looks like I’m the Queen.

The wind is howling like this swirling storm inside
Couldn’t keep it in, heaven knows I tried

Don’t let them in, don’t let them see
Be the good girl you always have to be
Conceal, don’t feel, don’t let them know
Well, now they know

Let it go, let it go
Can’t hold it back anymore
Let it go, let it go
Turn away and slam the door

I don’t care
What they’re going to say
Let the storm rage on,
The cold never bothered me anyway

It’s funny how some distance
Makes everything seem small
And the fears that once controlled me
Can’t get to me at all

It’s time to see what I can do
To test the limits and break through
No right, no wrong, no rules for me
I’m free

Let it go, let it go
I am one with the wind and sky
Let it go, let it go
You’ll never see me cry

Here I stand
And here I'll stay
Let the storm rage on

My power flurries through the air into the ground
My soul is spiraling in frozen fractals all around
And one thought crystallizes like an icy blast
I’m never going back,
The past is in the past

Let it go, let it go
And I'll rise like the break of dawn
Let it go, let it go
That perfect girl is gone

Here I stand
In the light of day
Let the storm rage on,
The cold never bothered me anyway

這是內建中文翻譯版本

2014年2月6日 星期四

春節記事-黑貓

(這圖是隨便抓來的,當時光線不夠,手機拍不起來)

大年初一凌晨,照慣例跟家人到附近土地公廟拜拜,一點半拜完離開時,突然聽到身後傳來一聲喵叫聲,回頭瞧半天卻不見喵影。
轉過身來竟看到一隻黑貓,毛色黑的像要融入背景,黃色的眼睛像懸在半空中似的,直勾勾地盯著我看。
難得遇到貓跟我對看超過3秒鐘沒逃跑的,於是我蹲下來對牠伸出手。沒想到這傢伙不理我的手,直接晃到我身後靠著我蹭了幾下,接著繞回前面,在距離一步的地方,背對我直挺挺的坐著,看著前方。
我試探著摸了摸牠的頭,不理我;在牠後頸抓了幾下後順著背部摸下來,不理我;改往下巴撓幾下,還是不理我。

整個就超~淡~定~

好吧,我被冷落了,只好再摸兩下頭後離開。

回到家後,摸摸口袋,原本帶去土地公廟要化掉的,以前在媽祖廟拿的護身符,不見了...

微妙...

2013年11月20日 星期三

全家Asahi WONDA coffee X 涼宮立體

其實...本來只是要去買飲料的。

2013年11月19日 星期二

The Hobbit Soundtrack - Song of the Lonely Mountain


Far over the Misty Mountains rise
Leave us standing upon the height
What was before we see once more
Is our kingdom a distant light

Fiery mountain beneath the moon
The words unspoken, we'll be there soon
For home a song that echoes on
And all who find us will know the tune

Some folk we never forget
Some kind we never forgive
Haven't seen the back of us yet
We'll fight as long as we live

All eyes on the hidden door
To the Lonely Mountain born
We'll ride in the gathering storm
Until we get our long forgotten gold

We lay under the Misty Mountains cold
In slumbers deep, and dreams of gold
We must awake, our lives to make
And in the darkness a torch we hold

From long ago when lanterns burned
Until this day our hearts have yearned
A fate unknown, the Arkenstone
What was stolen must be returned

We must awake and make the day
To find a song for heart and soul

Some folk we never forget
Some kind we never forgive
Haven't seen the end of it yet
We'll fight as long as we live

All eyes on the hidden door
To the Lonely Mountain born
We'll ride in the gathering storm
Till we get our long forgotten gold

Far away the Misty Mountains cold.

Two Steps From Hell - Back to the Earth


look at your watch with a perilous gaze
a troubled stare
and when i ask where do we go
say you don't care

call on me
when the day is dark
never too late you're underrated

whatever your sins, whatever your loss
your cup is filled
there is no way to turn back the clock
no one will

call on me
there's fire in your heart
lying in wait just like a lion

maybe we should go back to the earth
and live off the sun
maybe we should crawl in the dirt
before we run

a thousand years of art and song
love and war
tell me why you joined the club
what are you fighting for

all hands on deck
a suicidal race
prop up the good and smother the hate

the wall is high the sun is low
the four winds roar
wide-eyed children fill the streets
to take back the score
there is no truth
that lies can make
no willing soldiers in the wave

maybe we should go back to the earth
and live off the sun
maybe we should crawl in the dirt
before we run

life is fragile
the fire of a sparrow
will end
and the same goes for us
born from the same rain and dust

maybe we should go back to the earth
and life will grow
and the river soon to return
and a plan unfold

look at your watch with a perilous gaze
a troubled stare
and when i ask where do we go
say you don't care

call on me
when the day is dark
never too late, you're underrated