Skip to content

Instantly share code, notes, and snippets.

@dyoder
dyoder / qcl-program.qcl
Created August 16, 2012 01:36
QCL Program
QCL Quantum Computation Language (64 qubits, seed 1345080866)
[0/64] 1 |0>
qcl> qureg a[1]; qureg b[1];
qcl> Rot(-pi/3,a);
[2/64] 0.86603 |0,0> + 0.5 |1,0>
qcl> H(b);
[2/64] 0.61237 |0,0> + 0.35355 |1,0> + 0.61237 |0,1> + 0.35355 |1,1>
@dyoder
dyoder / shell-transcript.txt
Created August 6, 2012 04:11
Clearing out the events database
root@si-demo1:~# mongo events-database
MongoDB shell version: 2.0.0
connecting to: events-database
> db.events.remove()
@dyoder
dyoder / binding-example.coffee
Created July 12, 2012 03:31
Resource Description Schema Example
account:
versions:
"1.0":
paths: [ "/accounts/:id" ]
actions:
get: (id) ->
# code for getting an account
@dyoder
dyoder / name-generator.rb
Created July 5, 2012 21:51
Two syllable word-based name generotor
$available = File.open("available-domains.txt","r") do |file|
file.read.split
end
$unavailable = File.open("unavailable-domains.txt","r") do |file|
file.read.split
end
def available?(domain)
$available.include?(domain) or

Don't see your question below? [Email us!][email]

Do you guarantee that messages are delivered the order in which they were published?

No, we cannot guarantee that. There is varying latency from one client device to the next, so even if one device published before the another, we might received the second one first. It's also possible for our servers to process requests out of order if one request hits a server with less load than a subsequent request.

That said, we do guarantee the ordering once we have processed a message, and our timestamps are done on a microsecond basis, so even if you are processing thousands of requests per second, we can preserve that ordering. Furthermore, the latency variations within our own server are on the order of a millisecond or two, so messages received at a lower frequency will generally be processed in order. However, network latency can vary much more widely across devices and geography, often by tens of milliseconds.

In short, we make every possible effort to pre

Let's get you started building things! We're going to use JavaScript and jQuery in what follows. Once you're up and running with JavaScript, you can follow a similar process to get up and running with our [other client libraries][libraries].

Important: The example below is just to get you up and running. You should never include your account secret in a Web application. See [our tutorial][chat-tutorial] to see a more realistic example.

Create A Sample Project

Create The Project Structure

Create a project directory. Within that create a javascript directory.

@dyoder
dyoder / architecture.md
Created April 28, 2012 00:17
The spire.io Architecture

People often ask us about the technologies we use to power the spire.io platform. Our architecture is a big part of what makes us unique and ensures that your applications will be reliable, performant, and secure.

There are basically five major components involved:

  • Load-balancer and proxy

  • A dispatcher

  • A message transport

@dyoder
dyoder / configure-aws.txt
Created March 28, 2012 02:16
Dolphin with no options
[dan@yoda dolphin (open-source)]$ ./bin/dolphin configure aws --help
Usage: ./bin/dolphin (options)
-g, --group GROUP The AWS security group to use for new instances
-i, --image IMAGE The AWS image for provisioning pods
-k, --key KEY Your AWS account key
-p, --keypair KEYPAIR The AWS keypair name to use with SSH
-r, --region REGION The region (datacenter) for region-specific options
-s, --secret SECRET Your AWS account secret
-h, --help Show this message
@dyoder
dyoder / dispatcher.coffee
Created March 6, 2012 04:55
Go dispatcher, phase 1
http = require('http')
Redis = require("redis")
c = Redis.createClient(@port, @host)
marshal = (req) ->
JSON.stringify
method: req.method
url: req.url
headers: req.headers
body: req.body
@dyoder
dyoder / hello_world.go
Created February 28, 2012 22:53
Hello world Go Web app
package main
import (
"fmt"
"http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:])
}