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 bash | |
# Run as root or with sudo | |
# Make script exit if a simple command fails and | |
# Make script print commands being executed | |
set -e -x | |
# Set names of latest versions of each package | |
export VERSION_PCRE=pcre-8.43 | |
export VERSION_ZLIB=zlib-1.2.11 |
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
/* You've probably seen those goofy comments in forums that say "find the | |
* missing number in a list of 10,000 numbers. Who wants to take time to | |
* do that? I know there are arithmetical solutions to this problem, but | |
* I thought I'd find a simple functional approach to this. | |
* | |
* This snippet simply takes the array of numbers (expected to be unsorted, | |
* but either will work), sorts them, then uses the reduce function to compare | |
* to the previous value in the array. I like this method more than summing | |
* all numbers, dividing by two, comparing, blah, blah. The map function works | |
* great! |