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
| def main(args): | |
| try: | |
| first_results_page = ResultsPage(0, args.what, args.where) | |
| print(f"Scraping {first_results_page.getTotalResultCount()} job vacancies for '{args.what}' in '{args.where}'...") | |
| now = datetime.datetime.now() | |
| data = { | |
| "what" : args.what, | |
| "where" : args.where, | |
| "datetime" : str(now), |
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
| @retry(wait_exponential_multiplier=1000, wait_exponential_max=60000) | |
| def geocodeLocation(self): | |
| ''' | |
| Returns [latitude, longitude] for job listing. | |
| Many job listings use generic, wide, areas for the 'location' field. | |
| E.g. 'London' rather than 'EC12' or 'Bristol' rather than 'BS6'. | |
| This function attempts to get around this by searching Google Maps for the 'company' near to the 'location' field. | |
| If this fails, it searches for the 'location' field near to the 'where' search term entered by the user. | |
| If that fails, it just geocodes 'where'. | |
| ''' |
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
| // Help with the maths of using the modulo operator was found from this Stack Overflow post: | |
| // https://stackoverflow.com/questions/25214008/rot13-and-the-use-of-the-modulo | |
| #include <cs50.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| // Error messages | |
| string USAGE_ERROR = "Usage: ./caesar key\n"; |
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
| // Help with the maths of using the modulo operator was found from this Stack Overflow post: | |
| // https://stackoverflow.com/questions/25214008/rot13-and-the-use-of-the-modulo | |
| #include <cs50.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| // Declare prototypes for functions | |
| int shift(char 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
| #include <stdio.h> | |
| #include <cs50.h> | |
| int main(void) | |
| { | |
| // Get and validate user input | |
| int user_input; | |
| do | |
| { | |
| user_input = get_int("Height: "); |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| // get rid of magic numbers | |
| #define BLOCK_SIZE 512 | |
| typedef uint8_t BYTE; | |
| int main(int argc, char *argv[]) | |
| { |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <ctype.h> | |
| #include <math.h> | |
| #include "bmp.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| // ensure proper usage |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include "bmp.h" | |
| int main(int argc, char *argv[]) | |
| { | |
| // ensure proper usage | |
| if (argc != 3) | |
| { |