« first day (2271 days earlier)      last day (26 days later) » 

12:00 AM
RELOAD! There are 6276 unanswered questions (89.7091% answered)
1 hour later…
1:15 AM
possible answer invalidation by Bruno Lemos on question by Bruno Lemos: codereview.stackexchange.com/posts/224421/revisions
1 hour later…
2:43 AM
Q: System Dependency Manager - Ruby

jimmywestsideI recently got a prompt when looking for a job. To spare any details, the company decided not to get back to me, so because I did not get a code-review/feedback from them, I was wondering if someone would review this and tell me how i could improve it. Here is a link to the full prompt (pretty ...

2 hours later…
4:27 AM
@Duga seems ok for me
1 hour later…
5:47 AM
@RMunroe And here I thought we had a lot of odd warnings.
Monking all
6:00 AM
possible answer invalidation by Kristada673 on question by Kristada673: codereview.stackexchange.com/posts/210025/revisions
6:44 AM
Q: Project Euler # 48 Self powers in Python

emadboctorThe series, 1 ** 1 + 2 ** 2 + 3 ** 3 + ... + 10 ** 10 = 10405071317. Find the last ten digits of the series, 11 + 22 + 33 + ... + 1000 ** 1000. def self_power(n): """returns sum of self powers up to n.""" total = 0 for i in range(1, n + 1): total += i ** i return str(tot...

6:55 AM
If this is about working code that needs improvement code review might be a better fit to ask. Be sure to check out their guidelines before posting. — Luuklag 30 secs ago
7:28 AM
@SimonForsberg Got one with the great giveaway at the beginning of the year ;)
7:38 AM
@Duga Rolled back
@Vogel612 Hmmm, increases the likelihood of nobody complaining if we create our own. It isn't particularly hard to outline a logo to a surface and send it to a duckprinter.
8:07 AM
@MathiasEttinger What great giveaway?
8:26 AM
For working code that you want to improve, Code Review is the better place. — Ocaso Protal 49 secs ago
Q: Announcing Our Amazing 2018 Stuff-A-Way!

Tim Post Mar 5 UPDATE: This order is proving a bit more laborious to expedite than our vendor had originally anticipated, so these boxes haven't been shipped out yet. Anyone who filled in a form should receive an email with tracking information as soon as their box is shipped. Anyone who didn't catch t...

You should put your question on codereview.stackexchange.com, you will get a better answer regarding performance — N69S 58 secs ago
8:45 AM
Q: Project Euler # 49 Prime permutations in Python

emadboctorThe arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another. There are no arithmetic sequences made up of three 1-, 2-, or 3-digit pri...

9:25 AM
Q: Improving python tkinter code structure

ofeksill be happy to know how i should improve my code in order to be a proper tkinter program. Ill post here only certain parts to show you the main structure. Thank you. import tkinter as tk class MenuBar(MyFinanceManager, tk.Frame): portfolio = None def __init__(self, parent): t...

Q: Grouping by on Pandas df with focus on performance

Mayeul sgcI am doing a group by on a subset of a dataframe. I am working with 9m+ rows atm, subject to sharp increase. I tried different approaches already and wanted to know if i could squeeze a bit more juice in performances. What I tried : Option 1 df2=df[["ColA","ColB","ColC"]].query("(ColA == 'X') &

9:45 AM
Q: Simplying a identifying cities python program

Susanth KakarlaFor this Code, I am provided a text file that contain several cities. I am suppose to identify the cities mentioned and print their state and country. Requirements: If a mentioned city is in two or more countries, I ask the user to mention which city they are talking about. In addition if there ...

Q: Openshift CLI to Rest API

Nilzone-I have made an OOP-based solution to the Openshift CLI, which I intend to use for a rest API. I'm wondering if this approach upholds the basic OOP principles, in terms of abstraction, encapsulation and inheritance Not all the features is implemented, but it's 100% functional as is. OpenShif...

2 hours later…
11:25 AM
Q: How can simplify this query, which select all distinct groups?

MorganFreeFarmThis is my query: SELECT DISTINCT type FROM `log` where type LIKE 'group_%' My DB looks like: |group_1| |group_1| |group_1| |group_2| |group_2| |group_3| |group_3| |group_3| So this query returns me: group_1, group_2, group_3 But .. in near future this table would have more than a millio...

1 hour later…
12:25 PM
Q: Algorithm in getting total garnered hours for student using php

RubicsHello I'm calculating now the total garnered hours student get in school using php. (Same concept in getting the total work hours in employee for timesheets) So I have an array $attendance where the student check in and out in school. $attendance = [ "2019-07-01 08:03:00", "2019-07-01 12:1...

12:45 PM
Q: Zork look-a-like written in TypeScript

FederlizerI've been working on a a text based game with a very simple battling system. There are way to many questions I can ask to get reviewed about this project, but I'll take small steps at a time (this is my first post). I'm mostly concerned about how I handle command input and the execution of said ...

1:12 PM
I think this would be a better fit on Code ReviewAmy 9 secs ago
You should ask your Question in Code Review. — Mikku 55 secs ago
1:25 PM
Q: Caesar Cipher Guesser

LinnyI've written a Caesar Cipher in python (a more in-depth explanation is provided in the docstring at the top of the program). At first, it was supposed to just be the cipher, but I expanded it to have the user guess the original string, given the encoded string. I would like feedback on the caesar...

@Mikku no, that is not a candidate for code review because it's not a complete and working sample. Code Review only does complete and working in order to be able to review. — this 5 secs ago
1:45 PM
Q: Project Euler # 50 Consecutive prime sum in Python

emadboctorThe prime 41, can be written as the sum of six consecutive primes: 41 = 2 + 3 + 5 + 7 + 11 + 13 This is the longest sum of consecutive primes that adds to a prime below one-hundred. The longest sum of consecutive primes below one-thousand that adds to a prime, contains 21 terms, and is equal to...

2:05 PM
possible answer invalidation by dfhwze on question by rad: codereview.stackexchange.com/posts/224650/revisions
Q: Apache configuration for Node.js with SSL

xDGCould someone share some light and check if this is okay for apache httpd security/good standards? I'm using apache httpd to call my Node.js app that is running with Express and also configuring SSL. apache2.conf: DefaultRuntimeDir ${APACHE_RUN_DIR} PidFile ${APACHE_PID_FILE} Timeout 300 Kee...

2:25 PM
Q: Constructing all paths for multiple shortest paths between 2 vertices

Your IDEI'm trying to reconstruct all the shortest paths (even multiple paths which are tied for the shortest paths). So, based on the answer here, I've written down the code: def floyd_warshall(n, edge): rn = range(n) dist = [[inf] * n for i in rn] nxt = [[0] * n for i in rn] for i ...

2:45 PM
Q: React-Router, render multiple components with one path?

Robert CI have some code below, it works but it doesn't really seem ideal. Is there a better way to write this using react-router? <div> <BrowserRouter> <Route path="/" exact component={AuthorizeReddit} /> <Route path="/authorize_callback" exact component={Initialization} /> <Route path="...

If you have time you can review my code here code reviewRubics 37 secs ago
3:08 PM
While Code Review might be a good place to suggest going for this type of question, we should get out of the habit of sending question-askers over there. Please read this meta post for clarification. — Alessio 43 secs ago
3:46 PM
Q: Match favorite data from db with data coming from api

majdichaabeneI have a mutableListOf a sealed class. I am trying to compare the result coming from the api with the ones saved in the db so I can update my UI base on isSaved attribute. Here is my code : sealed class MasterList(val type: Type) { data class FavoriteList( val list: List<Info> )...

"Best" and "cleanest" are not objectively measurable quantities and thus are not really good measurements for Stack Overflow questions. Please edit your question to include what you're finding "unclean" or "bad" about the code you have that you'd like to improve, or, if the code is written by yourself, you're willing to share all of it, and would like all parts of it thoroughly reviewed, you could check the help center of Code Review to see if it's on topic over there. — Heretic Monkey 16 secs ago
3:59 PM
@SebastianMach Since the code is not working as intended it is off topic for Code Review. — 1201ProgramAlarm 43 secs ago
Use whatever you feel works. When you have done something more than just written code for the sake of testing, then I would recommend that you post at Code Review. Right now there's really not much to review. Reviewing your whole pong app however, now that would be interesting! — Simon Forsberg 27 secs ago
@Duga Finally you've got it!
Hello Guys...
I need some help on OOP paradigm
@overexchange What kind of help?
I seriously follow this guy. I came across this nice talk3 after talk1 & talk2
But talk3 does not have an example that relates to the approach mentioned in talk3.
Coming from OOPs using C background...I would like to refine my idea of OOP with talk3
Can somebody help me refer an example code that relates to the idea in talk3?
4:26 PM
Q: Create a loop for web scraping - brute force works but there must be a better way

John KennedyJust starting out trying to do some python for data analysis. I am a total beginner and have figure out how to brute force somethings, but I know it is inefficient but don't know how to do it without messing up what i have. I have multiple webpages to scrape and then store data in a data frame. ...

Q: Invoking parallel threads of a nslookup command in python

newTOcodeI've written below python script just to invoke parallel threads of a command nslookup linux-host01 dns-server, i'm Just trying to flood the DNS Server dns-server with multiple number of queries in parallel way. As an argument to this script i'm passing a hostlist file example linux-host01 , lin...

Q: How does this alias-adding script for linux look?

LegoroojCan anybody find anything to pick apart in this script? # Copyright (c) 2019. Legorooj import sys import os docstring = ''' add_alias [alias] [command]''' if len(sys.argv) <= 1: print(docstring) else: alias, cmd = sys.argv[1], sys.argv[2] print('Adding alias...') os.system(f'e...

I listened to talk3 all the way through, and I have several problems with it. I'm suspecting that his experience predates agile and that everyone he's ever worked with went out of their way to show, by example, how non-agile development can go horribly wrong.
about 8 minutes in and haven't really heard much of a case for OO
first half of it sounded like a description of something similar to ECS, design wise
which i'd usually think of as more of an inversion of OO
@Donald.McLean yes he comes from LISP generation and assembly programming era.
Am not interested to align OOP with agile work flow.
Some of his overly broad generalizations of problems in OO are things that can go wrong in any kind of development, or relate to concepts that he has either never heard or dismissed out of hand.
OOP and agile are not mutually exclusive :)
4:35 PM
He said something in OO about method names being a lie. That does happen, and one of the most basic principles of agile is that when the name is wrong, you fix it.
Naming being wrong is one of the most common problems with any programming style. In fact, I'm just discussing it with our QA right now.
In this case, it's DB columns being named stupidly.
So, no fix (except going forward with new tables) because it would cause downtime.
In this comment, one of the reviewer says that haskell follows the same approach
However, in that same section, he mentioned something about the work actually being performed elsewhere, and that often happens when you have an API and some of the features are delegated.
So, let's take the basic premise he's arguing--OOP is bad.
So, if you don't do OOP, you have to find something to replace it with.
Because having no development standard is worse.
istm the gist of it is he likes separation of data and functionality as a programming style, but you can still do it with oo, and then bashes oo a bit just for good measure
4:39 PM
Granted. I just don't find any of his anti-OO arguments convincing.
Will it be procedural (I'd fire you if you tried that), functional (I love that, but it has to be done well, just like OOP), etc.
@Hosch250 I would say the opposite - they are complementary.
OO is not bad, but it's not as good as functional, when both are done well.
@Donald.McLean Correct.
OOP, functional, etc. They can all complement an agile work flow.
Waterfall is what kills businesses, but it also can complement OOP, functional, etc.
I actually like a mix of waterfall + agile.
@Hosch250 I would say that functional, OO, and procedural are all different tools appropriate for different things and the use a mixed OO/Functional language so that I have all of the tools and can pick the best one for each individual piece of code.
@overexchange i think the most general example of what he's talking about would be the sort of scenario where you have a Foo class that doesn't really do much besides hold some data, and a FooManager that handles everything you'd wanna do with a Foo
4:41 PM
Waterfall is the business vision of the final product. They have a specific endgoal of what they want.
Waterfall doesn't kill business, but it is a totally different mind set.
Agile is how they get there.
@pacmaninbw Waterfall kills businesses because a wrong turn at the start can't be corrected.
It's the difference between driving off a cliff or doing a u-turn.
Agile is more for the current web market.
@user11536834 and what about datatype? he mentions state_module, logic_module & datatype.
@Donald.McLean Yep.
4:43 PM
No waterfall and agile are project management systems. Bad planning and bad architecture is what killed business.
Personally, my favorite is API + functional, but I find OOP slightly better for UI and storage systems.
good question, i guess Foo would actually be the datatype, maybe FooManager is the state manager and something else entirely does the logic... i guess we need a better example than Foo
I learned from CS61A, that OOP is needed when a value has multiple states. value I mean business value, not the temporary variables holding the value for computing logic
@overexchange That's dead wrong.
i think the value of OO is in being able to delegate functionality instead of all functions being "global," more or less
4:47 PM
@user11536834 That's wrong too. You can have scoped functions.
Functions scoped to other functions. Functions scoped to certain modules that can only be used by visible functions within that module.
Lots and lots of scoping is available.
what language are we talking about here?
All of them.
I mean, yeah, some languages likely only have public functions. But none of the mainstream functional languages I've heard of.
I am trying to find an email conversation with my CS 61A teacher, as an evidence
hmm i mean something like doFooStuff(foo) vs foo.doStuff() ... doFooStuff(foo) is gonna resolve to whatever it resolves to regardless of what foo is, but foo.doStuff and bar.doStuff could do different stuff
@overexchange Those who can't do, teach.
@user11536834 You can do that in functional programming too.
Function overloads. You can have doStuff(foo) and doStuff(bar) resolve to different functions.
I learned CS basics from here CS 61A
yeah, for sure, but not so much in procedural
@user11536834 Correct. Procedural is more like assembly.
It's really not in use by high-level languages anymore.
It's good to know if you are working with C or lower, but by far modern languages aren't structured toward procedural programming anymore.
yeah, i didn't mean to imply oo was better than fp because of that, fp just does it in a different way
4:51 PM
I find it best to know both.
and most of the assignments for CS 61A were reviewed by 200_success
this is how I learnt programming
right but you could still use a procedural style, i guess i was thinking more about the value of oo as a style over procedural
Yeah, it looks like a good course to learn programming structured toward OOP languages.
But it doesn't go deep enough to get into the OOP vs FP and when to use which--that's an architectural decision.
And I seriously doubt 200_success would say something like representing multiple business states can only be done with OOP.
the thing i can't really get my head around is how fp in multi-paradigm languages is really anything like fp in fp languages
@user11536834 TBH, it isn't.
4:54 PM
i mean like reducemap stuff is handy but fp languages are more like here are some rules, figure it out
C#'s functional pieces make it by far easier to use, but they don't come close to the F# features.
@user11536834 What do you mean by that?
Not sure, but is it more less documentation helping you learn the massive paradigm shift?
Because if you are in the middle of it, I'm happy to talk things through with you--I went through that a couple years ago, and I'm no expert, but I have some familiarity with it.
i'm thinking generally like how something like prolog works, you don't say "do this stuff," you define some state transformations, drop in some initial state, and let it solve for all possible outcomes
Oh, right.
i don't see anything like that in the fp parts of multi-paradigm languages
Multi-paradigm languages, in my experience, mostly support one paradigm at the program level, and multiple paradigms within the lower building blocks.
For example, C#'s new switch statement is really just a fancier way to write a lot of chained ifs.
But above the method level, it's still a full OOP language.
The non-nullable reference isn't really a dedicated functional piece--it's just that functional languages jumped on the bandwagon first.
5:00 PM
hmm yeah that makes sense
@Hosch250 I think switch in most languages is just a convenient way of writing chained ifs. Though some languages do it better - Scala's are very flexible.
so you could think of old java versions as not MP, but just OO (can't have anything that's not attached to an object), but newer javas as MP because you have lambdas and stuff now
@Hosch250 well he was also part of same course. I think he will say the same
Well, we could ping him and see what he says.
I mean, he's right here in the chat.
@Hosch250 By "non-nullable reference" do you mean "monoid"s (as used by programmers, not mathematicians)?
5:02 PM
Basically, yeah.
Maybe, Option, etc.
In C#, it's Nullable<T>.
@Hosch250 Scala has at least three: Option, Either, and Box.
FWIW, @overexchange, you might find this repository interesting. It represents multiple checkers variants (essentially, multiple businesses states) purely with functional programming: github.com/Hosch250/CheckersTreasury/tree/master/…
Anyway, GTG, now. Have fun programming.
5:19 PM
Bye bye, diamond.
5:46 PM
Q: Altering my validation method to be more sustainable in the long run instead of lots of if-elses

CeriI am attempting to create a web application that will allow people to enter certain bands in a list, e.g Metallica Megadeth Tool and a Spotify playlist ID to allow the program to add 'x' amount of songs per band to a playlist. The flow of the validation code goes: public void GeneratePl...

5:58 PM
@user11536834 java is actually procedural
and the object orientation parts are bolted on, just like the functional parts are
@Vogel612 I'd call it "imperative"
tomato tomato :)
methods are procedures
hmm, bolted on?
6:04 PM
@Vogel612 They are indeed, but I've never seen Java being referred to as a procedural language. en.wikipedia.org/wiki/Java_(programming_language)
@SimonForsberg my programming paradigms professor liked to do that
i guess any OO language is procedural at its core, but they are still considered OO languages, right?
shhh :)
yes, you're completely correct
i was thinking old java specifically as being "more OO" than others because of things like no top-level static classes, no functions that aren't methods, etc, basically everything is an object
except primitives
"no top-level static classes"??
there was a time before top-level static classes?
6:10 PM
i think so, but could be wrong there
@Vogel612 Well, I can't say that they're wrong...
oh wow, there is a whole SO thread on top-level static classes ...
6:26 PM
Q: What is the best/cleanest way to send/receive this things?

Tix3DevI am making a simple 2 player pong game(with the canvas element). The game itself works good but I try to send the coordinates of the ball and the paddle-position with 'WebSocket' to the other plyer. The code(game): var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d...

i wonder if needing a ~70 LOC routine to multiply two numbers is a sign of impending doom
what the...
@user11536834 Holy cow, what's going on?
messing with my toy language, trying to see how hard it is to get it to do some math
it's not really geared for math, heh
6:34 PM
@user11536834 I can do it in less with Assembly, what the heck are you using?
I can do it in less characters with Brainfuck.
it's a tuple rewriting language i've been messing with
sort of an esolang deal
@user11536834 What part of that is the routine definition?
all of it up to "testing it out"
there aren't any "keywords" in the language per se, it's just checking for tuples in a big list of tuples, binding some free variables on the way, replacing tuples with other tuples
the lines that look like multiply 3 and 16 as B are setting up the initial state (tuples in dataset), everything else is state transition rules
6:38 PM
@Mast And if you do, I'm reviewing it!
that somehow makes me wonder how I would multiply in prolog...
it's probably a bit easier...
pretty much like in c ;)
multiply (0, _) = 0.
multiply (_, 0) = 0.
multiply (1, X) = X.
multiply (Y, X) = X + multiply(Y - 1, X).
ahh that's not bad
@SimonForsberg lol
Defining a function in Brainfuck though...
Can't be done last I checked.
6:44 PM
@user11536834 doesn't deal with negative numvers, though
@Vogel612 Better not insert a negative value there...
HA I was quicker :)
Hey, you finally lost your diamond @SimonForsberg
Can be solved though, by checking if a parameter is < 0 , and if it is then outputting the reverse?
@Mast Yeah, JNat went on vacation for a while
1 hour ago, by Simon Forsberg
Bye bye, diamond.
in VBA Rubberducking, 1 hour ago, by Simon Forsberg
Has anyone seen my diamond? I think I've lost it.
@Mast Use Brainduck. Still not possible but easier to debug and verify that it's working correctly
6:50 PM
@Vogel612 now what about addition...
@user11536834 that can be resolved in a similar fashion
so long as you have a defined successor predicate, that is
addition is unary is easy, can just concat, but then negatives make it more difficult... if the numbers are encoded like +++ --- can recursively replace -+ and +- with empty string
7:25 PM
@SimonForsberg Talking about Brainduck, my current installation doesn't want to compile it. Something about a deprecated API?
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:fixVersion FAILED
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:fixVersion FAILED
@Mast It's my custom-made fixVersion task that fails, which is this: github.com/Zomis/Brainduck/blob/master/build.gradle#L57
Maybe you haven't cloned it as a git project?
@SimonForsberg Probably, might've downloaded a zip to cheat.
You might be able to fix it by removing this line: github.com/Zomis/Brainduck/blob/master/build.gradle#L74
@SimonForsberg Too late, it's cloned now.
@Mast Yay!
7:32 PM
Why did you make a custom fixVersion anyway?
And why is the bloody main file in /build/libs anyway? It's not a library if it's the main file.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed
java failed to run
I tell you to run, you run.
The only question java is allowed to ask is how fast.
Well, at least the build went well...
@Simon BTW the download link to your Jenkins for a pre-built .jar points to a log-in site.
@Mast Because I didn't find any existing solution for what I wanted to do
@Mast Blame Gradle for that
@Mast I should probably have Jenkins put it somewhere public where it can be downloaded...
@Mast I guess Gradle can't be sure that no one else will use it as a library
Q: my local variable returns two different values when accessed directly & when accessed via function

