Friday, July 02, 2010

花東行memo

住:

花蓮

花蓮國軍英雄館
http://www.netete.com/hero/about.htm
花蓮市花崗街56號
兩人套房1400

樺城民宿
http://www.leehome-taroko.com.tw/order.htm
花蓮縣新城鄉新城村中正路30號
兩人套房1000

花蓮縣勞工育樂中心
http://www.labor038563461.com/index.asp
花蓮縣花蓮市富安路199號
兩人房1000

民宿-六號美宿館
http://hs101.com.tw/news/index.php
花蓮市國盛八街95號
兩人房1200

台東

原住民文化會館
http://www.tac-hotel.com.tw/hotel.html
台東市中山路10號
兩人房1150

假期商務旅館
http://www.easytravel.com.tw/ehotel/default.aspx?n=7301
台東市正氣路147號
兩人房1000

馨園商務旅館
http://www.happyin.com.tw/
台東市中山路402號
兩人房1000-1400

高雄



行:

Sunday, June 27, 2010

mms location

音樂
ASIAFM衛星音樂台 321 mms://bcr.media.hinet.net/RA000004
Apple line 蘋果線上 248 mms://bcr.media.hinet.net/RA000001
BestRadio 台中好事903 211 mms://bcr.media.hinet.net/RA000010
BestRadio 台北好事989 212 mms://bcr.media.hinet.net/RA000013
BestRadio 花蓮好事935 303 mms://bcr.media.hinet.net/RA000011
BestRadio 高雄港都983 213 mms://bcr.media.hinet.net/RA000012
Flyradio飛揚調頻895 357 mms://bcr.media.hinet.net/RA000019
KISS RADIO 南投廣播 258 mms://bcr.media.hinet.net/RA000043
KISS RADIO 台南知音廣播 255 mms://bcr.media.hinet.net/RA000044
KISS RADIO 大苗栗廣播 256 mms://bcr.media.hinet.net/RA000041
KISS RADIO大眾廣播電台 156 mms://bcr.media.hinet.net/RA000040
KISSRadio 網路音樂台 308 mms://bcr.media.hinet.net/RA000042
POP Radio 370 mms://bcr.media.hinet.net/RA000080
中廣古典網 162 mms://bcr.media.hinet.net/RA000005
中廣流行網 205 mms://bcr.media.hinet.net/RA000009
中廣音樂網i radio 206 mms://bcr.media.hinet.net/RA000007
佳音CCM 340 mms://bcr.media.hinet.net/RA000031
全國廣播音樂網 338 mms://bcr.media.hinet.net/RA000047
台北之音HitFM聯播網 台中 88 mms://bcr.media.hinet.net/RA000035
台北之音HitFM聯播網 台北 222 mms://bcr.media.hinet.net/RA000036
台北之音HitFM聯播網 高雄 90 mms://bcr.media.hinet.net/RA000034
台北愛樂 228 mms://bcr.media.hinet.net/RA000018
台灣之音-音樂 313 mms://bcr.media.hinet.net/RA000061
太陽電台 289 mms://bcr.media.hinet.net/RA000064
奇美古典音樂網 294 mms://bcr.media.hinet.net/RA000014
寶島新聲廣播電台 259 mms://bcr.media.hinet.net/RA000066

生活資訊
ASIA FM92.3亞太電台 295 mms://bcr.media.hinet.net/RA000002
ASIA FM92.7亞州電台 210 mms://bcr.media.hinet.net/RA000003
GOLD FM-台中城市廣播 226 mms://bcr.media.hinet.net/RA000028
GOLD FM-台北健康電台 229 mms://bcr.media.hinet.net/RA000027
IC之音 148 mms://bcr.media.hinet.net/RA000037
佳音廣播電台 201 mms://bcr.media.hinet.net/RA000029
佳音電台2台 250 mms://bcr.media.hinet.net/RA000030
全國廣播 202 mms://bcr.media.hinet.net/RA000068
台中廣播 230 mms://bcr.media.hinet.net/RA000046
台北廣播電台- 都會資訊頻道 208 mms://bcr.media.hinet.net/RA000070
台北廣播電台喔海洋頻道 238 mms://bcr.media.hinet.net/RA000069
大千電台 109 mms://bcr.media.hinet.net/RA000067
大愛網路電台 325 mms://bcr.media.hinet.net/RA000017
宜蘭中山電台 301 mms://bcr.media.hinet.net/RA000065
環宇廣播 282 mms://bcr.media.hinet.net/RA000020
真心之音廣播電台 217 mms://bcr.media.hinet.net/RA000033
青春線上 356 mms://bcr.media.hinet.net/RA000079
飛碟電台 232 mms://bcr.media.hinet.net/RA000072

