2011年12月7日 星期三

BatMan Equation


It's a interesting equation. Here is the matlab code for batman logo.

% Grey axes
axes('Xlim'  ,[-7 7]    , 'Xtick' ,-7:7,...
     'Ylim'  ,[-5 5]    , 'Ytick' ,-5:5,...
     'YtickL',''        , 'XtickL',''  ,...
     'Ygrid' ,'on'      , 'Xgrid' ,'on',...
     'Xcolor',[.8 .8 .8], 'Ycolor',[.8 .8 .8]);
hold on
% Outer wings
f1 = '(x/7)^2 * sqrt(abs(abs(x)-3)/(abs(x)-3)) + (y/3)^2 * sqrt(abs(y + 3/7*sqrt(33))/(y + 3/7*sqrt(33))) - 1';
ezplot(f1,[-8 8 -3*sqrt(33)/7 6-4*sqrt(33)/7]);
% Bottom
f2 = 'abs(x/2)-(3*sqrt(33)-7) * x^2/112 - 3 + sqrt(1-(abs(abs(x)-2)-1)^2) - y';
ezplot(f2,[-4 4]);
% Outer ears
f3 = '9 * sqrt(abs((1-abs(x))*(abs(x)-0.75)) / ((1-abs(x))*(abs(x)-0.75))) - 8*abs(x) - y';
ezplot(f3,[-1    -0.75 -5 5]);
ezplot(f3,[ 0.75  1    -5 5]);
% Inner ears
f4 = '3*abs(x) + 0.75*sqrt(abs((0.75-abs(x))*(abs(x)-.5)) / ((.75-abs(x))*(abs(x)-.5))) - y';
ezplot(f4,[-0.75 0.75 2.25 5]);
% Connect inner ears (flat line)
f5 = '2.25*sqrt(abs(((0.5-x)*(0.5+x))/((0.5-x)*(0.5+x)))) - y';
ezplot(f5,[-0.5 0.5 -5 5]);
% Inner wings
f6 = '6*sqrt(10)/7 + (1.5-0.5*abs(x)) * sqrt(abs(abs(x)-1) / (abs(x)-1)) - 6*sqrt(10)/14 * sqrt(4-(abs(x)-1)^2) - y';
ezplot(f6,[-3 -1 -5 5]);
ezplot(f6,[ 1  3 -5 5]);
% Change line color and width
set(get(gca,'children'),'Color','b','Linew',2)
% Title and labels
title('Batman'); xlabel(''); ylabel('')
% Superimpose black axes with xy-ticklabels
xlbl(1:15,1:2) = ' '; xlbl([1,8,15],:) = ['-7';' 0';' 7'];
ylbl(1:11,1:2) = ' '; ylbl([1,6,11],:) = ['-5';' 0';' 5'];
axes('Xlim'  ,[-7 7], 'Xtick' ,-7:7,...
     'Ylim'  ,[-5 5], 'Ytick' ,-5:5,...
     'YtickL',ylbl  , 'XtickL',xlbl,...
     'Box'   ,'on'  , 'Color' ,'none');

ref:

2011年11月17日 星期四

Ubuntu panel problem

Problem: I can't find the network manager on top panel
Solution:
sudo gedit /etc/NetworkManager/nm-system-settings.conf
# This file is installed into /etc/NetworkManager, and is loaded by 
# NetworkManager by default.  To override, specify: '--config file' 
# during NM startup.  This can be done by appending to DAEMON_OPTS in 
# the file:
#
# /etc/default/NetworkManager
#

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true
Solution2:

1.gconftool --recursive-unset /apps/panel
2.rm -rf ~/.gconf/apps/panel
3.pkill gnome-panel 


ubuntu firefox is already running but is not responding

solution
-open terminal
-killall firefox
- restart your browser

Ubuntu network mangager can't save

 Today I found some problem when I setting static IP for ubuntu 11.04.
I using network manager GUI interface ,and set eth0 manual. After setting up the IP addrerss, i cant't press save button . And the step below can solve the proble.

Here's what I do :
1. Right click on NM applet and choose "Edit Connections"
2. Click "Add" to create a new wired connection.
3. Give it a name, like "Static 192.168.1.150"
4. Click on IPv4 settings
5. Click Method and change to "Manual".
6. Click "Add"
7. Double click on Address bit - enter address, remember to hit return.
8. Do the same for netmask - remember that return button at the end.
9. Do the Gateway, and yep - hit return to save everything.
10. Optionally configure DNS and search domains. I usually stick DNS as the gateway address.
11. Hit Apply and close the dialog.
12. Finally, left click on NM applet and choose your "Static 192.168.1.150" entry.
ref:http://ubuntuforums.org/showthread.php?t=1278133&page=2

2011年11月13日 星期日

Ubuntu Mount ISO image

1.首先我們要建立iso檔的掛載路徑:
sudo mkdir /media/iso && sudo modprobe loop

2.切換到/media的目錄下建立一個iso資料夾:
cd /media
sudo mkdir iso

