發表文章

地價稅的計算方式

地價稅的計算方式 → 公告地價 ╳土地所有權面積 ( 平方公尺 )╳ 稅率 一般: 10/1000 自用: 2/1000 房屋稅和戶籍設籍沒有關係 !!! 只有地價稅才有分 " 自用 " 一般 " 若是一般是自用的五倍 ( 一般 500 塊 , 改自用就 2500) 地價稅是 11 月才需要繳的 ~ 算法如下 : 你們可看你們土地持分多少 m2?? ~ 再去換算 , 公告地價 公 告 土 地 現 值 資 訊 查 詢 http://www.land.moi.gov.tw/chhtml/landvalue.asp?cid=100

我家,2010/05

圖片

msmtp im embedded system

msmtp im embedded system 網站:http://msmtp.sourceforge.net/ 1. msmtp is an SMTP client. 2. Authentication methods PLAIN, LOGIN, CRAM-MD5, DIGEST-MD5, GSSAPI, and NTLM. 3. TLS/SSL both in SMTP-over-SSL mode and in STARTTLS mode. Full certificate trust checks can be performed. A client certificate can be sent. 編譯需要下列 Libraries GnuTLS , 可用 OpenSSL 代替 GNU SASL (Using the GNU SASL library adds support for the GSSAPI, DIGEST-MD5, and NTLM authentication methods. (The methods PLAIN, LOGIN, and CRAM-MD5 are always supported).) GNU Libidn (Support for Internationalized Domain Names (IDN) is available if you have GNU Libidn installed.) 1. OpenSSL 1.0.0c tar -xf openssl-1.0.0c.tar.gz cd openssl-1.0.0c ./Configure linux-generic32 no-asm shared --prefix=`pwd`/install --openssldir=`pwd`/install 打開 Makefile 找到 CC= gcc 修改為 CC= arm-linux-gcc make make install 將 install/include/ install/lib/ 兩個目錄複製到 arm-linux-gcc 的 include 和 lib 裡面 ( example: /opt/crosstool/arm-linux/gcc-3...

RS232 read write ..

file1: with select #include <pthread.h> #include <stdio.h> #include <termios.h> #include <fcntl.h> #include <string.h> #include <sys/select.h> #define BUFFER_SIZE 100 char* Message="Hello1 Hello2 Hello3 Hello4 Hello5 Hello6 Hello7 Hello8 Hello9 Hello10"; char incomingBuffer[BUFFER_SIZE]; int fd1; int fd2; void* ReaderThread(void* object) {      int total=0;      int expected=strlen(Message);      struct timeval timeOut;      fd_set fdSet;      int maxFdp=0;      printf("Waiting for data on serial ports\r\n");      while(total<expected)     {           timeOut.tv_sec=0;           timeOut.tv_usec=1000000; // Every 100 ms            FD_ZERO(&fdSet);           FD_SET(fd1, &fdSet);      ...

RS232 baudrate setting

#include <stdio.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> #include <termios.h> int fd=-1; int getbaud(int fd) {      struct termios termAttr;      int inputSpeed = -1;      speed_t baudRate;      tcgetattr(fd, &termAttr);      /* Get the input speed. */      baudRate = cfgetispeed(&termAttr);      switch (baudRate)      {           case B0: inputSpeed = 0; break;           case B50: inputSpeed = 50; break;           case B110: inputSpeed = 110; break;           case B134: inputSpeed = 134; break;           case B150: inputSpeed = 150; break;           case B20...

shell 指令備忘

shell 指令 1. locate      locate tmp | more      尋找檔名有 tmp 的檔案.      如果跑出來一大堆的結果, 那可以使用 more 來將輸出的東西分頁暫停. 2. find      find . -name "*.tmp"      尋找目前目錄及其子目錄, 副檔名為 tmp 的檔案.      find . -name "*.tmp" -exec rm {} \;      同上, 但找到後執行刪除動作.      英文句點代表現行目錄, 當然也可以改成其他的目錄. 3. grep      尋找的是檔案內容是否含有某些字串.      grep Linux *      找目前目錄(不含子目錄)所有含有 Linux 字串的檔案      grep -r Linux *      同上, 但會連子目錄也去找           grep & locate 組合使用           locate tmp | grep Linux 只找含有 Linux 字串的 tmp 檔案.           locate tmp | grep doc 同理, 要找 tmp 的相關說明檔時, 就可以這樣使用.           locate tmp | ...

gettimeofday sample code

#include < sys/time.h > #include < stdio.h > int main() {   struct timeval tv, tv2;   unsigned long long start_utime, end_utime;   gettimeofday(&tv,NULL);   start_utime = tv.tv_sec * 1000000 + tv.tv_usec;     usleep(1000);   gettimeofday(&tv2,NULL);   end_utime = tv2.tv_sec * 1000000 + tv2.tv_usec;     printf(" runtime = %llu\n", end_utime - start_utime ); }