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
| ## Note: Tested on Linux only as of now. | |
| How to use? | |
| 1. There should be an alert.mp3 file in your directory for the sound to be played. | |
| 2. Use a python virtualenv to install requirements. | |
| 3. Just run the system_honeypot.py file. |
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
| class LeafNode<T> { | |
| ... | |
| slice(_startIndex: number, _length: number) : T { | |
| return this.#data; | |
| } | |
| } | |
| class NetworkNode<T> { | |
| ... | |
| slice(startIndex: number, length: number): T { |
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
| class LeafNode<T> { | |
| ... | |
| at(_index: number): T { | |
| return this.#data; | |
| } | |
| } | |
| class NetworkNode<T> { | |
| ... | |
| at(index: number): T { |
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
| type TNode<T> = LeafNode<T> | NetworkNode<T>; | |
| class LeafNode<T> { | |
| #data: T; | |
| constructor(data: T) { | |
| this.#data = data; | |
| } | |
| get data(): T { |
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
| /** | |
| Large string has been broken into Cords, a Tree like data structure that can only have a Leaf Node or an Internal Node | |
| Sample Cord: | |
| Simple: | |
| -> Leaf <length=5> "ABCDE" | |
| Complex: | |
| -> Internal <length=10> | |
| -> Left: Internal <length=4> |
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
| /* | |
| # Intensity Addition Problem | |
| ## Problem Statement | |
| Read a 24-bit Bitmap image from a user given path and store into 2-D matrix and add a constant intensity value to each pixel and save to a image path given by user. | |
| ## Constraint | |
| 1. Input file will definitely exist and have valid 24-bit Bitmap image. |
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
| #======================================================================== | |
| # Description: Tokenise an Excel formula using an implementation of | |
| # E. W. Bachtal's algorithm, found here: | |
| # | |
| # http://ewbi.blogs.com/develops/2004/12/excel_formula_p.html | |
| # | |
| # Tested with Python v2.5 (win32) | |
| # Author: Robin Macharg | |
| # Copyright: Algorithm (c) E. W. Bachtal, this implementation (c) R. Macharg | |
| # |
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
| # Module: Expression Tree for Spreadsheet | |
| # @function: tree | |
| # @param table: A set of reference and their formula/rules | |
| # @param @optional debug: Prints table (Given) and values (Evalutated) iff True | |
| # @returns Evalutated table | |
| def tree(table = {}, debug = False): | |
| class Node(object): | |
| def __init__(self, key = None, value = None): |
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> | |
| /* | |
| * USAGE: create(<SIZE OF SIEVE>) | |
| * RETURN TYPE: CHAR* (STRING) | |
| * THIS METHOD CREATES DYNAMIC MEMORY ALLOCATION | |
| * IN HEAP WHERE THE SIEVE HAS TO BE IMPLEMENTED | |
| * LOOPS THROUGH ALL NUMBER UPTO 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
| #include <stdio.h> | |
| #define get getchar_unlocked | |
| /* | |
| * USAGE: scand(<ADDRESS OF INTEGER VARIABLE>) | |
| * RETURN TYPE: VOID | |
| * THIS METHOD READS CHARACTER FROM CONSOLE | |
| * CHECKS WHETHER IT BELONGS TO NUMBER OR NOT | |
| * IF IT IS A NUMBER KEEP ADDING UNTIL A NON-NUMERIC | |
| * CHARACTER IS FOUND. PUT THE INTEGER FORMED IN GIVEN |