본문 바로가기

전체 글127

지도위에 구글차트 띄우기 2015. 2. 5.
JS 생성자?? 프로토 타입??? The Constructor PatternConstructor – 생성자 – 는 특별한 타입의 객체를 생성하는데 사용됩니다. 자바스크립트에서는 함수가 생성자의 역할을 할 수 있습니다. 그래서 객체를 생성하는데 사용되는 함수를 생성자 함수 – Constructor function – 이라고 합니다. 생성자 함수는 매개변수를 설정할 수 있고, 그것을 생성자 함수를 통해 생성될 객체의 프로퍼티들에 초기값을 주는데 사용할 수 있습니다.Basic Constructors자바스크립트에서 생성자 함수를 사용하는 방법은 인스턴스를 만드는 타당한 방법이라고 생각됩니다. 자바스크립트에는 다른 객체지향 언어에서 사용하는 클래스가 없지만 생성자 함수가 그와 유사한 역할을 할 수 있습니다. new 키워드와 함께 생성자 함수를 실.. 2015. 2. 5.
JSP Servlet 호출 톰캣 설정 1. Tomcat6.0 -> conf -> web.xml 파일에서 invoker를 포함한 태그의 주석을 해제한다. invoker org.apache.catalina.servlets.InvokerServlet debug 0 2 invoker /servlet/* 2. 톰캣을 실행해도 아래와 같은 에러가 난다. 톰캣 6.x 버전부터는 서블릿 리로딩에 관련된 설정을 해주어야 한다. java.lang.SecurityException: Servlet of class org.apache.catalina.servlets. InvokerServlet is privileged and cannot be loaded by this web application Tomcat6.0 -> conf -> context.xml 파일을 .. 2014. 11. 21.
oracle 날짜 관련 함수 select /* 오늘날짜 시분초 포함*/ to_char(sysdate,'yyyy/mm/dd hh24:mi:ss') from dual select /* 오늘날짜 00시 00분 00초 */ to_char(trunc(sysdate),'yyyy/mm/dd hh24:mi:ss') from dual select /* 오늘날짜 00시 00분 00초 위와 동일*/ to_char(trunc(sysdate,'dd'),'yyyy/mm/dd hh24:mi:ss') from dual select /* 이번달 1일 00시 00분 00초 */ to_char(trunc(sysdate,'mon'),'yyyy/mm/dd hh24:mi:ss') from dual select /* 올해 1월 1일 00시 00분 00초 */ to_char.. 2014. 11. 20.
EPSG:4326 to EPSG:900913 transform //*Google Mercator, 구글지도/빙지도/야후지도/OSM 등 에서 사용중인 좌표계//EPSG:900913(통칭), EPSG:3857(공식)Proj4js.defs["EPSG:900913"] = '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs';Proj4js.defs['EPSG:4326'] = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs'; var EPSG_900913 = new OpenLayers.Projection("EPSG:900913");var EPSG_4326 = new OpenLayers... 2014. 11. 19.
형변환 Java – comparing stringsUse == for primitive data types like intIf (mystring == null) Use the equals() method to compare objectsUse .equals for strings : if (a.equals(“cat”)) Java - Converting int to stringString myString = Integer.toString(my int value) orString str = "" + i Java - Converting String to intint i = Integer.parseInt(str); orint i = Integer.valueOf(str).intValue(); double to String.. 2014. 11. 19.