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
var io = require('socket.io').listen(80); | |
io.sockets.on('connection', function (socket) { | |
console.log("Someone just connected!"); | |
// Echo back messages from the client | |
socket.on('message', function (message) { | |
console.log("Got message: " + message); | |
socket.emit('message', message); | |
}); |
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
{Time since VM started, in seconds}: [GC {Time since VM started}: [{GC type} | |
Desired survivor size {size of one survivor space} bytes, new threshold {y} (max {x}) <- how many collections objects can stay in the young gen. More on this later | |
- age 1: {a} bytes, {a} total <- How many objects have survived one collection. Next collection, any surviving objects will appear in age 2 | |
- age 2: {b} bytes, {a+b} total | |
: {pre-collection young gen[5] usage}K->{post-collection young gen usage}K({Total young gen size}K), {young gen time} secs] | |
{pre-collection heap size}K->{post-collection heap size}K({total heap size}K), {total collection time} secs] |
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
{% capture tags %}{% for tag in site.tags %}{{ tag[0] }}|{% endfor %}{% endcapture %} | |
{% assign sortedtags = tags | split:'|' | sort %} | |
{% for tag in sortedtags %} | |
<a name="{{ tag }}"></a> | |
<h2>{{ tag }}</h2> | |
<ul> | |
{% for post in site.tags[tag] %} | |
<li><a href="{{ post.url }}">{{ post.title }}</a></li> | |
{% endfor %} |
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
{Time since VM started, in seconds}: [GC | |
[1 CMS-initial-mark: {estimated old gen usage}K({total old gen size}K)] {estimated heap usage}K({total heap size}K), {pause time} secs] | |
{Time since VM started, in seconds}: [Rescan (parallel) , {pause time} secs] | |
{Time since VM started, in seconds}: [weak refs processing, {pause time} secs] | |
[1 CMS-remark: {old gen usage}K({total old gen size}K)] {heap usage}K({total heap size}K), {pause time} secs] | |
{Time since VM started, in seconds}: [CMS-concurrent-reset: 0.019/0.019 secs] |
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
294989.748: [GC | |
[1 CMS-initial-mark: 1782676K(2097152K)] 1784501K(3137664K), 0.0067714 secs] | |
295047.329: [Rescan (parallel) , 0.2497803 secs] | |
295047.579: [weak refs processing, 0.1272999 secs] | |
[1 CMS-remark: 1782929K(2097152K)] 2303079K(3137664K), 0.3816787 secs] | |
295049.065: [CMS-concurrent-reset: 0.019/0.019 secs] |
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
325209.429: [GC 325209.429: [ParNew | |
Desired survivor size 4128768 bytes, new threshold 2 (max 2) | |
- age 1: 1812544 bytes, 1812544 total | |
- age 2: 305568 bytes, 2118112 total | |
: 1034582K->2103K(1040512K), 0.0116910 secs] | |
2598263K->1565814K(3137664K), 0.0118312 secs] |
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
<!-- Add the following to the head of your webpage: --> | |
<script type="text/javascript" src="http://platform.linkedin.com/in.js"> | |
api_key: your_api_key_goes_here | |
</script> |
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
var result = $('.section-item .item').get().reduce(function(total, item) { | |
var text = $(item).text().split("\n").join(" "); | |
var matches = /.+\((\d):(\d\d)\)/g.exec(text); | |
var minutes = parseInt(matches[1]); | |
var seconds = parseInt(matches[2]); | |
var totalMin = total[0] + minutes; | |
var totalSec = total[1] + seconds; | |
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
// Put this filter early in your filter chain so it can initialize and clean up | |
// the cache | |
object CacheFilter extends Filter { | |
def apply(next: RequestHeader => Future[Result])(request: RequestHeader): Future[Result] = { | |
def init = RestClient.initCacheForRequest(request) | |
def cleanup = RestClient.cleanupCacheForRequest(request) | |
// You have to be very careful with error handling to garauntee the cache gets cleaned | |
// up, or you'll have a memory leak. |
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
fact(0, 1). | |
fact(N, Out) :- N > 0, N1 is N - 1, fact(N1, Prev), Out is N * Prev. |