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
<?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 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
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 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 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 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 com.lambdaworks.redis.codec; | |
import java.io.IOException; | |
import java.nio.ByteBuffer; | |
import java.nio.charset.Charset; | |
/** | |
* A {@link RedisCodec} that handles binary keys and values. | |
* This is useful if you are storing non-UTF8 data in Redis | |
* such as serialized objects or multimedia content. |
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
$ 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 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
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 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
$ vertx run test.js -cluster | |
Starting clustering... | |
No cluster-host specified so using address 192.168.1.11 | |
1.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
SET GLOBAL general_log = 'ON'; | |
Query logs: /usr/local/var/mysql/<machine-hostname>.log |
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
An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler | |
in the pipeline did not handle the exception. | |
java.nio.channels.ClosedChannelException | |
at io.netty.channel.AbstractChannel$AbstractUnsafe.flushNow(AbstractChannel.java:683) | |
at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:654) | |
at io.netty.channel.AbstractChannel$AbstractUnsafe.write(AbstractChannel.java:644) | |
at io.netty.channel.DefaultChannelPipeline$HeadHandler.write(DefaultChannelPipeline.java:1040) | |
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite0(DefaultChannelHandlerContext.java:716) | |
at io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:700) | |
at io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:692) |
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
def grepFromFile(filename, string): | |
content = run('cat' + filename, capture=True) | |
return grep(content, string) | |
def grepFromString(haystack, needle, caseSensitive): | |
result = None | |
if(caseSensitive): | |
needle = needle.lower() | |
s = StringIO.StringIO(haystack) |
OlderNewer