« first day (3069 days earlier)      last day (931 days later) » 

12:02 AM
REFRESH! There are 7848 unanswered questions (89.2901 answered)
 
0
Q: Dictionary based non-local mean implementation in Matlab

JimmyHuGiven a dictionary including multiple X-Y pairs where X, Y are both three dimensional structure. dictionaryBasedNonlocalMean function return a output which is weighted sum of each Y in the dictionary. Each weight of Y are based on the distance between the input of dictionaryBasedNonlocalMean func...

 
12:57 AM
0
Q: Display product summary for an e-commerce website

Hooman BahreiniI am working on an e-commerce website. I want to display products in the search result. Here is a subset of what I am doing to display the images. I am using flex to divide the screen into 3 columns and I am using flex-grow-1 to make all the cards the same height, here is the code: .summary-c...

 
1:31 AM
Code Review is the place for more opinion-based questions. That said, you could just write console.log(isAnimal) and so on without having to write and concatenate a string for each possible condition and variable combination. — t56k 13 secs ago
 
2:11 AM
0
Q: Console logging multiple false conditions, how to refactor efficiently?

SuzyI'm trying to improve my code and have better logging. Is there an ideal way of how to tell which conditions are false in a list of conditionals? i.e) if(isAnimal && isCarnivore && isPlant){ // does something } else { // want to console.log all the false conditions in one console.log } We coul...

 
possible answer invalidation by frozenca on question by frozenca: codereview.stackexchange.com/posts/268428/revisions
possible answer invalidation by frozenca on question by frozenca: codereview.stackexchange.com/posts/268428/revisions
 
2:35 AM
0
Q: Optimizing Code for Project Euler Problem 04

fabinfabinfabinI just finished Problem 04 on Project Euler, and I was looking at ways to optimize my code, just started learning functions too, so I'm pretty sure it's very bad, hopefully you guys can help me. Question A palindromic number reads the same both ways. The largest palindrome made from the product o...

 
possible answer invalidation by frozenca on question by frozenca: codereview.stackexchange.com/posts/268428/revisions
 
 
1 hour later…
3:41 AM
 
Monking
 
4:15 AM
0
Q: First attempt at chess in Python #2

BradeAlmost a month ago I asked for some review of my first attempt at Chess in Python, with the main goal being to start learning inheritance in Python. It can be found here: First attempt at chess in Python I finally have had enough time to make a bunch of the suggested changes and have since implem...

 
4:41 AM
I’m voting to close this question because these kinds of code improvement questions are better asked on Code Review. — Ken Y-N 36 secs ago
 
5:10 AM
Monking
By the way, yesterday I became a grandpa ;-)
8
 
 
2 hours later…
6:59 AM
I think you should post this on codereview.stackexchange.com - there is a lot that could be optimized, e.g. you can use recordset.getRows (docs.microsoft.com/en-us/office/client-developer/access/…), use subs per task (getRecordset, getArrayFromRecordset, writeArrayToRange) ... — Ike 27 secs ago
 
0
Q: Disjoint-set data structure (C++)

NayukiI'm an intermediate-level C++ programmer aiming to write reference-quality code. I hope to learn about any mistakes in this piece of code and blind spots in my understanding of concepts. Notes: The stylistic use of public:/private: on every member is discussed in a thread. I'm not totally sure ...

0
Q: Convert string to 10 character string with leading zeros if necessary

banana_99I have the below data and am obtaining the expected output column for it. DATA EXPECTED_OUTPUT EXPLANATION ---------------------------------------------------------------------------------------------- 123 0000000123 9 leading 0s to get to 10 characters. ...

 
8:03 AM
@Heslacher Congratulations!
Monking.
 
If your code works as expected, your question might br a better fit for codereview.stackexchange.com - but make sure that your question satisfies their requirements. Maybe more explanations about what your code does would be needed. — Thierry Lathuille just now
possible answer invalidation by Toby Speight on question by Nayuki: codereview.stackexchange.com/posts/268461/revisions
 
@Duga Code fence only
 
possible answer invalidation by Toby Speight on question by Nayuki: codereview.stackexchange.com/posts/268461/revisions
 
8:21 AM
0
Q: Python 3 Multi-connection downloader

