Posts

AP102 2016/5/26 早上

AP102 2016/5/26 早上 LOGIN //Parse JSON to objects NSMutableDictionary * datas = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error: nil ]; // NSJSONReadingMutableContainers = (1UL << 0),000000001=1 // NSJSONReadingMutableLeaves = (1UL << 1), 000000010=2 // NSJSONReadingAllowFragments = (1UL << 2) 000000100=4 NSString *message = nil ; NSMutableDictionary * userInfo = datas[@ "user_info" ]; NSNumber *karma = userInfo[@ "karma" ]; if (datas[@ "error_text" ]!= nil ){ message = datas[@ "erroe_text" ]; } else { message=@ "Login successfully" ; } GCD用法 //分兩條路 dispatch_async //做完才執行 dispatch_sync 跳出karma dispatch_async (dispatch_get_main_queue(), ^{ NSString * karmaString = [ NSString stringWithFormat:@ "Karma:%f...

深入淺出SQL

深入淺出SQL 啟動關聯式資料庫管理系統 (relation 終端機輸入這行進入SQL mysql -h localhost -u root -p 輸入密碼 Enter password: 進入歡迎畫面 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 31 Server version: 5.7.12 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 建立資料庫 mysql> CREATE DATABASE gregs_list; Query OK, 1 row affected ( 0.01 sec ) 使用資料庫 mysql> USE gregs_list ; Database changed 如果只有一個資料表是否還要資料庫? A:所有資料表都要放在資料庫內,給予資料庫權限會比給予單一資料表權限來的簡單。 MySQL是否有大小寫區分? A:不必,但指令與資料庫名稱分開大小寫可區分 CREATE DATABASE gregs_list 命名資料庫有注意事項嗎? A:避免大小寫混雜 ‘的符號可以使用嗎? A:在SQL內有特殊的使用 CREATE TABLE建立資料表 doughnut_list資料表名稱 do...

AP102 2016/5/25 下午

AP102 2016/5/25 早上

Title6

Title6 MKPointAnnotation 不是UI 只是資料物件存放大頭針的相關資料 CLLocationCoordinate2D annotationCoodinate = currentLocation .coordinate ; annotationCoodinate .latitude += 0.0005 ; annotationCoodinate .longitude += 0.0005 ; MKPointAnnotation * annotation =[MKPointAnnotation new] ; //存經緯度座標 標題 副標題 annotation .coordinate =annotationCoodinate ; annotation .title = @ "KFC" ; annotation .subtitle =@ "真好吃��" ; //添加到MapView [_mainMapView addAnnotation:annotation] ; protocol不見得搭配delegate來使用 protocol的定義是一堆方法或者是property的集合 protocol定義的是一種溝通方式 delegate基於protocol 存在

資料庫安裝錯誤

Last login: Tue May 24 21:36:21 on ttys000 FinancialbraindeMacBook-Air:~ financialbrain$ 1 -bash: 1: command not found FinancialbraindeMacBook-Air:~ financialbrain$ 2 -bash: 2: command not found FinancialbraindeMacBook-Air:~ financialbrain$ 3 -bash: 3: command not found FinancialbraindeMacBook-Air:~ financialbrain$ jacob@promote:~$ mysql -u root -p -bash: jacob@promote:~$: command not found FinancialbraindeMacBook-Air:~ financialbrain$ Enter password: -bash: Enter: command not found FinancialbraindeMacBook-Air:~ financialbrain$ ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) -bash: syntax error near unexpected token `(' FinancialbraindeMacBook-Air:~ financialbrain$ 1 -bash: 1: command not found FinancialbraindeMacBook-Air:~ financialbrain$ 2 -bash: 2: command not found FinancialbraindeMacBook-Air:~ financialbrain$ 3 -bash: 3: command not found FinancialbraindeMacBook-Air:~ financialbrain$ jaco...

資料庫

Image
安裝MySQL 點選Community 點選最下面的.DMG按下download 不需要註冊 直接點選選N 點選這行 No thanks, just start my download. 安裝完成以後會出現一個請你紀錄密碼的警視窗 安裝教學 http://jacob110.github.io/2015/10/13/mac-os-install-mysql5-7/ database利用query 的查詢行為 畫一個圓柱體就代表著database 由column 與row組成 一個資料庫內可能有多個資料表 field 欄位 (資料欄) record 記錄(資料列) 安裝 http://m.blog.csdn.net/article/details?id=51220684 移除 http://mini.nidbox.com/diary/read/7485055