« first day (2743 days earlier)      last day (1275 days later) » 

12:00 AM
RELOAD! There are 7094 unanswered questions (89.7337% answered)
 
 
1 hour later…
1:30 AM
Great work. Really impressed to see you not only following the leads on your question but being involved in fixing the problem once identified. Would you like a code review, or have the maintainers you spoke to already done that? — Zach 8 secs ago
 
-2
Q: Trouble creating a floor in python tkinter

WillAs part of a simple platformer game, I would like to make platforms that act as floors for a ball to sit on. I have this defined in the class Floor call in my program and it is not forming. Anyone know how I can correct this piece of code? import tkinter as tk tkroot = tk.Tk() class ...

 
1:57 AM
1
Q: An Element-wise Increment and Decrement Operator For Boost.MultiArray in C++

JimmyHuThis is a follow-up question for A recursive_transform Template Function for BoostMultiArray and An Add/Minus Operator For Boost.MultiArray in C++. Besides the add / minus operator for Boost.MultiArray, I am trying to implement an element-wise increment operator and decrement operator as below. T...

 
 
2 hours later…
3:34 AM
0
Q: Square roots via Newton's method in Java

E's computer classThis time, one of my labs state that I need to write a complete java program which will calculate the square root of a number via Newton's method. The reason behind using Newton's method, as opposed to Math.sqrt(x) is so that I get to practice the use of simple IO, conditional expressions, loops,...

 
3:59 AM
0
Q: Java generics with wildcard vs non generic List to deal with non generic data

Gulshan RajThere is a problem on Exercism Java track that requires writing a function to flatten an arbitrarily nested list to a flattened list without null values. For Example input: [1,[2,3,null,4],[null],5] output: [1,2,3,4,5] Here is the solution I wrote for it without using wildcards. public List flatt...

 
4:52 AM
Monking
 
5:36 AM
0
Q: Doubly Linked List Data Structure ADT in C++

Guy on the InternetI'm trying to implement a Doubly Linked List data structure in C++. Please give me suggestions on how this code can be improved. Try to remain in C++11 because that's what I know atm. #ifndef DOUBLY_LINKED_LIST_HPP #define DOUBLY_LINKED_LIST_HPP #include <iostream> template <typename T> class D...

 
6:33 AM
The boundaries between different stack exchange sites are fuzzy and hard to get right, but I sometimes like asking these kinds of questions on the codereview stack exchange - check it out, there's some cool stuff there similar to your question: codereview.stackexchange.comScotty Jamison 24 secs ago
 
6:49 AM
0
Q: Create dummy variables in dataframe using for loop and apply lambda

RensI like to compute dummy variables based on the existing values in a dataframe and a dictionary with certain "cut off" points. I wonder whether I need to get rid of the for loop in the example below. And if so, how? The second answer in this Stackoverflow post compellingly urges to avoid looping t...

 
7:38 AM
0
Q: Arrays to Object

uPongI'm new to javascript and trying to figure out what improvements I can make to my code. In this code I retrieve values ​​from an iODBC database then I format and push in SQL database. I am making arrays to get all my values that I am processing, however I think the best way would be to do it in o...

 
 
1 hour later…
8:51 AM
0
Q: vuejs: best practices with vuex when you call multiple actions