新聞
NEWS98新聞網 187 mms://bcr.media.hinet.net/RA000073
中廣新聞網 207 mms://bcr.media.hinet.net/RA000008

綜合
台灣之音-華語 315 mms://bcr.media.hinet.net/RA000063
復興廣播電台 短波網 288 mms://bcr.media.hinet.net/RA000026
復興廣播電台 第一網 286 mms://bcr.media.hinet.net/RA000024
復興廣播電台 第二網 287 mms://bcr.media.hinet.net/RA000025
正聲台北調幅台 317 mms://bcr.media.hinet.net/RA000015
正聲台北調頻台 198 mms://bcr.media.hinet.net/RA000016
漢聲光華網-中波 281 mms://bcr.media.hinet.net/RA000075
漢聲光華網-短波 309 mms://bcr.media.hinet.net/RA000077
漢聲廣播電台 215 mms://bcr.media.hinet.net/RA000074
漢聲廣播電台全國調頻網 216 mms://bcr.media.hinet.net/RA000076
綠色和平台灣文化廣播電台 327 mms://bcr.media.hinet.net/RA000032

外語
ICRT 177 mms://bcr.media.hinet.net/RA000038
台灣之音-FM 312 mms://bcr.media.hinet.net/RA000060
台灣之音-亞洲 311 mms://bcr.media.hinet.net/RA000059
台灣之音-歐美及方言 314 mms://bcr.media.hinet.net/RA000062

多元文化
中廣客家頻道 160 mms://bcr.media.hinet.net/RA000006
大漢之音 300 mms://bcr.media.hinet.net/RA000021
寶島客家 241 mms://bcr.media.hinet.net/RA000023
新客家廣播電台 254 mms://bcr.media.hinet.net/RA000048
高屏溪客家電台 298 mms://bcr.media.hinet.net/RA000045

Sunday, March 29, 2009

struct with bit limit

struct data {
int data_1:4;
int data_2:4;
int data_3;
};

int main(int argc, char** argv){
struct data my_data = {
.data_1 = 0;
.data_2 = 1;
.data_3 = 1;
};

my_data.data_2 = my_data.data_2 + 15;
my_data.data_3 = my_data.data_3 + 15;

printf("struct size = %d.\n", sizeof(struct data) );
printf("data_1 = %d.\n", my_data.data_1);
printf("data_2 = %d.\n", my_data.data_2);
printf("data_3 = %d.\n", my_data.data_3);
}

output:
struct size = 8
data_1 = 0
data_2 = 0
data_3 = 16

Saturday, March 21, 2009

Difference between "my" and "local" keyword

Please refer below two examples:

1.
$a = 3.14159;
{
local $a = 3;
print "In block, \$a = $a\n";
print "In block, \$::a = $::a\n";
}
print "Outside block, \$a = $a\n";
print "Outside block, \$::a = $::a\n";

# This outputs
In block, $a = 3
In block, $::a = 3
Outside block, $a = 3.14159
Outside block, $::a = 3.14159

2.
$a = 3.14159;
{
my $a = 3;
print "In block, \$a = $a\n";
print "In block, \$::a = $::a\n";
}
print "Outside block, \$a = $a\n";
print "Outside block, \$::a = $::a\n";

# This outputs
In block, $a = 3
In block, $::a = 3.14159
Outside block, $a = 3.14159
Outside block, $::a = 3.14159

"local" will make global variable with the same name "invisible" temporarily,
"my" will create a new memory space and you can distinguish local and global scope variable.

