start new:
tmux
start new with session name:
tmux new -s myname
| def binary_search_basic(arr, target): | |
| low, high = 0, len(arr) | |
| while low < high: | |
| mid = (low+high) // 2 # low + (high-low)//2 if cares about overflow | |
| if target < arr[mid]: | |
| high = mid | |
| elif target > arr[mid]: | |
| low = mid + 1 | |
| else: | |
| return mid |
| // Compiled by Igor Shults | |
| // Last Updated: Jan. 26th, 2016 | |
| GRAILS GROOVY SOURCE | |
| 3.1.2 2.4.6 https://github.com/grails/grails-core/blob/695a11caa4025e91bdbf5094c0b6324cf5b22075/build.gradle | |
| 3.1.1 2.4.5 | |
| 3.1.0RC2 2.4.5 | |
| 3.1.0RC1 2.4.5 | |
| 3.1.0M3 2.4.5 | |
| 3.1.0M2 2.4.5 https://github.com/grails/grails-core/blob/c309bfe2f4613942cccbd2428f35ca6f0d018419/build.gradle |
| object x { | |
| // stream a sql query | |
| def sql( str:String ):Stream[ResultSet] = withStatement { s => | |
| val rs = s executeQuery str | |
| new Iterator[ResultSet] { def hasNext = rs.next ; def next = rs }.toStream | |
| } | |
| // loan a sql statement |