달력

42024  이전 다음

  • 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

티오베 인덱스

 

IT 시대는 빠르게 변모 하는 만큼 개발자 들이 사용하는 언어도 빠르게 변화하고 있다.

매년마다 새로운 프레임 워크들이 출시 되고, 또 생태계 변화에 적응하지 못한 언어는 조금씩 사용자가 줄어 간다.

 

위 티오베 인덱스는 글로벌 개발언어 사용순위를 보여주는 지표이다.

1~ 4위 까지는 근소한 차이로 등위를 매김하고 있고, 파이썬, C, C++ 자바 순으로 보여진다.

 

국내의 웹 개발은  JAVA 단일툴이라고 할만큼 JAVA 사용자가 높은 편이다.

 

다만 표에서 보듯이 C 언어가 높은 순위를 자리하고 있는건 신규 프로젝트라기 보다, 교체 하기 어려운 고착화되거나, 정착된 시스템일 가능성이 농후하다. 

 

물론 특정 분야에서 주력으로 사용되고 있기는 하지만, 최신 프레임워크를 탑재한 언어들에 비해 편의성이 부족하긴 할듯 하다.

 

그럼에도 높은 순위를 유지한다는건 언어로서 굉장히 탄탄하다는 생각이 든다.

 

언어는 도구일뿐 한 언어의 마스터가 되는게 일단 중요하다고 생각 된다.

 

지극히 개인적인 생각이다.

Posted by 무심법
|

AWS 에서 제공하는 AMI2 정보 / 링크 클릭시 자세한 설명을 확인 할 수 있다.

 

 

 

아래 명령어를 통해 php 버전 확인.

sudo amazon-linux-extras |grep php

 

 

ami 확장 리포지토리에서  php 7.3 버전 설치

yum 명령어를 통해 아래 내용 추가 설치 

sudo amazon-linux-extras install php7.3
sudo yum install  php-cli php-common php-gd php-mbstring  php-mysqlnd php-pdo php-fpm php-xml php-opcache php-zip php-bcmath

 

 

php 버전 확인

php -v
Posted by 무심법
|

정부 에서 제공하는 공공데이터

지역코드(lawdcd) 와 년월(ymd)를 입력받아 지역의 매매 자료를 조회한다.

 

이후 KakaoChg 함수는 공공데이터에서 주소를 분리하여 좌표로 변환하는 역할을 가지고 있으나,

테스트로 작성된 코드여서 임시 값으로 테스트만 진행 하였다.


@RestController
public class DataController {

    @GetMapping("/test")
    public String callApiGate(String lawdcd, String ymd) {
        String jsonPrintString = null;
        String apiUrl = "";
       
        // 국토교통부_오피스텔 매매 신고 조회 서비스
        apiUrl = "http://openapi.molit.go.kr/OpenAPI_ToolInstallPackage/service/rest/RTMSOBJSvc/getRTMSDataSvcOffiTrade?"
                + "LAWD_CD=" + lawdcd + "&DEAL_YMD=" + ymd
                + "&serviceKey=******************************";
        // serviceKey 는 공공데이터 포털을 가입후 발급 신청 하여야 한다.
        jsonPrintString = callApiWithJson(apiUrl);
        
        // 받은 데이터 출력 
        System.out.println(jsonPrintString);
        
        // 수신한 공공데이터의 주소 부분한 잘라내어, 맵(카카오,네이버)에 표시 할 수 있는 좌표계로 변환.
        jsonPrintString = KakaoChg("강남대로 100");

        return jsonPrintString;
    }

    private static String GEOCODE_URL="http://dapi.kakao.com/v2/local/search/address.json?query=";
    
    // 카카오 개발자 센터 에서 api 키를 발급 받아야 하며, 아래와 같이 한칸 띄우고 사용한다.
    private static String GEOCODE_USER_INFO="KakaoAK *******************"; 
  
    private String KakaoChg(String args) {
      
        URL obj;
        String jsonPrintString = null;

        try{
            System.out.println(args);
            String address = URLEncoder.encode(args, "UTF-8");
            
            obj = new URL(GEOCODE_URL+address);
         
            HttpURLConnection con = (HttpURLConnection)obj.openConnection();
            
            con.setRequestMethod("GET");
            con.setRequestProperty("Authorization",GEOCODE_USER_INFO);
            con.setRequestProperty("content-type", "application/json");
            con.setDoOutput(true);
            con.setUseCaches(false);
            con.setDefaultUseCaches(false);
         
            Charset charset = Charset.forName("UTF-8");
            BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), charset));
            
            String inputLine;
            StringBuffer response = new StringBuffer();
            
            while ((inputLine = in.readLine()) != null) {
                response.append(inputLine);
            }
            JSONParser json= new JSONParser();
            org.json.simple.JSONObject jsonObject = (org.json.simple.JSONObject)json.parse(response.toString());
            
            jsonPrintString = jsonObject.toString();
      } catch (Exception e) {
         e.printStackTrace();
      }
        return jsonPrintString;
   }

    private String callApiWithJson(String apiUrl) {
        StringBuffer result = new StringBuffer();
        String jsonPrintString = null;
        try {
            URL url = new URL(apiUrl);
            HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
            urlConnection.connect();
            BufferedInputStream bufferedInputStream = new BufferedInputStream(urlConnection.getInputStream());
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(bufferedInputStream, "UTF-8"));
            String returnLine;
            while ((returnLine = bufferedReader.readLine()) != null) {
                result.append(returnLine);
            }

            JSONObject jsonObject = XML.toJSONObject(result.toString());
            jsonPrintString = jsonObject.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonPrintString;
    }
}

간단히 위와 같이 api 를 수신하여 결과를 확인 할 수 있다.

Posted by 무심법
|