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 <thread> | |
#include <mutex> | |
#include <queue> | |
#include <chrono> | |
template <class T> | |
class TSafeQueue{ | |
public: | |
TSafeQueue(){ |
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 <string> | |
std::string reverse(std::string str){ | |
if(str.empty()){ | |
return ""; | |
} | |
int last_elem_index=str.size()-1; | |
return str[last_elem_index] + reverse(str.substr(0, last_elem_index)); | |
} |
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
country=us | |
update_config=1 | |
ctrl_interface=/var/run/wpa_supplicant | |
# Create a new one with "wpa_passphrase NAME PASS" | |
network={ | |
ssid="NAME" | |
#psk="PASS" | |
psk=cfe117ff936f870afaa2fbb5b6c21aca8 | |
key_mgmt=WPA-PSK |
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
TargetVendor=0x12d1 | |
TargetProduct=0x1f1c | |
MessageContent="55534243123456780000000000000011062000000101000100000000000000" |
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/home/hmenn/.oh-my-zsh | |
# Set name of the theme to load. Optionally, if you set this to "random" | |
# it'll load a random theme each time that oh-my-zsh is loaded. | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes | |
ZSH_THEME="robbyrussell" |
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
import time | |
import serial | |
class SIM900: | |
def __init__(self, port, baudrate,timeout): | |
self.mPort = port | |
self.mPBaudrate=baudrate | |
self.mTimeout=timeout | |
def connect(self): |
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
open_brackets =['{','[','('] | |
close_brackets = ['}',']',')'] | |
def getIndex(l,ch): | |
index=None | |
try: | |
index=l.index(ch) | |
except: | |
index=None |
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
#from http://www.pyimagesearch.com/2015/03/30/accessing-the-raspberry-pi-camera-with-opencv-and-python/ | |
# import the necessary packages | |
from picamera.array import PiRGBArray | |
from picamera import PiCamera | |
import time | |
import cv2 | |
# initialize the camera and grab a reference to the raw camera capture | |
camera = PiCamera() |
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
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |
update_config=1 | |
network={ | |
ssid="Example_WEP_Network" | |
scan_ssid=1 | |
key_mgmt=NONE | |
wep_key0="wep_password" | |
wep_tx_keyidx=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
public Properties getPropertiesFromFile(String fileName) { | |
Properties properties = null; | |
try { | |
properties = new Properties(); | |
properties.load(getClass().getClassLoader().getResourceAsStream(fileName)); | |
} catch (IOException e) { | |
System.err.println("Error detected"); | |
e.printStackTrace(); | |
} | |
return properties; |