....

2014年12月9日 星期二

2014年12月4日 星期四

2014年12月3日 星期三

[食記] 台中 莎莎莉朵-秘境裡的cafe/早午餐

用餐時間:2014.10.26 10:10

標題下這樣有點誇張XD
其實是因為我們第一次來找的時候...找不到呀~~
因為Google地圖也找不到,所以繞有點久...
但不用擔心,底下我會交代清楚地理位置的!



2014年11月20日 星期四

2014年11月18日 星期二

[長知識] C++ x this this this

這裡是說明this怎麼使用

以下面這個範例來說

[長知識] C++ 物件來導導導導向 物件導向

像是每一種汽車有一種輪胎,那麼汽車公司會很麻煩,
不如就先有一個輪胎類別,小台車要生產就用小輪胎
大台車要大輪胎就生產大的。

範例分為兩部分:

[長知識] C++ 利用記憶體位置去作運算範例

前面文章有提過 利用變數傳值運算
這篇文章說明 利用記憶體位址的值去運算。

來說明吧:

2014年11月15日 星期六

[長知識] C++ 的 Reference & Pointer (參考和指標)

Reference (參考) 和 Pointer (指標) 在C++內很重要,很重要,很重要,
因為很重要,所以我打了3次。

言歸正傳:

[長知識] c++ 在字串 string 的初學玩法

要開始介紹C++的String字串之前,
一定要先 include <string> 否則不能使用字串的方法。

程式說明:

[長知識] C++ Overload 多載、多載、多載

這邊要解釋的是C++的Overload (多載)
多個方法的名字可以一樣,
只要程式給不同的值,他也可以區分。

以下面這個範例說明:

[長知識] C++裡面的template,Java裡面的generic

對於一個寫過Java而還不熟C++的人來說
有著一個共通的地方
Java說這是泛型Generic
C++說這是樣板template

以下範例在說明:

[長知識] c++ 要怎麼開始玩最快?

從c++開始,
我們要include的東西就不一樣了
原本C include <stdio.h> 和 <stdlib.h>
C++則是 include <iostream>和<cstlib>
再來是重要的命名空間使用 using namespace std;
來說說有using和沒有using的差別好了
有using namespace std ,就直接可以使用cout和endl
例如:  cout<<"hello world!<<endl;
沒有使用using namespace std,就不能直接使用cout和endl
例如: std::cout<<"hello world!<<std::endl;
差別就是每次要使用時,都必須要再寫一次 std::

下面這個範例是在說明:

2014年11月13日 星期四

[食記] 台中 黃鶴洞韓式料理(勤美店) - 銅盤烤肉/部隊火鍋

2014/11/14更新:
這家店似乎不受台中板友們喜愛
所以,想要去的人記得先去台中板爬文唷~
以下是我個人心得,可能當天有點餓,接受度就變高囉!
-----------------------------------------------------------------------------
用餐時間:2014.10.17 17:30

每次來勤美晃晃,就會看到這家店,而且都高朋滿座,似乎很夯~
我跟KEN就決定來吃看看!!!
( 但這天沒帶到相機...用手機拍請見諒~ )


2014年11月12日 星期三

[長知識] C語言 - 陣列mixed指標

陣列即指標!
陣列名稱:指向陣列起始位址的指標



#include 
#include 

