Skip to content

Instantly share code, notes, and snippets.

@siniusxcode
siniusxcode / gist:5848470
Created June 24, 2013 08:09
select all checkboxes using prop
<input type="checkbox" id="checkAll">
<input type="checkbox" class="check" value="1">
<input type="checkbox" class="check" value="2">
<input type="checkbox" class="check" value="3">
<script type="text/javascript">
$( function(){
$("#checkAll").click(function() {
$(".check").prop('checked', $(this).is(":checked"));
});
@siniusxcode
siniusxcode / gist:5848467
Created June 24, 2013 08:08
select all checkboxes using attr
<input type="checkbox" id="checkAll">
<input type="checkbox" class="check" value="1">
<input type="checkbox" class="check" value="2">
<input type="checkbox" class="check" value="3">
<script type="text/javascript">
$( function(){
$("#checkAll").click(function() {
$(".check").attr('checked', $(this).is(":checked"));
});
@siniusxcode
siniusxcode / methodExecutionTime.java
Created February 19, 2013 01:10
Measure execution time for a Java method.
// 1. System.currentTimeMillis()
long startTime = System.currentTimeMillis();
// Method Here
long stopTime = System.currentTimeMillis();
long elapsedTime = stopTime - startTime;
System.out.println(elapsedTime);
<logger name="jdbc.sqlonly" level="debug" />
<logger name="jdbc.resultsettable" level="debug" />
<bean id="logDataSource_pos" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
<constructor-arg ref="cmsDataSource" />
<property name="logFormatter">
<bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
<property name="loggingType" value="MULTI_LINE" />
</bean>
</property>
</bean>
#기존
#db.driver=oracle.jdbc.driver.OracleDriver
#db.url=jdbc:oracle:thin:@
#변경
db.driver=net.sf.log4jdbc.DriverSpy
db.url=jdbc:log4jdbc:oracle:thin:@
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>0.2.7</version>
</dependency>
public boolean isPositive(int num){
return num >= 0;
}
public boolean isPositive(int num){
if(num >= 0){
return true;
} else{
return false;
}
}
#!/usr/bin/python
# -*- coding: utf-8 -*-
import cx_Oracle
import os
os.putenv('NLS_LANG','.UTF8')
def rowsToDictList(cursor):
columns = [i[0] for i in cursor.description]