'Hoya 개발자 이야기'에 해당되는 글 100건

  1. 2016.05.20 5. Conditional Statements
  2. 2016.05.20 4. Control Flow
  3. 2016.05.19 3. Dictionary
  4. 2016.05.18 2. Array
  5. 2016.05.18 1. 상수와 변수
  6. 2016.04.21 AWS의 주요 기능.
  7. 2015.12.21 Xaml web browser application .xbap 캐시 지우기
  8. 2015.12.18 Method Not Allowed 405 on IIS
  9. 2015.12.07 @ViewBag is Not Working
  10. 2015.12.06 ASP.NET API 부수적으로 알아야할 기능들.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
import UIKit
 
//if
let age = 7
 
if age < 3
{
    print("Baby")
}
else if age >= 3 && age < 20
{
    print("child")
}
else{
    print("adult")
}
 
//Switch
 
switch age
{
    case 1..<3:print("Baby")
    
    case 3..<20:print("Child")
    
    default : print("Adult")
}
 
 
switch age
{
case 0,3,11,12 :print("Baby")
    
case 4...10:print("Child")
    
default : print("Adult")
}
 
cs


'IOS > Swift 문법' 카테고리의 다른 글

7. class  (0) 2016.05.20
6. Functions  (0) 2016.05.20
4. Control Flow  (0) 2016.05.20
3. Dictionary  (0) 2016.05.19
2. Array  (0) 2016.05.18
Posted by Hoya0415
,

4. Control Flow

IOS/Swift 문법 2016. 5. 20. 09:30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//: Playground - noun: a place where people can play
 
import UIKit
 
var age = 0
 
while age < 5
{
    print(age)
    age++
}
 
for var age2 = 0; age2<=5; age2++
{
    print("age2 : \(age2)")
}
 
for _ in 1...5{
    print("5")
}
 
for number in 1...5{
    print(number)
}
 
for name in ["Anna""Alex","Brian","Jack"]
{
    print("hello, \(name)")
}
 
for (animalName, legs) in ["ant":6,"snake":0,"cheetah":4]
{
    print("\(animalName)'s have \(legs) legs")
}
 
for index in 1...5 {
    
    print("\(index) items 5 is \(index * 5)")
    
}
cs

for-In Loops structure :

Closed range operator(...)

for index in 1...5 {
    
    print("\(index) items 5 is \(index * 5)")
    
}

underscore character ( _ ) : don't provide  access to the current value during each iteration of the loop

for _ in 1...5{
    print("5")
}
 

for-in loop with an array to iterate over its 

1
2
3
4
for name in names
{
    print("Hello, \(name)!")
}
cs

You can also iterate over a dictionary to access its key-value pairs

1
2
3
4
5
6
let numberOfLegs = ["spider":8,"ant":6,"cat":4]
 
for(animalName, legCount) in numberOfLegs
{
    print("\(animalName)s have \(legCount) legs")
}
cs


'IOS > Swift 문법' 카테고리의 다른 글

6. Functions  (0) 2016.05.20
5. Conditional Statements  (0) 2016.05.20
3. Dictionary  (0) 2016.05.19
2. Array  (0) 2016.05.18
1. 상수와 변수  (0) 2016.05.18
Posted by Hoya0415
,

3. Dictionary

IOS/Swift 문법 2016. 5. 19. 22:04
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

//: Playground - noun: a place where people can play

import UIKit

 
//mutable dictionary
var legs:Dictionary<String,Int> = [:]
 
