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
const int BEEP = 3; /* pin no */ | |
void setup() { | |
Serial.begin(9600); | |
pinMode(BEEP, OUTPUT); | |
} | |
void loop() { | |
int analogPin = analogRead(0); | |
int outputLevel = analogPin / 4; |
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
<?php | |
if (empty($argv[1]) || preg_match('/\A[0-9]+\z/', $argv[1]) !== 1) { | |
throw new Exception('Usage: fizzbuzz.php number [separator]'); | |
} | |
$array = range(1, (int)$argv[1]); | |
$separator = isset($argv[2]) ? $argv[2] : PHP_EOL; | |
echo implode($separator, array_map(function($i) { |
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
Hello World |
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
#!/usr/env/bin python | |
# -*- coding: utf-8 -*- | |
import sys | |
def fizzbuzz(i): | |
if i % 3 == 0 and i % 5 == 0: | |
return 'fizzbuzz' | |
elif i % 3 == 0: | |
return 'fizz' |
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
#!/usr/bin/env python | |
def fizzbuzz(func): | |
def fb(): | |
value = func() | |
if (value % 3 == 0 and value % 5 == 0): | |
return 'FizzBuzz' | |
elif (value % 3 == 0): | |
return 'Fizz' | |
elif (value % 5 == 0): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
arr = [3, 8, 1, 9, 18, 44] | |
try: | |
search = int(sys.argv[1]) | |
except IndexError: |
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
#!/usr/bin/env python | |
# -*- conding: utf-8 -*- | |
def search(l, value): | |
low = 0 | |
high = len(l) - 1 | |
while(low <= high): | |
lx = int((low + high) / 2) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def loadTable(l, size): | |
a = [] | |
for i in range(0, size): | |
a.append([]) | |
for i in range(0, len(l) - 1): | |
h = l[i] % size |
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
#!/usr/bin/env python | |
# -*- conding: utf-8 -*- | |
class Node: | |
left = None | |
right = None | |
value = None | |
def __init__(self, value): |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
class Node: | |
def __init__(self): | |
self.children = [] | |
def getName(self): | |
pass |
OlderNewer