adsense

2011-12-26

[facebook] 新版網誌 位置

自己的首頁==>滾輪往下滾 會跳出向上面一樣的選項 選擇動態時報==> 網誌

2011-12-19

什麼是 工作 熱情 成長 夢想


前一陣子跟朋友聊到了工作、成長、夢想
馬上讓我想到 C*Cool的部落格 曾說過的話


下面擷取幾句  要看全文  可能還是要移駕到 C*Cool的部落格 去看看


工作是什麼?
『獲得成就感的地方,獲得成就感還可以有錢拿,這就叫做專業』


熱情是什麼?
熱情,是那種會讓你心裡悸動,別人覺得無趣,你卻覺得每一分一秒都甘之如飴的事情。
專業,是那種你做的好棒,別人(不管是不是你老闆)會想掏出錢來請你幫忙的事情。


成長是什麼?
『幹!你不要以為成長就是那種對社會期望屈服的狗屁!』,先說在先,成長就是成長,跟屈服一點關係都沒。
在某個時間點,你回頭看過去的自己,你心裡會有那麼點青澀,那麼點對當時的情節不好意思,臉上泛起了一點點的笑容,
然後大口吸著正當下的空氣,你對自己說:『我終於懂了』。這就是成長。一種甜孜孜的感覺。


夢想呢?
夢想是一個目標,而熱情是一種fu而已。
跟夢想最接近的詞,其實是『執行』,而不是熱情阿!
把他們全部攤開來看,發現其實夢想根本沒有什麼好不好的差別,唯一的差別只在於那個持有夢的人,
有沒有去實踐而已,就只是這樣子,一點點的複雜都沒。




2011-12-05

[轉] 怎麼對待自己與別人


怎麼對待自己與別人
1. 把自己當作別人---
我們都喜歡聽好話,自己愛聽好話,別人也愛聽,得體的好話會讓人開心。

2. 把別人當作自己--
異地而處,自己不喜歡的,別人也不喜歡,盡量避免...(盡量把話吞肚裡)

3. 把別人當作別人--
別人就是別人不是自己,別人的隱私,不要到處說。別人改不了的,讓他去吧。但,因為把他當別人,所以,依舊鼓勵他,讓他有漸漸改進的動力。

4.把自己當作自己--
該保護自己的地方要懂得保護。清楚自己要什麼不要什麼。自己不是別人。自己要懂得判斷和處理好自己。希望別人怎麼對自己 自己就要怎麼對待別人


原文已死  所以不附上連結了

2011-11-28

[android] 上一頁 or 返回



public boolean onKeyDown(int keyCode, KeyEvent event) {
           // TODO Auto-generated method stub
    if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
                   //上一頁
                   return true;
           }
           return super.onKeyDown(keyCode, event);
   }


按下 返回键程序就關閉了
//關鍵的幾行
public void onClick(View v) {
                finish();//關鍵
            }
        });

2011-11-21

什麼是 OVF



光學觀景窗(Optical View Finder,OVF)
OVF內的影像是利用稜鏡或其他光學原理自主鏡頭中的進光折射成相

可參考
http://zh.wikipedia.org/zh-hant/%E6%95%B8%E4%BD%8D%E5%96%AE%E7%9C%BC%E7%9B%B8%E6%A9%9F

2011-11-17

[android] Tab在下面

xml的部分

<?xml version="1.0" encoding="utf-8"?>


<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tabhost"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
        <RelativeLayout
                android:layout_width="fill_parent"
                android:layout_height="fill_parent">
                <!-- set the tab title attributes and set the title align the bottom -->
                <TabWidget
                        android:id="@android:id/tabs"
                        android:layout_alignParentBottom="true"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content">
                </TabWidget>
                <!-- set the tab body attributes -->
                <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">
                        <LinearLayout
                                android:id="@+id/tab1"
                                android:orientation="vertical"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:paddingTop="20dip">
                                <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:src="@drawable/home_normal"/>
                        </LinearLayout>
                        <LinearLayout
                                android:id="@+id/tab2"
                                android:orientation="vertical"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:paddingTop="20dip">
                                <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:src="@drawable/garbage_normal"/>
                                </LinearLayout>
                        <LinearLayout
                                android:id="@+id/tab3"
                                android:orientation="vertical"
                                android:layout_width="fill_parent"
                                android:layout_height="fill_parent"
                                android:paddingTop="20dip">
                                <ImageView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:src="@drawable/help_normal"/>
                        </LinearLayout>
                </FrameLayout>
        </RelativeLayout>
</TabHost>

主程式
package test.c;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.widget.TabHost;
import android.widget.Toast;
import android.widget.TabHost.OnTabChangeListener;

public class test  extends Activity {
    /** Called when the activity is first created. */
public static TabHost tab_host;
private TabHost mTabHost = null;
//private TabWidget mTabWidget = null;  
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
      //tag開始
        TabHost host = (TabHost)findViewById(R.id.tabhost);
        host.setup();

        TabHost.TabSpec homeSpec = host.newTabSpec("Home");        //This param will be used as tabId.
        homeSpec.setIndicator(null,         //This param will diplay as title. 
        getResources().getDrawable(R.drawable.home_normal));
        homeSpec.setContent(R.id.tab1);
        host.addTab(homeSpec);

        TabHost.TabSpec garbageSpec = host.newTabSpec("Garbage");
        garbageSpec.setIndicator(null, getResources().getDrawable(R.drawable.garbage_normal));
        garbageSpec.setContent(R.id.tab2);
        host.addTab(garbageSpec);

        TabHost.TabSpec maybeSpec = host.newTabSpec("Help");
        maybeSpec.setIndicator(null, getResources().getDrawable(R.drawable.help_normal));
        maybeSpec.setContent(R.id.tab3);
        host.addTab(maybeSpec);

        host.setOnTabChangedListener(new OnTabChangeListener() {

        @Override
        public void onTabChanged(String tabId) {
        // TODO Auto-generated method stub
        Toast toast = Toast.makeText(test.this, tabId, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 50);
        toast.show();
        }
        });

//                 host.setCurrentTabByTag("Home");
        Toast toast = Toast.makeText(test.this, "Home", Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER_HORIZONTAL, 0, 50);
        toast.show();
        }
        }
        //tag finish

小提醒  記得放入圖片到 layout ==>drawable
       
    


2011-11-14

[笑話]


案例一
A:看見我的相機包說你也要去台大拍照喔
B:恩是阿
A:我們也是 你用哪一台相機阿,能看一下嗎
B:喔 好沒問題
(打開包包:給他看我的7D+小小白IS)
A:疑你怎麼不用N家的 C家的相機不是比較低階嗎
B:會嗎(忍住)
A:你看我用N的D5100這台超好的
B:恩是阿 還不錯(忍忍忍)
A:而且阿7D因該是很久以前的機器了,現在不是已經出到600D嗎
B:是阿(無言.)..
A:你看之前電視CSI 裡面的警察 都是用這個牌子
忍不住了.........
B:你知道為啥嗎,因為他們拍的都是死人 顏色差點也無所謂啦
........
http://www.mobile01.com/topicdetail.php?f=244&t=2439962&p=1

案例二
小弟前陣子某場合遇到朋友
朋友說:喔~你這是5D喔,我朋友也用5D
不過他用了五六年了,一直都捨不得換
你也是捨不得換喔
小弟也只是笑笑說這是5D二代啦
http://www.mobile01.com/topicdetail.php?f=244&t=2439962&p=3#31889192

2011-11-08

[google+] 移除遊戲授權

因友人提問所以就順便寫了
左上角齒輪點一下  google+設定

點選帳戶總覽

找到安全性 --> 授權應用程式和網站

將不想要的程式--> 撤銷存取權限

end

2011-11-04

[隨筆] net send

發訊息給個別的電腦  or 群體



我的電腦右鍵  ==> 管理  ==> 服務及應用程式  ==>服務  ==>
Messenger  ==> 啟動類型  (自動)  ==>套用 ==> 啟動  ==>確定



個別送訊息  net send 172.19.225.20 "訊息"

群體  net send * "訊息"

2011-10-27

[隨筆] TRIB


TRIB=被接數的實體資料位元/位元被接收所需時間

K: 每字元所代表的訊息位元
M: 字元的區段長度
R: 每秒鐘可傳送的字元量
C: 美區段非資訊的平均數量
P: 重傳的機率
T: 區段傳輸之時間間隔
ps: 全雙工時 T=0
-------------------------------------聽說我是分隔線---------------------------------------------
EX:

