2016年9月29日 星期四

螺釘安卡

鐵釘
用於一般木料之接合,通常使用於室內。

鋼釘
接和水泥牆面或木料與水泥材料,硬度高,不易鏽蝕

銅釘
用於木質飾品之接合固定,價格較低

木螺絲
用於木料或搭配壁虎使用於水泥材料

鐵板牙螺絲
用於固定鐵板材之物件,搭配華司使用可增加鎖固能力

鑽尾螺絲
又稱自攻螺絲,末端鑽尾設計可較輕鬆鑽穿軟金屬材料

安卡壁虎
埋入水泥中搭配螺釘使用,使其膨脹於恐壁,增加牢固

膨脹螺絲
埋入水泥材質中,做螺釘上固定,一般為較大載重使用

華司
搭配羅斯使用,增加鎖固面積,加強鎖固能力





2016年9月27日 星期二

android app 開發安裝

觀念:

1. 安裝JDK
2. 安裝Eclipse或者Android Studio
3. Eclipse or Android Studio 都要安裝Android SDK, Android Studio內建,Eclipse要去抓Android Studio 的 Android SDK

4. 安裝設定模擬器
5. 也可以直接run在手機

2016年9月19日 星期一

Recursion Algorithm

1.
一般來說,有兩種方式可以撰寫具有重覆執行 (Repetitive)特性的演算法:
Iteration (迴圈)
Recursion (遞迴)

Def: algorithm 中含有self-calling (自我呼叫)敘述存在。




2.遞迴的種類:
直接遞迴 (Direct Recursion):
函式或程序直接呼叫本身時稱之。

void function(void)
    {
     function(void);
     }

間接遞迴 (Indirect Recursion):
函式或程序先呼叫另外的函式,再從另外函式呼叫原來的函式稱之。

void function(void)
    {
     function1()
         void function1(void)
            {
              function();
             }
     }



3.遞迴演算法則的設計:
找出問題的終止條件 (即:base case).
找出問題本身的遞迴關係 (即:general case).
 Procedure 遞迴副程式名(參數)
{
  if (base case)
     return(結果); ……//達到終止條件時結束遞迴,需要時回傳結果
  else
     general case; ……//利用general case執行遞迴呼叫,需要時加上return
}


























2016年9月18日 星期日

條件運算子(Conditional Expressions)

變數 = ( 條件運算式 ) ? 變數值1 : 變數值2;

在指定敘述的「=」號右邊是條件運算式,其功能如同if/else條件,使用「?」符號代替if,「:」符號代替else,如果條件成立,就將變數指定成變數值1,否則就是變數值2。

hour = (hour >= 12) ? hour-12 : hour;

上述程式碼使用條件敘述運算子指定變數hour的值,如果條件為true(即不等於0),hour變數值為hour-12,false(等於0)就是hour。


2016年9月17日 星期六

perl quotes

Alternative Quotes: qq, q, qw, qx

print qq/Hello\n/;                  # same as: print "Hello\n";
print q/He owes $5.00/;       #  same as: print 'He owes $5.00', "\n";
@states=qw( E T A L );       # same as ("E", "T", "A","L")
$today = qx(date);               # same as $today = 'date'; 



While we usually think of quotes as literal values,
in Perl they function as operators,
providing various kinds of interpolating and pattern matching capabilities.
Perl provides customary quote characters for these behaviors,
but also provides a way for you to choose your quote character for any of them.
In the following table, a "{}" represents any pair of delimiters you choose.

Customary  Generic        Meaning        Interpolates
                 ''       q{}          Literal             no
               ""      qq{}          Literal             yes
               ``      qx{}          Command             yes*
                        qw{}         Word list            no
                //       m{}       Pattern match          yes*
                         qr{}          Pattern             yes*
                         s{}{}      Substitution          yes*
                         tr{}{}    Transliteration         no (but see below)
              <<EOF                 here-doc            yes*

    * unless the delimiter is ''.



perl operators and precedence


operators
+
-
*
/

precedence
4+2*4
(4+2)*4

notice:  ++ different location different result
print $num1++ . "\n";
result: 10

print $num1;
11

print ++$num2 . "\n";
11



$letter  = "a";
$letter++;
print  "$letter\n";





perl conditionals

loop,foreach

if elsif else

unless