« first day (2528 days earlier)      last day (1483 days later) » 

12:00 AM
RELOAD! There are 6477 unanswered questions (90.1045% answered)
 
12:24 AM
1
Q: Building an email generator using abstract factory pattern

rafiaTechI'm trying to build a customer email generator in java using the abstract factory pattern. I understand how to use the factory method pattern; however, I'm a bit confused about the abstract factory pattern. I'm trying to generate an email based on customer type. Could you look at my code below an...

0
Q: Visualize virus infection against population on a webpage

Yu Zhang<!DOCTYPE html> <html> <body> <canvas id="myCanvas" width="1200" height="1000" style="border:1px solid #d3d3d3;"> Your browser does not support the HTML5 canvas tag.</canvas> <script> const maxWidth = 1200; const maxHeight = 1000; const radius = 5; const numberOfPeople = 250; ...

 
1:02 AM
This might be more appropriate on https://codereview.stackexchange.com/. — Steve 30 secs ago
Ben.T, thanks so much for this. Your solution is so much more concise than mine. My solution involved looping through array, using find_nearest() in codereview.stackexchange.com/a/239946/221419 to find nearest car & truck values for each item, then create new columns from there. I'm finding out that loops are bad when you are dealing with millions of rows. I haven't timed it, yet, but I have a feeling your would be faster because it avoids loops. I will try to implement ideas from blog.paperspace.com/… to improve on your solution. — thdoan 16 secs ago
 
1:21 AM
1
Q: Looking for any enhancements to avoid a stackoverflow exception in a C# program

Aashish UpadhyayThe program below results in a stackoverflow exception in C# for the input provided. I am trying to see if there are any enhancements that can be made to avoid the stack-overflow. When using BFS approach the program works which is obvious as there's no recursion. The BFS approach is also provid...

 
1:45 AM
I edited the description so that it is more clear but maybe I will try Code Review since it is working code — jaksco 33 secs ago
 
2:17 AM
-1
Q: Mount component in componentWillUnmount?

WebwomanHere my snippet: // modal component's lifecycle functions componentWillUnmount(){ let{updateContextState}=this.context; updateContextState({ mountTopBar:true, mountFooter:true }) } I am simply updating my context...

 
2:37 AM
Thank you very much! I have been working on a different angle. But I will post over on code review board, as you suggested. Thanks again for looking at it. — wiggles 46 secs ago
 
3:08 AM
cross-posted: codereview.stackexchange.com/questions/239966/… I will delete this question if no one responds with useful information. thanks — jaksco 22 secs ago
 
0
Q: R simplify nested for loop which removes rows from a global variable

jakscoCross-posted in https://stackoverflow.com/questions/61036376/r-convert-nested-for-to-nested-operator-with-global-variable but I will delete either the SO/CR question which has no useful information The program should remove rows from pts. I would like to use nested operator %:% instead of neste...

 
3:52 AM
0
Q: List always stay empty after recursive call C#

Jin TigerI am confused by this problem, why my IList type variable res always stay empty after each recursive call. After calling "res = new List(tmp);" the res should has value However, right after return statement, if I check res value, it will has count == 0 As I know, res should be reference type, so ...

 
4:12 AM
0
Q: Vending Machine Project - Python OOP

wigglesI have been working on a vending machine project which is outlined below. After selecting 'b' in the first menu, I am having trouble with comparing the selected item cost with the total amount within the vending machine (self.total). I have worked out how to reference the product selected via a...

 
 
1 hour later…
5:17 AM
I'm voting to close this question as off-topic because there is no error in the code, this probably belongs on code review instead. — D.B. 55 secs ago
 
5:36 AM
@Ramesh yes but if I knew how to use it, then I would avoid this lots of code. See this code review question I've asked before codereview.stackexchange.com/questions/239942/…rob.m 1 min ago
 
6:24 AM
0
Q: Design decision for clone scenario

