[javascript] json 이쁘게 보여주는법 function output(inp) { document.body.appendChild(document.createElement('pre')).innerHTML = inp;} function syntaxHighlight(json) { json = json.replace(/&/g, '&').replace(//g, '>'); return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { var cls = 'number'; if (/^"/.test(match)) { if (/:$/.test(match)) { cls .. 더보기 [Elasticsearch] php에서 elasticsearch 다루기 # composer.json 파일 생성 후 아래 내용 입력{ "require": { "elasticsearch/elasticsearch": "~5.0" }} # composer.json 위치에서 다운로드curl -s http://getcomposer.org/installer | phpphp composer.phar install --no-dev # 사용하고자 하는 php에 생성된 "vendor" 디렉토리를 옮긴 후 아래와 같이 사용require 'vendor/autoload.php';use Elasticsearch\ClientBuilder; $client = ClientBuilder::create()->build(); 출처 : https://www.elastic.co/guide/en/elasticsear.. 더보기 [JAVA] String -> json [JAVA] String -> JSON import net.sf.json.JSONObject;import net.sf.json.JSONSerializer; String jsonData = "{'name':'kkyun', 'age':31}"; JSONObject jsonObject = JSONObject.fromObject(JSONSerializer.toJSON(jsonData)); 출처 : http://childeye.tistory.com/entry/String-Json 더보기 이전 1 2 3 4 5 6 7 ··· 44 다음