int main(){
  int a[5] = P{1, 2, 3, 4, 5};
  int i, n;
  
  printf("sizeof(a)%d\n",sizeof(a));
  printf("sizeof(a[0])%d\n",sizeof(a[0])); 
 

[長知識] C語言 - malloc()

p = (int*)malloc(sizeof(int));
malloc: 動態取得記憶體傳回指標。



#include 
#include 

int main(){
 int *p;
 p = (int*)malloc(sizeof(int));
 *p = 10;
 

[長知識] C語言 - 玩玩 參數傳值和傳址


#include 
#include 
 
 //傳址,希望函數幫我改值的狀況就用傳址! 
int dayBetweenByAddress(int *in, int *out){
 int temp;
 if(in >out){
  temp = *in;
  *in = *out;
  *out = temp; 
 } 
 return *out-*in;
}

[長知識] C語言 - 就是要玩玩指標


變數
指標
宣告 ()
a
*ptra
取址 ()
&a
ptra





2014年11月10日 星期一

[長知識] C語言 - 新手篇章 - 命名常數(pi)

#define 是在編譯時被執行!!
最常用的就是定義數學Pi = 3.1415926了

#include 
#include 
#define pi 3.1415926

[長知識] C語言 - 新手篇章 - 自訂函數


#include 
#include 

//Topic : 自訂函數 function
//printf(), scanf() :內建函數,等待呼叫
//if, for, while :敘述 statement 
 

2014年10月23日 星期四

[食記] 台中 法森小館 - 超人氣法式料理 多訪

用餐時間:2014.10.08 12:30

上次來吃是謝師宴(2014.07.16)    →點我看上篇
這次是Lab迎新聚餐,是給老師請唷~ (YA!!)
兩次吃得時間有點近
但還是寫出來分享給大家囉~




2014年10月22日 星期三

[食記] 桃園龍潭 橄欖樹 平價手做料理-套餐均一價 (環境好、CP值高)

用餐時間:2014.10.5 11:30

因為媽媽朋友的介紹,我們得知這間不錯的餐廳
趁著周末,全家出動一起來嘗鮮~~
要來可以先提前訂位,當天店裡是滿的,頗熱門唷!!
這間店還有提供素食餐唷,要提前告知的樣子。



2014年9月21日 星期日

[長知識] Android Service 在背景偷偷下載資料不是問題~

在這裡跟大家分享 Android Service的做法,其實非常非常的簡單~

事先準備
1. 你要在哪裡啟動Service
2. 你要在哪裡關閉Service
3. 準備一個class來繼承Service

Let's gooooooooooooooooooo...


[長知識] Android getApplicationContext() VS getBasecontext() 的差異

最常見到選擇這四種選擇的情況是在Toast吧~
Toast.makeText( getApplicationContext() , "Hi~", Toast.LENGTH_SHORT).show();
所以就上網搜尋了一些資料,大概是以下~~~
1. getApplicationContext():
基本上,他會永遠跟著Android Activity的生命週期~

2. getBasecontext():
在Activity跑到 onDestory()的時候,就會被殺掉~

2014年9月13日 星期六

2014年9月12日 星期五

2014年8月28日 星期四

[食記] 台中 芙葉屋-外型超特別的蛋糕蛋包飯

用餐時間:2014.8.16 19:30

難得有機會往台中北部去
就查了一下北屯區的美食
查到這間 "芙葉屋",有很特別的蛋包飯
就來吃吃看囉~


2014年8月15日 星期五

[長知識] Android Eclipse Unable to execute dex: GC overhead limit exceeded

有時候寫完專案要匯出成 apk檔的時候
會有錯誤訊息產生
導致不能正常的匯出 apk檔

當遇到
Unable to execute dex: GC overhead limit exceeded
的解決方式是以下

2014年8月13日 星期三

[食記] 台中 隱藏居酒屋 向上店 - 人氣丼飯 日本料理

用餐時間:2014.8.3 18:45

這天KEN的妹妹心血來潮,揪我們一起吃飯
很愛吃日本料理的KEN一家,就決定來吃 隱藏
我早上的 "田樂" 飽到現在,剛好吃晚餐XD


2014年8月8日 星期五

[食記] 台中 for Farm Burger 田樂 小公園店 - 早午餐&鬆餅

用餐時間:2014.8.3 09:00

一樣是因為有朋友的拜訪
我帶她們一起來吃台中很有名的田樂!
沒想到我朋友也有所耳聞
田樂到底是多有名啦XDD


2014年8月7日 星期四

[食記] 台中 小梗甜點咖啡-食尚玩家推薦-精緻又好吃的夢幻甜點

用餐時間:2014.8.2 12:00

周末有朋友特地來台中玩~
拿出我的一堆口袋名單,帶她們一起嚐(ㄘㄞˇ)(ㄌㄟˊ) XDD
小梗甜點是我很久以前看食尚玩家看到的
但是KEN說來這裡太娘們了,所以都不跟我來QQ
被一堆甜點包圍,很幸福的好嗎 !!


2014年7月21日 星期一

[食記] 台中 法森小館 - 超人氣法式料理

用餐時間:2014.7.16   12:30

學長姐們要畢業啦~~
我們挑了一間老師最愛的店,辦 "謝師宴"
說是謝師宴也太正式了
其實就是請老師吃個飯啦~


2014年7月17日 星期四

2014年7月4日 星期五

[長知識] 關閉Blogger的Google+留言功能-可以不用登入就留言囉!

最近突然發現,要在Blogger留言
要登入Google帳戶才能留言
要是我要留言,看到要登入
會懶得登入,寧願選擇不留言...

只要拿掉Google+留言功能
就可以不用登入就留言囉~
也可以匿名留言 ^ ^

↓↓ 以下教學 ↓↓

2014年7月2日 星期三

[食記] 台中 艾可先生勤美店-美式漢堡

用餐時間:2014.6.30  18:00

悠閒的周末,和KEN去大賣場補貨
跟KEN賭了一把,結果KEN輸了
就只好叫KEN請我吃晚餐囉XDD
這天傍晚,台中突然下雨了
幸好沒有下很久,雨停了就出門找吃的
沒有目的的亂晃,就晃到"艾可先生"
就進去用餐囉~



2014年7月1日 星期二

[食記] 台中 布列塔尼歐法鄉村雅廚-服務五顆星

用餐時間:2014.6.28   12:00

夏天到啦~台中的夏天好熱啊...
今天是搬家的日子,所以可以跟爸媽去吃好料的XDD
原本是預計要晚上去吃"義塔ita",都預先訂好位了
但沒想到...搬家才搬一趟就OK ( 是KEN大力士太厲害了!!!! )
所以緊急挑了一家,吃中午
就挑了我兩年前吃過的"布列塔尼"
那時候留下不錯的印象,所以算是二訪囉~

2014年6月23日 星期一

[長知識] Android Google Maps API v2 - Debug key and Release key

在Android 上,要能夠使用Google Maps在裝置上跑地圖的話呢~
最重要的步驟就是去申請一把 KEY 
而這把KEY分為兩種
1. Debug key : 顧名思義就是讓我們去測試的時候所用的。
2. Release Key : 就是要把專案匯出成apk檔案,以及上傳到Google play供使用者下載所使用的。

給大家的心得 :
前陣子我利用USB線把檔案編譯在裝置上,他能夠正常地顯示出跑出google地圖,而匯出成apk檔在安裝到裝置的時候,根本跑不出google地圖,看似很明顯地沒有把release key弄好,搞了好久終於發現~~(灑淚),所以分享一下要注意些甚麼事情~~~~~

2014年6月18日 星期三

[長知識] Linux Compile new Kernel 3.x on Ubuntu

網路上找的一堆都是2.6版的,照著他那樣做了好幾天,根本不能用,
現在新的Kernel不像舊的了~

雖然我做的是3.6版,但我想3.xx版也應該是同樣的作法

2014年6月16日 星期一

[長知識] Google Maps Android API v2 Setting

在一開始,我想要說的是...
要玩GoogleMaps其實不難,但是要看懂互相call來call去的方法,
要看懂~~ 真的要懂~~ ^^



2014年6月10日 星期二

[食記] 台中 小豚手作輕食-日式鬆餅初體驗♥


用餐時間:2014.6.7  AM 11:30

這個周末是畢業季啊~~
臉書到處都是畢業照...
我跟KEN目前與畢業無緣
所以遠離塵囂,來到小豚...


2014年6月9日 星期一

[長知識] Android 利用SQLite的好處勝過於File


SQLite好處多多呢:)


*If you have data related with each other, file will not allow you to relate them. At that time SQLite will help you.
*If you wan to query your data, store the data in structured manner you will prefer SQLite

2014年5月29日 星期四

[長知識] Android 利用SQLite語法找出兩個日期內的資料 (SQLite Manager)

再查詢資料庫前
我們必須要有資料庫存在
而這邊我也有存了資料進去
最後才能進行語法搜尋


首先
要能夠看到資料庫裏面的欄位以及資料
我是使用Firefox的外掛程式 --> SQLite Manager
點選設定裡面的外掛程式 搜尋 即可以下載

2014年5月27日 星期二

2014年5月26日 星期一

[長知識] Android 多個 DatePickerDialog 在同一個Activity

今天在寫datePickerDialog的時候發現的小小幫助,希望可以幫助大家:)
當我們發現在同一個Activity下需要寫兩個以上的datePickerDialog,可能會需要switch case來幫忙






