This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File: Modbus.cpp | |
* Author: mbains | |
* | |
* Created on January 8, 2016, 5:21 PM | |
*/ | |
#include "Modbus.h" | |
#define T35_TIMEOUT (5) //ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write a python method to remove items from a dictionary based on the value | |
def removeByValue(d_dict, value_in): | |
''' delete item in d_dict where from value = value_in ''' | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Credit(): | |
charges = [] | |
history = {} | |
def __init__(value): | |
self.charges.append(value) | |
def balance(): | |
print sum(self.charges) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
using namespace std; | |
class BaseClass{ | |
public: | |
virtual int funk() { | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Simple example shows using await and defer of IcedCoffeeScript with setTimeout | |
#The calls within a code block are forced to wait until the previous defer action is completed. | |
#Program output: | |
# 1 going to sleep | |
# 2 going to sleep | |
# 2 done sleeping | |
# 1 done sleeping | |
test1 = ()-> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from ctypes import CDLL | |
foo = "Fiesta" | |
bar = "Fiesta" | |
#Change foo with low level C | |
libc = CDLL('libc.so.6') | |
libc.strcpy(foo, "Nachos") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __signals_h__ | |
#define __signals_h__ | |
#include <list> | |
#include <memory> | |
#include <iostream> | |
#include <functional> | |
namespace signals { | |
template<typename... Values> class Signal { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// This server will start a bash shell and expose it | |
// over socket.io to a browser. See ./term.html for the | |
// client side. | |
// | |
// You should probably: | |
// | |
// npm install socket.io | |
// curl -O https://github.com/LearnBoost/Socket.IO/raw/master/socket.io.min.js | |
// |