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 getParameterByName(name) { | |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); | |
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); | |
} | |
var meta = document.getElementsByTagName('meta'); | |
var apple_launch_elem; | |
for (var i=0;i < meta.length; i++) { | |
var elem = meta[i]; |
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 main(): | |
name = raw_input ("Enter Your Name: ") | |
month = raw_input("Enter Birth Month: ") | |
day = int(raw_input("Enter Birth Day of Month: ")) | |
if month == "March": | |
if day > 20: | |
print "Aries" | |
else: | |
print "Pisces" |
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
# displays alphanumeric character count and sum of digits in file | |
import sys | |
if len(sys.argv) < 2: | |
print "Usage: python charcount.py <input.txt>" | |
exit() | |
f = open(sys.argv[1]) |
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
;;; FIRST CHALLENGE | |
(defn challenge1 | |
"Given file name f reads it and prints statistics." | |
[f] | |
(let [{numbers false letters true} (group-by #(nil? (re-matches #"\d*" %)) | |
(clojure.contrib.duck-streams/read-lines f)) | |
letter-freqs (frequencies letters) | |
sum (reduce + (map #(Integer/parseInt %) | |
numbers))] |