« first day (2213 days earlier)      last day (1797 days later) » 

12:00 AM
RELOAD! There are 6061 unanswered questions (89.8642% answered)
 
12:46 AM
0
Q: Catching Exception Using Outer Scope

user318974I write a code in which we have confusion in this code output is wrong If the number divided by zero then ArithematicExceptionerror Occur but in this code we do not find right answer. public class Test23 { public static void main(String[] args) { try { int a[]={5...

 
 
2 hours later…
3:06 AM
0
Q: Python: CLI Menu library

pescaI started writing a small CLI menu library in python. I'm uncertain of the structure and scalability of the current code. For example the Menu.choice method would grow very large if were to add more options for navigation input. Could this be better done with a class to handle the input? import...

 
3:26 AM
1
Q: Babel code in React component to display tasks

Robert CI'm trying to think of ways to clean up this component in my app so it looks more readable to other devs. This is the best I came up with so far. It's not that bad, but I think it could be a lot better. What do you guys think? How would you clean this code up to make it more readable? const Disp...

1
Q: Credit card validator using Luhn Algorithm

tphI'm looking for feedback or tips to maybe make my code more readable or faster or just general tips to help get myself started with app making with Python. import sys # check for valid input if len(sys.argv) == 2: try: int(sys.argv[1]) if(len(str(sys.argv[1])) == 16): ...

 
3:58 AM
I'm voting to close this question as off-topic because programs working as intended seeking feedback and suggestions for improvement belong on codereview.stackexchange.com. — ggorlen just now
 
 
1 hour later…
5:06 AM
Much better, but now there is a different issue: we don't review working code here :( we help with "not working" code. So, you might want to study the help at codereview.stackexchange.com to see if your request could fit there. Otherwise, if your solution isn't always working, then read Minimal, Complete, and Verifiable example and enhance your question accordingly. — GhostCat 33 secs ago
 
6:05 AM
-1
Q: Finding the subset with best utility function among all list's permutations

Daniel ChepenkoI have the following problem: Among the list of elements I need to find the subset with maximum value of given utility function. Also the type of the adjusted element should be different import sys #python 3.5 class Object: def __init__(self, initial_position, object_type): self.in...

0
Q: Handling multiple JavaScript classes that lead back to one

nn2I have a simple JavaScript RPG that has the main Player() class. From there, I'm thinking of having multiple classes for Inventory() and Wear(), Levels() on its main constructor. Not extending it perse... but see below. For example, I have: class Player { constructor(uuid) { this.uu...

 
6:57 AM
0
Q: Tic-tac-toe for the terminal, written in C

J. CzekajI recently started learning C, and this is my first fairly large (to me) program. It's a basic tic tac toe game for the console. There's no ai, it's just a 2 player game. Anything I can improve? // Tic Tac Toe in C. V1.0 by James 26/05/2019 #include <stdio.h> #include <stdlib.h> #include <stdbo...

 
 
1 hour later…
8:00 AM
possible answer invalidation by Gilad on question by Gilad: codereview.stackexchange.com/posts/221022/revisions
 
8:27 AM
1
Q: Python program to convert a 24 hour format to 12 hour format

enoyGiven a string in a 24 hour format the program outputs a 12 hour format. The rules are: The output format must be 'hh:mm a.m.' if it represnt before midday and 'hh:mm p.m.' after midday When the hour is less than 10:00 you should not write a 0 before the hour, example: '9.05 a.m.' For example...

 
9:15 AM
I'm voting to close this question as off-topic because it is working code and should be on codereview.stackexchange.com site — Simply Ged 25 secs ago
 
9:44 AM
0
Q: Tag request [visual-foxpro]

GreedoJust edited a question mistagged as VBA to instead use a new visual-foxpro tag. After looking at tag synonyms for VBA, I see there is no visual-basic-applications tag, so perhaps the new tag I created should instead be vfp if abbreviations are preferred? NB. Stack Overflow has both tags with vf...

 
0
Q: Daily coding problem 18

EMLarray = [10,5,2,7,8,7,9] k = 3 for index in range (len(array)-2): print(max(array[index:index+3])) The challenge Given an array of integers and a number k, where 1 <= k <= length of the array, compute the maximum values of each subarray of length k. For example, given array = [10, 5, 2, ...

 
If you have a working solution you should take it to Code Review. — Filburt 41 secs ago
 
10:07 AM
0
Q: Removal of subtrees in tree on condition optimally

user7854965i have mini program that removes subtrees of a tree based on following condition: If a subtree is consisting only of nodes with "rank" 1 remove it. I am using recursive DFS approach. Trees or subtrees does not have any further special properties. I want to ask about your opinions. Is it posibble ...

 
"I would like to optimize the below code" = CodeReview. — Ahmed Abdelhameed 48 secs ago
 
10:26 AM
0
Q: Is this a correct way to implement solution by BDD

BooloodThis is the problem: Write a function to create a table from CSV data. The input to the function is a list of strings. Each string is formatted as a CSV record. Here’s an example for a possible input: Name;Street;City;Age Peter Pan;Am Hang 5;12345 Einsam;42 Maria Schmitz;Kölner Straße 45;50123 ...

 
10:40 AM
possible answer invalidation by Jon on question by Jon: codereview.stackexchange.com/posts/221049/revisions
Provide your code in your question rather than a link. This question is better for codereview.stackexchange.compmg 44 secs ago
 
-1
Q: C# reflection optimize out type

JonI would like to optimize the below code The only difference is the datatypes RadioButton, Label, and Button. Outside the method I have an loop that iterates over all the controls in the aspx-page. I have the limitation of .NET 3.5. using System.Web.UI.WebControls; using System.Web.UI.WebControls...

 
11:06 AM
1
Q: Simple C++ program to keep moving average of price

MansoorThe simple program listed below which reads a text file with a specified format, update its time record of a stock price then calculates the time-weighted moving average of the price. I am primarily concerned about performance. #include <ios> #include <set> #include <string> #include <vector> ...

 
11:25 AM
1
Q: A Python Blackjack terminal based game

famesI am looking for some feedback on my blackjack Python code. Any feedback is much appreciated. Docstring, code etc. Other than that, i need to test it. And i am not sure how to. Any tips on that would also be appreciated. from random import shuffle class Card(): """Class handles cards in a...

 
12:05 PM
0
Q: General purpose replacement for enum with FlagsAttribute

t3chb0tEnums with the FlagsAttribute have the disadvantage that you need to be careful when assigning their values. They are also inconvenient when you would like to allow the user of the library to add their own options. The enum is closed/final. My alternative Option class should solve these two issu...

 
12:23 PM
Monking
 
12:39 PM
possible answer invalidation by J. Czekaj on question by J. Czekaj: codereview.stackexchange.com/posts/221035/revisions
 
1:10 PM
Monking
@Feeds Done.
 
1:25 PM
Maybe more suited for code review — Joseph Wood 49 secs ago
 
1:42 PM
0
Q: reverse recursive search on an object with javascript - like tree search

Juneyoung OhI implemented a tree search with javascript. It has below basic rules. It will search over an array of objects which has recursive(like fractal) If it found a according data in a leaf(the final depth one), it will return its ancestors, but without its siblings.(Example is below) So here is a...

 
2:01 PM
0
Q: Refactoring: Replacing a temporary variable with a query. Is this code example bad practice?

AleksandrHBefore I ask my question, I want to note that this is not my own code; it comes from the Refactoring Guru website (note that I've tagged this question as relating to C because I could not find a tag for refactoring/code cleanliness/style): I often find myself using the code on the left, an...

 
2:48 PM
Should this question be closed for not being the authors code (see poster's comment): codereview.stackexchange.com/questions/221000/…
 
@Dair Are you sure you're posting the correct link? That's an answer, and I don't see anything obviously wrong with the question it's on.
 
Oh it should be about the question...
but I just checked it is the correct question
 
Why do you think it's not OP's code?
 
The comment on the question links to a GitHub. Is there an reason to suspect that the OP is not the owner of the repo?
 
because the context is linked to PARI-extensions
oh wait...
 
2:52 PM
@Dair Look who made the last commit on that.
 
nvm. Yeah, I thought it was to Pari-GP, which is like a pretty big thing, but it is by a guy named Charles. Nvm. My bad.
Good thing I asked instead of actually voted to close it haha.
 
No problem, and indeed.
 
I edited the link into the question. (Although that requires review)
I need to answer some more Q's so I can start editing unilaterally.
 
0
Q: Array Stutter Implementation

David WhiteI was assigned this homework assignment to complete. The question originates from CodeStepByStep. Below is the prompt for the question: Write a function stutter that takes an array of Strings as a parameter and that replaces every String with two of that String. For example, if an array s...

0
Q: Data structure with linked list implementation in C++

ponikoliI need to create appropriate insertion, deletion, copy constructor and assignment operator for a certain data structure. It is a hashtable containing pointers that are linked lists. It works on tests I wrote and valgrind says there are no memory leaks. STL is forbidden, as well as changing the da...

 
@bruglesco Best way to get good at answering questions is by finishing your game ;P
 
3:47 PM
@ElliottFrisch Sure, done. Thanks. This turned into quite the code review. — Basil Bourque 22 secs ago
 
4:36 PM
1
Q: Ruby chess engine gem

Anikeev GennadiyThis is my first Ruby gem that claims to provide all the rules of the chess game. My goal was to keep this library as simple as possible via OOP principles, and I'd be glad to hear any feedback from you. In particular, I'm interested in code organization and OOP issues The source code and useful...

 
 
1 hour later…
5:50 PM
@CaptainObvious Why so many downvotes? I see that the ForEach() method is incomplete, but is there anything else wrong with the question?
 
0
Q: Identifying an object pointer by generating and using a unique ID

user3132457I have an image class and a table class. To each image a single table can be "attached". Each <image, table> pair should be identified with an ID, which can later be used to get the pointer of image or table associated with that ID. Images in this "map" should be unique. Below is my solution, ple...

 
Good evening everyone.
 
6:08 PM
@200_success I added a comment but poor title (which isn't enough of a reason alone for a DV), poor question body and description (which is). I didn't downvote it for being a beginner level question because I am a beginner myself, but some people do seem to dv poor code quality. (Dunno if that is what is happening though)
ohh and lines 3+4 elicit strong reactions from people.
 
@200_success I have taken the liberty to also point out your observation in a comment.
 
 
1 hour later…
7:30 PM
1
Q: Python program to solve matrix-chain multiplication

JustinAn assignment at school required me to write a program for this task: In the matrix-chain multiplication problem, we are given a sequence of matrices A(1), A(2), …, A(n). The aim is to compute the product A(1) …, A(n) with the minimum number of scalar multiplications. Thus, we have to f...

 
8:28 PM
0
Q: Python program to solve the "rod-cutting problem"

JustinAn assignment at school required me to write a program for this task: In the rod-cutting problem, we are given a rod of length n inches and a table of prices p[i] for i = 1, 2, …, n. Here p[i] is the price of a rod of length iinches. We have to find the optimal way of cutting the rod so...

 
8:47 PM
-1
Q: python calculator Error

az3ar netI try to do Calculator but i have error with formatting this the error: lblr['text'] = ('Result" $s $s $s = %s' % (n1,ope,n2,round(r,2))) TypeError: not all arguments converted during string formatting this my app: import tkinter from tkinter import ttk frm = tkinter.Tk() frm.geometry('70...

 
9:06 PM
0
Q: Huge performance difference: PowerShell Core vs. 5.1

JosefZRecently I have answered another question about performance. A solution found using PowerShell-ISE successfully, and good speed testified using PowerShell Core. However, running the same script(s) in PowerShell 5.1 displays utterly different results, absolutely worse in the performance improveme...

 
codereview.stackexchange.com — Vitaly Borisov 32 secs ago
@CareyGregory No piece of code using a construct like that would ever survive a code review with me - The labels as values extension is extensively used in the jump table in the by hand optimized glibc printf. And I think it's the only place i've seen it used. — Kamil Cuk 13 secs ago
 
 
1 hour later…
10:19 PM
1
Q: Policy regarding "flooding" Code Review with questions

AlexVThere seem to be a few users which "flood" Code Review with questions recently (2 to 4 questions in rapid succession). They often present relatively small pieces of code, allegedly from homework, coding challenges, and the like. Per se, there is nothing inherently wrong with the questions as suc...

 
11:00 PM
0
Q: Palindrome Pairs

thadeuszlayThe task is taken from leetcode Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome. Example 1: Input: ["abcd","dcba","lls","s","sssll"] Output: [[0,...

 

« first day (2213 days earlier)      last day (1797 days later) »