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
local Set = {} | |
package.loaded["Set"] = Set | |
Set.__index = Set | |
Set.__eq = function (a, b) | |
for e in a:iter() do | |
if not b:contains(e) then | |
return false | |
end |
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
local Node = {} | |
Node.__index = Node | |
function Node:new(data) | |
self = {} | |
self._data = data | |
self.left = nil | |
self.right = nil |
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
#include <stdlib.h> | |
#include <assert.h> | |
#include "person.h" | |
#include "employee.h" | |
#include "iperson.h" | |
// Private helper function declaration. | |
static void check_salary(double salary); | |
static char* _name(void *self); | |
static void _set_name(void *self, char *name); |
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
#include <assert.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include "animal.h" | |
#include "dog.h" | |
#include "duck.h" | |
#include "tiger.h" | |
struct animal { |
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
# Detect underlying system. | |
ifeq ($(OS),Windows_NT) | |
detected_OS := Windows | |
else | |
detected_OS := $(shell sh -c 'uname -s 2>/dev/null || echo not') | |
endif | |
export detected_OS | |
# Set default C compiler. |
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
#include <stddef.h> | |
#include <stdio.h> | |
#include <string.h> | |
#ifdef _WIN32 | |
#define SEP "\r\n" | |
#else | |
#define SEP "\n" | |
#endif |
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
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
char * separator_parse(const char *sep); | |
int main(int argc, char *argv[]) | |
{ |
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
#include <assert.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include "queue.h" | |
queue_declare(int); | |
int main(void) | |
{ | |
bool failed = false; |
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
/* | |
YahooFinanceCrawler | |
Version: 1.0 | |
Copyright: 2018, Michael Chen; Apache 2.0. | |
System Requirments: | |
- JDK 8 | |
- Selenium Java package and its dependencies. | |
- MgntUtils |
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
#!/usr/bin/env python | |
############################################################################## | |
# fetchStockData.py - a friendly Yahoo Finance crawler. # | |
# # | |
# Requirements # | |
# # | |
# - Python 3 # | |
# - Selenium package for Python # | |
# - The web driver for Chrome # |