假設每秒傳輸9600Bits的半雙工網路,其每一字元為8位元,
每一通訊區段有600個字和10 個字的控制位元,
發生錯誤重傳的機率為每100個傳輸區段有1個需要重傳,
延遲時間由規格輸得知為25毫秒,則其流量的計算方法如下:


9600/8=1200

           8*(600-10)*(1-0.01)
IRIB= ----------------------------=8900 bit/s
           600/1200+0.025



K=每一字元為8位元
M=每一區段知600個字元
R=1200字元/秒(由9600位元/秒除以8位元/字元而得)
C=每一區段10個控制字元
P=0.01(每100個傳輸區段有1個需要重傳)
T=25毫秒反向傳輸時間

2011-10-26

[企業通訊概論] 2011/10/25 上課內容

yum install -y kernel-devel
yum install -y gcc

#include
#include
#include
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Robert");
MODULE_DESCRIPTION("Hello");
static int _init hello_2_init(void)
{
printk(KERN_ALERT "Hello",world 2\n");
reutrn 0;
}

static void_exit hello_2_exit(void)
{
printk(KERN_ALERT "Goodbye,world 2\n");
}



obj-m+=t1.o
all:
make -C /lib/modules/s(shell uname -r) /build M=S(PWD) modules
clean:
make -C /lib/modules/s(shell uname -r) /build M=S(PWD) clean


vim t1.c
vim st.c
make clean: make

tail -f /var /log /messages

insmod

insmod hw.ko


makefile insmod xxx.ko

rmmod xxx

中場休息

聽說下面是簡易版
這邊老師講太快了
來不及拍  改用錄影  
但剛好我的相機又沒電了  冏rz



linux cross reference

v2.6.18   尋找 skbuff

找到 filename search:skbuff
include/linux /skbuff.h/net /core/skbuff.c

ip.h
include/linux/ip.h

99 100行  手抖了一下 糊了 sorry


2011-10-25

讓我幫你google 你想要的那樣東西


先到 http://lmgtfy.com/
再輸入欄位輸入您想要的google 的東西
如:賈伯斯
將下方的連結給對方
他就會幫對方google 了
http://lmgtfy.com/?q=%E8%B3%88%E4%BC%AF%E6%96%AF




2011-10-24

[隨筆] 為什麼要學


alongalone:how old are you ?                                  
gmoz:I'm fine, thank you. and you?

這兩句 真的有蝦到

如果不想成為這種烏龍對話 
就要多學一點  恩恩

2011-10-20

[嵌入式] 往右抹去


/*
 *  Copyright (C) 2008 by National Chip Implementation Center
 *  Author: ycchang <yaochung@cic.org.tw>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include "EX_LCD_V.h"
#include "image.h"
#include "image1.h"

#define DELAY_TIME 100000

unsigned int base = 0x10000000;
int LCDHSize  = 320, LCDVSize = 240, PixelSize = 3;
char *image;

void clean_screen();
void delay(unsigned int);
void move_right();
void move_rightdown();

int main()
{
    int i,j,k;
    int flag = 0;

    //uart_init ();

    /* turn on lcd */
    lcdc_init ();

    memset ((char *) base, 0xff, LCDHSize*LCDVSize*PixelSize);
    // clean screen
    clean_screen();

    // show images
    LCDC_FRAMEBASE = base;
    while (1) {
     flag ^= 1;
     image = (flag) ? imagebits : imagebits1;

for (i=0; i<LCDHSize; i++)
          for (j=0; j<LCDVSize; j++) {
             for (k=0; k<PixelSize; k++)
                 (*((char *)(base + j * LCDHSize * PixelSize + i * PixelSize + k))) =
                 image[j * LCDHSize * PixelSize + i * PixelSize + k];
        }
     // show onto LCD
LCDC_FRAMEBASE = base;
        delay(DELAY_TIME);
     }
exit (0);
//while (1);
}

// clean screen
void clean_screen()
{
    int i,j,k;
  
for (i=0; i<LCDVSize; i++)
        for (j=0; j<LCDHSize; j++) {
            for (k=0; k<PixelSize; k++)
                (*((char *)(base + i * LCDHSize * PixelSize + j * PixelSize + k))) = 0x00;
        }
    // show onto LCD
LCDC_FRAMEBASE = base;
}

// delay time
void delay(unsigned int count)
{
    for(;count>0;count--)
        ;
}

2011-10-17

[android] 切換視窗

