function unique(redundantList) {
	var _uniqueList = [];
	$.each(redundantList, function(i, el) {
		if($.inArray(el, _uniqueList) === -1) _uniqueList.push(el);
	});
	
	return _uniqueList;
}


d3.json("/data.json", function(error, datadata) {
	if (error) {
		return console.error(error);
	} else {
		var datajson_data_code_list = [];
		var datajson_adm_code_list = [];
		
		datajson_adm_code_list = unique(datadata.map(function(d) { return d.adm_code; }));
		datajson_data_code_list = unique(datadata.map(function(d) { return d.data_code; }));
		
		d3.csv("/static/kostat_sigungu10-14.csv", function(error, data) {
			if (error) {
				return console.error(error);
			} else{
				var adm_region_list = data;
				var adm_code_list = data.map(function(d) {return d.code;});
				var adm_region_dict = {};
				
				for (item in adm_code_list) {
					adm_region_dict[adm_code_list[item]] = adm_region_list[item].sigungu;
				}
				adm_code_list = unique(adm_code_list.concat(datajson_adm_code_list)).sort();
				
				var table = d3.select("#datatable").append("table").attr("id", "datatablet");
				var trs = table.selectAll("tr").data(adm_code_list).enter().append("tr");
				trs.attr("id", function (d) {return d;});
				trs.append("td").text(function (d) {return d;});
				trs.append("td").text(function (d) {if (adm_region_dict[d]) return adm_region_dict[d];});
				for (item in datajson_data_code_list) {
					trs.append("td").attr("id", function (d) { return "cell_" + d + "_" + datajson_data_code_list[item]; }).style("background", "red");
				}
				
				
				for (item in datadata) {
					var theitem = datadata[item];
					var cell = d3.select("#cell_" + theitem.adm_code + "_" + theitem.data_code);
					cell.text(theitem.value);
					cell.style("background", "blue");
				}
				
//				
//				var adm_region_dict = data
//				var adm_region_key_list = [];
//				var adm_region_list = [];
//				
//				for (aKey in adm_region_dict) {
//					adm_region_key_list.push(aKey);
//				}
//				
//				var adm_code_list = unique(adm_region_key_list.concat(datajson_adm_code_list)).sort();
//				
//				
//				
////				adm_region_key_list = adm_region_key_list.sort();
////				for (aKey in adm_region_key_list) {
////					adm_region_list.push(adm_region_dict[adm_region_key_list[aKey]]);
////				}
//					
//				var table = d3.select("#datatable").append("table").attr("id", "datatablet");
//				var trs = table.selectAll("tr")
//						.data(adm_code_list)
//						.enter().append("tr");
//				trs.attr("id", function (d) {return d;});
//				trs.append("td").text(function (d) {return d;});
//				trs.append("td").text(function (d) {if (adm_region_dict[d]) return adm_region_dict[d].name;});
//				trs.append("td").text(function (d) {if (adm_region_dict[d]) if (adm_region_dict[d].isobsolete) { return "폐지"; } });
//				for (item in datajson_data_code_list) {
//					trs.append("td").attr("id", function (d) { return "cell_" + d + "_" + datajson_data_code_list[item]; });
//				}
			}
		});
//		d3.json("/static/sido_sigungu_db_20160201.json", function(error, data) {
//				
//		});
	}
});
@@ -1543,21 +1543,16 @@
 %09%7D%0A%09%09%09%09%0A
-%09%09%09%09%0A
 %09%09%09%09for 
@@ -1772,1297 +1772,10 @@
 %0A%09%09%09
-%09%0A//%09%09%09%09%0A//%09%09%09%09var adm_region_dict = data%0A//%09%09%09%09var adm_region_key_list = %5B%5D;%0A//%09%09%09%09var adm_region_list = %5B%5D;%0A//%09%09%09%09%0A//%09%09%09%09for (aKey in adm_region_dict) %7B%0A//%09%09%09%09%09adm_region_key_list.push(aKey);%0A//%09%09%09%09%7D%0A//%09%09%09%09%0A//%09%09%09%09var adm_code_list = unique(adm_region_key_list.concat(datajson_adm_code_list)).sort();%0A//%09%09%09%09%0A//%09%09%09%09%0A//%09%09%09%09%0A////%09%09%09%09adm_region_key_list = adm_region_key_list.sort();%0A////%09%09%09%09for (aKey in adm_region_key_list) %7B%0A////%09%09%09%09%09adm_region_list.push(adm_region_dict%5Badm_region_key_list%5BaKey%5D%5D);%0A////%09%09%09%09%7D%0A//%09%09%09%09%09%0A//%09%09%09%09var table = d3.select(%22#datatable%22).append(%22table%22).attr(%22id%22, %22datatablet%22);%0A//%09%09%09%09var trs = table.selectAll(%22tr%22)%0A//%09%09%09%09%09%09.data(adm_code_list)%0A//%09%09%09%09%09%09.enter().append(%22tr%22);%0A//%09%09%09%09trs.attr(%22id%22, function (d) %7Breturn d;%7D);%0A//%09%09%09%09trs.append(%22td%22).text(function (d) %7Breturn d;%7D);%0A//%09%09%09%09trs.append(%22td%22).text(function (d) %7Bif (adm_region_dict%5Bd%5D) return adm_region_dict%5Bd%5D.name;%7D);%0A//%09%09%09%09trs.append(%22td%22).text(function (d) %7Bif (adm_region_dict%5Bd%5D) if (adm_region_dict%5Bd%5D.isobsolete) %7B return %22%ED%8F%90%EC%A7%80%22; %7D %7D);%0A//%09%09%09%09for (item in datajson_data_code_list) %7B%0A//%09%09%09%09%09trs.append(%22td%22).attr(%22id%22, function (d) %7B return %22cell_%22 + d + %22_%22 + datajson_data_code_list%5Bitem%5D; %7D);%0A//%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D);%0A//%09%09d3.json(%22/static/sido_sigungu_db_20160201.json%22, function(error, data) %7B%0A//%09%09%09%09%0A//
+%7D%0A
 %09%09%7D)

delete unused codes