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
@Test | |
public final void testPubSubPongBug() throws Throwable{ | |
final Jedis c = pool.getResource(); | |
final String psubMessage = "bang"; | |
JedisPubSub jps = new JedisPubSub() { | |
@Override | |
public void onUnsubscribe(String channel, int subscribedChannels) {} | |
@Override | |
public void onSubscribe(String channel, int subscribedChannels) {} |
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
/** | |
* Created by sscarduzio on 16/10/2014. | |
*/ | |
object Scalaz extends App { | |
import scalaz.stream._ | |
import scalaz.concurrent.Task | |
def fahrenheitToCelsius(d:Double) : Double = { | |
3d // who cares about actually converting.. |
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
import org.joda.time.format.DateTimeFormat | |
import org.joda.time._ | |
import scala.annotation.tailrec | |
val timeWindow: Seconds = Seconds.seconds(Hours.hours(12).toStandardSeconds.getSeconds) | |
type Delta = (DateTime, DateTime) | |
def splitInterval(from: DateTime, to: DateTime, interval: Seconds): Seq[Delta] = { | |
@tailrec | |
def loop(_from: DateTime, intervalList: Seq[Delta]): Seq[Delta] = { |
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
<?php | |
/** | |
* Counts words in a text files and outputs a chart of the most used. | |
*/ | |
// Test code, run from CLI | |
// php WordChart.php freakingLongNovel.txt | |
$filename = $argv[1]; |
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
public void start() { | |
NetServer ns = vertx.createNetServer(); | |
ns.setTCPNoDelay(true); | |
ns.setReuseAddress(true); | |
ns.connectHandler(new Handler<NetSocket>() { | |
public void handle(final NetSocket socket) { | |
socket.exceptionHandler(new Handler<Exception>(){ | |
@Override |
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
import static org.quartz.CronScheduleBuilder.cronSchedule; | |
import static org.quartz.JobBuilder.newJob; | |
import static org.quartz.TriggerBuilder.newTrigger; | |
import java.util.TimeZone; | |
import org.quartz.CronTrigger; | |
import org.quartz.Job; | |
import org.quartz.JobDetail; |
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
$ mvn clean package | |
i[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building Project - bbcmonitor 1.2 | |
[INFO] ------------------------------------------------------------------------ | |
Downloading: https://oss.sonatype.org/content/repositories/snapshots/io/vertx/vertx-core/2.0.0-SNAPSHOT/maven-metadata.xml | |
Downloaded: https://oss.sonatype.org/content/repositories/snapshots/io/vertx/vertx-core/2.0.0-SNAPSHOT/maven-metadata.xml (356 B at 0.2 KB/sec) | |
Downloading: https://oss.sonatype.org/content/repositories/snapshots/io/vertx/vertx-core/2.0.0-SNAPSHOT/vertx-core-2.0.0-20130426.110906-777.pom | |
Downloaded: https://oss.sonatype.org/content/repositories/snapshots/io/vertx/vertx-core/2.0.0-SNAPSHOT/vertx-core-2.0.0-20130426.110906-777.pom (0 B at 0.0 KB/sec) |
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
16.04 14:05:04 euler:/tmp/shit $ cd project/ | |
16.04 14:05:04 euler:/tmp/shit/project $ ls | |
README.md build-and-run.sh pom.xml src | |
16.04 14:05:04 euler:/tmp/shit/project $ mvn clean package | |
[INFO] Scanning for projects... | |
[INFO] | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building Project - project 1.0-SNAPSHOT | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] |
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
$ vertx run test.js -cluster | |
Starting clustering... | |
No cluster-host specified so using address 192.168.1.11 | |
1.0 |
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
SET GLOBAL general_log = 'ON'; | |
Query logs: /usr/local/var/mysql/<machine-hostname>.log |
OlderNewer