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
x = function() | |
y = function() | |
local table = 5 | |
end | |
local old_table = table | |
y() | |
table.insert(old_table, 4) | |
assert(table == old_table and table ~= 5) | |
end | |
x() |
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
The program 'curl' is currently not installed. You can install it by typing: | |
apt-get install curl |
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
#!/usr/bin/env node | |
var sys = require('sys'); | |
var stomp = require('stomp'); | |
// Set debug to true for more verbose output. | |
// login and passcode are optional (required by rabbitMQ) | |
var stomp_args = { | |
port: 61613, | |
host: 'localhost', |
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
client.on('connected', function() { | |
num = num || 1000; | |
for (var i = 0; i < num; i++) { | |
txn = client.begin(); | |
client.send({ | |
'destination': queue, | |
'body': 'Testing' + i, | |
'persistent': 'true', | |
'transaction': txn | |
}, receipt); |
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
#!/usr/bin/env node | |
var stomp = require('stomp'); | |
var num = process.argv[2]; | |
// Set to true if you want a receipt | |
// of all messages sent. | |
var receipt = false; |
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
var stomp_args = { | |
port: 61613, | |
host: 'localhost', | |
debug: false, | |
login: 'guest', | |
passcode: 'guest', | |
}; |
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
>>> tu.search_friends(['twitter', 'cleveland', 'benjaminws', 'python']) | |
[{'status': 'CPython is on mercurial now, so you can come contribute...', 'name': 'Benjamin Peterson', 'matches': ['python'], 'static_location': 'Minnesota, USA', 'coords': None, 'user': 'gutworth', 'geo': None}, {'status': '@benjaminws it is going to kick intergalactic ass', 'name': 'Alfredo Deza', 'matches': ['benjaminws'], 'static_location': 'Atlanta Georgia', 'coords': None, 'user': 'alfredodeza', 'geo': None}, {'status': 'The Python mercurial transition is complete! Now the real work begins. http://bit.ly/eFYmar Special thanks to @birkenfeld and @djco', 'name': 'Michael Foord', 'matches': ['python'], 'static_location': 'Northampton, UK', 'coords': None, 'user': 'voidspace', 'geo': None}, {'status': '@benjaminws I stand corrected', 'name': 'Alfredo Deza', 'matches': ['benjaminws'], 'static_location': 'Atlanta Georgia', 'coords': None, 'user': 'alfredodeza', 'geo': None}, {'status': '@benjaminws if it is not \\s+(documented|tested)\\s+ |
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
function distance(lat1,lon1,lat2,lon2) { | |
var R = 6371; // km (change this constant to get miles) | |
var dLat = (lat2-lat1) * Math.PI / 180; | |
var dLon = (lon2-lon1) * Math.PI / 180; | |
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
Math.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) * | |
Math.sin(dLon/2) * Math.sin(dLon/2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); | |
var d = R * c; | |
if (d>1) return Math.round(d)+"km"; |
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
#include <string.h> | |
#include <stdio.h> | |
#include "handler.h" | |
void handle_request(int sockfd, const char *request) | |
{ | |
char *res = "HTTP 200 OK\r\n\r\n"; | |
char file_buf[1024]; | |
char url[1024]; |
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
Selected and implied templates: | |
pecan#base Template for creating a basic Pecan project | |
Variables: | |
egg: test_app | |
package: test_app | |
project: test_app | |
Creating template base | |
Traceback (most recent call last): | |
File "bin/pecan", line 9, in <module> |
OlderNewer