« first day (3011 days earlier)      last day (77 days later) » 

12:03 AM
REFRESH! There are 7720 unanswered questions (89.3737 answered)
 
1:02 AM
0
Q: Python3 Simple Calculator- Pytest

Anita PI have had to create a simple calculator that takes in two values and adds, subtracts, multiply or divides the values. I have completed this, below, but now I need to do a pytest on it and I am at a loss as to where to start with creating the test. Can anyone help? The test needs to "check the av...

 
 
2 hours later…
2:43 AM
0
Q: Reverse Polish Notation in C (using a Finite State Machine)

IshkiI recently learned about Finite State Machines (FSM) and thought I'd use that to implement a Reverse Polish Notation (RPN) calculator. I wanted it to also work nicely with the unix pipe. For example, if we have an input file with a set of RPN expressions, I can do something like: $ cat file.txt |...

 
 
3 hours later…
5:46 AM
0
Q: I have used switch inside switch inside a while loop. Can you help me with optimizing code?

Zhamshidbek AbdulkhamidovI am making a program about numbers. The user will enter a number and will get its properties. Program objectives: 1. Welcome users; 2. Display the instructions; 3. Ask for a request; 4. If a user enters zero, terminate the program; 5. If numbers are not natural, print the error message; 6....

 
6:07 AM
Monking
 
 
1 hour later…
7:27 AM
0
Q: How to make my benchmarking code better

donaldI am trying to time radix sort on 128 bit unsigned integers for different base sizes (that I call bitwidth). My code has at least the following problems: The radix sort itself may run slower than it would otherwise as the bit width, number of passes etc are not constants that the compiler can u...

 
7:51 AM
If your code doesn't work, you should provide specific input and expected vs wrong output, or the complete error traceback if you get an error. If it works, then your question is off-topic for SO, and would probably be a much better fit for codereview.stackexchange.comThierry Lathuille 59 secs ago
 
 
3 hours later…
10:49 AM
0
Q: Design pattern to access value from child class in super class constructor?

MKorschGiven following code snippet: abstract class ParentClass { public final int fooResult; protected final Integer a; ParentClass(Integer a) { this.a = a; this.fooResult = computeFoo(); } protected abstract int computeFoo(); } class ChildClass extends ParentCl...

 
11:41 AM
possible answer invalidation by Deepeshkumar on question by Deepeshkumar: codereview.stackexchange.com/posts/265575/revisions
possible answer invalidation by Deepeshkumar on question by Deepeshkumar: codereview.stackexchange.com/posts/265575/revisions
 
 
1 hour later…
12:49 PM
MNonking
 