最近很多人都在問 android 切換視窗 or 換頁的問題
第一個辦法就是
setContentView(R.layout.t2);

t2  是另一個xml的名稱

第二個辦法就是
用 Intent intent = new Intent();

intent.setClass(t1.this, t3.class);
startActivity(intent);
t1.this.finish();

ps: t1是我原本的java名稱  t3是換到那頁的名稱


我覺得使用 intent 大多數的人都忘記在 manifest 加上active
所以請在 manifest加上下面這一行   我習慣加在 之上



這樣才有辦法執行

package t1.c;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class t1 extends Activity implements OnClickListener {
private Button Button01,Button02;
    /** Called when the activity is first created. */
    @Override
    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.t1);
        Button01 = (Button) findViewById(R.id.Button01);
        Button02 = (Button) findViewById(R.id.Button02);
        Button01.setOnClickListener(this);
        Button02.setOnClickListener(this);
    }
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (v == Button01)
dot2();
if (v == Button02)
showt3();
}
private void showt3() {
// TODO Auto-generated method stub
setContentView(R.layout.t2);
}
//請在 manifest加上下面這一行   我習慣加在 </application> 之上
//<activity android:name="t3"></activity>
 // </application>
//這樣才有辦法執行
private void dot2() {
// TODO Auto-generated method stub
Intent intent = new Intent();
intent.setClass(t1.this, t3.class);
startActivity(intent);
t1.this.finish();
}
}







2011-09-30

[android] 可編譯 無法執行


[2011-09-27 11:45:00 - t1] Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED [2011-09-27 11:45:00 - t1] Please check logcat output for more details. [2011-09-27 11:45:00 - t1] Launch canceled!



最近發現剛安裝起來的 eclipse 建立檔名時偶爾會漏掉
建立專案 packet 要輸入  名稱.名稱
正常來說會自動建立 名稱.名稱 
不知道為什麼會自動漏掉建立

漏掉的話請手動改一改
先點SRC 底下的 c   在按 F2  將檔名改為t1.c   
ps:會因為檔名不同而有所不同,請修改成你自己的

2011-09-28

bbs

請再google 打kkman 下載軟體

安裝完成


輸入 telnet://bbs.ptt.cc

可以guest  但通常都被用完了  所以請打new(註冊的意思)

輸入帳號   請不要使用平時的帳號  因為哪天說不定會被人肉搜索

然後登入你的帳號和密碼  密碼不會顯示

有空就可以一個個去逛逛

但今天心情不太美麗
所以就看看別人 的笑話吧
登入完後  按鍵盤的s  在上方會看見  可以輸入文字的地方
打上 stupid

裡面都是真的



[嵌入式] 第三次實驗 操作步驟

2011-09-24

[linux] fidisk /dev /sdb

fidisk /dev /sdb
m ==>menu (選單)
p ==>partition (區塊/分區)
n ==>new disk (新增 硬碟)
1 ==> 數字
p ==>partition
w ==> 寫入

2011-09-22

整數(int)


整數(int)  
   
signed   short   int   有符號短整型數說明。簡寫為short或int,  
字長為2字節共16位二進制數,   數的範圍是-32768~32767。  
signed   long   int   有符號長整型數說明。簡寫為long,  
字長為4字節共32位二進制數, 數的範圍是-2147483648~2147483647。  

unsigned   short   int   無符號短整型數說明。簡寫為unsigned   int,
字長為2字節共16位二進制數, 數的範圍是0~65535。
  
unsigned   long   int   無符號長整型數說明。簡寫為unsigned   long,
字長為4字節共32位二進制數,   數的範圍是0~4294967295。  

[android] droiddraw

android果然熱門
最近又發現新東西了



2011-09-20

[linux] makefile


#include
#include
#include
int main(void){
char word[20];
bzero(word,sizerof(word));
strcpy(word"this is a book");
}


vim makefile
all:
gcc-o xxx.xxx.c   //xxx檔名
clean:
rm -f xxx
:wq!    //離開
make clean
make

./xxx   //執行

結果
this is a book

2011-09-19

在伺服器上用 127.0.0.1 存取仍然要輸入帳號密碼


我小小作了修改
但還是附上的參考的連結

如果你改用 127.0.0.1,例如:http://127.0.0.1/localstart.asp,卻會發現 IE 會彈出一個視窗要你輸入帳號密碼。為什麼 localhost 沒問題,127.0.0.1 卻會要求輸入帳號密碼?

