This file contains hidden or 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
# Title | |
Arduino Powered Burglar Alarm | |
# Picture | |
media: http://www.deviantsart.com/3099afr.jpg | |
# Objective | |
Nigeria is a very hot place. Temperature averages 30 degree Celsius and even at Night the temperature is hot. The aim of this project is to regulate temperature by turning on the fan whenever the temperature reaches a certain level and turn it off whenever the temperature drops. This helps to conserve energy and also to improve comfort for the owner. | |
# Duration | |
40min | |
# Age Group | |
all |
This file contains hidden or 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
// Uses a PIR sensor to detect movement, buzzes a buzzer | |
int ledPin = 13; // choose the pin for the LED | |
int inputPin = 2; // choose the input pin (for PIR sensor) | |
int pirState = LOW; // we start, assuming no motion detected | |
int val = 0; // variable for reading the pin status | |
int pinSpeaker = 10; //Set up a speaker on a PWM pin (digital 9, 10, or 11) | |
void setup() { | |
pinMode(ledPin, OUTPUT); // declare LED as output |
This file contains hidden or 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
# Title | |
Smart Farm | |
# Picture | |
media: http://www.deviantsart.com/38fdru4.jpg | |
# Objective | |
A lot of people don't have the time or resources to grow their own food even though they would like to. | |
The goal of this project is to help ordinary people take care of their farms. It automatically waters the plants when it detects that the soil moisture level has gone below a certain treshold. | |
# Duration | |
2 hours | |
# Age Group |
This file contains hidden or 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
def lastWord(word): | |
if len(word)==1: | |
return word | |
lastletter = word[-1] | |
restOfWord = lastWord(word[:-1]) | |
if ord(lastletter)>=ord(restOfWord[0]): | |
return lastletter+restOfWord | |
else: | |
return restOfWord+lastletter |
This file contains hidden or 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
def flip(s): | |
res = [] | |
for l in s: | |
if l=='+': | |
res.append('-') | |
else: | |
res.append('+') | |
return "".join(res) | |
def countFlips(s,k): |
This file contains hidden or 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
def flip(s): | |
res = [] | |
for l in s: | |
if l=='+': | |
res.append('-') | |
else: | |
res.append('+') | |
return "".join(res) |
This file contains hidden or 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
def flip(s): | |
"""changes all _ in s to + and all + in s to _""" | |
res = [] | |
for l in s: | |
if l=='+': | |
res.append('-') | |
else: | |
res.append('+') | |
return "".join(res) | |
This file contains hidden or 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 <vector> | |
using namespace std; | |
void enumerate(vector<int> arr){ | |
for(int current_set = 0; current_set < (1<<(arr.size()-1)); current_set++){ | |
for(int j=0; j<arr.size(); j++){ // j is the position in arr. | |
if (current_set & (1<<j)){ // if the bit is set in this set, then arr[j] is in the set | |
cout<<arr[j]<<','; | |
} | |
} |
This file contains hidden or 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
solution = [] | |
def possibleCombinations(N, items): | |
if N < 0: | |
return | |
if N == 0: | |
print solution | |
else: | |
for k in items: |
This file contains hidden or 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 re | |
import os | |
import sys | |
for directory in sys.path: | |
for directory, subDirectories, files in os.walk(directory): | |
for file in files: | |
if file.endswith('.py'): | |
filepath = os.path.join(directory, file).replace('/', '.') |
OlderNewer