var legs2:[String:Int= [:]
 
legs2["ant"= 6
legs2["snake"= 0
print(legs2)
 
var legs3 = ["ant":6"snake":0"cheetah":4]
 
print(legs3)
 
legs3["human"= 2
 
print(legs3)
 
//immutable dictionary
let legs4 = ["ant":6"snake":0"cheetah":4]
 
 
if(legs4.isEmpty)
{
    print("Didn't have Data")
}
else
{
    print("had Data")
    
    legs3["snake"= 10
    
    print(legs3)
}
 
 
var legs5:[String:String= ["YYZ":"Toronto","DUB":"Dublin",
"DUB2":"Dublin2"]
 
print(legs5)
 
for (legValue, legType) in legs5{
    print("\(legValue): \(legType)")
}
cs

written in full as :

Dictionary<Key, Value>

Creating an Empty Dictionary as :

var nameOfIntegers =[Int:String] ()

var nameOfIntegers:[Int:String] = [:]




'IOS > Swift 문법' 카테고리의 다른 글

6. Functions  (0) 2016.05.20
5. Conditional Statements  (0) 2016.05.20
4. Control Flow  (0) 2016.05.20
2. Array  (0) 2016.05.18
1. 상수와 변수  (0) 2016.05.18
Posted by Hoya0415
,

2. Array

IOS/Swift 문법 2016. 5. 18. 22:49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//: Playground - noun: a place where people can play
 
import UIKit
 
//mutable array
var comment:Array<String>= []
var comment2:[String= []
 
comment2.append("Anna")
comment2.append("Alex")
 
var comment3 = ["Anna","Alex","Brian","Jack"]
 
comment3 += ["Song"]
comment3 += ["jin"]
comment3 += ["Kim"]
 
print(comment3[1])
 
comment3[1= "Tim"
 
comment3[2...4= ["Free","Style"]
 
print(comment3)
 
 
 
//immutable array
let comment4 = ["Anna","Alex","Brian","Jack"]
//comment4 += "Song"
 
//var someInts = [Int]()
 
//print("someInts is of type [int[ with \(someInts.count) iteems.")
cs

배열 풀 닉네임으로 선언을 했을 경우는 변수명 뒤에 :Array[Element]를 써주면 된다

Written in full as : var 변수명:Array<Element>

짧게 배열을 선언 할려면 변수명 뒤에:[Element] 타입을 사용하면 된다.

shorthand [Element]

var 변수명 = [Element]


'IOS > Swift 문법' 카테고리의 다른 글

6. Functions  (0) 2016.05.20
5. Conditional Statements  (0) 2016.05.20
4. Control Flow  (0) 2016.05.20
3. Dictionary  (0) 2016.05.19
1. 상수와 변수  (0) 2016.05.18
Posted by Hoya0415
,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//: Playground - noun: a place where people can play
import UIKit
 
//type inference
 
var str = "Hello, playground"
 
var version = 1.0
 
let year = 2015
 
let handsome = true
 
 
 
var str2:String = "Hello, playground"
 
var version2:Double = 1.0
 
let year2:Int = 2015
 
let handsome2:Bool = true
cs


type inference 기능으로 인해 명시적으로 변수 타입을 선언하지 않아도 된다.

var 변수명 = 값 :

상수를 선언 할 경우에는 let이라는 키워드를 이용하면 된다

let 변수명 = 값;

명시적으로 변수를 선언이 가능한데 변수명 뒤에 자료형 값을 써주면 된다.

var 변수명:자료형 = 값


'IOS > Swift 문법' 카테고리의 다른 글

6. Functions  (0) 2016.05.20
5. Conditional Statements  (0) 2016.05.20
4. Control Flow  (0) 2016.05.20
3. Dictionary  (0) 2016.05.19
2. Array  (0) 2016.05.18
Posted by Hoya0415
,

AWS의 주요 기능.

Software/AWS 2016. 4. 21. 10:00

PaaS(플랫폼 서비스

IaaS(인프라 서비스)

SaaS(쏘프트웨어 서비스)


AWS의 주력 서비스

EC2 : (Elastic Compute Cloud, 서버 자원을 임대해주는 IaaS)

독립적인 컴퓨터

Linux, Window 운영체제 제공

웹서버, 에플리케이션 서버로 사용


S3 : (Simple Storage Service, 저장공간(스토리지)을 임대해주는 IaaS)

파일 서버

무제한 저장

스케일은 아마존 인프라가 담당.

1byte ~ 5Tra 바이트의 단일 파일을 저장 가능


RDS : (Relational Database Service) MySQL, PostgreSQL, MariaDB, Oracle BYOL 또는 SQL Server를 위한 관리형 관계형 데이터베이스 서비스

Mysql, Oracle, SQL Server 지원

백업, 리플리케이션을 아마존 인프라가 자동으로 제공


ELB

Elastic Load Balancing

EC2로 유입되는 트래픽을 여러대의 EC2로 분산

장애가 발생한 EC2를 감지해서 자동으로 배제

Auto Scaling 기능을 이용해서 EC2를 자동으로 생성,삭제


IoT : 디바이스를 클라우드에 쉽고 안전하게 연결. 수십억 개의 디바이스와 수조 건의 메시지로 안정적으로 확장.


ECR :  개발자가 Docker 컨테이너 이미지를 손쉽게 저장, 관리 및 배포할 수 있게 해주는 완전관리형

Posted by Hoya0415
,

Xaml web browser application 을 업데이트 할 경우 캐시를 지워줘야함


Visual Studio 명령 프롬프트를 실행해서 아래 메세지를 치면 된다. 

mage -cc


명령 프롬프트 창이 없으면, cmd에서 아래의 명령어를 치면 된다.

rundll32 %windir%\system32\dfshim.dll CleanOnlineAppCache


'.NET 개발 > C#' 카테고리의 다른 글

lambda expression  (0) 2016.06.05
공변성, 반공변성  (0) 2016.06.05
WebSecurity 클래스  (0) 2015.12.03
NamedPipeClientStream 에러 : System.UnauthorizedAccessException  (0) 2015.11.17
명명된 파이프  (0) 2015.11.11
Posted by Hoya0415
,

IIS에서 PUT DELETE가 안될 때 Method Not Allowed 405

WEB API 에서 DELETE Method 만들고, 로컬에서 테스트 할 때는 정상적으로 작동하지만,

IIS 서버에 호스팅하게 되면, 안될 수 가 있다. HTTP Method에 제한이 걸려있을 텐데

Handler Mapping에서 WebDav 쪽에 Method가 제한되



IIS Handler Mapping -> WebDAV를 찾는다..



요청 제한 버튼을 클릭한다.


동사 탭을 선택 후 모든 동사들 체크해서 확인 누른다.





<handlers>
  <remove name="WebDAV" />
  <add name="WebDAV" path="*" verb="*" modules="WebDAVModule" resourceType="Unspecified" requireAccess="None" />
</handlers>

그리고 위에 구문을 Web.config에 써주면 된다. 
IIS를 재실행하자


Posted by Hoya0415
,

나는 Empty Web Project를 만들어서, MVC를 시도하고 있다. 

index 페이지로 이동 하던 중에 ViewBag가 작동하지 않는다.

이유는 Views라는 폴더 밑에 Web.config 라는 파일을 내가 생성해주지 않았기 때문이다.


저 파일을 생성하주면 된다.


내용 Web.config 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0"?>
 
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>
 
  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <!--<add namespace="System.Web.Optimization"/>-->
        <add namespace="System.Web.Routing" />
        <add namespace="MoccozyProject" />
      </namespaces>
    </pages>
  </system.web.webPages.razor>
 
  <appSettings>
    <add key="webpages:Enabled" value="false" />
  </appSettings>
 
  <system.webServer>
    <handlers>
      <remove name="BlockViewHandler"/>
      <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
    </handlers>
  </system.webServer>
 
  <system.web>
    <compilation>
      <assemblies>
        <add assembly="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
  </system.web>
</configuration>
 
 
cs


Posted by Hoya0415
,

overall 

http://www.asp.net/media/4071077/aspnet-web-api-poster.pdf


formats of model Binding

http://www.asp.net/web-api/overview/formats-and-model-binding


Self Hosting

http://www.asp.net/web-api/overview/older-versions/self-host-a-web-api


About WebApiConfig Class

http://www.asp.net/web-api/overview/advanced/configuring-aspnet-web-api


Routing 

http://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-in-aspnet-web-api


Message handler

http://www.asp.net/web-api/overview/advanced/http-message-handlers


Model Validation

http://www.asp.net/web-api/overview/formats-and-model-binding/model-validation-in-aspnet-web-api


.NET CLIENT CALLING

http://www.asp.net/web-api/overview/advanced/calling-a-web-api-from-a-net-client


WEB API NINJECTION

http://www.asp.net/web-api/overview/advanced/dependency-injection

unit testing 

http://www.asp.net/web-api/overview/testing-and-debugging/unit-testing-with-aspnet-web-api


'.NET 개발 > ASP.NET Web API' 카테고리의 다른 글

Method Not Allowed 405 on IIS  (0) 2015.12.18
@ViewBag is Not Working  (0) 2015.12.07
Asp.Net Configuration Tool In Visual Studio 2013  (0) 2015.07.15
aspnetdb 생성  (0) 2015.07.14
IPrincipal 와 Identity  (0) 2015.07.14
Posted by Hoya0415
,