Rajesh SubramanianAs part of my application, I am maintaining a cache which is structured like below, class Container { List<ExecEnv> ExecEnvList; List<ControlMod> ToBeProcessedControlModList; // Other Properties goes here // Other properties can be either simple type or List of other...

 
6:43 AM
Monking
@skiwi 6 years huh, doesn't look like it will be fixed any time soon.
At least your answer is extra valuable now.
 
7:39 AM
0
Q: Best approach on handling function that returns either a promise or just synchronous code

IonutI wrote some code and I'm trying to get some feedback on it. I'll try to summerize the essential only. I have a function that based on a condition returns a promise or something else: function isActive(){ if(condition){ return API.someFunction().then(function(response){ return respon...

 
8:36 AM
 
8:55 AM
possible answer invalidation by falinsky on question by AdmiralThrawn: codereview.stackexchange.com/posts/239935/revisions
 
9:12 AM
@Duga Fine
Although now it appears broken due to maxrecursiondepth.
I imagine most reviewers know how to look past that.
 
@Mast We can look again in 6 years
Points: 15.964.949 (Place 21 of 1.582)
 
9:29 AM
Shiny, must take some effort to stay that high.
 
Nah they put a major update with class system and market in, I practically only do expeditions, sell ships and start mines and oh build some def
 
lol
If you don't have much fleet, they can't crash it.
 
Yeah
 
No, Code Review is for working code only. — mkrieger1 25 secs ago
 
9:51 AM
-2
Q: //Implement Mystring class so that following driver code runs succesfully

Simran Kamra//Implement Mystring class so that following driver code runs succesfully Please help me! int main() { Mystring s1; // Create Mystring class with char *str and Size as dat members // Default constructor should be created with str=NULL and Size=0 Mystring s2(10,'x'); // St...

 
10:10 AM
-1
Q: Python's UnboundLocalError and inline variables' assignment

MichaelHere's a method which returns a method which each time called returns the next fibonacci number (0, 1, 1, 2, 3, 5, ...). def make_fib(): j, k = 0, 1 def fib(): nonlocal j, k result = j j, k = k, j+k return result return fib While the above works fine, if I break the inline assi...

 
10:29 AM
-1
Q: How to test that an event will not be fired in xUnit?

ThemelisI have two questions. Does it make sense to test that an event will not be fired? If yes, what is the best way to accomplish that using the xUnit framework? For example I have a class with a single property Mark, public class Box : INotifyPropertyChanged { private Marking mar...

 
10:48 AM
-1
Q: What is the best way to avoid using a lot of if statements?

KordyI'm creating a .COM disassembler or decoder and the way it works is as follows: the .COM file will be fed into the code to read it byte by byte. each byte has a unique opcode and all of them are listed in a LUT that have the following structure. template<int N, typename ...T> using VariadicArr...

 
11:06 AM
0
Q: Simple rainfall animation in Pygame

Mitchell van ZuylenI made the following code. It's a simple animation of 'raindrops' falling and splattering once they reach the ground. The images I use can be found here: https://imgur.com/a/VYV07ef import pygame, sys from pygame import locals import random import itertools def listenToQuit(): for event ...

 
11:25 AM
-1
Q: Correct use of an interface when two different classes are valid as parameter?

NoPizzaNoCodeIn one of my projects I wrote a little tournament platform, but the way I handle participants is a bit messy and I want to clean this up. So in my case a Tournament can have participants, but either a User or a Team can signup to become a participant. A participant now holds a user_id or a team_...

 
 
2 hours later…
12:57 PM
Mongnik
 
1:19 PM
1) For better help sooner, edit to add a minimal reproducible example or Short, Self Contained, Correct Example. 2) See Detection/fix for the hanging close bracket of a code block for a problem I could no longer be bothered fixing. Please edit the question to add 4 space chars ahead of the closing } at the end of the code. 3) See the File Browser GUI for tips. — Andrew Thompson 32 secs ago
 
1:37 PM
-1
Q: Is this an optimal implementation for the knapsack algorithm?

Mahmudul HasanI have implemented a solution for the knapsack problem white fraction is allowed. I've used the dictionary data structure where I used weight as a key and value per weight as a value. After that, I sorted the dictionary by value and filled the knapsack until there's no space left. Here is my py...

 
1:56 PM
0
Q: Check header files for namespace usage

LinnyTo ensure there are no naming conflicts within our project (C++) I was tasked with writing a python script to check all of our header files for any occurrences of a using namespace ... within the file. If an occurrence is found, it's appended to a list then written to a log file. It's a fairly si...

 
2:16 PM
If you wanted to introduce the filter earlier, you'd likely have to roll your own power set function, which is covered in other questions e.g. codereview.stackexchange.com/a/178264nivekastoreth 16 secs ago
 
 
2 hours later…
3:50 PM
0
Q: Basic Blackjack game in Python

Joel VI've only been learning Python for a few days after a Humble Bundle book sale, but I made a functional Blackjack game on which I'd like some constructive criticism as far as my coding structure and any suggestions for improvement from more experienced coders. Edit: This is coded in Python 3.8.2 ...

 
4:09 PM
0
Q: The most minimal way to retrieve live data using setInterval

NyxI am writing a script that is supposed to retrieve some data from a MYSQL database but I need to make it happen live and after lots of research I learned that this thing can be done using something called "Web Sockets" but since it seemed too complicated and I haven't even learned javascript that...

 
4:25 PM
What's your question? Are you looking for a code review? Then this is your site: codereview.stackexchange.comUnhandled Exception 36 secs ago
 
4:46 PM
0
Q: Simple and insecure Python Password Manager

Grajdeanu Alex.Out of boredom, I decided to start my personal project and I've chosen a simple Text Password Manager. Note: For anyone out there, I strongly recommend you NOT to use this for any sensitive storage purposes as it DOESN'T provide encryption yet!. That'll probably come in a later release. About...

 
5:05 PM
0
Q: passport.authenticate is not a function TypeError

IceColdForumsI have been having an issue with an error, I have tried to add var routes = require('./routes/index')(passport); to my app.js file , after I read about others having this issue, but it did not help. I couldn't find an answer to this problem and im hoping that someone can help me. This is what ...

 
5:43 PM
0
Q: Split word file in multiple word documents by renaming each generated .doc documents VBA

Lemshope that Everyone is doing fine. I have a word document containing some text (see below). I would like to split the document in multiple word documents with a specific name for each document generated. Let me show you by a example. Test.doc contains: Name: DavidVorowski Reference: Report Conte...

 
 
3 hours later…
8:15 PM
-1
Q: Nonsense program written in Go

MattIzSpookyI felt like messing around with Go and I was wondering how I did. What do you guys think? https://github.com/MattIzSpooky/goroutines I am also really wondering how I can improve this. func (s Spammer) Start() error { var err error go func() { for { select { ...

 
 
3 hours later…
11:24 PM
-1
Q: Implement a to do list using the HeapPriorityQueue for c++ in visual studio

Cameron FelfoldiI am supposed to create a to do list using the HeapPriorityQueue and my code seems to keep popping up with errors and I can't figure out how to make it all compile and run. Can you look through and help fix the changes and tell me what I did wrong. Thank you. Driver.h #ifndef DRIVER_H #define D...

0
Q: (Js) Schedule Conflict Detection Algorithm Logic & Length

Sterling ButtersFirst post here - I hope I understand the purpose/intent of the community. I am trying to create a scheduler WebUI using Js. I am hoping to see if there are any suggestions for improving my schedule conflict detecting algorithm - I'm not entirely happy with it since the logic is difficult to read...

 

« first day (2528 days earlier)      last day (1483 days later) »