kevinG73I am working on a project in which I am using vue js 2 and electron , to manage the state I use vuex , I have at least 20 actions to call methods: { ...mapActions('Store1', ['FETCH_AB',...]), ...mapActions('Store2', ['FETCH_DS',...]), ...mapActions('Store3', ['FETCH_SD']...

 
9:10 AM
Could you run a profiler to see exactly what is taking so long? I suspect it's the fuzz.token_sort_ratio method; in which case you will need to find another quicker similarity method. Moreover, your post should be posted on code review not on stack overflow. — Mathieu 53 secs ago
 
 
1 hour later…
10:25 AM
If your code works, then you should consider asking on codereview.stackexchange.com (but be sure to read their tour first). If your code doesn't work, then the appropriate place for it is in the question, not an answer. — Nick 44 secs ago
 
0
Q: increment value in a list of dictionaries

user3379546i have a list of dictionary let's say : l=[{'a':1,'b':2},{'a':5,'b':6},{'a':3,'b':2}] and i want to have another list l2 and add 4 to the 'a' in the all dictionaries l2=[{'a':5,'b':2},{'a':9,'b':6},{'a':7,'b':2}] (the first list l shouldn't change) so i am doing it this way but i feel there is be...

 
@Mathieu As a relative newcomer to this forum, I'm curious about your comment "your post should be posted on code review not on stack overflow". My understanding is that this post belongs here on SO, and the code review forum is meant for asking a more open-ended question like "What do you folks think about my code?". Is my understanding wrong? — fountainhead 37 secs ago
 
11:00 AM
@fountainhead SO is for more open question, on code usually not working. Code review is meant for working code only; to optimize it further; usually to improve the computation time and memory usage. Additionnaly, the overall "look" of the code/design and clarity is generally improved simulteneously. — Mathieu 16 secs ago
 
 
1 hour later…
12:01 PM
"failed code review" is pretty subjective. Your code seems to be a pretty correct replication of the previous code — Hassan Naqvi 18 secs ago
 
0
Q: Concatenating optional strings in Scala

SumaI have two optional strings, any of them can be None. I want to create their combination with a delimiter between them if they both exist. I have two versions working, but I do not like any of them much, I expect to be able to come with a more concise and nicer solution. I like the reduce version...

 
 
2 hours later…
1:44 PM
1
Q: Getting data from database and present it on Winforms

LV98Currently, I am working on this project where I need to achieve the following... Get column named Category from MySQL database. And whatever the output is, check the specific radio button on winforms. I'd like to see if I can improve it, or if there is a much easier way of achieving my goal: Pers...

 
 
2 hours later…
3:29 PM
Medi Madelen Gwosdz on November 06, 2020
Welcome to ISSUE #46 of the Overflow! This newsletter is by developers, for developers, written and curated by the Stack Overflow team and Cassidy Williams at Netlify. This week: Our CEO looks back on his first year at Stack Overflow, spiders teach us some math, and the release of React App 4.0. Enjoy! From the blog Communities and…
 
3:45 PM
codereview.stackexchange.com for working code that needs improvement. ;) — jmargolisvt 16 secs ago
 
4:12 PM
0
Q: Manage list of subjects (show, delete, add) in Python

Tom GebelThis is my code. It loops a menu, from which you can select whether you want to add a subject, see all subjects or delete a subject. Is there anything style- or functionality-wise to add or correct? def add_subject(subjects): # ask for subject to add add = input("\nWhat subject do yo...

0
Q: Given a byte string S of length l, obtain the string D of length l-1 as D(i) = S(i) * S(i+1)

just1frustredstudentGiven a byte string S of length l, obtain the string D of length l-1 as D(i) = S(i) * S(i+1) (each element of D is the product of two consecutive elements of S). here is my code. bits 32 global start extern exit import exit msvcrt.dll segment data use32 class=data s db 1, -3, 4, ...

0
Q: Python Popup menu for main app gui

SN-812The codes for the popup menu are below. The user should be able to launch the main app through this popup menu but it doesn't work. #Popup menu from tkinter import * import os root = Tk() root.title("Popup Menu") p = Label(root, text = "TFL Journey Planner", height = "18", width = "250", bg =...

 
4:37 PM
0
Q: Is my Matlab to Python translation correct?