Xeнεi ΞэnвϵςI have written a fully functional simple command line multi-connection downloader, written in Python 3, using just threading, requests and pathlib for its core functionality, plus 19 other libraries for some extra features. I have added resume support and it automatically resumes interrupted down...

 
L3n
@SimonForsberg That dropped project was for Discord, a chatting platform, which added a command (pretty creepy xd) that would notify you when a user went online
Like in Teams, the status notifications you know?
 
8:46 AM
0
Q: Connect 4 board, how do I optimise this?

Micah KanI am required to code (as part of a 3-question assignment) a variable-size connect 4 board with a standard size of 6x7, with a minimum size of 2x2 and a maximum of 20x20. The professor said that he could do it in 20 lines, and the maximum one can write is 3 times that. My code sits uncomfortably ...

 
9:01 AM
This is more suited to Code ReviewSayse 10 secs ago
 
9:39 AM
codereview.stackexchange.com is probably the correct place to share your working code to get feedback. — Ted Lyngmo 30 secs ago
 
10:35 AM
possible answer invalidation by blueray on question by blueray: codereview.stackexchange.com/posts/268336/revisions
possible answer invalidation by blueray on question by blueray: codereview.stackexchange.com/posts/268336/revisions
 
 
1 hour later…
11:55 AM
@Zeta thanks
 
0
Q: Simple flex-based design for automotive sales platform in HTML5

avenas8808This is my code for a simple used car sales platform, with flex used for the DIVs: https://jsfiddle.net/m56npe32/ I am looking for constructive criticism on how to improve the design, as the entire code works well at a basic level. Embedded within is: <div class="row"> <article class="col-lg-3"> <

 
12:16 PM
@Heslacher Congratulations!
@Duga Handled by a newcomer that does not frequent the 2nd Monitor.
 
Welcome to Stack Overflow! If you want help improving working code, you should post this on CodeReview.SE. If you do decide to do so, please delete the question here. — NathanOliver 34 secs ago
 
0
Q: Weather status on dashboard design

Mads Sander HøgstrupSo I've made a dashboard, and I have alot of colors / icons on this page. One of the things I wanted to get some others view on was the design I've choosen. I use bootstrap background colors: primary, success, danger, warning, dark, so all icons can appear with this background. To change the colo...

 
@Duga @TobySpeight Was there a reason you didn't roll this back when you commented?
 
I’m voting to close this question because it belongs on codereview.stackexchange.comcodeling 23 secs ago
 
1:03 PM
@pacmaninbw thanks
 
1:15 PM
0
Q: C++ Sieve of Eratosthenes how to make this better?

jaronbass21#include #include int main() { vector<int> primes; int n = 100; // amount of numbers - 1 vector<bool> sieve; for (int i = 0; i <= n; i++) { // creating vector with all true values sieve.push_back(true); } // let's set 0 and 1 to false because well we know...

 
 
1 hour later…
2:35 PM
This is probably more fit for codereview.stackexchange.comReyno 54 secs ago
 
@L3n And what was not so useful about it? Sounds quite useful to me
 
2:54 PM
0
Q: Outlook VBA to Replace Tokens from an email template

immobile2I'm creating a few macros that open specific Outlook templates an allow you to replace specific tokens before sending the email. It seems to work, but I'm admittedly doing full loops when I probably don't need to. So I'm just wondering if anyone sees a better way to approach this. As you can see ...

 
3:09 PM
Nibjubg
 
0
Q: Fantasy Character Creation Tool (early prototype)

Davide MarchiI recently started studying C++ programming; while attending the course I'm writing a program on the side as a personal project to familiarize with what I'm learning. It is still very basic and I'm sure that as I begin learning OOP there will be a lot of room for improving it. But for now I would...

 
@SᴀᴍOnᴇᴌᴀ You've definitely been corrupted @skiwi.
 
3:28 PM
@pacmaninbw Yes: I couldn't be sure whether the answers were actually invalidated (also not sure about the other added text). If it's plainly obvious, I do roll back, but this was too complex for me to figure out on a busy day!
 
@RMunroe 5 out of 4 people have problems with fractions
 
