« first day (2905 days earlier)      last day (1106 days later) » 

12:01 AM
RELOAD! There are 7523 unanswered questions (89.4618% answered)
 
12:49 AM
0
Q: SmartUnit: Unit Testing with DI

Return of the HoschI was thinking about how unit tests require you to manually instantiate all your dependencies, even though many of them are the same for every test or don't really matter (such as logging, where people usually just inject mocks). As a possible solution to this problem, I wrote a unit test framewo...

 
1:41 AM
0
Q: Powershell Refolder by Filename Before Delim

Shane SullivanI'm pretty new to Powershell but have been using it more and more to automate tasks at work. Now I'm reaching out for some help. I typically use the scripts I write in a way where I copy and paste the ps1 into the directory I want to perform the task on. Then double-clicking. That is why you'll s...

 
 
1 hour later…
2:41 AM
 
0
Q: Dominos [Python] CLI Game

ElbaselMost concerned with improving efficiency and eliminating redundancy than anything else. a lot of Dominos rules have not been implemented yet. Any form of feedback is appreciated. from itertools import combinations_with_replacement from random import sample, choice def get_starting_board(): ...

 
 
2 hours later…
5:15 AM
I understand that your code works and you don't have a problem. Then maybe Code Review is more appropriate for your question? I would just say that you should create new instances of class Customer and class Product inside the while loop. Check if there is any difference in the elements of list between creating Customer and Product objects inside the while loop to the way you have it now where you create a single Customer object and Product object before entering the while loop. — Abra 21 secs ago
 
 
1 hour later…
raf
6:25 AM
@RMunroe it's a xkcd comic, right?
@raf my bad. I should have properly noticed the profile pic :)
 
0
Q: Installing charts in parallel using go

bred strarutsI use the following code which works and install helm chart (in the loop) in parallel, it get a kubeconfig file (to access to k8s) create a helm client and install the charts from the defined location and waits (upgradeAction.Wait = true) that each chart installation will finished successfully. a...

 
raf
Hi, I tried to add a new tag `streamlit` to my question:https://codereview.stackexchange.com/q/259468/230104
But failed to do so because the tag doesn't exist and my reputation is not yet enough to create a new tag. Can anyone with a high reputation help me adding it? :)
 
6:53 AM
0
Q: Rxjs search in Angular

Gábor PehlI created an rxjs search for a hiring company, but I got rejected for the following reason: -performance issue on a bigger data set. -bugs My question is how can I make this code better for the next time if I have similar task? brands = These should be populated from the brand property from the ...

 
7:21 AM
@CaptainObvious Does this answer count as a code review? – There is some advice (“The important thing is to maximize the amount of time you spend doing divisions and minimize the amount of time you spend doing bookkeeping.”) which might apply to the code on the question, but generally it looks like a “use this faster algorithm instead” answer to me, without reviewing the code.
 
7:53 AM
I’m voting to close this question because it is more suitable on codereview.stackexchange.com . — Jérôme Richard 9 secs ago
 
8:20 AM
@raf If you can tell me why adding a new tag is justified, sure.
@MartinR It reads like a suggestion for an alternative without reviewing the code, but it could be a bit of a grey area.
It's perfectly salvageable, but as it stands, it's a poor answer.
 
8:32 AM
0
Q: This code is a non-static C# class for rolling a number of dice

DaseinHello Everyone! Fellow human beings, today I present to you my dice rolling script! Behold, in my amateurish attempt at some raw C# code. Perhaps this will remain here regardless of the dozens of other dice rolling scripts out there. Contains a 'for' loop, a 'switch', and a method that returns a ...

 
8:43 AM
@Mast Thanks, that was my impression as well.
 
 
1 hour later…
9:55 AM
@MartinR I think the answer is on-topic (better word alludes me) for answers. The answer has one insightful observation -> a better algorithm. I've given new solutions without reviewing code before and been well received so far.
@Mast ^
 
10:15 AM
@Peilonrayz The answer just states “this is the fastest algorithm ..., the idea is to ...” without any reference to the code in the question. It does not even compare the algorithms or explain why it is faster. The same could be posted as an answer to any question about prime factorization. In my opinion, Why are alternative solutions not welcome? from Meta applies to the answer in its present form.
 