[食記] 台中 高町平價日本料理

用餐時間 : 2014.5.24 晚上

先來個讓人流口水的照片> <



2014年5月25日 星期日

[長知識] C語言 - 新手篇章 - 結構struct

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
// 結構struct
//  自訂的變數型態,結構變數

//可以存放多個不同型態的變數 ex. 裡面有19個int, 12個double,...

[長知識] C語言 - 新手篇章 - 字串、指標應用

#include <stdio.h>
#include <stdlib.h>
#define MAX 1024 

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
//  字串、指標應用
//  java的String 是假字串,都是用字元陣列接的
int i;
char str[MAX];
printf("請輸入一段文字吧~");
gets(str);

[長知識] C語言 - 新手篇章 - 字串

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
// 字串String 為 字元陣列

char str[] = "Hello!";

[長知識] C語言 - 新手篇章 - 動態配置記憶體空間

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
//動態配置一塊記憶體空間,以byte為單位
// int *ptr = (int*)malloc(?byte);
int amount;
int i;

printf("輸入幾個int?");
scanf("%i", &amount);

[長知識] C語言 - 新手篇章 - 指標陣列的應用

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

//宣告很長一段的陣列
//陣列唯一連續的記憶體空間
//指標指向陣列第一個位置,是否能透過指標把陣列值讀出來


