Skip to content

Instantly share code, notes, and snippets.

// Copyright (c) 2015 VividCortex
//
// 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
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
#!/bin/sh
for f in *.md; do
month=`echo $f | cut -d'-' -f1`
day=`echo $f | cut -d'-' -f2`
name=`echo $f | sed 's/[0-9][0-9]-[0-9][0-9]-//'`
echo $month '/' $day '/' $name
mkdir -p $month/$day
mv $f $name
### STAT 5630 Presentation ###
# Team 4
# Chris Haberland
# Haiguang Du
# Preetam Jinka
###
# Dependencies
library('glasso') # glasso
library('igraph') # plotting
@Preetam
Preetam / glasso.R
Last active September 13, 2015 14:50
library('glasso')
library('igraph')
library('qgraph')
library('MASS')
s <- matrix(c(10,1,5,4,1,10,2,6,5,2,10,3,4,6,3,10),4)
a <- glasso(s, rho=1)
A1 <- abs(a$wi) > 1E-4; diag(A1) <- 0
g1 <- graph.adjacency(A1, mode='undirected')
plot(g1)
{
"data": {
"byBytes": [
{
"source": "101.103.___.___",
"destination": "199.58.___.___",
"sourcePort": 51145,
"destinationPort": 55999,
"protocol": "TCP",
"bytesPerSecond": 1.2089721,
int main(void) {
foreach();
return 0;
}
∂ [15:34:44] [~]: curl -XPOST -H 'Content-Type: application/json' -d '[{"source": "my.source", "metric": "my.metric", "timestamp": 100, "value": 0.0}]' localhost:8080/insert
{"data":null}
∂ [15:36:10] [~]: curl localhost:8080/sources?start=100
{"data":["my.source"]}
∂ [15:37:37] [~]: curl -XGET -H 'Content-Type: application/json' -d '[{"source": "my.source", "metric": "my.metric", "start": 90, "end": 110}]' localhost:8080/query
{"data":{"series":[{"start":100,"end":100,"source":"my.source","metric":"my.metric","points":[{"timestamp":100,"value":0}]}]}}
import http.client
import json
class Client:
def __init__(self, address):
self.connection = http.client.HTTPConnection(address)
def sources(self, start=-86400, end=0):
self.connection.request('GET', '/sources?start=' +
str(start) + '&end=' + str(end))
SIGQUIT: quit
PC=0x440029
goroutine 0 [idle]:
runtime.epollwait(0x7fff00000004, 0x7fff3f8f0ba8, 0xffffffff00000080, 0x7f4f00000000, 0xffffffff000000e9, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:400 +0x19
runtime.netpoll(0x8c9e01, 0x0)
/usr/local/go/src/runtime/netpoll_epoll.go:68 +0xa3
findrunnable(0xc208012000)
/usr/local/go/src/runtime/proc.c:1472 +0x485
SIGQUIT: quit
PC=0x43feb1
goroutine 0 [idle]:
runtime.futex(0x8ca678, 0x0, 0x0, 0x0, 0x0, 0x8c9dc0, 0x1, 0x40eaaf, 0x40ecce, 0x8ca678, ...)
/usr/local/go/src/runtime/sys_linux_amd64.s:277 +0x21
runtime.futexsleep(0x8ca678, 0x0, 0xffffffffffffffff)
/usr/local/go/src/runtime/os_linux.c:49 +0x47
runtime.notesleep(0x8ca678)
/usr/local/go/src/runtime/lock_futex.go:145 +0xae