This file contains 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
@Grab('com.github.pengrad:java-telegram-bot-api:4.4.0') | |
import com.pengrad.telegrambot.TelegramBot | |
import com.pengrad.telegrambot.UpdatesListener | |
import com.pengrad.telegrambot.request.SendMessage | |
def bot = new TelegramBot("my:token") //token | |
def chats = [] as Set //chatIds as Long | |
bot.setUpdatesListener { updates -> |
This file contains 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
// | |
// Override the javadoc task to use umlgraph doclet. This depends on the presence | |
// of GraphViz on the path in your environment (http://www.graphviz.org) | |
// | |
allprojects { | |
configurations { | |
umljavadoc | |
} | |
dependencies { |
This file contains 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
apply plugin: 'scala' | |
repositories{ | |
mavenCentral() | |
} | |
dependencies{ | |
compile "org.scala-lang:scala-library:2.11.8" | |
compile "org.scala-lang:scala-compiler:2.11.8" | |
} |
This file contains 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
data <- read.csv('data.csv', sep=',') | |
subplot <- function(data, set) { | |
subdata <- subset(data, column == set) | |
xrange <- strptime(subdata$period, format='%H:%M:%S') | |
yrange <- subdata$fitness | |
plot(xrange, yrange, type="l", col="blue", xlab="Period", ylab="Fitness", main="Evolution") | |
} |
This file contains 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 | |
'SELECT setval(''' || table_name|| '_id_seq'', COALESCE((SELECT MAX(id)+1 FROM ' || table_name || '), 1), false);' AS command | |
FROM | |
information_schema.tables | |
WHERE | |
table_type = 'BASE TABLE' | |
AND | |
table_schema = 'public'; |
This file contains 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
plugins { | |
id "de.kotka.clojuresque.nrepl" version "2.0.0" | |
} | |
apply plugin: 'application' | |
clojure { | |
warnOnReflection = true | |
aotCompile = true | |
} |
This file contains 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
@Grab(group='io.reactivex', module='rxjava', version='1.1.1') | |
@Grab(group='com.hazelcast', module='hazelcast', version='3.6') | |
import rx.Observable | |
import rx.Observer | |
import rx.Subscription | |
import rx.schedulers.Schedulers | |
import rx.subscriptions.Subscriptions | |
import com.hazelcast.core.Hazelcast | |
import java.util.concurrent.TimeUnit | |
import java.util.concurrent.atomic.AtomicBoolean |
This file contains 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
@Grab("org.nd4j:nd4j-jblas:0.4-rc3.6") | |
@Grab("org.nd4j:nd4j-java:0.4-rc3.6") | |
@Grab("org.ejml:simple:0.27") | |
@Grab("org.gperfutils:gbench:0.4.3-groovy-2.4") | |
import gbench.* | |
import org.ejml.simple.SimpleMatrix | |
import org.nd4j.linalg.jblas.NDArray | |
import org.nd4j.linalg.java.JavaNDArray | |
benchmark { |
This file contains 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
require 'chunky_png' | |
class Gradient | |
attr_accessor :resolution, :R0, :G0, :B0, :R1, :G1, :B1 | |
def initialize(start = 0x0000ff, stop = 0xff0000, resolution = 100) | |
@resolution = Float(resolution) | |
@R0 = (start & 0xff0000) >> 16; | |
@G0 = (start & 0x00ff00) >> 8; |
This file contains 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
@Grab('com.netflix.rxjava:rxjava-groovy:0.20.7') | |
@Grab('io.reactivex:rxjava-reactive-streams:0.3.0') | |
@Grab('org.apache.camel:camel-rx:2.14.1') | |
@Grab('io.ratpack:ratpack-groovy:0.9.11') | |
@Grab('org.slf4j:slf4j-simple:1.6.6') | |
import org.apache.camel.impl.* | |
import org.apache.camel.rx.* | |
import static rx.RxReactiveStreams.toPublisher | |
import static ratpack.groovy.Groovy.ratpack | |
import static ratpack.sse.ServerSentEvents.serverSentEvents; |
NewerOlder