How variable definition affect GDB access policy?

Consider this defnition:

int x[] = {5,4,3,2,1};
char y[] = {9,8,7,6,5};

Because sizeof(*x) = 4 and sizeof(*y) = 1
GDB will calculate result of x with alignment value of 4 and result of y with alignment value of 1,
therefore we will have such output in GDB:

p (int)*(x+1) --> 4
p (char)*(y+1) --> 8

Eventually, x will be added by 4 and y will be added by 1 then do type casting.

Sunday, March 15, 2009

Linux in Virtualbox with Windows XP as host system

1. Software we need:

Virtualbox to install Linux and X server running on Windows XP to enable X11 forwarding

Pietty:
http://www.csie.ntu.edu.tw/~piaip/pietty/

Virtualbox:
http://www.virtualbox.org/

Xming:
http://sourceforge.net/projects/xming

Linux (Ubuntu, in this example):
http://www.ubuntu.com/

3. Install all software and Linux system

4. In Virtualbox control window:
a. add a new netwotk adapter with "HOST interface" option

5. Login Linux system and get local IP address binding on "HOST interface" network adapter using "ifconfig" command

6. Make sure that SSH server deamon is listening on specific port

7. Login Linux system using pietty by guest IP address and SSH protocol

8. Modify .bashrc as below:
alias v='gvim -font "Monospace 16"'
alias c='clear'
alias l='ls --color'
alias cl='clear; ls -la'
alias gcc='gcc -Wall'
alias h='history'

You will get "small" font size on gvim probably if you do not set fontsize option

9. Modify .vimrc as below:
behave mswin "enable MS windows hbehavior
syntax on "enable syntax
colors desert "color scheme setting
filetype on "enable file type
set number "enable line number
set tabstop=4 "set soft tab space
set cindent "set auto indent
set ignorecase "set case-insensitive search
set hls "highlight search result
set ruler "show current cursor position
set mousef "focus follows mouse
set nocompatible "enable backspace
set backspace=indent,eol,start "enable backspace
nnoremap q :quit "quit by typing 'q' only

You can get more information at this --> http://www.vim.org/

10. Change pietty setting:
connection --> SSH --> X11
Enable X11 forwarding and set display location as "localhost:0.0"

11. Start Xming, login guest Linux system, try "xeyes &" to hceck X window forwarding

Sunday, April 15, 2007

cygwin header file bug?

剛剛試著在自己的NB上面編himax-cc
偶然間發現一個似乎是cygwin bug的敘述

問題出現在/usr/include/cygwin/types.h
其中
#ifndef __u_int8_t_defined
#define __u_int8_t_defined
typedef unsigned char u_int8_t;
#endif
#ifndef __u_int16_t_defined
#define __u_int16_t_defined
typedef __u_int16_t u_int16_t;
#endif
#ifndef __u_int32_t_defined
#define __u_int32_t_defined
typedef __u_int32_t u_int32_t;
#endif
#ifndef __u_int64_t_defined
#define __u_int64_t_defined
typedef __u_int64_t u_int64_t;
#endif

問題出現在__u_int16_t, __u_int32_t, __u_int64_t並未在之前被定義
所以compiler在跑這一段的時候還是不知道到底u_int16_t, u_int32_t, u_int64_t到底應該用什麼樣的type來組合
因此對照/usr/include/sys/types.h中的敘述
我試著把它改成如下

#ifndef __u_int8_t_defined
#define __u_int8_t_defined
typedef unsigned char u_int8_t;
#endif
#ifndef __u_int16_t_defined
#define __u_int16_t_defined
typedef unsigned short u_int16_t;
#endif
#ifndef __u_int32_t_defined
#define __u_int32_t_defined
typedef unsigned int u_int32_t;
#endif
#ifndef __u_int64_t_defined
#define __u_int64_t_defined
typedef unsigned long long u_int64_t;
#endif

就可以動了
不過我懷疑這是cygwin的一個bug

Thursday, December 21, 2006

HTML tag list 網站整理

HTML
http://www.w3schools.com/tags/ref_byfunc.asp

CSS
http://www.w3schools.com/css/css_syntax.asp