« first day (2319 days earlier)      last day (1994 days later) » 

00:00
RELOAD! There are 6164 unanswered questions (90.0323% answered)
00:36
0
Q: c++17 compatible std::bind_front alternative

user233009One of the things that has been really exciting me in c++20 is std::bind_front. Using placeholders with std::bind and boost::bind has really bothered me and the code looked messier and messier with each call to bind. It was bad enough for me to decide to enable -std=c++2a and pray that I wouldn't...

00:57
This question should be at codereview.stackexchange.com since it's just about refactoring a working code. — arieljuod 57 secs ago
01:56
0
Q: Merge k sorted lists in Java

A userI hava a question similiar with mege in Python but I am trying to write Java code. Here is my code: The input is: The first line - a number of arrays (k); Each next line - the first number is the array size, next numbers are elements. Max k is 1024. Max array size is 10*k. All numbers between 0 ...

02:56
0
Q: Python List of Dictionaries to XLS

LaycoonzHow may I optimize the following function to write a xls file from a list of dictionaries using the openpyxl library in Python. The current logic behind feels very very wrong The dict list: things = [ { "Fruit": "Orange", "Flavour": "Good", "Expiration": "21May20" ...

03:36
0
Q: State machine to handle sequential and async events

AnonProgrammerI created this state machine to handle events. I'm unsure about my implementation firstly because I don't use a transition table or anything like that, instead, I simply input the next event/state that needs to happen. I think this is cleaner than calling method to handle event b inside the metho...

04:32
Monking
 
1 hour later…
05:35
Also, I know this is not the place to ask this but if you have experience with gawk extensions can you take a look at codereview.stackexchange.com/questions/227424/…oguz ismail 8 secs ago
@ManpreetSingh If this answered your question please upvote/mark it as solved: Accepting Answers: How does it work? • Improve your coding skills by practicing, reading the official documentations or tutorials in the internet. If you need someone to look over your code codereview.stackexchange.com might be a good point to go. — Pᴇʜ 40 secs ago
06:32
you might want to consider asking in codereview.stackexchange.comshrys 27 secs ago
07:31
Monking
JAD
JAD
o/
1
Q: Incremental Sieve of Eratosthenes Generator

JADSo I was fiddling around with the Euler challenges. One of the things they mentioned in their discussions of the solutions is the Sieve of Eratosthenes and that you can only use it when you know an upper bound of the primes you want to generate. I wondered whether the algorithm can be adapted to...

Monkin'
08:37
-1
Q: China Peruvian Deep Curly Lace Closure manufacturers

sf50259 JOIN Incidents inc ON log.year = inc.year AND log.month = inc.month AND log.day = inc.day Covering 35, 000 square meters. There are more than 400 workers and we can produce more than 100, 000 pieces hair goods each month. Production Market North Ameri...

Questions about refactoring working code are off-topic for stack overflow. Try Code Review. — Michael 33 secs ago
08:57
0
Q: Instantiating ViewModels with Caliburn Micro

KezI'm using WPF (MVVM), Caliburn Micro, and Autofac to create a simple desktop application. I am a beginner at all three. I have a ShellView with a ContentControl (bound to CurrentView) that displays the DetailsView after clicking a button (bound to ShowDetails()). internal class ShellViewMo...

0
Q: DDD Architecture for an e-commerce website (uploading images)

Hooman BahreiniProblem Description I am working on an e-commerce website, when a user wants to sell a product, he would open the product page and he can upload up to 12 photos: Image Upload Process This is the process that I follow for saving images. Once user drops an image on the uploader, it would get s...

09:17
1
Q: CandidateArchive for model-assisted multi-fidelity global search algorithm

EnergyaFor my research I'm working on global search methods where a candidate solution can have it's fitness (=score) evaluated in multiple fidelities (=accuracy levels). The goal of the CandidateArchive is to keep a clear overview of which candidate solutions have been evaluated under which fidelities....

09:37
0
Q: Simple UDP server (java)

bw_devI write kind of UDP server. It should serves about 10 messages per second. I would like a review about the general code 'quality' and logic. The code: public class UdpServer extends Thread { /* Receive timeout in mills */ final private static int RCV_TIMEOUT = 100; /* Buffer size */ f...

10:17
0
Q: Extract strings from nested array in Perl

Miroslav PopovExtract the strings from nested arrays in Perl. It prints: a, b, c, d, E use strict; use warnings; use feature qw(say signatures current_sub); no warnings qw(experimental::signatures); my $tree = [1, 'a', [2, 3, 'b'], [4, [5, 6, 7, ['c']], [7, [8, 9, [10, 'd']]], 11, 'E']]; print join ', ', ...

10:37
0
Q: YAVI (Yet another std::vector implementation)

Marius TI am a C# game developer currently learning C++. I am trying to implement some simplified STL containers. Here is my implementation of vector, which does not have the allocator (becase std::allocator Is To Allocation what std::vector is to Vexation ). My objective is to understand the mech...

 
3 hours later…
13:36
0
Q: Django turn ChoiceField into a submit button

Bruno VermeulenI have made a ChoiceField into a select and submit button and wondered if this is the correct approach. forms.py class PortfolioForm(forms.Form): def __init__(self, *args, **kwargs): super(PortfolioForm, self).__init__(*args, **kwargs) portfolios = [('pf 1', 'pf 1'), ('...

13:56
0
Q: Use of setTimeout better way to write this javascript "preloader"?

mm_blnI am working on a website and therefore on an animation that runs at the beginning before the content of the homepage becomes visible. I've looked at some examples of preloaders and now use that code with some setTimeout to implement the desired effect. The effect works the way it should but I t...

 
1 hour later…
15:05
This answer to my question was pretty good until the alternate solution was added. I was wondering if it could get a few upvotes and comments on how it could be improved. I am not asking for my question to be upvoted I just want to encourage the user that posted the answer. codereview.stackexchange.com/questions/227678/…
15:16
0
Q: hangman in php matching letters with words

Noel Jimenez BenagesI have problems matching the letters i input with the word i have to guess, I don not where is the problem. Also if you could explain me where the error is because i am starting with php <?php require_once 'hangedman.php'; $words = array(); $numwords = 0; function printPage($image, $guess...

15:37
@pacmaninbw I don't get what's wrong with providing code that support earlier observations? I do it all the time.
15:51
@MathiasEttinger the entire solution? There are a number of things wrong, especially if it is homework.
0
Q: Making a grid for collision detection in a game that wraps

Shuri2060I'm making a 2D game which wraps (when you move off the right edge, you appear on the left, etc). The game area is square, all objects are circles (with AABB smaller than the game area, and in most cases, much smaller). I'm dividing the game area into a grid to perform collision checks. I need t...

Monking
@pacmaninbw It's not as if most comments on codes are of the form "don't do that, do this instead", providing code explaining how might benefit anyone that would ask themselve the question and feels clearer than plain english statements (for the most part).
16:06
@MathiasEttinger Did you look at the comment I gave the answerer?
Code to make points or explain points made is great, I use it all the time.
@pacmaninbw Yes, that's exactly why I started wondering in the first place
Great answers don't necessarily need code.
What is so bad about full updated code?
@pacmaninbw I do agree
But that's not what we’re talking about here.
TTQW, will catch up in a while
@MathiasEttinger I'm not sure what I'm supposed to see in the link. The problems I see with a full answer are 1) This is a sight to educate programmers and improve their code a full solution isn't what is called for. 2) Don't do anyone's homework. 3) having participated in hundreds of code reviews in the office as well as on this site completely re-writing someones code indicates they are an idiot, which is not the point of a code review.
in posts involving JS there are typically rewrites - often to demonstrate simpler approaches
16:34
ERROR: We've reached an unreachable state. Anything is possible. The limits were in our heads all along. Follow your dreams.
6
16:56
0
Q: JavaScript - Handle API exceptions codes in the frontend

Mouad EnnaciriIn our Angular 1 application we handle backend exceptions in this way : updateContacts() { return this.ApiService.patch(`apiQueryParams...`) .then(({ data }) => this.UtilService.toCamelCase(data)) .catch(({ data }) => this.handleProjectError(data)) } handleContactErrors(err = {}) {...

GZ0
GZ0
17:20
@pacmaninbw I agree with your points on full updated code. Advices on correcting logical mistakes and stylistic improvements, which are the most common forms of suggestions, are often sufficient w/o or with little code. However, for code-logic-simplifying advices, which may not always be necessary as long as the code is functional, sometimes I feel it is easier to show it with code because I am a bit unsure whether the idea is conveyed clearly enough in written text for others to implement it.
17:34
It's perhaps more suited for CodeReview. — Ted Lyngmo 15 secs ago
Ok thank you. I was unaware of the CodeReview section. Thanks — tonton41 just now
 
1 hour later…
18:36
-1
Q: Dynamically combine ActiveRecord Relation results

kaydanzieThis isn't the actual use-case I have but for simplicity, let's say I have an ActiveRecord Animal model in a Rails app. The Animals have a name (string) and rating (int). There could be animals with the same name but different ratings. In my Animal model I have a hardcoded constant like this: SP...

-1
Q: How to simplify this UI code?

tonton41I am coding a UI for C++. I have a Frame class, which inherits from the Element class, which inherits from the Callbackable class. For every element callbacks needs to be called - I could call the "runXXXCallback" from every element I make, but I feel like there should be a better way, which wou...

-1
Q: C# Winforms Value of 256 is not valid for red. red should be greater than or equal to 0 and less than or equal to 255

Xtra o SnipesI'm having a problem where i am trying to make an rgb splash screen however i get the error System.ArguementException: 'Value of '256' is not a valid option for 'red'. 'red' should be greater than than or equal to 0 and less than or equal to 255. it does this for all parts. Red, green and blue an...

@RMunroe I once encountered an error that said something along the following lines:
> Runtime error. Something unexpected happened. If you see this, you probably did something you weren't supposed to do yet we didn't expect you would even try such a thing. Please, restart and don't try it again.
@MathiasEttinger Nothing wrong with it, as long as it isn't a purely alternative implementation without regards for the original code.
To each his own style, so others may not think it's proper form for a review. But we haven't disallowed it and sometimes it's refreshing to see someone write down suggestions and a suggested implementation of them while still adhering to the task set by OP as well.
Those answers can be very valuable. Don't let anyone tell you otherwise.
3
 
2 hours later…
21:36
-1
Q: Code Improvements/Shortening

user12027822I do not care about the byte count of the code I am simply looking to find more efficient code as I am a Python beginner. The code is supposed to ask for a name and ask a quiz that later counts the g's, y's, 0's and 1's to "determine if someone is gay or not"(no offense to anyone, joke among fri...

22:16
-1
Q: Python code shortening/improvements

pythonier500The object of the code is to prompt the user with a quiz and collect the g's, y's, 0's, and 1's and if there is more than one than the user passes (else, they fail). I am a beginner and would like to know if there is a more efficient direction for this code to go in. from time import sleep prin...

22:36
0
Q: Kotlin HTML timetable visualisation generator

Mark GreenA Kotlin class that I wrote fairly early on while learning Kotlin which is used by another program to build and generate HTML visualisations of timetables. I'd be grateful for any feedback, especially if there's any way (that's not too verbose) of tidying up the multilayer data structure. import...

22:56
0
Q: Compare the double and triples of numbers in Python

Ed1995The code iterates from 1 to 11 and print the double and triple of that number This is how it my output looks I need to modify this for loop so that it stops iteration when the square of a value is larger than the triple of the value, without printing anything in the last iteration. This is h...

23:16
0
Q: Nested CORS iframes for secure user-configurable javascript tools

ShapeOfMatterContext I'm trying to build a system in which a tool (the Client) will generate a header to be used as part of an HTTP request from the user's browser. The user should be able to choose their own implementation of the Client. The user should not have to install a plugin or extension to their ...


« first day (2319 days earlier)      last day (1994 days later) »