2011年8月30日 星期二

觀摩口試(題目:semantic-Driven HOG-based pedestrian detection)

今天,去觀摩了碩士口試.故想試著吧感想及心得寫下
是位高雄第一科大的學長-題目是Semantic-Driven HOG-Based Pedestrian Detection


2011年8月20日 星期六

無人值守"XP安裝光碟啦

在XP的瘦身方面,nLite是一套很方便的工具
但是其他各種不同的程式想要在開機自動安裝可就不是一件簡單的事
AutoIt正是一個方常好的解決方案!

2011年8月4日 星期四

Virtual Box +網路設定

在virtual box中,若要連結上網路或是VM <--> host
(你必須先去考量所在的網路架構,是否為staic ip ,DHNP,DNS,gateway

2011年6月6日 星期一

整合XP光碟

前因:
        最近,因想提升電腦上的效能.買了一顆硬碟(seagate,st9320423as,320g,7200rpm)
但是,..........

2011年5月21日 星期六

雙螢幕zbar

目的: 如何在windows xp上設定,為雙螢幕

前言:
今天,在看資料時.覺得很煩.因為我必須要不斷地切換視窗
所以,我把樓下不用到的LCD搬上用.

2011年4月6日 星期三

linkage & storage during'scope


Linkage

Typeobject's size and memory address alignment

storage durationdetermines the lifetime of the storage for that object. it determines how and when during program execution the storage for that object comes and goes. three storage durations: static, automatic, and dynamic. Only objects have storage duration. Enumeration constants, functions, labels, and types don't.

scope portion of a translation unit in which the name is visible. file scope, block scope, function prototype scope, and function scope, namespace scope, class scope

linkageaffects whether two or more declarations for that name are valid, and if so, whether they refer to the same entity

"a function name has a type, a scope, and a linkage, but no storage duration. A statement label name has only a scope."





其linkage相關為由 the storage class specifier and the scope of the function's declaration決定
對於"function"對於linkage的影嚮, 指的是在"宣告",分為 file scope and block scope。
其中在block scope中 的部份,
static void add(void)
{
    printf("test!\n");
}
int main()
{
    extern void add(void);//宣告其中add()可能為internal linkage(同一unit);或是extern(不同unit)
    add();
    return 0;
}


int main()
{
    static void add(void);

   //error: invalid storage class for function 'add'|
    add();
    return 0;
}
















"此為object對於linkage的影嚮";對於block scope中的宣告變數中,對於static 會使得它雖不能linkage,但卻可以變為static storage(lifetime)


Storage class specifiers and storage duration




Storage class specifiers don't specify scope but combine with scope to determine storage duration

Scope regions in C and C++
C and C++ each support five different kinds of scope regions. Although the C and C++ standards use different names for some regions and different verbiage to define those regions, the two languages support essentially the same five regions:
  • In C, a name has file scope if it's declared in the outermost scope of a translation unit. C++ extends the concept of file scope to the broader concept of namespace scope. In C++, a name has namespace scope if it's declared either in a namespace definition or in what C calls file scope. The C++ standard refers to the C concept of file scope as global namespace scope, or just global scope.
  • A name (other than a statement label) has block scope if it's declared within a function definition or a block nested therein.
  • A name has function prototype scope if it's declared in the function parameter list of a function declaration that is not also a definition.
  • Each statement label has function scope, which spans the body of the function containing the label.
  • A name in C++ has class scope if it's declared within the brace-enclosed body of a class definition. Classes in C++ include structures and unions, so a member of a C++ structure or union has class scope as well. The C standard doesn't have a corresponding notion of structure scope, but rather says that each structure or union has a separate name space for its members. Despite the different verbiage in their respective standards, C and C++ look up structure and union members in much the same way.


Storage class specifiers
Storage class specifiers are keywords you can use in declarations to control storage duration and linkage.
Every declaration in C and C++ has two principal parts: a sequence of zero or more declaration specifiers, and a sequence of zero or more declarators, 






















declarator is the name being declared, possibly surrounded by operators such as *[](), and (in the case of C++) &.
A declarator may contain more than one identifier. The declarator *x[N]contains two identifiers, x and N. Only one of those identifiers is the one being declared and it's called the declarator-id. The other(s), if any, must have been declared previously. The declarator-id in *x[N] is x.


Some of the declaration specifiers leading up to a declarator can be type specifiers such as intunsignedlongconst, or a user-defined type name. They can also be storage class specifiers such as extern or static, or function specifiers such as inline.



The type specifiers contribute to the type of the declarator-id; the other specifiers provide non-type information that applies directly to the declarator-id. For example:(type specifiers是給declarator-id(只有一個)的type(類型);而其它的specifiers則提供非type給declarator-id.
static unsigned long int *x[N];
declares x as an object of type "array of N pointers to unsigned long int". The keyword static specifies x's storage class.
The C standard lists five storage class specifiers: autoexternregister,static, and typedef; however, C considers typedef to be a storage class specifier for syntactic convenience only. (typedef只是因為方便)
Storage duration The storage duration of an object determines the lifetime of the storage for that object
Only objects have storage duration. Enumeration constants, functions, labels, and types don't.
Each object in C and C++ has one of the following three storage durations: static, automatic, and dynamic.
(即scope+storage class specifier==storage duration)
例如:
An object declared at file scope (in C) or namespace scope (in C++), or declared with the storage class specifier extern or static, has static storage duration. The lifetime of the storage for that object is the entire time that the program is executing.
但在,dynamic中
When a program allocates storage for an object by calling an allocation function, such as malloc in C or an operator new in C++, that object hasdynamic storage duration. The lifetime of the object's storage lasts until the program passes the address of that object to a corresponding deallocation function, such as free in C or an operator delete in C++.
 a program can't declare any objects with dynamic storage duration. A program can create them by calling an allocation function; it just can't declare them(對於dynamic duration, ...)



The mechanics of storage allocation

The exact manner in which static storage is allocated and deallocated depends on the target platform.

Typical C and C++ programs allocate automatic storage on a run-time stack, often the same stack that they use for storing function-call return addresses. Allocating storage for a local object isn't free, but it's usually dirt cheap--just one machine instruction. For example, in:
int foo(int v)
    {
    int m;
    ...
    return m;
    }

function foo has a single local object, m. The compiler determines m's size from its type, typically 2 or 4 bytes. When it compiles foo, the compiler simply generates an instruction such as:
sub sp, 4

2011年2月27日 星期日

如何搭公車

最近,因為要去外地去考試時,去目的地
除了,坐小黃.但大貴了
故想搭公車時,卻發現自己不知在那裡下車

問題有.
Q1.要去的目的地,的公車站要在那裡搭
Q2.要如何判斷,何時下車

A1:比較容易,可先在網路上查看資料
     ex:
          a,先決定出可到達的地方(火車站)
          b.知道目的地附近的主要路口,查看其公車站牌
             以此來決定搭幾號的公車
          c.在網路上查看,即可

A2: 可記住目的附近的主要道路.
      ex:
          因為人在外地,人生地不熟下.並不知該在何處下車
        
         a.記前一個的公車站牌
             :雖然可由沿路上公車站牌來決定,但是公車並不是每站
              都有人招公車,故你可能不知在何時下車

         b.由附近的主要道路的路名            
            :可用來,輔助公車站牌的缺點,因為路口通常會有紅緣燈.
            故你可以看清楚路口,故你可以在目的地附近下車.