instruction
stringlengths
71
71.9k
In my textbook there is no mention of keybindings and it encourages the use of keylistener so there isn't any example code using keybindings for its problems. I was wondering if this is sorta close to how I'm supposed to use them. I tried to let one Action object handle all the keybinds and use the event info to determ...
I have built a random machine generator website. It fetches the quotes from forismatic and has a button to get a new quote. When it gets a new quote, the website color changes. It also features a button to tweet the quote and a button to copy to clipboard (using clipboard.js). //Needs JQuery function getNewQuote(){ /...
Just mucking around with Elixir and bitstrings and wondering if there is a better way to implement the following ( or improve ). :- defmodule Crypto do def hexdigit( digit ) do case digit do d when d >= ?0 and d <= ?9 -> d - ?0 c when c >= ?a and c <= ?f -> c - ?a + 10 ...
In order to learn C++ I have written a solution to this Kattis "Hitting the Targets" problem Basically the program is to accept some shapes (circles and rectangles) on std in and a set of points and output the number of shapes that include each point. Seeing as it is my first C++ program I'm sure I have made significan...
I've been researching ways to reduce response size on requests in my rest API without adding lots of calls to get back just the ID and single properties. What I've ended up attempting is creating the ability for the API consumer to specify the fields they want back from a default response model and have the response b...
I've been working in C++ for awhile now, but always like for others to look over my code as much as I can get them to. My main concerns are if I've made something overly complicated or if I've broken any general conventions in my code. Anyways, thank you for reviewing and I hope you enjoy playing the game if you choose...
I had a test on sorting using quick sort algorithm, which I have implemented. It's working fine. But my examiner is not satisfied. They say that the solution which I provided is not a proper quicksort, my code partially deviates from the actual quicksort algorithm, and the code is a mess in certain places. I took the ...
I'm working on optimizing a class for decompressing Mass Effect 3's .sfar files. .sfar files are archives, and this function decompresses a file from inside an .sfar and writes it to the provided Stream. Sometimes the file isn't compressed, and so just gets copied to the output stream. Most of the time though, the fi...
While implementing Android Activity component using MVP pattern a discussion arose - who should be responsible of creating list adapter - view or presenter? If presenter creates adapter, apparently View needs to provide Context for Presenter to be able to instantiate adapter: public interface MyView { void setAdapter(...
I have made a search script in OO PHP that searches for products based on the inserted criteria, selects them and checks whether a sale is on, if it's in stock and other features. I am new to OOP so I would like to get your feedback on it and whether I am doing it correctly. The whole script works but I need to know if...
Below is the code I implemented to solve the binary gap problem: Find longest sequence of zeros, bounded by ones, in binary representation of an integer. However, it seems to be different from the answers out there. Is it because this is a bad approach in terms of performance? I wanted to get some ideas. function bi...
I have a Database worksheet (SoapUI - CollisionsSingle) that have around 1500 records and 38 columns of data per record. I have a VBA script that copies the records into a algorithm worksheet (COL_STpremcalc) and then copies the results back to the database worksheet. However it takes around 1-2 minutes to perform 1 re...
I have two tables, looking like this: Table 1 id | name | date ---+------+--------------------- 1 | zaak | 2016-08-03 11:37:40 -- top 1 dates, name #5 2 | aap | 2016-08-01 11:40:35 3 | corn | 2016-08-02 11:42:16 -- top 3 dates, name #3 4 | quar | 2016-08-02 11:42:28 -- top 2 dates, name #4 5 | a...
I just finished the Pluralsight courses about Inversion of Control and Mirco-ORMs, and I am struggling with the implementation aspect of some of the concepts. This is my (simplified) repository implementation using Dapper: public class AppRepository : IAppRepository { public string TableName { get; } = "apps"; ...
An entry for the August 2016 Community Challenge I slightly modified the input and output to suit the snippet tool, and also because I really like the mapped output with the basins. I have been golfing a lot recently, which always impacts my coding style. You will find a number of possibly too smart one-liners. I am lo...
Explanation This software is currently designed to: Spawn a daemon which controls and monitors multiple threads Create threads based on a 'list' of functions Monitor threads for operation Restart threads if not running Cleanly stop threads and exit upon SIGTERM It runs on a single embedded system, operating Debian 8 ...
I wrote a simple chatbot in Python a while ago, and I'd like to know how it could be improved. Here's the code: import random import pickle class Bot: current = "" botText = "BOT> " def __init__(self, data, saveFile): self.data = data self.saveFile = saveFile def say(self, text): ...
C++ doesn't supply a std::hash<std::tuple<...>>, so I decided to implement one. However, I was viewing this as more of a hash library than extensions to std, so I placed it all under the namespace utils. This was my first time seriously using template meta-progamming. I tried to make my code work no matter the cv-ness ...
This is a fairly simple Ruby solution to the August 2016 community challenge. Ok, the title is way too dramatic. But tributary is a nice word, and the alliteration was too good to pass up. Besides, konijn started it! I didn't bother to output a 2D "map" of the basins, I just print their sizes as the challenge requires....
Let's say we're writing a user script which interacts with a 3rd party site we don't control. We want to open a menu, so we trigger a click on the button and then wait 10ms before accessing the menu (which is appended to the document after the click), like this: $button = $('#button'); $button.trigger('click'); setTime...
I have a program where I need to implement asynchronous tasks (writing a directory to a file following any change to the directory). There is existing documentation within my organization for implementing tasks, which includes actions and actors. Most of it deals with distributed activity across multiple servers, which...
I have a collection inside MongoDB with thousands of documents. A document should be processing depending on some logic. To make the point simple, I suppose here there is a field requiresProcessing indicating whether or not the document must be processed. To do the processing I created a stream of objects from MongoDB ...
I have been building an app in React Native and have decided that since my Login and Signup components share much of the same code, it would be best to create an AuthState component and pass login={true} or login={false} as props to trigger renderLogin() or renderSignup() in AuthState. However, in doing so, I think I h...
I'm writing a little text based adventure game, and wanted to know if there's anything I can do better thus far. It is not completed to don't get mad when it ends. I'm just curious as to better ways to write the syntax, or different ways to do things. from random import randint BACKPACK = {} # What you will bring wi...
My solution for the Rainfall Challenge (August 2016 Community Challenge). Error handling was intentionally ignored. Cell.cs public class Cell { private readonly int myRowIndex; private readonly int myColIndex; private readonly int myValue; public Cell(int value, int rowIndex, int colIndex) { ...
This code is meant to run through a column of values, bin the values based on specified ranges, then output the average value of each bin. The problem is the code is running quite slowly (approximately 30 min for around 100000 values). I am definitely a beginner at coding and was hoping there was some way to speed th...
I have made a shopping basket script that allows the user to add and remove items from the basket, and edit quantity of items that are in the basket. I am new to OOP, and I would like to get your feedback on it about whether I am doing it well. The whole script works but I need to know if it could be improved or it is ...
I'm pretty new to programming (haven't written much code myself, only read code for my computer science studies etc) and I keep getting confused by how to best structure my code. Let me get a bit more specific by including the code of a Chess game I started to program today (want it to fully function text based, GUI ma...
I am currently writing a program to sync files (music, photos, etc) from my PC to an Android device. In order to do this, I have 2 application: one that is running on my PC, and one that shall be running on the Android device. When the Android app will open, it will try to connect to a specified IP:port on the PC appli...
That is a programmatic solution to a puzzler from Car Talk, its summary is: "I noticed that the last 4 digits were palindromic. I drove a mile, and the last 5 were palindromic. I drove another mile and the middle 4 were palindromic, and the ends were not involved. And then one mile later, all 6 digits were palin...
Rubberduck works well enough when the VBE is of the VBA variety, but it currently only works when the Rubberduck is configured to load at VBA start-up, and it has a tendency to crash the host application or fail to shutdown when exiting. There's a number of outstanding issues around being able to load Rubberduck after ...
I have product results with some filter, and the one is category. I'll get the category list from product results. the model category and products is one to many relationship. This is the search query: $results = Product::where('available','=', 1)->whereRaw('stock_available > min_quantity'); $results = $results->where(...
Problem Implement a base N to base 10 (decimal) converter, where N is between 2 and 36 inclusive. Implementation Am I over-complicating things in calculateDecimalCharacterValue? public class BaseToDecimalConverter { public static int convertToDecimal(int base, String input) { if (base < 2) { throw new...
I'm taking my first ever CS class and I have an assignment due Friday. I just wanted someone to check my code. Instructions: Write a program that: gets the name of a text file of numbers from the user. Each number in the file is on its own line. reads in those numbers one at a time writes the even numbers to a file n...
I wanted to create a short, informational and colourful prompt. My prompt includes: Exit status of last command (if not 0) Distinctive changes when root rsync-style user@host:pathname for copy-paste goodness Git branch, index, modified, untracked and upstream information Pretty colours Example: Is there a way to ac...
Requirements: To store strings into variables, check if they are valid for the field. To be able to easily unit test the validity checks with different parameters. To throw exception when a check fails To scale appropiately for dozens of field types To have a good API for users. To be expandable. I have the following...
I have an EF-driven Repository pattern implementation. Roughly looks like this: public class DataRepository : IDataRepository { public IDbSet<Contacts> Contacts { get; set; } } I would like to implement a Contact import functionality, which has some custom logic for manipulating the entity which is being imported (i...
I am fetching around more than 300000 items through a query: @items = current_company.item_masters.user_hierarchies_filter(current_user).accessible_by(current_ability).paginate(:conditions => condition.compile, :include=> includable_tables, :order => (sort_column + " " + sort_direction), :page=> new_par...
I have been trying to write a sample code block to read file contents into a buffer. I am assuming that: Code must be platform independent Should work in all cases(or report proper error) It should be readable and maintainable It shouldn't be over-complex and shouldn't have errors Do you think the return of fseek sho...
I want to convert a large PDF file into individual text files with PDFBox using Python. This code takes lot of time to convert a PDF containing 1000 pages. Is there anything I can do to improve it? I cannot use any other library. My other code (Python - parsing of obtained text) works best with output of PDFBox. import...
I have the following poller class that can be used to "poll the required action": public class Poller { private readonly string name; private readonly Action action; private readonly int pollingInterval; private readonly Thread pollingThread; private readonly AutoResetEvent stopEvent; private r...
I have been working with multi threading and would like some feedback on the code, i generally suck at class design/OO which i am trying to improve. Im sure there is a better way of making it neater and maximizing readability. using System; using System.Collections.Generic; using System.IO; using System.Linq; using Sys...
I have two functions now with very similar functionality, and would like to merge them into one more generic function. The only difference between those two functions is that one handles json input file and the other xml input file. I could use if statements to achieve this, but I find it cumbersome, other suggestions ...
Is there any better way than doing: if ((newState & InputState.DEFAULT) == InputState.DEFAULT) ? My InputState.class defines static int variables to the power of 2 that are being ORed with an int to make it possible to determine more than one input state. However, checking the existence of a set bit like this looks ju...
First time working with html 5 so far. Am I using my markup correctly thus far? Semantically correct that is? <!doctype html> <html lang="en"> <head> <title>Salon Sociel | Hair-Nails-Unisex</title> <meta charset="utf-8"> <link rel="stylesheet" href="style/main.css"> </head> <body> <header> ...
1. Introduction This code is my attempt at solving the August 2016 Community Challenge. Coming from a city where it rains cats and dogs on a daily basis this challenge was right up my alley =) 2. Algorithm I used the solution 200_success ♦ outlined in his answer here: Each Cell keeps track of which Basin it belongs ...
Here is a programming challenge from codility A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of higher indices, i.e. A[0] + A[1] + ... + A[P−1] = A[P+1] + ....
Problem Statement : Given a string of lowercase alphabets, count all possible substrings (not necessarily distinct) that has exactly k distinct characters. Example: Input: abc, k = 2 Output: 2 Possible substrings are {"ab", "bc"} I have written the solution with a two pointer approach. I am not sure how to calculate th...
This is my attempt to solve the August 2016 Community Challenge in Swift. I tried to implement the algorithm described by @200_success: Each Cell keeps track of which Basin it belongs to; each Cell is initially assume to be in its own Basin. Each Basin has a sink, or lowest Cell, which acts as a "representative el...
I am working on a replacement for a program called pdftk. The program needs to be able to take pdf's, and generate fdf files for them, fill a pdf from an fdf, output info about the forms, and output data about the pdf. I'm sorry for horrible formatting (I'm new to Java). Right now the program works, but is quite slow. ...
This is a direct follow up to Parsing cells containing Line Feed Characters. Link to sanitized xls on dropbox if test data is needed Essentially the reports I work with aren't bad - The issue is the way it exports to excel - With the problem being that these cells are filled with LF characters breaking apart the dat...
Is there a better way than using 2 for loops and 2 if statements deep? jsfiddle: https://jsfiddle.net/bobbyrne01/bmnk9bLz/ Code: var documentsInDatabase = [{ id: '1', revision: '1' }, { id: '2', revision: '1' }, { id: '3', revision: '1' }]; // incorrect revision of document with id of 1, and non-existent d...
I have written a script which is supposed to call the function at the bottom for each unique combination of values in the parameter vectors. That function is a simulation which I intend to run over all the unique combinations of those parameters. The simulation is run on a cluster, and the sim_ind for each of these job...
This code wraps the user endpoint and media endpoint of Instagram API. Any best practices/ styles or glaring bugs you can see? I wrote some unit tests for each class but did not include for readability Base class: import unirest from oauth2 import OAuth2API class Client(OAuth2API): host = "http://api.instagram...
I have created a function that adds "shadow" to the content of a canvas. The algorithm for adding shadow follows these rules: If the either x or y is 0, ignore. If the pixel on the current pixel's top left corner is not completely transparent, set current pixel's alpha value to 0.1. This algorithm runs from top to bo...
I've written the code below to display a list of tasks from a Flask API. The form and associated .ajax method post to the API, immediately appending the data to the list of tasks. The code is working, but I'm fairly new to jquery and am curious if my code could be improved. <html> <head> <title>Home</title> <script src...
In what ways could I improve this? Does it look good? Any security concerns? I am using Jersey, Jackson and JPA. What about the architecture? I basically have CustomerResource communicating with CustomerService and CustomerService Communicates with the Entity. The updateCustomer method is in CustomerResource. I am abso...
I have written a simple wrapper for docker build and docker run that allows me to build and run my image without having to use the docker command directly. Here's the layout of my code: esp8266 ├── scripts │ ├── config.sh <- configuration │ └── util.sh <- utility functions ├── docker <- docker image roo...
Recently while developing our demo project I had to a write a lot of repetitive code for executing the database queries (insert, update, delete). So, I have put all the repetitive code into a class library, imported and used the library for db related actions i.e. open, close, execute insert, update, and delete queries...
I've been learning Go for a few months and this is one of my first projects with it. It's an analytics beacon for my low-volume blog; it emits a tracking pixel and logs parameters from the browser to a database. I'm hoping to use it in addition to Google Analytics, so it isn't mission critical or anything. I'd apprecia...
I solve this problem in Swift. However, some cases I got terminated due to timeout because the solution isn't efficient enough. I did check the solutions and they are correct. Any tips on making it more efficient and code review? import Foundation func readInteger() -> Int { guard let line = readLine() else { fat...
Is there any better way to do this? import json product_data = [x for x in open('product_strings.txt', 'r', encoding='utf-8').read().split(',')] json_data = json.load(open('tedata.json', 'r', encoding='utf-8')) for product_no in json_data: for product in product_data: if product.lower() in json_data[prod...
In my app I'm using JSON Web Tokens for authentication purposes, using the pyjwt library. Instead of using static keys and/or worrying about key distribution, the server generates a public/private key pair upon startup itself and just keeps it in memory. The keys will be reset and thereby all existing tokens invalidate...
I want to use an existing C++ library in a C# app. The C++ library will have async callbacks for things like OnConnect and user updates so I want to reflect this in the eventual C# code. I would appreciate thoughts on the following implementation particularly in the area of memory leaks in the CLI part. To begin, I hav...
I wrote a Python module to learn about memoization, and I have some questions on what I did. How pythonic is this? Does it make a difference if I used a class attribute instead of a function attribute for my lookup_table? How can I modify multi_run_chrono to use it like Python's decorators (with @)? Should I keep the ...
The following code will generate a sequence of N mac addresses based on the input from user. The input must be atleast one octet to generate the sequence , ie : input : A0 , 5 output : A0:00:00:00:00:01 - A0:00:00:00:00:05 My actual code is working fine and I wanted to make it optimized if it could be : public static...
I am very new to Python and trying to refactor my code which is ripe for error. Currently, I manually name a bunch of arrays: open_cost_mat_train = np.array([]) closed_cost_mat_train = np.array([]) open_cost_mat_train_1 = np.array([]) closed_cost_mat_train_1 = np.array([]) open_cost_mat_train_2 = np.array([]) closed_co...
I am currently in the process of learning C++. As such, I am making small programs to get more comfortable with the language. One of these programs is a small mergesort function with a basic wrapper for human-readable output and a few utility functions. I have posted this program here to get feedback on it. I am most i...
For an interview question I made a roman to integer converter: def romanToInt(self, s): """ :type s: str :rtype: int """ mapping = {"I": 1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000} numeral_list = list(s) num_list = [[mapping[i], -1] for i in numeral_lis...
I need to encrypt/decrypt 2D arrays (double pointers) using AES-128/CTR using Intel TinyCrypt (written in C). The following are two helper methods to simplify the library usage. Any comments would be highly appreciated. Thanks in advance. #include <tinycrypt/constants.h> #include <tinycrypt/ctr_mode.h> #include <tinycr...
I have a finance web-application in ASP.NET WebForms using Telerik RAD controls. Two event handlers wound up being very similar in implementation. What steps could I take to improve the organization of and/or the efficiency or DRY-ness of the code? What other issues / code-smells are present? The Code Update Event ...
The purpose of this function is to determine if report_input_file is either in JSON format or XML format, this is what I came up with, just want to know if this is best practice / pythonic way of achieving this? def parse_report_file(self, report_input_file): """ Checks if input report file is of type json or xml "...
This is my code: <?php $begin = microtime(TRUE); $result = get_web_page('WEB_PAGE'); $dom = new DOMDocument(); $dom->loadHTML($result['content']); $xpath = new DOMXPath($dom); // Get the links $matches = $xpath->evaluate('//li[@class = "lasts"]/a[@class = "lnk"]/@href | //li[@class=""]/a[ @class = "lnk"]/@href');...
What are the best practices to writing clean, expandable game code? I always end up getting overwhelmed with my games because the code gets very unorderly. I use OOP (java), but I still feel like my code is unorganized. I will get examples below. The blocker class is basically like a pipe in flappy bird. It moves aroun...
How do I refactor common code with different union types? I'm still struggling with refactoring F# code with different types but same behavior. I have the following function that I would like to refactor: let movePiece destination positions piece = let foundPiece = positions |> List.filter (fun space -> space = Al...
I implemented Kosaraju's algorithm on a graph with 800k vertices and 5100k edges. The time taken by various operations are: building graph took 11.84 seconds ordering took 2.54 seconds finding SCCs took 2.63 seconds My computer has an i7 with 4GB RAM. I would like to know if my code can be made more efficie...
I'm writing some unit tests for testing C# code but I'm using F# and Unquote for the first time for the unit tests and would like some input as to how I might make the tests more 'f-sharpier' to take advantage of and learn more about the functional approach in F#. Here's an example of one of my tests - please make reco...
I am making a simple function to find and match any possibilities what Pokémon the user wants. This is accomplished by taking in the input (what the user thinks the Pokémon is named) and compare its spelling with preset Pokémon names (letter by letter searching). With each successful match, the Pokémon's score (determi...
Pretty standard. Generates the first n primes, input via a scanner. package main; import java.util.Scanner; public class Prime_Generator { public static void main(String args[]) { int n; int status = 1; int num = 3; Scanner scanner = new Scanner(System.in); System.out.print("First n ...
I have written this implementation and I would love to make it more efficient. While I am indeed requesting a code review/suggestion, I would also love to get feedback on readability and coding style. Every bit of input helps The main code for this factory is below: (function(window, q, $, cordova) { "use strict"; ...
I started to learn C a week ago and this is my culminating program of what I've learned but I could use a few pointers. #include <math.h> #include <stdio.h> void binary(int n){ int x = 0, m = 0, z = n; while(n >= 1){ ++x; n /= 10; } n = z; int i[x]; x = 0; whi...
I haven't programmed in a while and need to improve my code in any way possible: efficiency, readability, etc. This program is for getting integer coefficients of any polynomial and factoring: ex. $$ 2x^2+8x^1+8 \longrightarrow 2(x+2)(x+2) $$ What advice can you offer to help me out? factor.py (Main file) #!/usr/local/...
Is there anything I can do better here? I tried looking for ways to simplify this with comprehension but could not figure out how and was told it is better to explicitly use for loops. import re print("This is a email/phone number parser.") print("Type in the name of the file you want to parse:\n") filename = input(">...
This may seem like a lot of stuff? I just need help with 2 small parts the code works, however I have provided the rest of the info in case some one can help. USING PYTHON 3.4 Code below is responsible for comparing multiple CSV files against a cross-reference file and creating a metadata file, information files, also ...
I have subclassed Qt QAbstractTableModel with QJsonDocument as data source which I have reimplemented the setData() method in: bool UeJsonPlacesTableModel::setData(const QModelIndex& index, const QVariant& value, int role) { if(role!=Qt::Edit...
I have the following code (running in LINQPad) which takes tens of thousands of CSV files and concatenates them to create a single file. Each CSV file has two lines: a header line and a data line. I need the header line only once, then the rest of the lines are data. However, it appears to be getting slower as it runs ...
There is a lot of code duplication because it generates hashes using multiple cryptographic hash algorithms. How can I improve this code? package main; import java.util.Scanner; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class String_Hash_Gene...
Somewhat experienced with JavaFX, but this is my first potentially large JavaFX project that I recently started and wanted some feedback on anything that could be done better or more efficiently thus far, before continuing. Note: I am aware that there are a few functions not in use, I'm just leaving them in for future...
I'm developing a Tic Tac Toe game where you can change your pawn look Now as You can see it has 2 buttons one for next one for previous, and You can also pick if you want to edit the O or the X sprite. Now here comes the custom collection I made and the reason for that is because I need something that can remember wh...
I have a situation where I have a program will start up another program and it will do some work. I need to be able to stop this work if certain conditions arise. I want to use a CancellationToken on the worker side but as far as I know these can't be used across process boundaries. I wrote the following code to acco...
A solution for the August 2016 Community Challenge (Rainfall). I've intentionally left out error checking on the file formatting. This seems like a very obvious graph problem to me - we want to partition some graph based off of relative elevations. I've used networkx 1.9.1 to operate on the graphs, and matplotlib to ...
The following Golang code accepts a sequence of numbers (any integer and float type) in the terminal, adds them, and prints the result (sum) to the terminal. Actually in Golang you can't add different integer types together, because of which this script accepts all the digits as a string representation of space-separat...
I'm using the icalendar module to parse (google) calendar entries and the dateutil.rrule module to deal with recurring events. Right now, I'm using the rrulestr class to parse (part of) the RRULE data and rruleset to add EXDATE entries: from icalendar import Event from dateutil.rrule import rrulestr, rruleset from date...
How can I optimize this code? #include<iostream> #include<queue> using namespace std; struct Node { int data; Node *left,*right; }; Node *createNode(int data){ Node *node=new Node; node->left=NULL; node->right=NULL; node->data=data; return node; } Node buildTree(Node *newNode,queue<Node *...
As a puzzle we were asked to bring out the possibilities in breaking a 4 letter wordlock combination. It was to be a four letter word from the English dictionary. There were 10 possible characters in each place. So \$10^4\$ possibilities of random words. I brute forced my code to return a list of possible words by firs...
This code is a server for websocket connections, it handles the low level stuff and delegates incoming messages to handler objects. I wanted performance to win in any trade off against maintenance costs or readability, but security should be as good as possible without becoming unfit for purpose. It "works" and I'm usi...
My job entails me to send a lot of emails. I'm really bad at typing so I decided to create a program to do it for me. I've created an email generation tool (originally posted here.) I've changed everything around so that I was able to push the tool to Github, so now you can actually run it, and fall in love with it's m...
I came across an interesting method of solution for the Tower of Hanoi puzzle and wrote a short version of it as a programming exercise. The program produces the correct results but I have two questions. First is there simpler way to write the alternating step of determining the only valid move which does not involve t...
Trying to implement producer/consumer problem in C++. I have one question: should I use nofify_all or notify_one method here? Also any feedback is welcome template <class T> class Stack { public: Stack(size_t size) : size_(size) { arr_ = new T[size_]; init(); } ~Stack() { de...
My intention is to create a complete HTML parser, so far I made a basic algorithm that iterates trough text and extracts everything in an "a" tag. It works on everything I tried, but I want a review of what I could do better or what I did right. #include <iostream> #include <stdio.h> #include <vector> #include <fstream...