int main(int argc, char *argv[]) {

int ary[] ={17, 56, 56, 13, 64};
//取得第一個(7)記憶體空間
int *ptr = &ary[0];
int i;
int len = sizeof(ary)/sizeof(ary[0]);

[長知識] C語言 - 新手篇章 - 透過傳值傳址互換記憶體

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

//兩數交換
void changeByValue(int a, int b){
//a, b為方法內的區域變數
//傳值交換

printf("a的記憶體位置:%d,值:%d\n", &a, a);
  printf("b的記憶體位置:%d,值:%d\n", &b, b);
 
  int temp = a;
  a = b;
  b = temp;
 
  printf("a的記憶體位置:%d,值:%d\n", &a, a);
  printf("b的記憶體位置:%d,值:%d\n", &b, b);
 
}

//兩數交換
void changeByAddress(int *a, int *b){
//a, b為方法內的區域變數
//傳址交換

printf("a的記憶體位置:%d,值:%d\n", &a, *a);
  printf("b的記憶體位置:%d,值:%d\n", &b, *b);
 
  int temp = *a;
  *a = *b;
  *b = temp;
 
  printf("a的記憶體位置:%d,值:%d\n", &a, *a);
  printf("b的記憶體位置:%d,值:%d\n", &b, *b);
}

int main(int argc, char *argv[]) {

int a = 10, b = 20;
printf("changeByValue------------------------------------\n");
printf("--a的記憶體位置:%d,值:%d\n", &a, a);
printf("--b的記憶體位置:%d,值:%d\n", &b, b);

changeByValue(a, b); //a:20, b=10
printf("--a透過傳值方法,運算後記憶體位置為:%d,值為:%d\n", &a, a); //a=10, b=20
printf("--b透過傳值方法,運算後記憶體位置為:%d,值為:%d\n", &b, b);

printf("changeByAddress-----------------------------------\n");

printf("--a的記憶體位置:%d,值:%d\n", &a, a);
printf("--b的記憶體位置:%d,值:%d\n", &b, b);
//要傳值給他,可是他只吃址
//所以給址(&a)
changeByAddress(&a, &b);
printf("--a透過傳值方法,運算後記憶體位置為:%d,值為:%d\n", &a, a);
printf("--b透過傳值方法,運算後記憶體位置為:%d,值為:%d\n", &b, b);

return 0;
}

2014年5月23日 星期五

[長知識] C語言 - 新手篇章 - 指標轉換應用

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

int a=10, b=20, c=30;
int *ptr, *ptr_2;

ptr = &a;

printf("a的記憶體本身位置%i,指向的位置%i\n", &a, a);
printf("b的記憶體本身位置%d,指向的位置%d\n", &b, b);
printf("b的記憶體本身位置%d,指向的位置%d\n", &c, c);

//指標本身減2個單位(int = 4 byte),所以就是ptr退8個byte
//最後指標指到c的位置
ptr -=2;
printf("ptr的記憶體本身位置%d,指向的位置%d,內容%d\n", &ptr, ptr, *ptr);

//指標指到b的位置
ptr +=1;
printf("ptr的記憶體本身位置%d,指向的位置%d,內容%d\n", &ptr, ptr, *ptr);

//兩個指標指向同一個位置
ptr_2 = ptr;
printf("ptr的記憶體本身位置%d,指向的位置%d,內容%d\n", &ptr, ptr, *ptr);
printf("ptr_2的記憶體本身位置%d,指向的位置%d,內容%d\n", &ptr_2, ptr_2, *ptr_2);

return 0;

}

