Skip to content

Instantly share code, notes, and snippets.

View tuulos's full-sized avatar

Ville Tuulos tuulos

View GitHub Profile
@tuulos
tuulos / README.md
Created March 10, 2012 01:36
Bitdeli Visualization Example: Trains arriving to BART stations in next 15 minutes

Bitdeli visualization example: Trains arriving to BART stations in next 15 minutes

This example shows how to use real-time data from the Bitdeli API to create visualizations with RaphaelJS.

The visualization shows a BART station on each column. The further the estimated time arrival is for a train, the further it is drawn from its destination station down bottom. The data is updated once a minute. Refresh the page to see the updated status.

The data originates from the BART API through this Bitdeli script.

You can view the live visualization here with bl.ocks.org.

handle_cast({update_config_table, Config}, S) ->
error_logger:info_report([{"Config table update"}]),
UpdateNodes = fun({Host, Slots}, DNodes) ->
DNode = case gb_trees:lookup(Host, S#state.nodes) of
none ->
#dnode{name = Host,
slots = Slots,
node_mon = monitor(Host)};
{value, N} ->
N#dnode{slots = Slots}
handle_cast({update_config_table, Config}, S) ->
error_logger:info_report([{"Config table update"}]),
Update =
fun({Host, Slots}, DNodes) ->
DNode =
case gb_trees:lookup(Host, S#state.nodes) of
none ->
#dnode{name = Host,
slots = Slots,
node_mon = monitor(Host)};
handle_cast({update_config_table, Config}, S) ->
error_logger:info_report([{"Config table update"}]),
Update = fun({Host, Slots}, DNodes) ->
DNode = case gb_trees:lookup(Host, S#state.nodes) of
none ->
#dnode{name = Host,
slots = Slots,
node_mon = monitor(Host)};
{value, N} ->
N#dnode{slots = Slots}
def fun_mapinit(input_iter, params):
import os
os.environ["DYLIB_LIBRARY_PATH"] = "your_path"
params.pycuda = __import__("pycuda")