ImranI have been trying to understand and play around with javascript closures and that is when I came across the below issue. Am trying to add/remove elements from an array declared inside a function. I have been able to add or remove and access the updated array for the same. But when I access the ...

Q: ExactlyOne extension method

Jesse C. SlicerI often find in codebases something on the order of if (sprockets.Count() > 0) which is easily replaced with LINQ's if (sprockets.Any()). This keeps the entirety of sprockets from having to be iterated over completely (to get the count) then comparing to zero. Further, the business logic often re...

sometimes i wish it were easier to use program entrypoints as library functions
have written code basically identical to this before:
extern int main(int, char**);

/* this should be the entry point, i.e. -Wl,-e_main */
int _main(int _argc, char** _argv) {
char* argv[] = { "", "some arg" };
return main(2, argv);
idk how to use this chat room <_<
how do i format that
7:51 PM
I'd warmly recommend putting up your full working code up for review on Code Review; you'd be surprised how a working piece of code can end up after another pair of eyes has gone through it, let alone with everything there is to learn from CR answers. — Mathieu Guindon 43 secs ago
@SimonForsberg Everything can be used as a hammer library.
I'm stupid... I'm writing TypeScript, and extracting a class to it's own file, but suddenly it can't be compiled.... silly me created a .js file instead of a .ts file so the compiler didn't know that it was TypeScript I wanted to use...
8:06 PM
Q: Traversing two trees until a common value has been found

Bram VanroyI am traversing two objects that may share a common ancestor. To make the code small enough to show here, I have changed it into two dictionaries with values. As you can see, a_d and b_d are the inverse of each other. The idea is to step into each dictionary step by step until we find an overlapp...

8:26 PM
Code review: (a) does not compile (b) useless extra variable counter, you already have two loop variables you could have used one of those (c) poor variable naming (counter - what is it counting?) (d) platform-specific: don't use literal "\r\n" (e) don't answer questions that don't provide an attempt, you're just doing someone else's homework. — iakobski 39 secs ago
Q: Laravel testing password rehash - sanity check

ThePoet444I currently have an event listener tied to Laravel's Attempting class. The listener is designed to rehash an old password to something newer. The current DB stores the pass in an old crypt format. I'm just silently converting that old hash to a newer one. This works when going to the site to logi...

Q: Jsoup connection to URL

mara122I have simple class that I want to ask if is there any possible to improve it? I mean, for me it looks poorly. Is there any way to use here try-with-resources, stream or optional? package bookstore.scraper; import lombok.extern.slf4j.Slf4j; import org.jsoup.Jsoup; import org.jsoup.nodes.Documen...

This looks more appropriate to the Code Review Stack Exchange, since it's working code you want feedback on. — ShadowRanger 34 secs ago
Your solution looks clever to me. Agreed, this should be on Code Review. — Amy 18 secs ago
This question is too broad for StackOverflow, however is on topic for CodeReview as others have suggested. I find this to be a helpful reference in these situations: codereview.meta.stackexchange.com/questions/5777/…Tyler Roper 31 secs ago
The error indicates that db is undefined. Which means MongoClient and mongo are undefined, too. See codereview.stackexchange.com/a/69660danh 7 secs ago
8:45 PM
This question is too broad for StackOverflow, however is on topic for CodeReview as others have suggested. I find this to be a helpful reference in these situations: A guide to Code Review for Stack Overflow users. You'll notice that it clarifies StackOverflow questions require a specific goal (which 'more optimal' doesn't seem to reach), whereas CodeReview is tolerant of open-ended questions and answers. — Tyler Roper 9 mins ago
^^ love that comment
Q: Single-thread Task Scheduler with type erasure and allocator-aware