@TobySpeight I was just curious. Adding that much code after an answer generally isn't good.
 
3:44 PM
@pacmaninbw It was possible that some worthwhile information was there as well as the code edit, and I just didn't have time to unpick it.
I should probably have mentioned here, to have someone else examine it.
@pacmaninbw I wouldn't really call Sara J a "newcomer" - 2¼ years membership and 38 posts should be enough to lose that tag. (But not frequenting T2M is true).
 
@CaptainObvious LOL in the jsfiddle the images of the cars are quite skewed unless the frame is widened
 
Monking
 
 
1 hour later…
5:02 PM
This question is not suitable here. You might try CodeReview.SE but check their guidelines first. — Paulie_D 14 secs ago
I’m voting to close this question because SO is not a code reviewing site. CodeReview.SE is recommended subject to review of their guidelines. — Paulie_D just now
 
Ben Popper on September 28, 2021
This is no joke. The copy and paste keyboard from our April Fool’s joke is real and available for purchase.
 
5:33 PM
This would be better suited for Code Reviewdevlin carnate 32 secs ago
 
@SᴀᴍOnᴇᴌᴀ Compact cars.
 
@Mast yes - at first glance I almost thought those were life-sized toy cars
 
@TobySpeight @pacmaninbw A lot of our regulars don't visit The 2nd. Some of them don't really visit any SE chat.
 
6:11 PM
0
Q: Optimizing code (style and logic)? Leetcode #5

Tim_Jarvis99Being completely upfront, I know this isn't good code. As the title says, the code is a solution to leetcode #5, which asks to find the longest palindrome in a string. Link here: https://leetcode.com/problems/longest-palindrome/ the code passes with runtime being 45% faster and memory usage being...

 
L3n
6:26 PM
@SimonForsberg I imagine it being somewhat annoying for the people that you're notifying 😅, also didn't want to be like those guys that when they get a notification always check on it immediately
 
@L3n Nothing wrong with following up on notifications, we do that all the time :-)
 
If your code works, your questions might be better suited to codereview.stackexchange.com. — jfaccioni 22 secs ago
 
6:58 PM
@L3n I assumed that people would "subscribe" to notifications themselves? So that I could for example do /online-notify L3n to get notified whenever you're online?
 
0
Q: Find All Subtrees in Binary Tree. Complexities

beatmaisterSo I believe i finally solved this, I testes a few cases, But please feel free to point out any. I am mostly trying to figure out the time/space complexities of this solution. Because binary trees are usually O(n^2), I believe my solution is O(n), since each node is only visited once. But I would...

 
7:25 PM
0
Q: C++ - Tic Tac Toe AI powered by minmax algorithm

Random_Pythoneer59This was my previous post on Tic Tac Toe in C++. I received very good feedback and tried to implement all of the improvements. I could not implement some due to the AI needed functions or complexity. I wanted to know where I could - Optimize the performance. Improve my Tic Tac Toe class. Improve...

 
7:38 PM
@Feeds No good for us Emacs guys. We need C-w and C-y keys...
 
7:49 PM
0
Q: Python, using multiprocessing and asyncio together

LoïcI coded this, so that a function that'll likely listen to a redis PUB/SUB channel can run in multiple processes and be asynchronous as well, to make the most of the machine. I'm curious about what you think : from multiprocessing import Process import asyncio as aio import coloredlogs, logging im...

 
8:27 PM
(global-set-key (kbd "C-c c") #'kill-ring-save)
(global-set-key (kbd "C-c v") #'yank)
After all, C-c <letter> is reserved for users :)
 
 
2 hours later…
10:23 PM
"I have tried to implement my own solution by using the .iterrows function and using dynamically created variables, but I would like to know what would be the recommended, most simple, and elegant way of solving the problem." We can only tell you if there's something wrong with it, if you show it to us. We cannot tell you what is "recommended, most simple, and elegant", because subjective questions don't fit here. If you have working code that you want to improve, try codereview.stackexchange.com. — Karl Knechtel 20 secs ago
 
 
1 hour later…
11:43 PM
welp ... two answers, both not taking into account a basic corner case: codereview.stackexchange.com/questions/268437/…
 

« first day (3069 days earlier)      last day (931 days later) »