instruction
stringlengths
71
71.9k
Following is the piece of code which represents the bottleneck of my application: #include <iostream> #include <chrono> #include <unordered_map> #include <vector> #include <memory> #include <cassert> #include <thread> #include <random> #include <utility> using namespace std; using namespace chrono; static const size_...
From this question and John Palmers answer about active pattern I discovered a gap in my knowledge about F# and took the challenge to code me into some level of understanding this technique. The result is as follows: module PokerCards open System type Suites = | Clubs | Diamonds | Hearts | Spades type Valeurs = // I...
A challenge in the beginner book "Automate the boring stuff": #! Python3 # Table printer # Takes a list of lists of strings and displays in right-justified table # assumption is inner lists contain same number items # each inner list must be printed as a column the_list = [["a", "bbbbbbbbb", "tttt"], ["d"...
My react.js Image component will load an image from a URL or base64 string, do some processing on it and put it on a canvas. The "preload" prop is a 10x10 pixel image that is blurred just a little bit to make it look smoother. The blur algorithm itself is very fast (I also tried removing it, but got the same results i...
I wanted to implement the Sieve of Erathosthenes up to int.MaxValue in C#. No object is allowed to exceed 2Gb so you can't allocate a bool[int.MaxValue] array. In order to solve the problem, I created a class that packs the bits into an array of bytes instead. I know that it's possible to use a segmented sieve: this wa...
I want to calculate the Cartesian product of n copies of a small list, marker=[0,1,2]. I want to use these Cartesian product tuples as keys in a dictionary. The value per each key is to be a numpy array with n random floats between 0 and 1. The only twist is that for each key:value pair in the dictionary, if the key ha...
I have managed to write code that does something fairly complex. It's working as I need it to, but it is so slow. Information about a list of suppliers needs to be consolidated into a word document that maintains the same layout on all pages. To do this, a document in the required layout has been created with bookmarks...
I am working on Project Euler problem 504, which states: Let \$ABCD\$ be a quadrilateral whose vertices are lattice points lying on the coordinate axes as follows: \$A(a, 0), B(0, b), C(−c, 0), D(0, −d)\$ where \$1 ≤ a, b, c, d ≤ m\$ and \$a, b, c, d, m\$ are integers. It can be shown that for \$m = 4\$ there are exac...
I am trying to test #initialize of class Author: # lib/author.rb class Author attr_reader :name, :filename, :website def initialize(name, filename, website) @name = name @filename = filename set_filename_from_name if filename == :auto @website = website end end In reality there are 8-9 propertie...
I have an ASP.NET MVC 5 application that needs to log to the database every request for a specific controller action and every link click that happens on the view of that action. Since the user shouldn't be affected of this operation. I came up with the following pattern: For the controller: //get the repository instan...
I have made a small game just for my own practicing. While making it I wrote an asset loader, which (as the name says) loads assets. But my main knowledge and effort was on the game, so now I am wondering how I could improve the asset loader. On the bright side: It does the job quite well, no matter what changes I put ...
I am trying to find a efficient solution for the 3n + 1 problem on uvaonlinejudge. The code I have uses memoization using a dictionary. I am getting a 'Time limit Exceeded' error when I submit the code. Can anyone suggest an improvement(s) that will help with the execution time of this code. I have already seen this po...
I'm originally a Java developer taking a stab at some Scala development. One of the main reasons I'm posting is because I know that in Scala you can write your code in a Java (OOP) way and it will run but that makes it bad Scala code. I was hoping I could get a review of my code and maybe somebody could point out how I...
I've made a dice game that rolls three die, calculates the sum of their results, and asks the user whether he/she thinks the next roll's total will be higher, the same, or lower than the current roll. It works but I want to know if there is a better/more efficient way to do this. I just started C programming a couple d...
This code is part of Construct library that converts between byte and bit representations. from construct.lib.py3compat import * def integer2bits(number, width): r""" Converts an integer into its binary representation in a b-string. Width is the amount of bits to generate. If width is larger than the actual a...
This is part of the Construct library. Rebuffered is used to turn a seekless/tellless stream like from a socket or pipe into a seekable/tellable one like a BytesIO or a file. If tailcutoff is provided, only that amount of bytes is kept counting from the end of last read write operation backwards. Otherwise entire stre...
The following is part of a personal budgeting program I'm writing. This code pulls line item information from multiple tables and writes it into an array and then displays the information by transid => family => category => lineItems. Everything works, and I get the results I want out of it. I want to know if there is ...
I have a function that extracts basic parts-of-speech words (NN,NNP,JJ,VBS etc.) from about 2000 sentences. I want to understand if there is a way to optimize so I can bring down the execution time (from about 12 secs right now to single digits) if possible. import re, nltk, html def extract_entities(text_list): ...
I am interested in learning a more succinct (or better performing) way of writing the following working code. I just figured it out but it is pretty messy. This program takes a file full of daily financial transactions for x number of months (for example), and appends each line to the appropriate month file to create s...
This class returns a cached contact by ID. The two cached functions here are doing the same thing. The only difference being an early return statement or using else and having only one return statement. CacheHelper class is a static class that is a wrapper around .Net's MemoryCache class. It's a dll reference so I don'...
This was one of my assignments in which I had to create a backup script that will individually compress all files (of an arbitrary number) of file-types (indicated by their .extension). Example: backup a b c will take all files ending in .a, .b and .c and compress them using tar, keeping the original file, and naming t...
Edit: it seems flow based (or reactive) programming approach would help here; there are some libraries in python that try that. I tried to follow the generator pipeline style (see David Beazley's famous presentation) for finding duplicate files (similar to answers here). It seems pretty straightforward with MapReduce, ...
This is new code and continue discussion from thread (Social network broadcast message algorithm), and this thread focus on build new graph from strong connected graph part. Let me post the problem again, this time I want to focus more on the 2nd step of the algorithm (i.e. code after replace nodes in a strongly connec...
I had to create a report for a customer by most sold products in the last month and sorted by parameters they have assigned. We have three parameters on products: Colour, Type and Collection. The desired result is to sort products by most sold Collection, then most sold Colour, then most sold Type. The query I have wri...
I have an app with a bunch of questions defined in a yaml file. For various reasons I would like the data to be divided into sections (section_0, section_1, section_2 etc.). When I load this file into my js app I get an object that looks like this: const questionData = { "section_0": { "items": [ { ...
I'm working on a problem to clone a linked list (each node has a regular next pointer), and each node also has a random pointer which could point to any node in the linked list. Each linked list node has a unique ID and new cloned linked list node should have the same node ID. One major concern in my current implementa...
I recently applied for a job as a node/react developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was too academic and that it would take me too long to get up to their requirements. I'm not really sure what this means so a...
I have a WinForms project in which I am trying to implement the Passive View MVP pattern (meaning no business logic in my Views). Each form is a concrete View with an IView interface to which a Presenter is connected. I do think i should handle some UI related logic in my View because I am otherwise adding needless co...
I recently applied for a job as a Node/React developer. I'm attempting to cross over from a research position to web development. I didn't get the job but all the feedback I got was that my code was too academic and that it would take me too long to get up to their requirements. I'm not really sure what this means so a...
I had a task to create simple audio player. So far I managed to do functionalities and all that is needed. Other part of same task was to make it semantic and modular. I read some blog posts and articles about semantic but I am not sure how to do it in right way. player(); function player(){ music = new Audio...
I am building a Go based image processing worker for my web application. I am trying to be idiomatic, but I am new to Go. Any feedback, is appreciated. This program uses bimg to generate 4 square images based on top, left, width, height, which come from a client side cropping library (croppie.js) package main import (...
This code is supposed to search for a specific key in a object or an array or a mix between both. Is there anything I can improve? function getAllObjectsIn(key, data, casesensitive){ var returns = []; var searchForInner = function (key, data, returnParameter, casesensitive){ if(typeof(data) === 'obje...
I need to run 12 queries on a SQL Server DB. Currently I pass the "SELECT..." string to a function below. Is it optimal to open and close the connection again and again (as my code is doing), or can I set up an ADODB connection as a global variable and reuse the same connection? Sub ConnectServer(FileName As String, r...
I have a view that performs some rolling totals. In this instance, it must be in a view. The issue is that it takes about 10 minutes to run, returning 2700 records. There should be a faster way, but I am not privy at the moment. I asked a question here in order to get this far. I am running SqlServer 2008 R2, so advanc...
This method finds an employee from a given mother company which consists of group of companies. An employee can work for many child company. $scope.getEmployee = function(subsidiary, salaryScale){ //1 var workingDepartments = [];//2 var findInGroupOfCompanies = function(comGroup, salaryScale){//3 ...
I had an assignment, for which I got full marks, but am really upset about the code I have written. I feel it is too manual and repetitive. Please help me make it more optimized. I am making many objects of StringTokenizer and using many static variables. I wish to reduce that, and instead of using declaring 10 Strings...
Was looking at this question (which I initially misunderstood completely), to which Peter Taylor posted a good answer outlining a much better algorithm. For kicks, I implemented it in Ruby, but I feel like it can be done more cleanly: def next_greater_permutation(integer) digits = integer.to_s.chars.map(&:to_i) ...
I've been learning Assembly over the past few days, and I've made a simple RPN calculator. Here is the main logic of the program, excluding utility functions such as printing: %include "utilities.s" SECTION .data badOpMsg db "Unknown character: ", 0h badNumMsg db "Error parsing number: ", 0h badE...
I have an original method that almost does what I want (a method I did not create), but now I need to find records that were deleted so I added another method GetAllGuideRecords minus the delete condition in the where clause. But now I kind have repeated code so I decided to pack everything in one method, with an optio...
I am using the book "Realm of Racket" which was written by the people behind the Racket and Dr. Racket projects. It is a great book based on games, similar to the famous "Land of Lisp". The first game we are supposed to code is the classic "Guess My Number". Following the instructions on the book you end up with this c...
I'm pretty new to web development and I don't know if my solution is OK according to the best practices, considering performance and clean code. I have a Merchant model that belongs to a Price model. Price table: create_table "prices", force: :cascade do |t| t.string "price_range" t.integer "percentile" t.date...
This code prints out a list of all the possible sums that can be made from a set of cash. For example, say you have 2 fives and 2 tens in your wallet. With these, you can make exact change for $0, $5, $10, $15, $20, $25, and $30. import itertools cash = {1: 1, 5: 3, 10: 2} # Keys are denominations (e.g. $1 bill) ...
The way these 1's and 0's flip are like the Lights Out game, except I only have to worry about a single row. So, if I have 1001 and I "press" the first bit it will become 0101 Now if I "press" the third bit, it will become 0010 and so on until you get the string to be all zeros. The way I solved this puzzle was to tes...
This is my solution to Project Euler Problem 48. Problem: The series, \$1^1 + 2^2 + 3^3 + ... + 10^{10} = 10405071317\$ . Find the last ten digits of the series, \$1^1 + 2^2 + 3^3 + ... + 1000^{1000}\$. I would like feedback/advice to possibly increase efficiency and/or correct incorrect practices. public static vo...
I'm in the middle of a program to simulate gravity between particles for > 50000 particles. It works so far, but the way I calculate gravity seems to be a tad askew. Generally, it works. It fails when particles get too close (distance between them approaching 0, gravitational force approaching infinity). I believe this...
I'm looking for feedback on my singly linked list implementation in JavaScript. Please let me know if you have any suggestions on coding style, documentation, bug fixes, etc. UML / code overview LinkedList _head - The first element in the list _size - The number of elements in the list getSize() R...
I am writing a module that will synchronize destination to be the same as source, but will only overwrite files in destination that differ from source as to not cause excessive writes, hopefully prolonging the life of the backup. I will probably add additional functionality on top of this later. I am primarily looking ...
I recently created a QuadTree implementation in C++. It varies slightly from most implementations. Instead of storing elements it only organizes elements. This allows programmers to insert elements into the QuadTree and maintain access of those elements outside the QuadTree. Nodes will only subdivide if an element is i...
in my application i have a form 'DetailScreenView' which implements 'IDetailScreenView'. It is connected to 'DetailScreenPresenter' by the Passive View MVP pattern. I also have a 'DetailScreenUserControl' which needs to be put onto the 'DetailScreenView'. I have looked at how other people have implemented it, such as ...
I need to create method which handle HttpResposeMessage. Method should throw an exception if error exist, client will handle rest. You can see my code bellow. This code is working fine and doing what I want, but still it looks quite ugly to me. Do you have some ideas for nicer implementation? [Authorize] public abs...
I'm working on a problem to find wholly repeated shortest substring of a given string, and if no match, return length of the string. My major idea is using a Trie tree to build substrings from length 1 to half length of the whole string, then traverse the Trie tree to find if there is a wholly repetitive match or not (...
I have page where I am inserting some data into Entry fields. For each Entry I have written in XAML different controls with parameters. One of them is Formated parameter where I am giving a string which I am checking on C# logic code. The problem which I figure out that some one could insert wrong string or string but ...
Can you help me to optimize my code for the following problem: An array of hashes named expected_tasks has tasks. Each task has a user that has to execute an action and contains fields. The expected_tasks are related to the actual_tasks. We want to execute the expected_task[action] on the actual_task["id]". Therefo...
As the title say, I have a huge SQL Query which was built over the time (as new requests came, fast workarounds were demanded).More, there were three DB Admins who contributed to this query, and I'm just a poor programmer who has to deal with it. This query's purpose is to build a report, using some functions and appa...
I'm implementing a stack by C++ and here I think it has memory leakage problem: in Stack::peek() and Stack::pop(), where I created heap space and returned pointer to function caller. Users who call these two functions may perform deletion on returned pointer, which will recycle heap space once done. I am wondering what...
I created a small logging class library and wanted you guys to check it out, I used to use Log4Net but thought I could create something more user friendly that was more suitable for my project than Log4Net was, don't get me wrong Log4Net is an amazon library but it can just be hard to edit to your personal preference a...
I would really welcome some advice, and notes about my code. I am a long time Python user, and some days ago i decided i should try C++. So a couple of days passed, and i wrote my first application which has a practical use. I still find C++ very complicated (my current perspective is over complicated) but i can clearl...
I have written this function for creating complete HTML-elements including arbitrary attributes and inner HTML. I want to keep and reuse it. Therefore I have tried to document the usage well. I would be interested in hints concerning: Could the code be improved? So that it is becomes more succinct and efficient? Can...
I make a 2D matrix class (where matrix elements are of type float) which so far can: Create a matrix of zeros of any size by typing Matrix2D myMatrix(n,m) where n is row size and m is column size (default is 1) Create a matrix based on an initializer list, for example Matrix2D myMatrix({{1,2},{3,4}}) creates the matri...
I'm getting the right results for the code for the sample outputs, but the OJ is giving a TLE (3 seconds max). The questions is here. int main() { double h,u,d,f; while(scanf("%lf%lf%lf%lf",&h,&u,&d,&f)!=EOF) { //cin>>h; // if(h==0) // break; //cin>>u>>d>>f; double ...
I was given this task: Calculate amount of elements in collection by property: "name" let array = [ {name: 'Serhii'}, {name: 'Serhii'}, {name: 'Nile'}, {name: 'Apple'}, {name: 'Serhii'}, {name: 'Serhii'}, {name: 'Apple'}, {name: 'Serhii'}, ]; Here is my solution: function calculate...
Objective: Print all combinations with repetition of k elements out of a set of n elements. using System; namespace Chapter10Exercise2 { class KofNCombinationsIterative { static int[] combination; //------------------------------------------------------------------------- static void Mai...
I'm looking to identify any weak points and unnecessarily slow/expensive operations to optimize this function: https://jsfiddle.net/vkoc22kh/24/ Any help is much appreciated!!! Thank you!!! function cleanTerm(term) { // Escape any regex syntax inside this.term var cleanTerm = term.replace(/[-\/\\^$*+?.()|[\]{}]...
I'm not sure about this code but it feels ugly to me. It is a solution to this. package main import ("golang.org/x/tour/tree"; "fmt"; "reflect"; "sort") // Walk walks the tree t sending all values // from the tree to the channel ch. func Walk(t *tree.Tree, ch chan int) { if t != nil { ch <- t.Value ...
The "Images" exercise in A Tour of Go asks for an implementation of image.Image. I wrote two solutions, one easy and one harder (just for practice in dealing with interfaces). SOLUTION 1: (HARD WAY) package main import ( "golang.org/x/tour/pic" "image" "image/color" ) type Image struct{ // one array ...
I just started to learn C++ and I decided to make a Rock Paper Scissors game. It works fine but I would like to know how can I improve it further. In particular I couldn't find an efficient way to implement a play again feature. Thanks in advance. #include <cstdlib> #include <ctime> #include <iostream> #include <strin...
I have code in the this example: legacy_id phone_type phone_number 1 f 1234567890 1 b 1233854100 1 f 4110256565 2 f 0707070770 2 b 7895120044 I want the data to end up like the following: legacy_id f_phone_number_1 b_phone_number_...
I want to know about smart pointers in C++11, so I started to write my own linked list implementation: #include <iostream> #include <memory> template<typename T> struct link { T data; std::shared_ptr<link> next; link(T value) : data(value) {} void add_to_end(T value) { if (next) ...
Previous question: C# Logging System I have took your answers on board and added the following changes to my LogManager.cs class: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sahara.Sahara.Core.Logging { class LogMana...
I have written a basic slideshow program that uses pygame to manage the display screen. It cycles through all pictures files in the directory and sub-directories. There is a user configuration section for the start directory, sub-directories to ignore, image file type, display time, full screen or window display and ad...
I tried to resolve this task: The integers 14 and 15, are contiguous (1 the difference between them, noticeable) and have the same number of divisors. 14 ----> 1, 2, 7, 14 (4 divisors) 15 ----> 1, 3, 5, 15 (4 divisors) The next pair of contiguous integers with this property is 21 and 22. 21 -----> 1, 3, 7, 21 (4 di...
Here is a first difference function I threw together for a quick check in another program: use std::ops::Sub; fn first_difference<T>(input: &Vec<T>) -> Vec<T::Output> where T: Sub<Output = T> + Clone { let vec_len = input.len(); input.iter().take(vec_len-1).enumerate().map(|(ind, val)| { val....
I have developed a command line application which prompts the user to initially select an oven and then requests that they cook a pizza. The oven affects the pizzas cooking time. The pizzas information will be printed to the command line as well as the altered cooking time. I wanted to use the best design principles I ...
The function redsqrt(n) prints out the most reduced form of the square root of n. It calls on another function perfsq(n), which produces a list of perfect squares less than or equal to n. from math import sqrt def perfsq(n): # Returns list of perfect squares less than or equal to n l = [1] i, x = 0, 3 ...
I'm a little unhappy with the look of this "flexible" way of dealing with errors from an API in Ruby: class ApiError < StandardError def initialize(response) message = response.is_a?(String) ? response : !(response.respond_to? 'body') ? 'Error' : response.body.is_a?(Hash) ? response.body['...
This is my second day into C++ and I wanted to get a small review from someone experienced with the language. I'm coming from Python so some stuff seems kind of weird. My plan is to build a little "web store" with this. #include <string> #include <vector> #include <iostream> #include <initializer_list> enum class Item...
I used this code to give -h(help) options to my bash script. It's working fine and I wanted to get the code reviewed. while true; do if [ "$1" != "-l" ] && [ "$1" != "-a" ] && [ "$1" != "-h" ] && [ "$1" != "" ]; then output=$(curl -k -s -u "$username:$password" -H "X-Requested-With: Curl...
I just built an audio player in Angular 2 using a player component and a player service. It's all working fine, I just feel like there is a much better way to do this. Should the audio object be in the service or the component? I'm skeptical because I'm using three different observables and I don't think that is the be...
I've been updating a little text-based game of mine to have the text roll out over a time period to give the appearance that it's being typed. I'm doing this by using non-blocking output with ncurses. The text to be output is passed to a function called TimedPrint, along with arguments for the screen to print it on, th...
so I created a database manager and wanted to know if I could improove it in any way? Thanks. DatabaseManager.cs: using MySql.Data.MySqlClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Sahara.Core.Database { class DatabaseManager ...
I took an entire line of input in the form of a string, and tokenized the string into substrings and obtained the first string as the first name and the second as the last name. This program as it stands is very basic and limited however my primary focus was on the creation of generic functions to do all the heavy lift...
I am trying to use this VBA code to pass a SQL stored procedure multiple values from an excel sheet. In order to have the procedure run multiple times and insert multiple sets of information into the database, I copied and pasted the parameter section of the code each time I wanted to insert new data and hard coded whi...
I have a browserify module I've made for resizing two divs I have beside each other. The idea is that I have two panes with a bar between them which I can grab and drag to resize the panes. As one pane gets bigger the other gets smaller. It's not really that important for the code review that this is a browserify modul...
For a genetic algorithm I'm writing, I need to sub-sequence a list, but I need it to be lazy so I can compose it with other lazy functions. If I introduce strictness into the chain, I risk potentially massive slow-downs since each step in the chain requires a full traversal of the population. Amazingly, such a function...
I'm attempting to write a (hopefully) efficient way of "expanding" a 2d array into a 1d array. Let me illustrate what I mean: Given the 2d array {{1, 2}, {3, 4}} and a block width of 2 and a block height of 2, we can "expand" into a 1d array {1, 1, 2, 2, 1, 1, 2, 2, 3, 3, 4, 4, 3, 3, 4, 4} Notice, if newlines are a...
From Rosetta Code: The Archimedean spiral is a spiral named after the Greek mathematician Archimedes. It can be described by the equation: $$r=a+b\theta$$ with real numbers \$a\$ and \$b\$. Here is my attempt to draw it in Python (using Pillow): """This module creates an Archimdean Spiral.""" from math import co...
After reading a certain question on the Stack Overflow website, I tried to write a solution to the problem just for fun. I'm, however, left with the nagging feeling there is a beautiful one-liner that can be used instead. The question's premises: Create a function that will receive a string. The function will count ea...
I'm doing a Euler challenge that is stating to find the smallest positive number that is divisible (without a remainder) by all numbers from 1 to 20. So I did it however, I don't like the fact that I have to guess up to which number the while loop have to go (var s.... s < 303000000) and I guess there are too many vari...
This question is a follow-up question from here, where I implement the method from @vnp. I have tested my code and it works, but the 3 steps processing seems a bit long to me. I also tried to write a few if/else, which seems a bit cluttering (e.g. code like newList.nextNode = newList.nextNode.nextNode if newList.nextNo...
I have a few of files, and total size of them is more than 5 GB. Each line of the files is a IP address, looks like: 127.0.0.1 reset success ... 127.0.0.2 reset success how can i find Top10 frequently IP in 25s within 500M memory? Here is my code,but it takes probably 64s and use more than 1G memory. package main; i...
The goal of this code is to print the entity tree of a VHDL project. There are a readme and very minimal tests on the github repo. I am trying to refactor the code to use generators in order to familiarize myself with yield, and to think in terms of iterators, not raw data structures. Here is my current attempt at doin...
I am trying to tackle two fairly massive concepts through JavaScript and jQuery, the first being object-oriented programming and the second being how to build robust modular plugins with an OOP approach. So far I've learned it's hard. Here is an example plugin I built, that I somewhat based my much larger project on; ...
What do you think about this? #include <alloca.h> #include <setjmp.h> #include <cassert> #include <functional> template <::std::size_t N = 4096> class coroutine { jmp_buf env_in_; jmp_buf env_out_; bool running_{}; char stack_[N]; public: coroutine() = default; auto running() const noexcept { ...
I have some Managed Metadata in SharePoint which is in the following format: Managed Metadata Service People Job Title And I have a list of people, each of whom have a name and a job title, called MyTestList. What I needed to do was display these people in a TreeView, sorted by their job titles, where some...
I work with an embedded target that contains a list of commands and registers that may change from one device to another. So I need to build my commands list from metadata received from that particular target. Unfortunately, the communication with the target is slow and the amount of commands is high. So I cannot buil...
I want to reduce my repetitive code used to validate inputs values. For that I'm using: a class associated to the input a condition to validate the input value an event handler First I declare the classes I'm using: var inputNotNull = '.js-mandatory-notnull', input2Words = '.js-mandatory-2words', inputNumb = ...
I'm currently making a server in Java, as database stuff I'm using HikariCP (because AFAIK, it's the best library). I try to do it as good as possible so I hope some of you can review my classes. First, the DatabaseManager.java class: package PKG.storage; import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari...
Okay I've just finished writing a nice tiny C program to have an ASCII spinner (works on Windows and POSIX). I'm quite new to C, so any suggestions would be great. This is designed to be a small function in my other programs, so please point out anything that could cause problems when been integrated into a larger prog...
I have a text analytics process that I complete for work. This process mines text for different Twitter accounts and finds patterns in the tweets. The actual machine learning pipeline is much more complicated than what's shown below, but this will have to suffice as my minimum reproducible example. In reality, there ar...
I've implemented the prime sieve of Eratosthenes in Haskell using a mutable array of unboxed Bools instead of the usual pure and immutable datastructures. My main concern with this code is speed. For large upper bounds, it runs approximately 70% slower than C code implementing the same algorithm. Memory is already opti...