Do you think the same of my answer here: codereview.stackexchange.com/a/259211
 
@MartinR It's actually a little better than that, just poorly worded.
I haven't written TI in years, but the following "The important thing is to maximize the amount of time you spend doing divisions and minimize the amount of time you spend doing bookkeeping." is basically the start of a remark about the code.
It's clearly not nominable for deletion, just, meh. Meh answers are acceptable.
 
I agree with Mast
 
11:22 AM
0
Q: My first React Custom Hook

doplumiI need to change the page title based on the current state of my store. Right now I came up with const useTitle = () => { const { foo, bar } = useSelector(selectFoorBar); const baz = useSelector(selectBaz); const fooBarDisplayString = format(foo, bar); const barDisplayString = (bar ?? 0)...

 
11:45 AM
0
Q: Getting new vs. returning customers in Postgres

Denis ShvetsovI have this work task, to write a SQL query that would show how many of the active customers are new (= do not have prior transactions) as opposed to returning per a given period. There is nothing particular in the DB to get this, so my solution takes a transaction and compares customer_id to the...

 
@MegaIng you can see it from here if that would help :) codereview.stackexchange.com/questions/259561/…ProtractorNewbie 52 secs ago
 
12:15 PM
0
Q: Fill missing dates into array of np.datetime

Levon AvetisyanHere is the problem: Given an array of a non-continuous sequence of dates. Make it a continuous sequence of dates, by filling in the missing dates. # Input dates = np.arange(np.datetime64('2018-02-01'), np.datetime64('2018-02-25'), 2) print(dates) #> ['2018-02-01' '2018-02-03' '2018-02-05' '2...

0
Q: In Django is it better to do operations in views or models?

Kyoko SasagavaSo i created a social media website in django and here is how i managed accepting friend requests and showing friends posts in home page. Would it be better to do this operation in models.py file, create a function and call it in views using django forms? My concern is security def home(request):...

 
12:43 PM
I am in awe, a first answer that shows we have a new C expert in town, and they do a great code review.
 
 
1 hour later…
1:56 PM
@Peilonrayz I just read through your answer on this meta question. I learned that observation from someone who was my supervisor for 10 years. Where did you find the Odd Couple reference since I think you are too young to have seen the original runs of the series?
I never knew it came from the TV series The Odd Couple.
 
@pacmaninbw I watched the video after I tracked down the source of the quote. The quote is AFAIK a meme
But I've never watched Odd Couple before.*
 
I remember watching the series when I was your, I also saw the original movie.
^^young not your
to late to edit
 
Nice, I can image the entire show was very fun to watch
 
It was.
 
0
Q: How to divide the following code correctly into functions? Calculator /JS

SebaI am new in js, can u help me please. I made a calculator, but within one function. Everything is working properly but is there a way to make the code look more clear and readable? How to divide ifs into different functions? Thank you very much for help let input = document.querySelector('.in...

 
2:15 PM
Ryan Donovan on April 17, 2021
During our second session, we learned how to transform arrays into Bouncing Balls. In this session, we will take the principles of loops and arrays we used to create 100 ellipses bouncing around the canvas and learn how to adapt them to fit within in an object-oriented approach. We will start from the basics and…
 
@CaptainObvious CNI, feature request.
@Vogel612 How do you encourage the community to VTC rather than using the hammer?
 
don't use the hammer :D
 
I don't want to that's why I'm asking. Do you ever flag anything?
 
there is no such thing as flagging for VTC for mods :/
 
OK.
 
2:27 PM
3k+ users can't flag to close, they vote
and mod votes (as well as R/A & Spam flags) are binding
you can flag as "other" but it's easier to just ... use the 1st if you want a second opinion
 
There's always chat.
 
@Mast You're correct, that is one way to do it.
 
If you really want to, and I'm sure this is totally not how it's supposed to work, there's always the possibility of a second account.
 
I'm concerned that no matter who gets elected we will lose 2 valuable contributors from the review queues.
 
That's one of the reasons it's important we keep teaching the ropes to new people. There will always be a coming and going of people.
On one hand you don't want a moderator that has zero reviewing experience, on the other you don't want to lose a valuable reviewer. You can't have it both ways.
 
2:35 PM
Exactly.
 
I do think I will get back into that fray
 
That would be great.
 
just because I dropped my queue activity to near-zero as mod that doesn't mean I won't pick that back up :)
 
