'전체 글'에 해당되는 글 1800건

  1. 2019.04.10 (C#) resolving-method-overloads
  2. 2019.04.10 Oracle 11g 설치 및 환경 구성
  3. 2019.04.08 이클립스-개발환경-UTF8-인코딩-설정
  4. 2019.04.06 jsp 1강
  5. 2019.04.05 (C#) 타입 비교
  6. 2019.04.05 (C#) Array to Dictionary (Linq)

(C#) resolving-method-overloads

Unity3D/C# 2019. 4. 10. 16:21
반응형

https://stackoverflow.com/questions/19399382/is-there-any-priority-when-resolving-method-overloads

 

 

반응형

'Unity3D > C#' 카테고리의 다른 글

구조체(struct) 와 클래스(class)의 차이점  (0) 2019.08.15
visual studio code 에서 c# 디버깅 하기  (0) 2019.08.14
(C#) 타입 비교  (0) 2019.04.05
(C#) Array to Dictionary (Linq)  (0) 2019.04.05
인벤토리 만들기 (제너릭)  (0) 2019.04.02
:

Oracle 11g 설치 및 환경 구성

DB/Oracle 11g 2019. 4. 10. 09:12
반응형

https://wikidocs.net/3900

 

 

 

비밀번호 재 설정 

https://m.blog.naver.com/baekmg1988/221298569322

SQL Plus한글 깨짐 

https://colt357.tistory.com/entry/oracle-sqlplus-%ED%95%9C%EA%B8%80-%EA%B9%A8%EC%A7%90-%ED%98%84%EC%83%81

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
SQL*Plus: Release 11.2.0.1.0 Production on Wed Apr 10 16:41:35 2019
 
Copyright (c) 19822010, Oracle.  All rights reserved.
 
Enter user-name: system
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
 
 
Enter user-name: system
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
 
 
Enter user-name: sys as sysdba
Enter password:
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL> alter user scott account unlock;
 
User altered.
 
SQL> conn
Enter user-name: scott
Enter password:
ERROR:
ORA-28001: the password has expired
 
 
Changing password for scott
New password:
Retype new password:
Password changed
Connected.
SQL> conn
Enter user-name: scott
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
 
 
Warning: You are no longer connected to ORACLE.
SQL> conn
Enter user-name: scott
Enter password:
Connected.
SQL> show user
USER is "SCOTT"
SQL> conn
Enter user-name: sys as sysdba
Enter password:
Connected.
SQL> alter user system identified by 1234
  2  ;
 
User altered.
 
SQL> alter user hr identified by 1234;
 
User altered.
 
SQL> conn system/1234
ERROR:
ORA-28000: the account is locked
 
 
Warning: You are no longer connected to ORACLE.
SQL> conn sys as sysdba/1234
SP2-0306: Invalid option.
Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM}] [edition=value]]
where <logon> ::= <username>[/<password>][@<connect_identifier>]
      <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>]
SQL> conn
Enter user-name: sys as sysdba
Enter password:
Connected.
SQL> alter user system account unlock;
 
User altered.
 
SQL> alter user hr account unlock;
 
User altered.
 
SQL> conn
Enter user-name: hr
Enter password:
Connected.
SQL> show user;
USER is "HR"
SQL> select status from V$instance;
select status from V$instance
                   *
ERROR at line 1:
ORA-00942table or view does not exist
 
 
SQL>
 
 
반응형

'DB > Oracle 11g' 카테고리의 다른 글

mac sqldeveloper vender code 17176  (0) 2019.05.09
mac oracle 11g xe vender code 17002  (0) 2019.05.09
오라클 삭제후 재설치  (0) 2019.05.01
:

이클립스-개발환경-UTF8-인코딩-설정

카테고리 없음 2019. 4. 8. 01:15
반응형

https://gangzzang.tistory.com/entry/%EC%9D%B4%ED%81%B4%EB%A6%BD%EC%8A%A4-%EA%B0%9C%EB%B0%9C%ED%99%98%EA%B2%BD-UTF8-%EC%9D%B8%EC%BD%94%EB%94%A9-%EC%84%A4%EC%A0%95

반응형
:

jsp 1강

카테고리 없음 2019. 4. 6. 23:25
반응형

JSP의 개요

스크립틀릿

표현식 

페이지 모듈화 

서블릿

 

 

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
<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
 
<!-- 외부 클래스  import -->
<%@ page import="java.util.Date" %>
<%@ page import="java.text.SimpleDateFormat" %>
 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
    <%
        Date nowDate = new Date(); //날짜 객체 
        out.println(nowDate+"<br>");    //웹 브라우저에 html코드 출력 
        System.out.println("nowDate: " + nowDate);//톰캣의 콘솔에 출력 
        //날짜의 출력 형식 제공 
        //yyyy : 연도, MM : 월, dd : 날짜, HH : 24시간, hh : 12시간 
        //mm : 분, ss : 초 
        SimpleDateFormat format = new SimpleDateFormat("yyyy년 MM월 dd일 a HH:mm:ss");
        //날짜포멧 .format(date객체) 출력형식으로 변환
        String formatDate = format.format(nowDate);
    %>
    <!-- 표현식 -->
    현재 날짜는 <%=formatDate %>입니다.
</body>
</html>
 
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<!-- 서블릿 정보 출력 -->
<!-- JSP(Java Server Pages) : server에서 실행되는 자바 웹페이지 -->
<!-- 자바 기반 스크립트 언어  -->
<!-- 자바의 기능을 그대로 사용가능  -->
<!-- HTTP에 대한 클라이언트의 요청 처리/응답 -->
<!-- 웹 애플리케이션에서 결과 화면을 생성할때 주로 사용 -->
<!-- jsp는 내부적으로 servlet으로 변환되어 실행됨 -->
<!-- jsp의 배포 디렉토리 : 이클립스에서 작업하는 폴더와 다름  -->
<!-- D:\workspace\java\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\jsp01\org\apache\jsp\ch01 -->
 
<%=getServletInfo() %>
</body>
</html>
 
 

 

서블릿 코드 경로 

D:\workspace\java\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\jsp01\org\apache\jsp\ch01

page 모듈화 

Front end (사용자 화면, jsp 페이지 -View)
Back end (톰캣 콘솔창, Model, Controller)

<%@ inclide file="불러올 페이지 주소" %>
1개의 클래스로 컴파일 됨 (변수 공유가능)

 

jsp:include page="불러올 페이지 주소"  />
2개의 클래스로 컴파일 됨 (변수 공유 안됨, 정적인 페이지)

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!-- jspf파일을 포함시킴 -->
<%@ include file="color.jspf"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
body {
    background: <%=bodyback_c%>
}
</style>
</head>
<body>
</body>
</html>
 
 

page모듈화 
Front end (사용자 화면, jsp페이지 -View)
Back end (톰캣 콘솔창, Model & Controller)

<%@ include file = "불러올 페이지 주소" %>
    1개의 클래스로 컴파일됨 (변수 공유 가능)


    2개의 클래스로 컴파일 됨 (변수 공유 x, 정적인 페이지)

http status code (http 상태 코드)

200 - success
403 - 권한 문제 
404 - 잘못된 url
500 - internal server error(서버의 논리적 오류)

반응형
:

(C#) 타입 비교

Unity3D/C# 2019. 4. 5. 15:41
반응형

 

 

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
 
namespace ConsoleApp2
{
    class App
    {
        public App() { }
 
        Dictionary<int, WeaponData> dicWeaponData;
        Dictionary<int, CharacterData> dicChracterData;
 
        public void Start()
        {
            this.dicWeaponData = new Dictionary<int, WeaponData>();
            this.dicChracterData = new Dictionary<int, CharacterData>();
 
            this.ReadFileAndAddToDictionary<WeaponData>("./data/weapon_data.json", dicWeaponData);
            this.ReadFileAndAddToDictionary<CharacterData>("./data/character_data.json", dicChracterData);
 
            this.ConsoleFromDictionary(this.dicWeaponData);
            this.ConsoleFromDictionary(this.dicChracterData);
        }
 
        // 파일이있는 경로(문자열)를 전달하면 사전에 등록 해줬으면...
        private void ReadFileAndAddToDictionary<T>(string path, Dictionary<int, T> dic) where T : RawData
        {
            //파일 읽기
            var json = File.ReadAllText(path);
 
            //역직렬화 
            var arrDatas = JsonConvert.DeserializeObject<T[]>(json);
 
            foreach (var data in arrDatas)
            {
                dic.Add(data.id, data);
            }
        }
 
        //내가 원하는 사전에 있는 내용들이 출력되었으면..
        private void ConsoleFromDictionary<T>(Dictionary<int, T> dic)
        {
            Console.WriteLine("ConsoleFromDictionary: {0}", dic);
 
            foreach (var element in dic)
            {
                var type = element.Value.GetType();
                if (type == typeof(WeaponData))
                {
 
                }
                if (element.Value is WeaponData)
                {
                    // 처리로직
                }
 
 
                //if (element.Value.GetType() is WeaponData)
                //{
                //    var weaponData = element.Value as WeaponData;
                //    Console.WriteLine("{0}, {1}, {2}", weaponData.id, weaponData.name, weaponData.max_level);
                //}
                //else if (element.Value.GetType() is CharacterData)
                //{
                //    var characterData = element.Value as CharacterData;
                //    Console.WriteLine("{0}, {1}", characterData.id, characterData.name);
                //}
            }
        }
 
    }
}
 
 
 

https://docko.tistory.com/entry/C-%ED%81%B4%EB%9E%98%EC%8A%A4-%ED%83%80%EC%9E%85-%EB%B9%84%EA%B5%90

 

C# 클래스 타입 비교

C#에서 클래스 타입을 비교하는 2가지 방법입니다. 1 2 3 4 5 6 7 8 9 10 11 string str = "문자"; if (str.GetType() == typeof(string)) { // 처리 로직 } if (str is string) { // 처리로직 } Colored by Color..

docko.tistory.com

 

반응형

'Unity3D > C#' 카테고리의 다른 글

visual studio code 에서 c# 디버깅 하기  (0) 2019.08.14
(C#) resolving-method-overloads  (0) 2019.04.10
(C#) Array to Dictionary (Linq)  (0) 2019.04.05
인벤토리 만들기 (제너릭)  (0) 2019.04.02
referencesource microsoft  (0) 2019.04.02
:

(C#) Array to Dictionary (Linq)

Unity3D/C# 2019. 4. 5. 13:52
반응형

T[]에는 ToDictionary에 대한 정의가 포함되어 있지 않고 가장적합한 확장 메서드 오버로드 Enumerable.ToDictionary<int, T>(IEnumerable, Func<int, T> 에는 IEnumerable형식의 수신기가 필요합니다.

 

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
46
47
48
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    public class App
    {
        private DataLoader dataLoader;      //데이터 로드 담당 
        private DataStorage dataStorage;    //데이터 자장 담당 
 
        public App()
        {
            this.dataLoader = new DataLoader();
            this.dataStorage = new DataStorage();
        }
 
        public void Start()
        {
            this.DisplayDataValues<WeaponData>("./data/weapon_data.json");
            Console.WriteLine();
            this.DisplayDataValues<CharacterData>("./data/character_data.json");
        }
 
        public void DisplayDataValues<T>(string path) where T : RawData
        {
            //데이터 로드 (파일 읽기)
            var arrWeaponDatas = this.dataLoader.LoadData<T>(path);
            this.dataStorage.Store<T>(arrWeaponDatas);
            //불러오기 테스트 
            T[] values = dataStorage.GetData<T>();
            Dictionary<int, T> dictionary = values.ToDictionary(data => data.id);
 
            //T[]에는 ToDictionary에 대한 정의가 포함되어 있지 않고 가장적합한 확장 메서드 오버로드 Enumerable.ToDictionary<int, T>(IEnumerable, Func<int, T> 에는 IEnumerable형식의 수신기가 필요합니다.
            //var dictionary = values.ToDictionary<int, T>(data => data.id);
 
 
            // Display all keys and values.
            foreach (KeyValuePair<int, T> pair in dictionary)
            {
                Console.WriteLine("{0}"pair.Value.id);
            }
        }
    }
}
 
 
 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var app = new App();
            app.Start();
 
            //var test = new Test();
            //test.Test3();
        }
    }
}
 
 
 

 

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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
 
namespace ConsoleApp1
{
    //데이터 로드 클래스 
    public class DataLoader
    {
        public DataLoader()
        {
 
        }
 
        //데이터 로드 메서드 
        public T[] LoadData<T>(string path)
        {
            //파일 읽기 
            var json = File.ReadAllText(path);
            //역직렬화 
            var arrDatas = JsonConvert.DeserializeObject<T[]>(json);
            return arrDatas;
        }
    }
}
 
 
 

 

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
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
 
namespace ConsoleApp1
{
    //데이터 적재 클래스 
    public class DataStorage
    {
        private ArrayList arrayList;
 
        public DataStorage()
        {
            this.arrayList = new ArrayList();
        }
 
        //저장 
        public void Store<T>(T[] arrDatas) where T : RawData
        {
            arrayList.Add(arrDatas);
        }
 
        //불러오기 
        public T[] GetData<T>()
        {
            T[] rtnArrDatas = null;
 
            foreach (var arr in this.arrayList)
            {
                if (arr is T[])
                {
                    rtnArrDatas = arr as T[];
                    break;
                }
            }
            return rtnArrDatas;
        }
    }
}
 
 
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    //데이터 매핑 클래스 (바인딩클래스)
    public class WeaponData : RawData
    {
        public string name;
        public int max_level;
        public float damage_min;
        public float damage_max;
    }
}
 
 
 

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    public class RawData
    {
        public int id;
    }
}
 
 
 

 

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ConsoleApp1
{
    public class Test
    {
        public Test()
        {
        }
 
        public void Test1()
        {
            // Example integer array.
            int[] values = new int[]
            {
            1,
            3,
            5,
            7
            };
 
            // First argument is the key, second the value.
            Dictionary<intbool> dictionary =
                values.ToDictionary(v => v, v => true);
 
            // Display all keys and values.
            foreach (KeyValuePair<intbool> pair in dictionary)
            {
                Console.WriteLine(pair);
            }
        }
 
        public void Test2()
        {
            // Example integer array.
            WeaponData[] values = new WeaponData[] { };
 
            // First argument is the key, second the value.
            Dictionary<int, WeaponData> dictionary =
                values.ToDictionary(data => data.id);
 
            // Display all keys and values.
            foreach (KeyValuePair<int, WeaponData> pair in dictionary)
            {
                Console.WriteLine(pair);
            }
        }
 
        public void Test3()
        {
            var dataLoader = new DataLoader();
            var dataStorage = new DataStorage();
 
 
 
            //데이터 로드 (파일 읽기)
            var arrWeaponDatas = dataLoader.LoadData<WeaponData>("./data/weapon_data.json");
            dataStorage.Store<WeaponData>(arrWeaponDatas);
 
            // Example integer array.
            WeaponData[] values = dataStorage.GetData<WeaponData>();
 
            // First argument is the key, second the value.
            Dictionary<int, WeaponData> dictionary =
                values.ToDictionary(data => data.id);
 
            // Display all keys and values.
            foreach (KeyValuePair<int, WeaponData> pair in dictionary)
            {
                Console.WriteLine("{0} {1}"pair.Value.id, pair.Value.name);
            }
        }
    }
}
 
 
 
반응형

'Unity3D > C#' 카테고리의 다른 글

(C#) resolving-method-overloads  (0) 2019.04.10
(C#) 타입 비교  (0) 2019.04.05
인벤토리 만들기 (제너릭)  (0) 2019.04.02
referencesource microsoft  (0) 2019.04.02
IEnumerator, IEnumerable 상속받은 Inventory 구현 (인덱서)  (0) 2019.04.01
: