기본 콘텐츠로 건너뛰기

10월, 2017의 게시물 표시

Webdriver file attach

https://stackoverflow.com/questions/16896685/how-to-upload-file-using-selenium-webdriver-in-java upload . click (); //put path to your image in a clipboard StringSelection ss = new StringSelection ( "C:\\IMG_3827.JPG" ); Toolkit . getDefaultToolkit (). getSystemClipboard (). setContents ( ss , null ); //imitate mouse events like ENTER, CTRL+C, CTRL+V Robot robot = new Robot (); robot . keyPress ( KeyEvent . VK_ENTER ); robot . keyRelease ( KeyEvent . VK_ENTER ); robot . keyPress ( KeyEvent . VK_CONTROL ); //open upload window upload.click(); //put path to your image in a clipboard StringSelection ss = new StringSelection ( "C:\\IMG_3827.JPG" ); Toolkit .getDefaultToolkit().getSystemClipboard().setContents(ss, null ); //imitate mouse events like ENTER, CTRL+C, CTRL+V Robot robot = new Robot (); robot.keyPress( KeyEvent .VK_ENTER); robot.keyRelease( KeyEvent .VK_ENT

java access parent class private variable

https://stackoverflow.com/questions/822648/accessing-private-instance-variables-of-parent-from-child-class No, not according to the  java language specification, 3rd edition : 6.6.8 Example: private Fields, Methods, and Constructors A private class member or constructor is accessible only within the body of the top level class (§7.6) that encloses the declaration of the member or constructor. It is not inherited by subclasses. But regardless of this language restriction, you  can   access private fields through reflection : Field privateStringField = MyClass . class . getDeclaredField ( "privateString" ); privateStringField . setAccessible ( true ); String fieldValue = ( String ) privateStringField . get ( privateObject ); System . out . println ( "fieldValue = " + fieldValue ); share   edit

spring mybatis dynamic rest endpoint

ui like swager and db mybatis concept : ioc , di , https://blog.dylants.com/2013/09/23/spring-data-rest-with-xml-less-configuration/ 동적으로 restapi endpoint 를 생성 타켓은 db, or traction 요구 사항 -------------------------------------------- 입력 항목 체크 쿼리항목 반영 결과 값 초기 : 첫술에 배 부르랴 http://stackoverflow.com/questions/28874135/dynamic-spring-data-jpa-repository-query-with-arbitrary-and-clauses 무엇이 효율적이고 다인가를 찾아야지 개념 service 구성 endpoint 생성 입력 항목 생성 디비 쿼리 생성 실행 결과 후처리 json 응답 서비스의 구성이 저장 된후 반영 버튼을 누를 경우 반영, 반영 결과를 revert 하는 기능 // jqwidget 이나 webpoent 의 컬럼 오더 반영 http://stackoverflow.com/questions/6514876/most-effecient-conversion-of-resultset-to-json sql data mapper

quartz 사용 하기

http://www.quartz-scheduler.org/documentation/quartz-2.2.x/quick-start.html 프로젝트 만들고 , lib 안에 다운로드 받은 jar 들 복사 후 QuartzTest.java 생성 1. 샘플 ================================================ QuartzTest.java ================================================ import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.impl.StdSchedulerFactory; import static org.quartz.JobBuilder.*; import static org.quartz.TriggerBuilder.*; import static org.quartz.SimpleScheduleBuilder.*; public class QuartzTest { public static void main(String[] args) { try { // Grab the Scheduler instance from the Factory Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler(); // and start it off scheduler.start(); scheduler.shutdown(); } catch (SchedulerException se) { se.printStackTrace(); } } } ======================================================= log4j.properties 생성 ===================================================

spring mybatis log 설정

스프링 설정을 application.property 파일이 아닌 application.yml 을 사용 하는 구조에서 로그 자료 이다. ===================================== = application.yml ===================================== logging:   level:     org:       mybatis: DEBUG     kr:       co:          company:            project: TRACE 위 설정으로 로그를 보면 보이긴 하지만 PREPARE STATEMENT 와 컬럼이 각각 출력 되어 디버깅에 무지 않좋다. <!-- https://mvnrepository.com/artifact/org.lazyluke/log4jdbc-remix --> <dependency>     <groupId>org.lazyluke</groupId>     <artifactId>log4jdbc-remix</artifactId>     <version>0.2.7</version> </dependency> http://addio3305.tistory.com/66 설명에는  context-datasource.xml을 수정이 기술 되어 있다. http://www.programcreek.com/java-api-examples/index.php?api=net.sf.log4jdbc.Log4jdbcProxyDataSource 프로그램 방식으로 dataSource 생성 @Bean public DataSource dataSource (){ Log4JdbcCustomFormatter formatter = new Log4JdbcCustomFormatter (); formatter . setLoggingType ( LoggingType .