There's often the risk of ex-moderators slowing down their activity greatly.
Not blaming them, mind you.
It's kind-of natural.
I'm sure your presence in the queues will be appreciated @Vogel612
3
 
3:38 PM
Its not a interesting idea but one won’t pass any code review session. — coderLMN 24 secs ago
 
0
Q: Lo Shu Magic Square (Python)

am2021I wrote a python program to find if a matrix is a magic square or not. It works, but I can't help feeling like I may have overcomplicated the solution. I have seen other implementations that were a lot shorter, but I was wondering how efficient/inefficient my code is and how I could improve it an...

 
Mzonking
 
3:53 PM
Monking @skiwi
 
Mzonking @Mast
 
For what it is worth, I don't really see what that codes does by casual inspection and I would not accept it as an solution on an assignment or as part of a code review. This is not a complicated problem and the solution seems to make it one. — JonSG 1 min ago
For what it is worth, I don't really see what that codes does by casual inspection and I would not accept it as an solution on an assignment or as part of a code review. This is not a complicated problem and the solution seems to make it one. My answer is my attempt to make the problem statement and a potential solution more clear while I guess not directly addressing your actual question. — JonSG 26 secs ago
 
4:11 PM
codereview.stackexchange.com might be a better site for this, the code is working, right? — user3783243 50 secs ago
 
 
1 hour later…
5:31 PM
 
6:00 PM
0
Q: URLify a given String - replace spaces with %20

salazarinI have written a code to replace all spaces in a String with %20. Input: "Mr John Smith " Output: "Mr%20John%20Smith" My logic: public class URLify { public static void main(String[] args) { String str = "Mr John Smith "; str = str.stripTrailing(); char[] ch = str.to...

0
Q: Optimize user access images php

Francesco TozziI have this code in PHP, working that manages the accesses by user role. In practice I have to check some conditions to understand if the parameters concur, for the user, so as to verify whether or not he can view the image. I wish I could optimize it and make it more "elegant". Can you help me? ...

 
 
1 hour later…
7:07 PM
0
Q: Python - Pagination class

Pierre-AlexandreI built a small flask app and a lot of routes do need some kind of pagination system. However, in some cases I would like to just display n-2, n-1, n, n+1, n+2 where n is the current page and in some others cases, probably a bigger range. Fo example, in the following picture, the range is 2. I am...

 
7:51 PM
0
Q: I want to a generic algorithm to play TicTacToe. It keeps stagnating at a point where it loses games. Why doesn't it advance further?

Malte Schulze BalhornThe AI is built with neat-python. The input is the gameboard as a list of fields (0:unoccupied, 1:player1, 2:player2). The AI produces 9 outputs and the index of the max(output) gets chosen as field to go. It trains against a bot who chooses fields randomly. If the field to go is already occupied...

 
 
1 hour later…
8:51 PM
Guess this suits better to codereview.stackexchange.comB001ᛦ 23 secs ago
 
0
Q: Random walk on a grid

JCC// generate a random "walk" of letters from A to Z in a 2D grid, assuming a // character set with contiguous values of uppercase letters (e.g. ASCII); // stops if the "walker" gets stuck // example of a successful walk: // A . . . I J K . . . // B C F G H . L . . . // . ...

 
 
2 hours later…
11:19 PM
0
Q: U.S. State Capitals Quiz (Python)

am2021I have a program that gives the player a random U.S. state, asks for its capital, and keeps score. This keeps going until the player decides to stop playing. At the end, it prints out both the amount of correct answers and amount of incorrect answers. I took some of the advice into account that I...

 

« first day (2905 days earlier)      last day (1106 days later) »