Skip to content

Instantly share code, notes, and snippets.

View scj7t4's full-sized avatar

Stephen Jackson scj7t4

  • Albuquerque, NM
View GitHub Profile
2012-May-01 08:41:44.007280 : Info(6): Receive a new marker different from current one.
2012-May-01 08:41:44.007686 : Info(6): Current version is e55a8948-6eeb-565c-85f1-1a4f7078d887 + 235
2012-May-01 08:41:44.008093 : Info(6): Incoming version is e55a8948-6eeb-565c-85f1-1a4f7078d887 + 236
2012-May-01 08:41:44.008669 : Info(6): Forward marker to 9e0f6504-8419-5e06-9283-9a47cb1255b0
2012-May-01 08:41:44.010963 : Info(6): Forward marker to e55a8948-6eeb-565c-85f1-1a4f7078d887
2012-May-01 08:41:44.140934 : Debug(7): virtual void freedm::SCAgent::HandleRead(freedm::broker::CMessage)
2012-May-01 08:41:44.141268 : Debug(7): Peer already exists. Do Nothing
2012-May-01 08:41:44.141601 : Info(6): Received message is a marker!
2012-May-01 08:41:44.142013 : Info(6): ===================================================
2012-May-01 08:41:44.142317 : Info(6): Receive a new marker different from current one.
@scj7t4
scj7t4 / options.py
Created June 15, 2012 15:28 — forked from mnuck/options.py
Three ways to do the same thing (now Four!)
# option 1
if request.POST['modify'] == 'public':
assign_perm('modify', anon, rs)
else:
remove_perm('modify', anon, rs)
if request.POST['view'] == 'public':
assign_perm('view', anon, rs)
else:
remove_perm('view', anon, rs)
if request.POST['execute'] == 'public':
# Supervisord auto-start
#
# description: Auto-starts supervisord
# processname: supervisord
# pidfile: /var/run/supervisord.pid
SUPERVISORD=/usr/bin/supervisord
SUPERVISORCTL=/usr/bin/supervisorctl
case $1 in
Hello World
@scj7t4
scj7t4 / LoadBalancePrototype.cpp
Created July 9, 2013 21:13
Load Balancing Prototype
class LBAgentBase
{
public:
// USER OVERLOADED FUNCTIONS
// USER OVERLOADABLE FUNCTIONS
void Init(); /// Called in run, sets any persistent user defined values like collected devices
void DetermineState(); /// Function which computes the state based on the current normal.
SignalValue ComputeNormal(vector uuid devicetype valuetype value); /// Using the collected state, compute normal.
SignalValue ComputeGateway(device state); /// Given the current state of local devices, compute & return agg
/// gateway.
f = open(file)
contents = f.readlines()
while len(contents):
line = contents.pop(0)
#Then if you need to read another line:
#but you'd need to test to make sure the next line is there?
if len(contents) > 0:
line = contents.pop(0)
#include<iostream>
using namespace std;
template <class T>
class StaticThing
{
public:
StaticThing()
{
// Programmer: Jennifer Leopold date: September 17, 2014
// File: hw4.cpp
// Purpose: Simulate a vending machine that dispenses
// medications.
//
// To compile: fg++ hw4.cpp -o hw4
//
// To execute: ./hw4
#include <iostream>
@scj7t4
scj7t4 / gist:47f5276a2b907be5d6df
Created November 6, 2014 14:56
Extreme Sorting
#include <algorithm>
#include <vector>
#include <cmath>
#include <iostream>
using namespace std;
template<typename T>
class dsort
{
@scj7t4
scj7t4 / gist:8e083741402d905f6139
Created December 5, 2014 16:07
Brackets Operator
class Pair
{
private:
int m_val1;
int m_val2;
public:
int operator[](int index) const;
};
int Pair::operator[](int index) const