@Duga I have a second auto statement for this now: In the future it would be better to add a follow up question with a link back to the original question rather than editing the question. Changing the question may cause answer invalidation. Everyone needs to be able to see what the reviewer was referring to. [What to do after the question has been answered](https://codereview.stackexchange.com/help/someone-answers).
Monking
 
1:33 PM
@pacmaninbw You can shorten the link to just (/help/someone-answers).
 
2:10 PM
@BobbyRedjeans Another option would be to post your working code on the Code Review site. Answers there tend to be about more efficient ways to do things rather than answers to problems you are having. — Daniel T. 13 secs ago
possible answer invalidation by Toby Speight on question by user222934: codereview.stackexchange.com/posts/247973/revisions
 
@Duga That part was not code - so I removed the code-quoting
 
So you are getting the expected layout, but now you want a code review? If it works, now, how will you be able to judge that the solutions we provide will be any better than yours? — Chris Schaller 49 secs ago
 
2:36 PM
0
Q: Generate Multiple Instances of Canvas-based UI Object

DaveL17Background I'm interested in implementing a small script to display multiple independent instances of a Canvas-based control on one page. The ultimate intention is to add many similar controls to the same page, so efficiency is helpful. Inspiration Code Here is the original source code that I'm w...

0
Q: BASIC Computer Games: Battle in C++

Aries_is_thereAs a C++ newbie, I am practicing my C++ skill by implement games in BASIC Computer Games and here is my C++ version for Battle. Suggestions I want Any suggestion are welcom! Current Project code from my work place full of C styles in C++(which is not a good thing), I wanna my code to be C++ style...

 
3:27 PM
0
Q: getting warning water compiling the code and some errors

Onkar Chougule#include <stdio.h> #include <string.h> #include<stdlib.h> #define FOUND 1 #define NOTFOUND 0 int main(void) { char username[5][10] = {"akshay", "shubham", "gaurav", "rahul", "amit"}; int i,flag; char urname[11]; char pass[11]; printf("enter the Username : "); scanf("%s

 
4:17 PM
0
Q: Curve fitting in Octave

Jake CraigI have a set of points in Octave (two 1672 x 1 arrays). I want to fit a polar function in it. Above plot is not the exact plot generated by Octave, but its almost same. I don't have any idea how to proceed. In MATLAB there is fit function for this purpose but apparently there is no such thing ...

 
@TobySpeight Thanks.
 
 
2 hours later…
5:59 PM
0
Q: Using locks to make my Python custom class parallel-safe

Mate de VitaIn one of my personal python libraries I have a custom class used for computing the running average and variance of a stream of numbers: import numpy as np class RunningStatsVariable: def __init__(self, ddof=0, parallel=None): self.mean = 0 self.var = 0 self.std = 0 ...

0
Q: Board Game in Java - MiniMax algorithm

ShaunylI have create a small program in Java to play Kalah with a the computer. The computer implements the MiniMax algorithm to play. The problem is that I am not sure that the MiniMax algorithm is working fine. Even if I set a high depth (like 8), the computer player loses agaist a player who makes r...

 
6:24 PM
0
Q: Is there a better version to this codes which extracts an XML repeating element's value into an array using a DOM parser?

gbasicThis code needs to extract data from in XML file. Specifically it needs to iterate over it, looking for a node called CHARGE_CODES that repeats over and over and has several elements. it needs to extract the values of one of them, called "CODE". the XML contens are omposed of repeating blocks lik...

 
 
1 hour later…
7:27 PM
Welcome to SO! This forum is not meant to review code, but rather to help solve coding issues. Please take this to codereview.stackexchange.com. — VirtualScooter just now
 
@CaptainObvious @TobySpeight That was a great edit. Turned a lousy question into a useful one.
 
0
Q: Make Array Consecutive

Raushan KumarRatiorg got statues of different sizes as a present from CodeMaster for his birthday, each statue having an non-negative integer size. Since he likes to make things perfect, he wants to arrange them from smallest to largest so that each statue will be bigger than the previous one exactly by 1. He...

 
 
2 hours later…
9:47 PM
0
Q: Barebones DNS Client in Rust

matthewmturnerI'm starting to learn about networking and as a project I am building a really simple DNS client in Rust. Functionality to start was just to take a command line domain argument and sending a DNS A record request to the google DNS server (8.8.8.8:53). The application works right now (when compared...

 
10:12 PM
The Answer code is correct ONLY IN THE CASE THE ARRAY IS DEFINED AND NON-EMPTY. If you really want to generically get the size of an Array, then here is a robust solution that handles all the edge cases: codereview.stackexchange.com/a/264359/4758chaotic3quilibrium 24 secs ago
This is a more robust solution than the one in the accepted Answer. However, as an edge case, what if the a As Variant isn't an Array? Here's what I created to deal with all the various edge cases: codereview.stackexchange.com/a/264359/4758chaotic3quilibrium 45 secs ago
 
11:03 PM
0
Q: Project Euler 1 using functional programming in JS

N3buchadnezzarSo I am once again beating a dead horse, this time by trying to dip my toes into functional programming in javascript. I followed the following advice no self-respecting functional programmer would be caught dead without a fold function (AKA reduce), whether she needed it or not, so let's be sur...

 

« first day (3011 days earlier)      last day (77 days later) »