Skip to content

Instantly share code, notes, and snippets.

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),
@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'.
'''
// 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";
// 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);
#include <stdio.h>
#include <cs50.h>
int main(void)
{
// Get and validate user input
int user_input;
do
{
user_input = get_int("Height: ");
#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[])
{
#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
#include <stdio.h>
#include <stdlib.h>
#include "bmp.h"
int main(int argc, char *argv[])
{
// ensure proper usage
if (argc != 3)
{