2005年12月31日

Nov. 12th, 2005

One of the biggest days of my life.

Interview was going on very well, I shaw my personal best to the interviewers and they were statisfied, but in the last round(HR interview) Heason asked me a question, which I don’t want to be asked, it’s a sudden strike, my face turn red. I didn’t want to tell a lie therefore I told the truth….

Before that I was confident that I would get a offer, but this question made it noncommittal.

Then I went back to school, I was nervous…

22:09
My mobile phone rang up, that guy said: Congratulations!….

I got the offer from Tencent!!! Yeah!

November 10,2005


Between Hell and Heaven

Where I will go, I don’t know now….gone with my heart

UU has failed, how could I comfort UU? I can’t fall asleep now…

logo_top.gif



http://www.ylyq.net/bmp/0014.mp3

Sinead O’Connor

I think it’s the best edition, even better than Madonna’s and Brightman’s! I like it

B000003JBI.01.LZZZZZZZ.jpg


2005年12月30日

Love at First Sight
by Wislawa Szymborska


they’re both convinced
that a sudden passion joined them.
such certainty is more beautiful,
but uncertainty is more beautiful still.


since they’d never met before, they’re sure
that there’d been nothing between them.
but what’s the word from the streets, staircases, hallways–
perhaps they’ve passed by each other a million times?

i want to ask them
if they don’t remember–
a moment face to face
in some revolving door?
perhaps a "sorry" muttered in a crowd?
a curt "wrong number"caught in the receiver?–
but i know the answer.
no, they don’t remember.

they’d be amazed to hear
that chance has been toying with them
now for years.

not quite ready yet
to become their destiny,
it pushed them close, drove them apart,
it barred their path,
stifling a laugh,
and then leaped aside.

there were signs and signals,
even if they couldn’t read them yet.
perhaps three years ago
or just last tuesday
a certain leaf fluttered
from one shoulder to another?
something was dropped and then picked up.
who knows, maybe the ball that vanished
into childhood’s thicket?

there were doorknobs and doorbells
where one touch had covered another
beforehand.
suitcases checked and standing side by side.
one night. perhaps, the same dream,
grown hazy by morning.

every beginning
is only a sequel, after all,
and the book of events
is always open halfway through.

一见钟情

他们彼此深信
是瞬间迸发的热情让他们相遇
这样的确定是美丽的
但变幻无常更为美丽
他们素未谋面
所以他们确定彼此并无任何瓜葛
但是自街道、楼梯、大堂
传来的话语……
他们也许擦肩而过100万次了吧
我想问他们是否记得
在旋转门面对面那一刹
或是在人群中喃喃道出的对不起
或是在电话的另一端道出的打错了
但是我早知道答案
是的
他们并不记得
他们会很讶异
原来缘分已经戏弄他们多年
时机尚未成熟
变成他们的命运
缘分
将他们推进
距离
阻挡他们的去路
忍住笑声
然后闪到一旁

Motocoder, Motorola’s developer center, has released an article about the JSR 135, better known as the Mobile Media API.



The article includes a working example of an application that allows to capture images by camera.



Download the article ( pdf )


The proposed Multimedia API specification provides a high-level
interface to sound and multimedia capabilities of a device running
J2ME. The target is to enable versatile multimedia functionality in
J2ME applications. The specification willl address the scalability of a
Multimedia API for various devices. To focus the effort, care will be
given to ensure that this API will support basic sound functionality on
constrained memory devices, with the possibility of additional
functionality supported by more capable devices

播放单

try
{
    Manager.playTone(ToneControl.C4, 5000
    /* millisec */, 100 /* max vol */);
}
catch (MediaException e){}

简单媒体重放功能实现:

try
{
    Player p = Manager.createPlayer
    ("http://webserver/music.mp3");
    p.setLoopCount(5);
    p.start();
}
catch (IOException ioe){}
catch (MediaException me){}


重放控制:

static final long SECS_TO_MICROSECS = 1000000L;
Player p;
VolumeControl vc;
try {
    p = Manager.createPlayer("http://webserver/music.mp3");
    p.realize();
    // Set a listener.
    p.addPlayerListener(new Listener());
    // Grab volume control for the player.
    // Set Volume to max.
    vc = (VolumeControl)p.getControl
    ("VolumeControl");
    if (vc != null)
    vc.setLevel(100);
    // Set a start time.
    p.setMediaTime(5 * SECS_TO_MICROSECS);
    // Guarantee that the player
    can start with the smallest latency.
    p.prefetch();
    // Non-blocking start
    p.start();
} catch (IOException ioe){}
catch (MediaException me){}

class Listener implements PlayerListener
{
    public void playerUpdate(Player p,
    String event, Object eventData)
    {
        if (event == END_OF_MEDIA || event == STOP_AT_TIME)
        {
            System.out.println
            ("Done processing");
            try {
                p.setMediaTime
                (5 * SECS_TO_MICROSECS);
                p.start();
            } catch (MediaException me){}
            break;
        }
    }
}


实现MIDI重放控制:

Player p;
TempoControl tc;

try {
    p = Manager.createPlayer
    ("http://webserver/tune.mid");
    p.realize();

    // Grab the tempo control.
    tc = (TempoControl)p.getControl
    ("TempoControl");
    tc.setTempo(120000);
    // 120 beats/min
    p.start();

} catch (IOException ioe)
{
} catch (MediaException me)
{
}


视频重放功能实现:

Player p;
VideoControl vc;

try {
    p = Manager.createPlayer
    ("http://webserver/movie.mpg");
    p.realize();

    // Grab the video control
    and set it to the current display.
    vc = (VideoControl)p.getControl
    ("VideoControl");
    if (vc != null)
    {
        Form form = new Form("video");
        form.append
        ((Item)vc.initDisplayMode
        (vc.USE_GUI_PRIMITIVE, null));
        Display.getDisplay(midlet)
        .setCurrent(form);
    }

    p.start();

} catch (IOException ioe)
{
} catch (MediaException me)
{
}


