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
package com.quote.my.mark.mmq.database | |
import android.content.Context | |
import android.database.sqlite.SQLiteDatabase | |
import org.jetbrains.anko.db.* | |
class QuoteDBHelper(ctx: Context) : ManagedSQLiteOpenHelper(ctx, "MMQDatabase", null, 1) { | |
companion object { | |
private var instance: QuoteDBHelper? = null |
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 function will write a 2 byte integer to the eeprom at the specified address and address + 1 | |
void EEPROMWriteInt(int p_address, int p_value) | |
{ | |
byte lowByte = ((p_value >> 0) & 0xFF); | |
byte highByte = ((p_value >> 8) & 0xFF); | |
EEPROM.write(p_address, lowByte); | |
EEPROM.write(p_address + 1, highByte); | |
} |
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
//========================================================================================== | |
#define NUM_OF_DIGITS 3 | |
#define NUM_OF_SEGMENTS 7 | |
//-------------------------- | |
long preMicros=0,preMillis=0; | |
unsigned char digitBuffer[NUM_OF_DIGITS]={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
import speech_recognition as sr | |
# obtain audio from the microphone | |
r = sr.Recognizer() | |
with sr.Microphone() as source: | |
print("Say something!") | |
audio = r.listen(source) | |
# recognize speech using Sphinx | |
try: |
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
:10000000758920758DFD759852D28EC2A2C2A0C28C | |
:10001000A17448114674451146744C1146744C1134 | |
:100020004674301146740D1146740A1146114E1172 | |
:1000300046B45204B2A080F5B45904B2A180EEB423 | |
:1000400047EBB2A280E73099FDC299F5992230982A | |
:06005000FDC298E59922B3 | |
:00000001FF |
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 cv2 | |
import sys | |
video_capture = cv2.VideoCapture(0) | |
#video_capture.set(3,320) | |
#video_capture.set(4,240) | |
face_cascade = cv2.CascadeClassifier('haar_frontalface_alt2.xml') |
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 RPi.GPIO as GPIO | |
import time | |
#=========== GPIO ALIASES [BCM MODE] ==================== | |
LED1 = 19 #BCM MODE | |
LED2 = 26 |
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 RPi.GPIO as GPIO | |
import time | |
#global veriables | |
LED_Pin = 16 | |
delay = 0.5 | |
#setup your pins and GPIO mode | |
GPIO.setmode(GPIO.BOARD) |
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
binary = reshape(dec2bin(s, 8).'-'0',1,[]) | |
str = char(bin2dec(reshape(char(binary+'0'), 8,[]).')) |
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 RPi.GPIO as GPIO | |
import time | |
TRIG = 24 | |
ECHO = 23 | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(TRIG,GPIO.OUT) | |
GPIO.setup(ECHO,GPIO.IN) |