MilTomMATLAB (original code): function p=wfpt(t,v,a,z,err) tt=t/(a^2); % use normalized time w=z/a; % convert to relative start point % calculate number of terms needed for large t if pi*tt*err<1 % if error threshold is set low enough kl=sqrt(-2*log(pi*tt*err)./(pi^2*tt)); % bound kl=max(kl,1...

 
4:56 PM
Monking
 
I’m voting to close this question because it is asking for a code reviewQuentin 56 secs ago
 
-1
Q: Python Project Structure for Data Science Application

JubblesI have written a forecasting application using a Jupyter notebook and would like to structure the application (and supporting) code as a Python project. At a high level, the application: fetches data from a remote database, and organizes and formats it trains a model using this data evaluates it...

 
5:26 PM
0
Q: Abstract class as a factory of its child classes

dzieciouI just got to review a hierarchy of classes, where the parent abstract class is at the same time a factory of its child classes. I have a feeling this is a code smell, but I cannot find a rationalization for that feeling. Is it a code smell? If so, how it can be improved? class Dictionary(ABC): ...

 
Yes! Readability is king. Like everything it's a fine balance. You want to write code that you and other people would find easy to maintain. However, by the looks of it you're about to get downvoted into oblivion. Stack overflow is less for opinion based questions. Use codereview.stackexchange.com - but come with two actual examples to compare (approach A vs approach B - which is best?). For general opinion, consider stackoverflow chat/gitter/material on writing clean code. — mbdavis 29 secs ago
 
6:01 PM
I know that's why I went t repost this to code review, although if you have anything that can help go to this link: codereview.stackexchange.com/questions/251724/…Boneless Cheese Flame 1 min ago
 
6:16 PM
0
Q: Handle database validation (exists, unique constraint, etc)

Yiyi ChenLet's assume you are writing a REST Api with a common structure like Controller > Service > Repository > Database. In the database there's a table with a column with a unique constraint: // Examples with typeorm/typescript // user.entity.ts @Entity() export class User { @Prima...

0
Q: Need Some Help to Make Adjustments

Boneless Cheese FlameWhat I'm Doing So here's the deal, I've made some code for a Minecraft server I began working on about a week ago. The only problem is that I'm the only one working on it. So I've been doing some building and decided to take a break to do some coding. What the Code is For I decided to start off w...

 
@Mathieu My informal rule is that it depends if they want to improve their existing program, or write a new one that they don't know how to write. If they want improvement, I recommend code review. If someone wants a completely different algorithm, I am happy to answer. (As I did here.) — btilly 21 secs ago
 
6:41 PM
0
Q: Initializing Google APIs serverside in MVC controller

Aishwarya ShivaI have this code in my MVC Controller: [HttpGet] [OutputCache(VaryByParam = "*", Duration = 3600, Location = System.Web.UI.OutputCacheLocation.ServerAndClient)] public async Task<string> GetAPI(string callback, string libraries) { var location_selector_script = System.IO.File.ReadAllText(Ser...

 
7:01 PM
I don't think people write spaghetti code on purpose... We all have to learn somewhere. Martin does have a bit of a point though; you might need to clarify what this code does, and maybe include some reasoning to your approach. Additionally, you could always take your code to codereview.stackexchange.com and see if someone is willing to help with optimization :) — Tim Lewis 14 secs ago
 
7:24 PM
@Peilonrayz It's on meta. shrug
There's enough questions about it that it probably makes sense to have a tag for it.
It seems policy has shifted a bit over the years too, so this will help.
 
0
Q: Expiring key/value repository. Java

bw_devThe following code is in-memory repository that stores key/value pairs. It will be used on our server to keep information about active clients. Clients send keepalive messages to indicate that them are active. Important point: the formation of inactive (expired) clients should be removed from rep...

-1
Q: What's an efficient way to optimize my code to make sure variables' value persists from one function to another?

TazmaniaI currently have 2 functions I'm working with. Originally, the fetchInventories() function didn't require an argument because I'm fetching some query results I need to use which's happening inside the getInventories() function. But down the line, I needed to make sure the query knows what's the...

 
 
1 hour later…
8:44 PM
0
Q: Prolog destructor?

2bigpigsI have an init predicate which asserts some facts. I would like to clean these up after execution. I'm running queries of the form init, do_stuff, cleanup.. I would rather not have a separate cleanup call if i can avoid it (because I forget to call it). I found this as a solution: init:- asse...

0
Q: "superior" input function

fartgeekHave you ever written a python script, then got to a part where you have to get input from the user? I would assume your code went something like this: user_input = int(input("Enter number: ")) Then you realized that if the player enters "keyboard spam", then your program crashes. So you need to...

 
9:34 PM
0
Q: Great-circle distance in Java

E's computer classToday's assignment states that I need to write a complete java program which will calculate the relative orthodromic distance between two sets of geographic coordinates declared by the user. When the user enters latitudes, it should be in degrees with negative numbers representing South latitudes...

 
 
1 hour later…
10:49 PM
0
Q: Optimizing algorithm for constructing a string given costs to operations

NorhtherI'm doing the following problem (not homework): I'm doing an exercise (not homework) and I decided to go with backtracking, The problem says as follows: You are given as input a target string. Starting with an empty string, you add characters to it, until your new string is same as the target. Y...

 
11:02 PM
I’m voting to close this question because it would be better placed on codereview.stackexchange.comDancrumb 54 secs ago
 
11:13 PM
0
Q: 3-way multiplexer built on 2-way multiplexers in Verilog

Ellen SpertusI created this project on EDA Playground that builds a variable-width 3-way multiplexer out of 2 variable-width 2-way multiplexers. It will be part of homework that I assign, so I want to follow all best practices. I followed the lowRISC Verilog Coding Style Guide. Design Modules module mux2 #( ...

 
11:38 PM
0
Q: How to make this F# code less nested?

KerryI'm trying to refactor the working code below, but it doesn't seem "linear" enough. What the code below is doing basically: take a request (made of parts) convert each part to a command checking one parameter among the ones needed to instantiate with validations if any failures then we exit with...

 

« first day (2743 days earlier)      last day (1275 days later) »