Below is list of results collected with netperf. The interesting value is TCP_CRR, it measures how fast it can TCP connect/request/response/receive. In short, the transaction rate. The test is used to simulate a normal HTTP/1.0 transaction. What's worrying is that this value has very low on Xen virtualized guests. Performance differences between bare metal and virtualization has been as high as 2-3x.
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 class StringTokenizer { | |
public static String[] tokenize(String string, char delimiter) { | |
String[] temp = new String[(string.length() / 2) + 1]; | |
int wordCount = 0; | |
int i = 0; | |
int j = string.indexOf(delimiter); | |
while( j >= 0) { | |
temp[wordCount++] = string.substring(i, j); | |
i = j + 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
import java.util.ArrayList; | |
public class TestArrayIteration { | |
public static void testArray() { | |
Integer[] arr = new Integer[1000]; | |
for (int i = 0; i < 1000; i++) { | |
arr[i] = 1; | |
} | |
int total = 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
var bp = require('beaconpush'); | |
// Create a new client | |
var beaconpush = new bp.Client('<your-api-key>', '<your-secret-key>'); | |
// Get number of users currently connected to your site | |
beaconpush.usersConnected(function (numConnected) { | |
console.log('There are ' + numConnected + ' users online'); | |
}); |
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
# Monkey patching with redis-py didn't work out so well | |
#from gevent import monkey; monkey.patch_all() | |
import gevent | |
import redis | |
import time | |
import random | |
client = redis.Redis(host='localhost', port=6379, db=0) | |
client.flushdb() |
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
# Monkey patching with redis-py didn't work out so well | |
#from gevent import monkey; monkey.patch_all() | |
import gevent | |
import redis | |
import time | |
import random | |
client = redis.Redis(host='localhost', port=6379, db=0) | |
client.flushdb() |
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
/* | |
node.js vs Python with Greenlets (say gevent) | |
I don't get why node.js is being so hyped. | |
Sure, the idea of writing things in JavaScript both on the client and server-side is really nice. | |
And JavaScript really fit an event-driven environment with its browser heritage. | |
But why on earth is boomerang code so appealing to write? I don't get. Am I missing something obvious? | |
All examples of node.js I see are littered with callbacks yet Ryan Dahl thinks coroutines suck. It doesn't add up for me. |
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
Ludwig Bell - Silvertejp | |
http://open.spotify.com/track/1yuUvo5DA0QqmKGPPpZlFF | |
Capo 5 | |
(Ackord relativt capo) | |
F/C x33210 | |
C x32013 | |
G 11 32301x | |
G 320013 |
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 function generateUri(protocol:String = "ws"):String { | |
var uri:String = protocol + "://" + host + "/spheres/" + apiKey + "/users/" + user; | |
var params:Array = ['authToken=t']; | |
if (sequenceId > 0) { params.push("sequenceId=" + sequenceId); } | |
if (channels && channels.length > 0) { params.push("channels=" + channels.join(',')); } | |
if (params.length > 0) { | |
uri += "?"; | |
uri += params.join('&'); | |
} |
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
/** | |
* Small patch by Carl Byström to make the readLine non-greedy. | |
* | |
* The MIT License | |
* | |
* Copyright (c) 2009 Adam MacBeth | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |