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
| In The Midst Of Winter, I Found There Was, Within Me, An Invincible Summer. | |
| - Albert Camus |
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
| -- this is the original cipher function you will run | |
| cipher [] _ = [] | |
| cipher a b = rot (head a) b : cipher (tail a) b | |
| -- Take a look at this 'rotate' function. | |
| -- Rotate will convert a Char into another Char. | |
| -- This almost works. But it doesn't loop around z-->a. | |
| rotate :: Char -> Int -> Char | |
| rotate c n = if n==0 | |
| then c |
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
| And how will you inquire, Socrates, | |
| into that which you know not? What will you | |
| put forth as the subject of inquiry? And if you | |
| find what you want, how will you ever know that | |
| this is what you did not know? | |
| - Meno |
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
| class IntersectionFound(Exception): | |
| def __init__(self, user_id): | |
| self.user_id = user_id | |
| def get_friends(user_id): | |
| """Returns a set of ids representing the friends of the given user.""" | |
| def update_shortest_path(shortest_paths, user_id, to_user_id, via_user_id, distance): | |
| """Update the shortest path for one user.""" | |
| if shortest_paths.has_key(user_id): |
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
| [ | |
| "vivekb", | |
| "octopi", | |
| "binroot" | |
| ] |
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
| db.codes.findAndModify( | |
| { | |
| query: {type:"hi"}, | |
| update: {desc:"stuff"} | |
| } | |
| ); |
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
| db.codes.group({key:{'type':1}, cond:{type:{$regex:'.*hi.*'}}, initial:{sum:0}, reduce:function(doc, prev){prev.sum++}}) |
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
| quicksort :: Ord a => [a] -> [a] | |
| quicksort [] = [] | |
| quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) | |
| where | |
| lesser = filter (< p) xs | |
| greater = filter (>= p) xs |
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
| cd ~ | |
| rm -rf Pictures Photos Videos Public |
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
| PS1="\e[0;37m┌──\e[0m[\e[0;33m\u\e[0m@\e[0;34m\h\e[0m]─[\e[2;37m\w\e[0m]\n\e[0;\ | |
| 37m└─\e[0m\$ " |