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 <iostream> | |
| #include <string.h> | |
| #include <SDL.h> | |
| /* | |
| * | |
| * Hello World in SDL2. | |
| * | |
| */ |
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
| import argparse | |
| import socket | |
| parser = argparse.ArgumentParser(description='Query a host address of all ports, returns open or closed.') | |
| parser.add_argument('-u', type=str, help='The host address (e.g.) example.com') | |
| args = vars(parser.parse_args()) | |
| host = args['u'] |
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
| # Client.py a client component to the server component! | |
| import socket # For network stuff obv. | |
| import argparse # Parse arguments! | |
| parser = argparse.ArgumentParser(description = 'Connect to a server and send commands and files to be executed.') # Create the parser. | |
| parser.add_argument('-u', nargs = 1, type = str, help = 'Target destination, e.g. (192.168.2.1., 127.0.0.1') # Add the target. | |
| parser.add_argument('-p', nargs = 1, type = int, help = 'The port for the target destination e.g. 80, 22, 8080.') # Add the port. |
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> | |
| typedef struct Vector { | |
| int *arr; | |
| int capacity; // # of elements that can occupy the vector total. | |
| int size; // # of elements in the vector. | |
| } Vector; | |
| Vector vector_init() { |
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
| ''' IMPORTANT !!!! | |
| explanation provided entirely by | |
| https://medium.com/@fabianterh/how-to-solve-the-knapsack-problem-with-dynamic-programming-eb88c706d3cf | |
| @fabianterh | |
| i just implemented this in python for bettering my understanding. | |
| ''' | |
| class Item: | |
| def __init__(self, value, weight): |
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
| import re | |
| class InputStream: | |
| def __init__(self, string): | |
| self.string = string | |
| self.cursor = -1 | |
| def peek(self): | |
| return self.string[self.cursor + 1] | |
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 <vector> | |
| enum NODE_TYPE { | |
| OBJECT_NODE, | |
| PROPERTY_NODE, | |
| ARRAY_NODE, | |
| LITERAL_NODE, | |
| NULL_NODE, | |
| STRING_NODE, | |
| }; |
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
| using import struct | |
| using import Array | |
| struct Token | |
| value : string = "" | |
| kind : i8 | |
| position : i32 | |
| struct InputStream | |
| source : string = "" |
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
| using import struct | |
| using import enum | |
| using import Array | |
| using import Map | |
| using import String | |
| enum N : i32 | |
| N_STRING | |
| N_NUMBER | |
| N_OBJECT |
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
| using import struct | |
| using import Array | |
| using import enum | |
| using import String | |
| using import Map | |
| # TODO; | |
| # * On demand lexing. | |
| # * Implement ATOF. | |
| # * Implement solidus string parsing. |
OlderNewer