What Is Software Design?

程式設計不是 “building software”,而是 “designing software”。

Is Design Dead?

軟體系統的設計是演進來的,不能一步到位,而是要藉由憑繁與使用者互動得到的回饋來修改系統設計。

Programming is Gardening, not Engineering

與其把程式設計比喻成蓋房子,實際上更像是園藝。

Orthogonality and the DRY Principle

所有程式設計活動其實都是維護,因為絕大部分的時間都在改code,寫一點改一點。即使是新專案,也很快需要回頭作修改。

2014年1月23日 星期四

利用Foundation來設計適應的web app ui 版型

本文介紹的是位於美國加州Campbell,一家名叫"Zurb"的設計公司所製作的Foundation框架。Pixar(皮克斯動畫公司)和National Geographic(國家地理頻道)都有採用此框架製作網頁。

從Foundation專案的Features(特色介紹頁),可得知Foundation的三大特色是Grid(格線系統)Rapid Prototyping(快速原型開發)Mobility(支援行動裝置)

HTML Page Markup

<!DOCTYPE html> <!--[if IE 9]><html class="lt-ie10" lang="en" > <![endif]--> <html class="no-js" lang="en" > <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Foundation 5</title> <!-- If you are using CSS version, only link these 2 files, you may add app.css to use for your overrides if you like. --> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/foundation.css"> <!-- If you are using the gem version, you need this only --> <link rel="stylesheet" href="css/app.css"> <script src="js/vendor/modernizr.js"></script> </head> <body> <!-- body content here --> <script src="js/vendor/jquery.js"></script> <script src="js/foundation.min.js"></script> <script> $(document).foundation(); </script> </body> </html>


改變版型請參照docs 設定id
http://foundation.zurb.com/docs/

利用 Responsive web design 自動適應所有版型 利用Bootsrap


step1. 先到官方網站去下載Bootstrap
http://getbootstrap.com/

step2.進入網站後 點選 左邊的Download 將套件下載回來!!!


step3.完畢解壓縮,分別會看到css、fonts、js的資料夾

step4.接著到jQuery官網中,下載jqury並放到js的資料夾中。



Bootstrap(RWD)應用:

接著在官網中,可找到以下的表格,此表格相當的重要,主要是在說明,該套件中的螢幕尺寸的那些,分別有四個尺寸,且代稱分別為lg、md、sm、xs....等。 

而Bootstrap是將版面欄位,等分等12塊,因此在設計RWD的版面需用百分比的方式來作設計。 


step5.這樣都懂了吧!!!來自己手做一個網頁試試嚕!!!




範例code

<!DOCTYPE html>
<html>
<head>
<title>test101</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">

<style type="text/css">

#header{height: 100px; background: :#1ab2f1;}
#header .container, #footer .container{border:solid 1px #fff;}
#content-body, #sidebar{border: solid 1px #333;}

html,
body{
height: 100%;
}

#wrap{
min-height: 100%;
height: auto;;
margin: 0 auto -60px;
padding: 0 0 60px;
}

#footer{height: 60px; background: #1ab2f1;}

</style>

</head>

<body>
<div id="wrap">
<div id="header">
<div class="container" style="border:solid 1px #fff;">
check
</div>
</div>


<div class="container"> 
<div class="row">

<div class="col-lg-9" id="content-body">內容</div>
<div class="col-lg-3" id="sidebar">側邊攔</div>
</div>
</div>
</div>

<div id="footer">
<div class="container"> 
版尾
</div>
</div>

<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
</body>


</html>

結果



2014年1月17日 星期五

判別 NSNumber 正確寫法

step1. 錯誤的寫法
NSNumber *value = [data objectForKey:@"samount"];
 if (value == 0)
     {
          NSLog(@" OK :) ");
     }
     else 
     {
          NSLog(@"  Bad :( ");
     }
step2.正確的用法
if ([value isEqual:@(0)])

2014年1月15日 星期三

ios UIImage URL 要讀取網路圖片

code範例:
NSURL *imageURL = [NSURL URLWithString:@"http://example.com/demo.jpg"];
NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
UIImage *image = [UIImage imageWithData:imageData];

2014年1月10日 星期五

Core Data 將設計出來的資料庫轉成 .h 與 .m

step1.
點擊 .xcdatamodel檔案 => add Entity => 新增你的Attributes


step2.點擊 Editor => Create NSManagedObject Subclass....





2014年1月9日 星期四

Core Data 新增版本

step1.新增一個model文件(xcdatamodel)


確認命名版本 建議在後面加上你的版本數字 以後好維護



右邊在選擇你現在需要的版本