Julien VernayI made a task scheduler to practice allocators and type erasure. With my project, you can delay execution of any callable (functions (using std::ref), lambdas...) in time by inserting it in a TaskScheduler, and by giving a std::chrono::time_point (you can also make a task be called multiple times...

Q: Efficient way to fill 2D matrices by rows in a list using R

PierreI have a list of 2D matrices. Each matrix is filled using the function “fillMatrices”. This function adds a number of individuals to each day 0 in a matrix and updates the columns “a_M”, “b_M” and “c_M”. The numbers of individuals come from an initial matrix “ind”. The code works but it is slow w...

9:19 PM
If your code works and you seek improvements or constructive criticism, your question is a better fit on Code ReviewAmy 25 secs ago
10:07 PM
Q: Optimize function without looping through array

luxaeternaI've developed a small memory game, the game contains a function to flip cards for every turn. I'm looping thru the array containing the images every time to pick one card. I'm sure there's away to optimize this function so I don't have to loop thru the array every time in order to just turn one ...

10:27 PM
Q: Crazy Slow, but working VBA. Please help lead me in the right direction to optimize

Nick HaslerWork flow is Copy Previous Year Reports Folder, Update Following Templates, Save, Close. There are 19 workbooks in the Source Folder and in the NewYear Folder. Each Work book has to save the final data from the end of the year(the "YTD ACTUAL" pages) along with resetting and prepping the month sh...

11:07 PM
Q: My class Rank.js work?

Maury DeveloperCould someone test my code and tell me if it worked. If you can help me with suggestions or bugs. This code has a class called rank. Its properties are: toString (), toArray (). toString (): Returns a custom ranking text. toArray (): Return an array with the rank. new Rank (values in an array...

Questions on optimizing working code are more suitable on codereview.stackexchange.comcharlietfl 45 secs ago

« first day (2271 days earlier)      last day (26 days later) »