This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get exchange rate as JSONP via YQL. | |
YQL Console: http://developer.yahoo.com/yql/console | |
Query (USD to SEK): select rate,name from csv where url='http://download.finance.yahoo.com/d/quotes?s=USDSEK%3DX&f=l1n' and columns='rate,name' | |
Example code: | |
<script type="text/javascript"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.* | |
class Utils { | |
def getGoodRenderingHints() { | |
def hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON) | |
hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HighlighterDemo Test | |
// | |
// refarence http://itpro.nikkeibp.co.jp/article/COLUMN/20110329/358840/?ST=develop&P=3 | |
// http://griffon.codehaus.org/SwingxBuilder | |
// | |
@Grab(group='org.swinglabs', module='swingx', version='1.6.1') | |
@Grab(group='org.codehaus.griffon', module='swingxbuilder', version='0.1.7') | |
import java.awt.Color; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.swing.SwingBuilder | |
import javax.swing.JFrame | |
import java.awt.GridLayout | |
def printlnswing(message) { | |
new SwingBuilder().edt { | |
frame(title: 'Message', pack: true, visible: true, | |
layout: new GridLayout(0, 1), | |
defaultCloseOperation: JFrame.EXIT_ON_CLOSE) { | |
message.eachLine() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Image | |
import java.awt.image.BufferedImage | |
import javax.imageio.ImageIO | |
def rootDir = new File(args[0]) | |
rootDir.eachFileRecurse { file -> | |
if(file.name ==~ /[^s].*\.jpg/) { // skip file starting with "s" | |
def srcFileName = file.name | |
def path = file.absoluteFile.parent | |
def dstFileName = 's' + srcFileName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.swing.SwingBuilder | |
import java.awt.* | |
import javax.swing.* | |
import javax.swing.event.* | |
SwingBuilder swing = new SwingBuilder() | |
def panel = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub trait RangedNum<T>: Num { | |
pub fn min() -> Self; | |
pub fn max() -> Self; | |
pub fn new(x: T) -> Self; | |
pub fn set(&mut self, x: T); | |
pub fn get(&self) -> T; | |
pub fn normalize(&self) -> Self; | |
pub fn normalize_self(&mut self); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time | |
import glob | |
#Define Pictures Folder | |
folder = '/Users/admin/Dropbox/Camera Uploads/' | |
fileFormats = ['JPG','jpg', 'MOV', 'mov', 'PNG', 'png', 'mp4', 'MP4']; | |
months = ['January','February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] | |
picPath = [] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Shared Pool | |
select | |
event, | |
time_waited "time_waited(s)", | |
case when time_waited = 0 then | |
0 | |
else | |
round(time_waited*100 / sum(time_waited) Over(), 2) | |
end "percentage" | |
from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
holders.*, | |
' IS BLOCKING ' is_blocking, | |
waiters.* | |
from | |
( | |
select | |
dw.holding_session, | |
hs.username, | |
do.object_name, |
OlderNewer