原因是出在 IE。只要你輸入的網址裡面有點("."),IE 就會認為你要存取的網頁是位於 Internet 區域,因此即使網站的驗證方式是整合式驗證,IE 基於安全考量,還是會要求輸入帳號密碼。
如果你的網站是位在 Intranet 區域,而且希望 IE 不要彈出這個視窗,就可以在 IE 的「網際網路選項」的「安全性」頁夾中點選「近端內部網路」,再點「網站」鈕。
此時會開啟一個對話窗讓你加入 intranet 的網址,你可以加入 http://127.0.0.1 或其他區域內網的網址,這樣以後 IE 碰到這些網址就會視為 intranet 的存取,就不會再要求輸入帳號密碼了。
如果覺得這樣太麻煩的話,直接用電腦名稱也可以,例如:http://machine-name/MyWeb/,因為裡面沒有點("."),IE 會當它是近端網址。

http://www.dotblogs.com.tw/huanlin/archive/2008/04/23/3244.aspx

2011-09-16

[linux] 常用指令


cd
回上一層目錄
pwd
回最上層目錄
mkdir 資料夾名稱
新增資料夾
vim hello.c
新增 文件hello.c
i
插入模式
自動對齊
esc
gg
v
g
=
儲存
esc
:wq!
編譯 執行
gcc -o hello hello.c
ls
./hello
取代
原本的字->r->取代字
工作管理員
kill -p pid
複製一份
cp hello.c myhello.c
ls
diff hello.c myhel
重新命名
rm -f -檔名
移除
rm -rf 檔名
關機
shutdown -h now

2011-09-10

[js] aptana studio 編輯器

現在的科技越來越發達了
寫起js也不用像以前一樣用記事本
傻傻的 寫  除錯還很難找
向大家推薦 aptana studio 
因為他免費


還會自動出現您想要打的字

整體的畫面長這樣


在這裡推薦給大家

2011-09-02

網內互打不用錢

最近許多業者都推出了網內互打不用錢
所以就整理一下 國外網站有些字體不支援 加減看一下 網內互打不用錢

2011-08-30

艾賓浩斯記憶曲線

艾賓浩斯記憶曲線

2011-08-29

送給新鮮人的 7 項建議


1. 分數不是重點,你要的是知識,不是分數
2. 瞭解時間的效益
3. 擁有一個夢想
4. 擁有正確的理財觀念
5. 當個怪人
6. 機會是給準備好的人
7. 人生是一段單向道的旅程

2011-08-26

一天一Google


http://www.agoogleaday.com/tw/#date=08-26-2011

從2005年2月開始,蘋果就在秘密研發 iPhone,當時在內部的完整英文專案代號是?

答:Purple 2

2011-08-24

Memory not configured correctly for proper MEBx execution. Make sure there is a memory module in the black DIMM socket.


Memory not configured correctly for proper MEBx execution.
Make sure there is a memory module in the black DIMM socket.



The first DIMM slot in channel A is black and all other DIMM slots are white. Populating a DIMM in the black slot insures memory is in channel A.


翻成中文
您現在的記憶體插在白色插槽  請將記憶體插在黑色的插槽上


重點
將記憶體插在黑色的插槽上

2011-08-23

如何變更SQL伺服器名稱


最近出來混
碰到一個問題  sql 伺服器名稱有部分無法自動修改
以下是解法


1. 預設第一套安裝 SQL Server 執行個體(Instance)會與 Computer Name 相同。

您可以修改 Computer Name 後,重新啟動 SQL Server 時,SQL Server 就會自我進行修正。
謎音:有些電腦無法連接

不過,為了確定 @@servername 可以會傳回正確的本機伺服器名稱,請利用以下的方式來進行修改:
use master
go
exec sp_dropserver
GO
exec sp_addserver , local
GO
-- 重新啟動 SQL Server 執行個體。
-- 驗證 @@servername 可以會傳回正確的本機伺服器名稱
SELECT @@servername
請參考以下的網址:
如何:重新命名 SQL Server 2005 的獨立執行個體
http://msdn2.microsoft.com/zh-tw/library/ms143799(SQL.90).aspx
2. 這邊要提示的是:您可以修改 Computer Name,但是無法修改執行個體名稱。
Best Regards
Derrick Chen 德瑞克