播放RMS内存储的数据:

RecordStore rs;
int recordID;
: // code to set up the record store.

try {
    InputStream is = new
    ByteArrayInputStream
    (rs.getRecord(recordID));
    Player p = Manager.createPlayer
    (is, "audio/X-wav");
    p.start();
} catch (IOException ioe)
{
} catch (MediaException me)
{
}


播放Jar文件中存储的媒体

/** Notice that in MIDP 2.0,
the wav format is mandatory only */
/** in the case that the
device supports sampled audio. */

try {
    InputStream is =
    getClass().getResourceAsStream
    ("audio.wav");
    Player p = Manager.createPlayer
    (is, "audio/X-wav");
    p.start();
} catch (IOException ioe)
{
} catch (MediaException me)
{
}


不同Player的同步

Player p1, p2;
try {
    p1 = Manager.createPlayer
    ("http://webserver/tune.mid");
    p1.realize();
    p2 = Manager.createPlayer
    ("http://webserver/movie.mpg");
    p2.realize();
    p2.setTimeBase(p1.getTimeBase());
    p1.prefetch();
    p2.prefetch();
    p1.start();
    p2.start();
} catch (IOException ioe)
{
} catch (MediaException me)
{
}


产生单音序列

byte tempo = 30;
// set tempo to 120 bpm
byte d = 8;
// eighth-note

byte C4 = ToneControl.C4;
byte D4 = (byte)(C4 + 2);
// a whole step
byte E4 = (byte)(C4 + 4);
// a major third
byte G4 = (byte)(C4 + 7);
// a fifth
byte rest = ToneControl.SILENCE;
// rest

byte[] mySequence = {
    ToneControl.VERSION, 1,
    // version 1
    ToneControl.TEMPO, tempo,
    // set tempo
    ToneControl.BLOCK_START, 0,
    // start define "A" section
    E4,d, D4,d, C4,d, E4,d,
    // content of "A" section
    E4,d, E4,d, E4,d, rest,d,
    ToneControl.BLOCK_END, 0,
    // end define "A" section
    ToneControl.PLAY_BLOCK, 0,
    // play "A" section
    D4,d, D4,d, D4,d, rest,d,
    // play "B" section
    E4,d, G4,d, G4,d, rest,d,
    ToneControl.PLAY_BLOCK, 0,
    // repeat "A" section
    D4,d, D4,d, E4,d, D4,d, C4,d
    // play "C" section
};

try{
Player p = Manager.createPlayer
(Manager.TONE_DEVICE_LOCATOR);
p.realize();
ToneControl c = (ToneControl)
p.getControl("ToneControl");
c.setSequence(mySequence);
p.start();
} catch (IOException ioe)
{
} catch (MediaException me)
{
}


语音捕获和录音功能的实现

try
{
    // Create a DataSource that
    captures live audio.
    Player p = Manager.createPlayer
    ("capture://audio");
    p.realize();
    // Get the RecordControl,
    set the record location, and
    // start the Player and
    record for 5 seconds.
    RecordControl rc =
    (RecordControl)p.getControl
    ("RecordControl");
    rc.setRecordLocation
    ("file:/tmp/audio.wav");
    rc.startRecord();
    p.start();
    Thread.currentThread()
    .sleep(5000);
    p.stop();
    rc.stopRecord();
    rc.commit();
} catch (IOException ioe)
{
} catch (MediaException me)
{
} catch (InterruptedException e)
{
}


实现摄像功能

Player p;
VideoControl vc;

// initialize camera
try {
    p = Manager.createPlayer
    ("capture://video");
    p.realize();

    // Grab the video control
    and set it to the current
    display.
    vc = (VideoControl)p.getControl
    ("VideoControl");
    if (vc != null)
    {
        Form form =
        new Form("video");
        form.append((Item)vc.initDisplayMode
        (vc.USE_GUI_PRIMITIVE, null));
        Display.getDisplay(midlet).setCurrent(form);
    }

    p.start();

} catch (IOException ioe)
{
} catch (MediaException me)
{
}

// now take a picture
try {
    byte[] pngImage =
    vc.getSnapshot(null);

    // do something with the image …
} catch (MediaException me)
{
}

转移自原来Blog的文章,搬家原因是Yam.com说台湾是一个国家。。。




IMHO, I don’t like F.I.R, but when I was in Beijing, I heard this song
in my friend’s car. I was in black mood and sink into a state of
depression, I was enwrapped by this pure song. I asked my friend to
repeat this song again and again, he said I was crazy.



Then when I went back to Canton, I bought a F.I.R CD, by I was
disappointed, I cound’t find that feel again. I thought that is because
of my bad sound card and earphone….



But yesterday I saw a demo edition, I understand finally! I heard in
Beijing was the demo edition, I found it again after one month’s
searching…Yesterday I was listening to it for the whole silent
night…

转移自原来Blog的文章,搬家原因是Yam.com说台湾是一个国家。。。

Why I want to create my blog? First, I saw Horst’s and Nikolay’s blog,
it is funny, sharing everything every time with your friends. And the
second, one week in Germany, I known I have to improve my English, for
my future, for my friends, I want to let them see a new Ben next time,
Ben++ :) .


I just recieved the email from Annika, she is in Barcelona. I sent my
birthday wishes to her, I was worrying about her, a strange contry and
a strange language, but I trust her. Now everything is fine, I am happy
now.


Horst is always busy and crazy, I hope he will keep healthy!

Friday is a nice day,isn’t it?


UU is coming back from Beijing…Yeah!