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 android.graphics.Bitmap; | |
import android.support.v4.util.LruCache; | |
public final class ImageCache { | |
private static final String TAG = "ImageCache"; | |
private static final int MEM_CACHE_SIZE = 1 * 1024 * 1024; // 1MB | |
private static LruCache<String, Bitmap> sLruCache; |
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
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/installer/0.6/griffon-installer-0.6.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/swingx-builder/0.6/griffon-swingx-builder-0.6.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/dialogs/0.3/griffon-dialogs-0.3.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/i18n-support/0.2/griffon-i18n-support-0.2.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/miglayout/0.4/griffon-miglayout-0.4.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/actions/0.4/griffon-actions-0.4.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/jide-builder/0.7/griffon-jide-builder-0.7.zip | |
griffon install-plugin http://artifacts.griffon-framework.org/repository/plugins/syntaxtext/0.2/griffon-syntaxtext-0.2.zip | |
griffon install-plugin http://artifacts. |
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
// see http://d.hatena.ne.jp/ksky/20110906/p1 | |
// http://isann.blog2.fc2.com/blog-entry-254.html | |
// | |
// location twitter4j.properties $HOME/.groovy | |
// edit $GROOVY_HOME/bin_groovyConsole | |
// export CP=$CP:$HOME/.groovy | |
@GrabResolver(name='twitter4j', root='http://twitter4j.org/maven2') | |
@Grab('org.twitter4j:twitter4j:[3.0,)') | |
@Grab('org.twitter4j:twitter4j-stream:[3.0,)') |
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
// | |
// using http://dl.getdropbox.com/u/653108/groovy/console.jnlp | |
// | |
@Grab('net.sf.groovydice:groovydice:1.4.1') | |
import net.sf.groovydice.* | |
ArrayList.metaClass.countBy={ | |
def map=[:] | |
delegate.groupBy(it).each{k,v-> |
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
// | |
// http://twitter.com/#!/xnrghzjh/status/78660855528554496 | |
// お題 | |
// | |
@Grab(group='joda-time', module='joda-time', version='*') | |
import org.joda.time.* | |
rand_date = {fr,to-> | |
d = new DateTime(fr) |
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
new File("D:/work/hoge").eachFileRecurse(groovy.io.FileType.FILES) { | |
def s = "${it.readLines().join("\n")}\n" | |
it.withWriter("UTF-8"){ w-> | |
w << s | |
} | |
} |
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
@GrabResolver(name='glassfish', root='http://download.java.net/maven/glassfish/') | |
@Grab('org.glassfish.extras:glassfish-embedded-web:3.0') | |
//@Grab('org.glassfish.extras:glassfish-embedded-web:3.1') | |
@Grab('jstl:jstl:1.1.2') | |
//use 3.0 | |
import org.glassfish.api.embedded.* | |
//use 3.1 | |
import org.glassfish.internal.embedded.* |
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
package foobar; | |
public class A { | |
private static class B { | |
private static String staticMethod() { | |
return "static method"; | |
} |
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
/** | |
* Created by IntelliJ IDEA. | |
* User: kyon | |
* Date: 11/03/15 | |
* Time: 0:54 | |
* To change this template use File | Settings | File Templates. | |
*/ | |
/* |
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
// test using: 1)Groovy Console Java Web Start | |
// http://dl.getdropbox.com/u/653108/groovy/console.jnlp | |
// | |
// 2)IntelliJ 10.0.1 CE | |
// Grape Plugin : http://plugins.intellij.net/plugin/?idea&id=4702 | |
// | |
// reference site: bluepapa32’s site | |
// http://d.hatena.ne.jp/bluepapa32/20101228/1293466511 | |
@Grab(group = 'org.twitter4j', module='twitter4j-core', version='[2.1,)') |
NewerOlder