[長知識] C語言 - 新手篇章 - 指標應用

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
//Pointer 指標
//所有變數都是記憶體的一個空間
//一塊記憶體可以在不同的地方取用

int a=10, b=20;
//宣告一個指標可以指向int,0byte
//*取值,&取址
// a: int , ptr: int的記憶體位置

int* ptr;
ptr = &a;

printf("%i\n", a);
printf("%i\n", *ptr);

printf("a的記憶體本身位置%i,值為%i\n", &a, a);
printf("b的記憶體本身位置%d,值為%d\n", &b, b);
printf("ptr的記憶體本身位置%d,值為%d,內容為%d\n", &ptr, ptr, *ptr);

//透過ptr把b的值變成10
b = *ptr;
printf("b的記憶體本身位置%d,值為%d\n", &b, b);



*ptr = 100;
printf("a的記憶體本身位置%i,值為%i\n", &a, a);
printf("ptr的記憶體本身位置%d,值為%d,內容為%d\n", &ptr, ptr, *ptr);





return 0;

}

[長知識] C語言 - 新手篇章 - 遞迴三

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int sum(int s, int e){
//遞增,s是定值
if(s==e){
return e;
}else{

// 2 ->3 ->4 ->5
return sum(s+1, e)+s;
}

}


int main(int argc, char *argv[]) {
int start, end;
printf("輸入start:");
scanf("%i", &start);

printf("輸入end:");
scanf("%i", &end);

printf("%i", sum(start, end) );

return 0;

return 0;
}

[長知識] C語言 - 新手篇章 - 遞迴二

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int sum(int s, int e){

if(s==e){
return s;
}else{
//      s=3 e=5
// 5 ->4 ->3
//      sum(s, e-1)+e  "+e"是重點
return sum(s, e-1)+e;
}

}


int main(int argc, char *argv[]) {

int start, end;
printf("輸入start:");
scanf("%i", &start);

printf("輸入end:");
scanf("%i", &end);

printf("%i", sum(start, end) );

return 0;
}

[長知識] C語言 - 新手篇章 - 遞迴

#include <stdio.h>
#include <stdlib.h>

int sum(int n){
//都任何值進去,都會做1加到 n
if(n == 1){
return 1;
}else{
//呼叫自己 sum(n-1)+n,+n被斷開欠著
// 丟5,sum(4)+5, +5欠著去堆疊 ...      
//  5 --> 4 --> 3 --> 2 --> 1
//  5 <-- 4 <-- 3 <-- 2 <-- 1
//  15   10     6     3
// 遞迴是一直往上堆疊,有上限
return sum(n-1)+n;
}

}

int main(int argc, char *argv[]) {
//遞迴
int a;

printf("輸入數字由1加到x \nx=");
scanf("%i", &a);

printf("%i", sum(a));

return 0;

}

[長知識] C語言 - 新手篇章 - 輸入起始值和終點值相加

#include <stdio.h>
#include <stdlib.h>


//輸入起始值和終點值相加,印出結果
int countResult(int start, int end){
int i, sum=0;
for(i=start ; i<=end; i++){
sum += i;
}
return sum;
}

int main(int argc, char *argv[]) {

int start, end;

printf("給我兩個數字,我來做相加吧~\n");
printf("請輸入起始值");
scanf("%i", &start);
printf("請輸入終點值");
scanf("%i", &end);

int result = countResult(start, end);
printf("總和為:%i", result);

return 0;
}

[長知識] C語言 - 新手篇章 - 利用方法將ID搜尋的獎金列出

#include <stdio.h>
#include <stdlib.h>


//怕main在使用getLottery()的時候不認識,所以寫在main上面
int getLottery(int id);

int main(int argc, char *argv[]) {

int id;
printf("請輸入ID!");
scanf("%i", &id);

int award = getLottery(id);
if(award <= 0){
printf("銘謝惠顧!");
}else{
printf("YOUR AWARD:%i" ,award);
}



}