hdfs get active name node

when programming out of hadoop cluster , if name-node is standby, connecting hdfs and any command fails. http://{0}:{1}/jmx?qry=Hadoop:service=NameNode,name=NameNodeStatus from stackoverflow ( http://stackoverflow.com/questions/26648214/any-command-to-get-active-namenode-for-nameservice-in-hadoop )

MySQL 이벤트 스케쥴러

MySQL  5.1 이상부터 이벤트 스케쥴러가 구성 되었다. 일별로 돌아가야 되는 배치가 있다. 1. 이벤트 스케쥴러 동작 시키기 먼저 서버 리부팅시 동작 하도록 my.cnf 파일을 수정한다. my.cnf ============================ event_scheduler  = ON 서버를 리부팅 해서 확인 해도 되고, 설정을 해 두었으면 리부팅 없이 설정을 변경 하면 된다. show variables like 'event%' ; SET GLOBAL event_scheduler = ON ; show variables like 'event%' ; 2. 샘플 등록 해 보기

cloudera 개발환경 구축

환경 구성 목표 윈도우 환경에 virtualbox 로 master + namenode + namenode 총 3대의 환경을 구축한다. 이번에 구축할 환경은 cludera 에 impala 를 사용한다. 엄밀히 말하면 하둡에 임팔라를 올린 것이다. 기존의 설명들은 centos 기반의 설명이 많은데, 개인적으로 ubuntu 를 좋아하는 관계로 ubuntu 기반으로 설치를 진행 하려 한다. 처음 환경구축을 위해 검색어는 cludera ubuntu 였는데, ubuntu hadoop 로 해서 찾아보니 더 많은 문서가 있다. 1. 크라우데라 다운로드 https://www.cloudera.com/downloads.html virtualbox 용으로 다운로드 2. virtualbox 윈도우용 다운로드 설치 https://www.virtualbox.org/wiki/Downloads 참고 : http://ourcstory.tistory.com/171 파일 업로드 http://addio3305.tistory.com/83 업로드 중간에 나감, 확인 안하고 나감, 세션 종료됨, 스프링 + 임팔라 다이렉트 쿼리 + 결과 도출, 조회로그

Data between views in eclipse rcp

ISourceProviderListener http://www.vogella.com/articles/EclipseCommandsAdvanced/article.html http://www.ibm.com/developerworks/opensource/library/os-ecllink/?ca=dgr-lnxw09EclipseGUIviews You have the different communication paradigm summarize in the  IBM article To make a view capable of listening to selection changes, a view must implement the  ISelectionListener interface and must register itself with the workbench page Using the  IAdaptable  interface: A class that implements  IAdaptable  has the capability to dynamically return certain types of adapters that can then be used to retrieve further information. property change listener paradigm Regarding the first approach, the article details: https://stackoverflow.com/questions/2227701/how-to-communicate-between-views-in-eclipse-rcp

Android ocr

컴퓨터에서 Nox 의 이미지를 가져온다 adb shell screencap -p /sdcard/screen.png adb pull /sdcard/screen.png adb shell rm /sdcard/screen.png 마우스 액션을 기억 한다 파이썬으로 특정영역을 ocr 하여 텍스트를 가져온다 https://m.blog.naver.com/PostView.nhn?blogId=samsjang&logNo=220694855018&categoryNo=66&proxyReferer=https%3A%2F%2Fwww.google.co.kr%2F 를 참고 하여 이미지를 해석한다 이미지 클리핑 파이썬으로 윈도우 캡쳐 매크로 레코딩 버튼이벤트 좌표 Read text match image 이미지프로세싱 예제 상세함 https://stackoverflow.com/questions/20427759/image-processing-and-extraction-of-characters 이미지처리 관련 링크 As of OpenCV 3.0 (in active dev), you can use the built-in "scene text" object detection module ~ Reference:  http://docs.opencv.org/3.0-beta/modules/text/doc/erfilter.html Example:  https://github.com/Itseez/opencv_contrib/blob/master/modules/text/samples/textdetection.cpp The text detection is built on these two papers: [Neumann12] Neumann L., Matas J.: Real-Time Scene Text Localization and Recognition, CVPR 2012. The paper is avail