3.接下來切換到下載好iso的存放路徑下,例如下載好的檔案放在家目錄:
cd ~

4.掛載iso到指定目錄,假設檔案名稱是EPT.iso:
sudo mount -t iso9660 -o loop EPT.iso /media/iso/ 

5.這樣切換到/media/iso就可以看到iso的內容了
cd /media/iso
ls -l

另外如果要卸載iso檔請執行下列指令:
sudo umount /media/iso

Ref:http://ithelp.ithome.com.tw/question/10027617

我的螢幕,依舊飄搖

螢幕送修一個禮拜,良X電子居然打電話來說 :廖先生你好我們初步檢驗你的螢幕怎樣怎樣(這我早就知道啦),那我們會幫你送修,那要是報價不修的話,我們還要多收XXX,聽起來真令人火大,當初宋過去早就知道這些狀況 你還不趕快送 打電話跟我說個爛消息還說要多收錢盡是廢話....你早點送我早點收不就得了 下次還是打電話給三爽的服務好了透過中間的 感覺只是多被剝皮而已。
我好想念我的螢幕喔

To+動名詞


to動名詞 
(1)
be used toa. I'm not used to Taipei traffic conditions.(我不習慣臺北的交通狀況。)
               b. I'm not used to driving in Taipei.(我不習慣在臺北開車。)
(2) confess to a. The thief confessed to the crime(那小偷承認他所犯的罪。)
               b. The thief confessed to having stolen the money.(那小偷承認偷了那筆錢。)
(3) object to   Would you object to going to the Chinese restaurant?
(4) own up to  ... 完全坦白地供認 It takes courage to own up to stealing money.
(5) fall to    The girls fell to (= began) discussing their boyfriends.(這些女孩子開始談論
(6) As to 至於
As to accepting their demand, we must consider it carefully.(
至於接受他們的要求
(7) Owing to failing twice, he had no courage to try again.(因為失敗過兩次﹐ 他沒有勇氣再試了。)

(
)
(1)
inclined prone (都作習性)後面都可接“to+名詞或代名詞﹐但不可接“to+動名詞﹐須改成不定詞。如: 
(a) He's inclined to laziness. (O)(
他生性懶惰。) He's inclined to be lazy. (O)
   He's inclined to being lazy. (×)
(b) He's prone to anger. (O) (
他容易發怒。)   He's prone to be angry. (O)
He's prone to being angry. (×)

(2) agree/consent to
之後既可接原形動詞﹐也可接動名詞﹐但含義不同:“agree/consent to+原形動詞是主詞應他人之請求而承諾做某事“agree/consent to+所有格+動名詞是主詞允許他人做某事 如:
    (a) He consented (or agreed) to lend me the money from his own pocket.

(3) be/get/become accustomed to
之後雖然常接動名詞 (或名詞或代名詞)﹐但是在英語中也可接原形動詞 (to 結合而成不定詞)﹐而且兩者的含義並無差異。 如:
(a)
A
You have to take a bus to school. Are you accustomed to that?
BI'm not accustomed to taking a bus to school. I'm accustomed to walking to school.

2011年11月8日 星期二

Linking Verb

連綴動詞

連綴動詞 係連接主詞及其補語主要包括look(看起來)sound(聽起來)smell(聞起來)taste(嚐起來)feel(感覺起來)(也包括Be動詞)等等,其用法如下:


a. 可接形容詞

ex) “I will be able to play for Milan and Galaxy in the same season, hence keeping with my commitment to Major League Soccer in order to develop football in the USA, which is something I feel really passionate about.” (Cited from The China PostBeckham confirms Milan switch until season's end” Mar. 9, 2009)

ex) The music sounds cheerful (愉悅的).

b. 可接like然後名詞子句

ex) What does the little girl look like?

ex) The coat (大衣) feels like wool (羊毛).

ex) The food tastes like beef (牛肉).

ex) The gas smells like CO2.

ex) The superman (超人) looks like he can do almost (幾乎) everything.

ex) Does David feel like he has a fever?

c. 可接as if然後子句,其用法和意義,跟like的後面子句完全相同


*

"This is he."

講到連綴動詞,我們不得不談一個經常被問到的問題;那就是,當你拿起聽筒聽電話時,對方說要找你,那麼你該怎麼回答才算正確? 正確的回答之一是:"This is he [she]." 連綴動詞後面的敘述語應是主格 (主詞) 型態 -- 絕對不是 "This is him." 如果你覺得 "This is he." 聽起來過於拘束,那麼你可以用 "Speaking" 取代之,或者說 "This is John." (把 John 換成你的名字) -- 除非是收帳的人或電話推銷員打來的電話,否則 "This is John." 對每個人 (名叫 John 的人除外) 來說都是一項很好的回答。

  1. http://blog.xuite.net/linchiajung/summary1/22686082
  2. http://www.cybertranslator.idv.tw/grammar/verbs.htm
  3. http://210.240.55.2/~t311/moe/engb3/b3grammar/b3see_linkv.htm