int getLottery(int id){

switch(id%5){
case 0:
return 10000;
case 1:
return 20000;
case 2:
return 30000;
case 3:
return 40000;
}
//default 其他回傳0
return 0;
}


[長知識] C語言 - 新手篇章 - 方法 - 有無回傳值

#include <stdio.h>
#include <stdlib.h>

//方法,就是叫程式幫你做事情
//void: 沒有回傳值

int main(int argc, char *argv[]) {


return 0;

}

//沒有回傳值
void 去掃地 (掃把 a, 拖把 b){
//a, b作為參數來傳遞用,為此方法內的變數
}

//有回傳值
帳單 去存錢 (錢 a){

return 帳單;
}

int saveMoney(int money){
int total

return total;
}

2014年5月20日 星期二

[長知識] C語言 - 新手篇章 - 方法 - 幾的幾次方

#include <stdio.h>
#include <stdlib.h>


//function
void countPow(int x, int p);

int main(int argc, char *argv[]) {
//2的20次方
countPow(2,20);

return 0;
}

[長知識] C語言 - 新手篇章 - 排序法 - 氣泡排序法

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

//排序法 - 氣泡排序法

int num[] = {2, 8,7,30, 14, 66, 95,100, 1};
int sortsize = sizeof(num)/sizeof(int);
int i, j, k;

[長知識] C語言 - 新手篇章 - 二維陣列介紹

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
//二維陣列

int ary[][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};

//第0維,第0個,為1
//第0維,第1個,為2
//第0維,第2個,為3

[長知識] C語言 - 新手篇章 - 陣列介紹

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

//陣列(Array)
//ary[3] 表示 陣列大小為3 (ary[0], ary[1], ary[2])

 int ary[];
ary[0] =5;
ary[1] =10;
ary[2] =15;
printf("總和:%i\n", ary[0]+ary[1]+ary[2]);

[長知識] C語言 - 新手篇章 - for和if應用 - 電梯程式

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
//電梯 break, continue

int floor=101;
int i, find;

printf("先生請問幾樓?");
scanf("%i", &find);

[長知識] C語言 - 新手篇章 - 巢狀for迴圈的應用 - 9x9乘法表

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

//巢狀for迴圈 - 9x9乘法表
//2x1=2   3x1=3   4x1=4   5x1=5   6x1=6   7x1=7   8x1=8   9x1=9
//2x2=4   3x2=6   4x2=8   5x2=10  6x2=12  7x2=14  8x2=16  9x2=18
//2x3=6   3x3=9   4x3=12  5x3=15  6x3=18  7x3=21  8x3=24  9x3=27

2014年5月19日 星期一

[遊記] 苗栗南庄民宿 橄欖樹 2014.01.23

這張民宿晚上的美圖就當作文章進入點吧~

[食記] 台中甜點 - 七個醫師的咖啡 - 試吃會心得

HI~大家好!!
我是小藍

2014.05.17 晚上六點

受到我的室友邀約
得到這個試吃會的機會

七個醫師的咖啡
01

02  

店長的名字很特別唷~
是道地的日本人!!!!

名片上的地址是他們的工作室

( 401 台中市東區振興路275號 )
我們也是在這邊進行試吃活動

2014年5月17日 星期六

[長知識] C語言 - 新手篇章 - 利用do while迴圈做出倒數計時

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int i=10;

[長知識] C語言 - 新手篇章 - 前置遞增&後置遞增

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
//    do-while loop
// 無論如何先做一次內容再做判斷
//   do{      }while();
// do無論如何都會先做一圈

  int i=0, sum=0;

[長知識] C語言 - 新手篇章 - do while迴圈

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
//    do-while loop

// 無論如何先做一次內容再做判斷 
//  do{      }while();

  int i=0, sum=0;

[長知識] C語言 - 新手篇章 - while迴圈相加總合以及while迴圈病毒

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
// while迴圈
// while(B),B表示判斷式 

// 印出0到9

int i=0;

[長知識] C語言 - 新手篇章 - for迴圈相加總合以及for迴圈病毒

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
//Loop迴圈
// for(A ;B ;C ){}
// A:初始式, B:判斷式, C:運算式, {}:在{}內重複執行,AC可以不寫,B一定要寫 
// i++, i=i+1, i+=1 三個一樣

int i, sum=0;

