본문 바로가기

분류 전체보기

(485)
[Oracle] NULL값을 치환해주는 함수 - NVL, NVL2, NULLIF NVL, NVL2, NULLIF는 NULL값을 치환할 때 사용할 수 있는 함수이다. 이 셋은 Oracle에서만 지원하는 함수이기 때문에 MySQL 등에서는 사용할 수 없다. NVL NVL(Column, Value) NULL값을 다른값으로 변경할 때 사용한다. Column의 값이 NULL일경우 Value의 값을 반환하고, Column의 값이 NULL이 아닐 경우 Column의 값을 반환한다. 예시 NVL(Column, NULL일 경우 반환값) NVL(컬럼, 'IS NULL') -- 컬럼의 값이 NULL 인 경우 'IS NULL' 로 치환 NUL(컬럼, 9999) -- 컬럼의 값이 NULL인경우 9999로 치환 NVL2 NVL2(Column, Value1, Value2) Decode 와 NVL을 합쳐놓은 형..
[iOS] 뷰 컨트롤러 - TapView, UIViewController 생명주기 다수의 뷰 컨트롤러 사용 탭 뷰 컨트롤러를 사용하여 여러 개의 뷰 컨트롤러를 제어한다. TapView 하나의 화면에 여러 개의 View를 Tab 방식으로 보여주는 것이다. 뷰 컨트롤러 뷰 class UI View Controller : ... { var view: UIView! ... } 지연로딩 ViewController가 로딩될 때 화면을 보일 필요가 있으면 view를 로딩하는 방법 사용 이유 : 전체 UIViewController 객체 중에 view가 가장 오버헤드가 크기 때문 ViewController의 view로딩 방법 프로그래밍으로 UiViewController의 loadView() 메서드로 오버 라이딩 인터페이스 빌더에서 스토리보드와 같은 인터페이스 파일 사용 스토리보드 다수의 뷰 컨트롤러를..
[프로그래머스] 완전탐색 - 전력망을 둘로 나누기 문제 풀이 #include #include #include using namespace std; /************************ n : 송전탑의 개수 wires : 전선 정보 *************************/ int g[101][101] = {0}; vector visited; int dfs(int index, int n){ if(visited[index]) return 0; visited[index] = true; int count = 1; for(int i=1; i
[프로그래머스] 완전탐색 - 모음사전 / 중복순열 문제 풀이 #include #include #include using namespace std; vector al = {"A", "E", "I", "O", "U"}; int count = 0; int answer; void dfs(string s, string word){ if(s == word){ answer = count; return; } if(s.size() == 5){ return; } for(int i=0; i
[프로그래머스] 완전탐색 - 카펫 문제 풀이 #include #include #include using namespace std; vector solution(int brown, int yellow) { vector answer; vector b; for(int i=1; i w = brown/2 + 2 - h -> w + h = brown/2 + 2 h를 3으로 세팅한 이유는 h가 3 이상일 때 노란 면적이 나오기 때문이다.
[iOS]텍스트 입력, Delegate 텍스트 필트에서의 입력과 Delegate 텍스트 필드의 속성 Placeholder 위치 : Attribute Inspector > Placeholder Placeholder : P텍스트 필드에 아무것도 입력하지 않았을 때 나오는 값 키보드 스타일 설정 Keyboard Type : Number Pad로 설정하면 숫자로 된 키보드가 나오게 된다 텍스트 필드 변경처리 조건 회씨를 입력하면 섭씨로 변경처리되도록 설정 -> 컨트롤 레이어와 모델 레이어에서 처리한다. 컨트롤레이어 ConversionViewController.swift 생성 // import Foundation import UIKit class ConversionViewControlller : UIViewController { } ViewContro..
[프로그래머스] 정렬 - H-Index / greater<>() 문제 풀이 #include #include #include // sort using namespace std; int solution(vector citations) { int Hindex = 0; sort(citations.begin(), citations.end()); for(int i = 0; i
[프로그래머스]스택 큐 - 다리를 지나는 트럭 문제 풀이 #include #include #include using namespace std; int solution(int bridge_length, int weight, vector truck_weights) { int count = 0; // 시간 int noww = 0; // 현재 다리 위에있는 트럭들의 무게 queue q; for(int i=0 ;i weight){ count = q.front().second + bridge_length; noww -= q.front().first; q.pop(); } q.push(pair(truck_weights[i], count)); noww += truck_weights[i]; } count += bridge_length; return count; } p..