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 processing.serial.*; | |
import ddf.minim.*; | |
Minim minim; | |
AudioOutput out; | |
PluckedString string; | |
// The fundamental frequency of the string (in Hz) | |
// Setting this very low (e.g. 2.0) results in |
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
<form action="login.php" method="post"> | |
<label for="foo">Username:</label> | |
<input type="text" name="username" id="foo"> | |
<label for="bar">Password:</label> | |
<input type="password" name="password" id="bar"> | |
<input type="submit" value="Login"> | |
</form> |
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
<?php | |
// A malicious user would be hard-pressed to compromise | |
// a user's password with crypt because crypt is a one-way | |
// function, and the malicious user would also need to guess | |
// the salt, which can be set on an individual-user basis. | |
$salt = "kr"; | |
// This saved_password would be saved in the database. | |
$saved_password = crypt('mypassword', $salt); | |
echo "<p>The saved password is: ".$saved_password."</p>"; |
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
/** | |
* oscP5broadcastClient by andreas schlegel | |
* an osc broadcast client. | |
* an example for broadcast server is located in the oscP5broadcaster exmaple. | |
* oscP5 website at http://www.sojamo.de/oscP5 | |
* FINAL FINAL FINAL | |
*/ | |
import oscP5.*; | |
import netP5.*; |
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
/** | |
* oscP5broadcastClient by andreas schlegel | |
* an osc broadcast client. | |
* an example for broadcast server is located in the oscP5broadcaster exmaple. | |
* oscP5 website at http://www.sojamo.de/oscP5 | |
* FINAL FINAL FINAL | |
*/ | |
import oscP5.*; | |
import netP5.*; |
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
function sendmail($email, $name, $title) | |
{ | |
$to = $email; | |
$subject = 'Maya Order Confirmation'; | |
$message = 'Hello '.$name.',<br /><br />This email is to confirm your order for the following book from Maya:<br /><br /><strong>'.$title.'</strong><br /><br />Please wait for the next update email which will contain shipping information.'; | |
$headers = 'From: Maya Book Service <info@mayabooks.com>' . "\r\n" . | |
'MIME-Version: 1.0' . "\r\n" . | |
'Content-type: text/html; charset=iso-8859-1' . "\r\n" . | |
'Reply-To: Maya Book Service <mayabooks@mayabooks.com>' . "\r\n" . |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> | |
<style type="text/css"> | |
svg { | |
font-size: 14px; | |
} |
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
def lexicographic(word): | |
word = list(word) | |
for i in range(len(word) - 1): | |
if (ord(word[i]) < ord(word[i + 1])): | |
k = i | |
for l in range(len(word)): | |
if (ord(word[l]) > ord(word[k])): | |
j = l | |
word[k], word[l] = word[l], word[k] |
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
def permutations(li): | |
""" Return all permutations of a given list. This function | |
assumes every element of the list is unique. """ | |
if len(li) <= 1: | |
yield li | |
else: | |
for el in li: | |
for p in permutations([e for e in li if e != el]): | |
yield [el] + p | |
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
def permutate(word): | |
returnList = [] | |
if len(word) == 1: | |
returnList.append(word) | |
for pos in range(len(word)): | |
# Recursively find permutations of the word | |
# that does not contain the letter in position | |
permuteList = permutate(word[0:pos] + word[pos+1:len(word)]) | |
# For each of those permutations, add |
NewerOlder