[長知識] C語言 - 新手篇章 - switch case && if 銀行開戶問題

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

int money;
char bankID;

[長知識] C語言 - 新手篇章 - switch case 用字元判斷

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

//背後執行的是ASCII碼
char input;

printf("嗨!請問你要去哪個國家?\n (A)美國\n (B)中國\n (C)日本\n");

[長知識] C語言 - 新手篇章 - switch case自訂範圍

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int score;

printf("阿呆,你考幾分?");
scanf("%i", &score);

2014年5月15日 星期四

[長知識] C語言 - 新手篇章 - 條件判斷式(switch case )

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {

srand(time(NULL));
int a = rand()%9+1;

[長知識] C語言 - 新手篇章 - 條件判斷式(猜數字遊戲)

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int userinput;

//共取一個亂數庫,否則遊戲會失去平衡機制
srand(time(NULL));
//rand()產生 0~32767 其中一個數字
int answer = rand()%9+1;  //1~9亂數產生

[長知識] C語言 - 新手篇章 - 條件判斷式(三個數字比大小)

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int num1, num2, num3;
int max;

printf("輸入三個數字比大小");
scanf("%i%i%i", &num1, &num2, &num3);

[長知識] C語言 - 新手篇章 - 條件判斷式,年紀判斷

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int age;

printf("請輸入您的年紀:");
scanf("%i", &age);

[長知識] C語言 - 新手篇章 - 條件判斷式,判斷奇數或偶數

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

//條件判斷式 if else, while, ...

int input;

printf("請輸入一個整數:");
scanf("%i", &input);

2014年5月13日 星期二

[長知識] C語言 - 新手篇章 - 邏輯運算子

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int a=1, b=2, c=3;

//a < b --> output=0 表示 錯誤
//a < b --> output=1 表示 正確
printf( " %i < %i ? %i \n " , a, b, a<b );  // 1 
printf( " %i < %i ? %i \n" , a, b, a>=b);  // 0

[長知識] C語言 - 新手篇章 - 華氏溫度轉攝氏溫度

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

//華氏溫度
int Fah;
        //攝氏溫度
float Cel;

[長知識] C語言 - 新手篇章 - 老闆請問打幾折

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int price;
float discounts, total;

printf("老闆請問多少錢?\n");

[長知識] C語言 - 新手篇章 - &怎麼用

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {

int enter;

//請求輸入-->轉譯 -->放入記憶體位置
printf("input:\n");

//記憶體取 &enter值,丟到 %i
//&是取得記憶體空間的意思
scanf("%i", &enter);

2014年5月5日 星期一

[長知識] Java 文字操作小小整理

1. 大量的文字操作,StringBuilder類別最快。
2. FileWriter類別是寫入字元檔案較便捷。
3. BufferedReader類別具有緩衝能力,提升讀取檔案的效率。

4. 讀取檔案 InputStreamReader ,再用FileWriter將讀取的內容寫入硬碟檔案。
5. StringBuffer是避免檔案的多次寫入(也就是實現了可變字串)。
6. BufferedWriter類別將文字寫入字元輸出流,緩衝各個字元,進一步提供單一字元、陣列和字串的高效率寫入。  BufferedReader 是高效率寫出。

2014年4月21日 星期一

[長知識] Java 呼叫類別的方法

就是啊,靜態和非靜態。
啊!
對於靜態方法可以直接使用類別名稱來呼叫
啊!
對於非靜態方法就必須使用類別的物件呼叫
就是要new出類別的物件啦!

[長知識] Java 記憶體空間配置 - 堆疊堆積分不清楚

Java把記憶體空間分成兩種
1. 堆疊
2. 堆積

啊!
堆疊裡面
儲存了基本型態和參考變數

堆積裡面
儲存了物件

2014年4月20日 星期日

[長知識] Java 宣告建構子來

Ahhhh....

因為在Java中建立物件的時候呀
需要建構子來先定義
假如說我們類別沒有事先定義建構子的話
編譯器就會自己提供給你一個預設的建構子來用~

那建構子要幹嘛用咧
想說就在全域變數定義就好了啊~
不對不對
建構子的主要目的是我們在new一個物件的時候
程式會建立物件所要執行的工作
這些工作通常就是初始化物件的屬性



//Reference
http://pydoing.blogspot.tw/2011/05/java-constructor.html