운영체제 :  window7 


1.키바나 다운로드 

> https://www.elastic.co/downloads/kibana



2. KIBANA 설정 변경

config 의 kibana.yml      

   elasticsearch.url 주석 해제





3. kibana.bat 실행




4. http://localhost:5601/ 




>> 혹시 설치 후 키바나 호스트를 못잡을 경우 elastic엔진 구동 후 재시도 

'검색엔진' 카테고리의 다른 글

5.[Elasticsearch] KIBANA로 데이터 조회 및 넣기  (0) 2017.09.19
4.[Elasticsearch] Logstash다운로드 하기  (0) 2017.09.15
2.[Elasticsearch] 데이터 넣기  (0) 2017.08.31
1. 엘라스틱서치 설치  (0) 2016.10.19
참고 링크  (0) 2016.09.07

운영체제 :  window7 



1. cmd


1) cd B:\STUDY\Java\elasticsearch\bin

2) service start 로 엘라스틱 실행




2. git 으로 데이터 넣기

1) 아래 git-bash.exe 를 실행 하여 명령어 입력

curl -XPUT http://localhost:9200/blog/article/1 -d '{"name":"noh","age":"20","family":["father","mother"]}'



2) 브라우저에  http://localhost:9200/blog/article/1



.NET 으로 구현



1. while문 으로 처리


public partial class Default : System.Web.UI.Page {     protected int targetN = 0;     protected int intN = 0;     protected string strRtn = "";     protected void Page_Load(object sender, EventArgs e)     {         targetN = 233;         intN = 16;         strRtn = mf_ConvertN(targetN,intN);      }     protected string mf_ConvertN(int _targetN, int _intN)     {         bool End = true;         string rtn ="";         int a=0; // 몫         int b=0; // 나머지         List <int> ConvertRtn = new List<int>();                   while (End) {             int starget = ConvertRtn.Count > 0 ? a : _targetN ;             a = starget / _intN;             b = starget % _intN;             ConvertRtn.Add(b);             if (a < _intN)             {                 End = false;        // N진수 보다 작아질 경우 빠져나온다             }         }         rtn = a.ToStringExt("");         for(int i = (ConvertRtn.Count-1); i>=0; i--){             rtn += ConvertRtn.ElementAt(i).ToStringExt("");         }         return rtn;     } }


2. 재귀 호출

 #region N진수 변환 작업
    public class Algorism_Dt
    {
        List<int> ConvertRtn = new List<int>();         // 나머지 저장 list 
        string strRtnVal = "";                          // 결과 값
 
        #region N진수 변환 함수
        public string mf_ConvertN(int _targetN, int _intN, string _strRtnVal)
        {
 
            if (_strRtnVal != "")                           // 결과 값이 나왔을때 
            {
                strRtnVal = _strRtnVal;
                return strRtnVal;
            }
            else {
 
                int intQt = 0;                              // 몫
                int intRm = 0;                              // 나머지
                int intTargetValue = _targetN;              // 변환 값
 
                intQt = intTargetValue / _intN;
                intRm = intTargetValue % _intN;
 
                ConvertRtn.Add(intRm);
 
                if (intQt <= _intN)                         // 빠져 나옴
                {
                    strRtnVal = intQt.ToStringExt("");
                    for (int i = (ConvertRtn.Count - 1); i >= 0; i--)
                    {
                        strRtnVal += ConvertRtn.ElementAt(i).ToStringExt("");
                    }
 
                    mf_ConvertN(intQt, _intN, strRtnVal); // 결과 값 리턴 재귀 호출
                }
                else
                {
                    mf_ConvertN(intQt, _intN, strRtnVal); // 재귀 호출
                }
 
 
                return strRtnVal;
            }
        }
        #endregion
 
    } 
    #endregion

재귀 함수 장/단점
장 1. 소스코드 길이가 짧아진다.

    2. 프로그램의 개념 잡기용으로 많이 나옵니다.
단 1.소스를 이해하는데 시간이 걸린다.

    2. 느리다.


문제 출처 : http://codingdojang.com/scode/458#answer-filter-area


'알고리즘공부' 카테고리의 다른 글

문제 사이트  (0) 2018.03.28

+ Recent posts