- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
# Author: Pieter Noordhuis | |
# Description: Simple demo to showcase Redis PubSub with EventMachine | |
# | |
# Update 7 Oct 2010: | |
# - This example does *not* appear to work with Chrome >=6.0. Apparently, | |
# the WebSocket protocol implementation in the cramp gem does not work | |
# well with Chrome's (newer) WebSocket implementation. | |
# | |
# Requirements: | |
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby |
var url = require('url'), | |
mongodb = require('mongodb'); | |
var sourceUrl = 'mongodb://user:pass@host:port/db', | |
targetUrl = 'mongodb://user:pass@host:port/db', | |
collectionName = 'my_awesome_collection'; | |
function openDbFromUrl(mongoUrl, cb) { | |
var dbUrl = url.parse(mongoUrl), | |
dbName = dbUrl.pathname.slice(1), // no slash |
"""Flask extension utility.""" | |
from flask.sessions import SessionInterface, SessionMixin | |
from werkzeug.contrib.cache import MemcachedCache | |
import memcache # Use https://code.launchpad.net/~songofacandy/python-memcached/mixin-threading | |
def setup_cache(app): | |
""" | |
Setup ``app.cache``. |
in upload handler | |
in file close | |
.. | |
---------------------------------------------------------------------- | |
Ran 2 tests in 0.021s | |
OK |
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import random | |
global compareCount | |
def swap(arr, l, r): | |
temp = arr[l] | |
arr[l] = arr[r] |
Attention: if you attempt to fork this gist, github will think that you are a spammer and you will have to confirm that you are human with them. Apparantly there are too many links in this list. Also I update it rather frequently (see revisions on the left), so it's probably wise to not fork it anyway.
Add this in your ini file:
[alembic:exclude]
tables = spatial_ref_sys
In env.py
:
import re
from Tank.Plugins.bfg import Sample | |
import logging | |
import time | |
import json | |
from MyService.Service import Service | |
import MyService.Service.ttypes as tt | |
from thrift.transport import TTransport | |
from thrift.transport import TSocket | |
from thrift.protocol import TBinaryProtocol |
A dendrogram is a common way to represent hierarchical data. For Python users, Scipy has a hierarchical clustering module that performs hierarchical clustering and outputs the results as dendrogram plots via matplotlib. When it's time to make a prettier, more customized, or web-version of the dendogram, however, it can be tricky to use Scipy's dendrogram to create a suitable visualization. My preferred method of visualizing data -- especially on the web -- is D3. This example includes a script to convert a Scipy dendrogram into JSON format used by D3's cluster
method.
In the example, I cluster six genes by their expression values from two experiments. You can easily replace that data with your own, larger data set, to harness the power of both Scipy and D3 for analyzing hierarchical data. The D3 code I used to generate this example is straigh