*** 설명 ***
기존에 선택되어 있던 것의 선택을 해제한 후 인덱스에 해당하는 것을 선택한다.
*** example ***
var newIndex = 0;
var selectedIndex = $('#select option').index($('#select option:selected'));
$('#select option:eq(' + selectedIndex + ')').removeAttr('selected');
$('#select option:eq(' + newIndex + ')').attr('selected', 'selected');
JQuery select 값 변경시 이벤트 함수
*** example ***
jQuery(function($) {
$('#select').change(function(){
alert('select change. value' + $('select').val());
});
});
jQuery(function($) {
$('#select').change(function(){
alert('select change. value' + $('select').val());
});
});
Camel Quartz 사용하기
*** Maven Dependency 설정 ***
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz</artifactId>
<version>2.11.4</version>
</dependency>
*** 쿼츠 URI 포맷 ***
*** 쿼츠 설정하는 자바 소스 예제 ***
import org.apache.camel.spring.SpringRouteBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class QuartzMain extends SpringRouteBuilder
{
@Autowired
private QuartzProcess quartzProcess;
public void configure() throws Exception
{
from("quartz://message/?cron=0+1/10+*+*+*+?" ).bean(quartzProcess, "proc");
}
}
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.11.4</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-quartz</artifactId>
<version>2.11.4</version>
</dependency>
*** 쿼츠 URI 포맷 ***
quartz:
//groupName/timerName?cron=expression
quartz:
//timerName?cron=expression
*** 쿼츠 설정하는 자바 소스 예제 ***
import org.apache.camel.spring.SpringRouteBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class QuartzMain extends SpringRouteBuilder
{
@Autowired
private QuartzProcess quartzProcess;
public void configure() throws Exception
{
from("quartz://message/?cron=0+1/10+*+*+*+?" ).bean(quartzProcess, "proc");
}
}
Java - 숫자 자리수 채우기
String.format 을 사용하여 빈 자리를 0으로 채울 수 있다.
ex)
System.out.pringln( String.format("%03d", 3) ); => 003
System.out.pringln( String.format("%02d", 2) ); => 02
System.out.pringln( String.format("%02d", 10) ); => 10
ex)
System.out.pringln( String.format("%03d", 3) ); => 003
System.out.pringln( String.format("%02d", 2) ); => 02
System.out.pringln( String.format("%02d", 10) ); => 10
이클립스 줄 번호 표시
*** 줄 번호 표시 ***
Window -> Preference -> General -> Editors -> Text Editors 로 들어가서
Show line numbers 항목 체크
Window -> Preference -> General -> Editors -> Text Editors 로 들어가서
Show line numbers 항목 체크
피드 구독하기:
글 (Atom)