« first day (2873 days earlier)      last day (1442 days later) » 

00:00
RELOAD! There are 7414 unanswered questions (89.5436% answered)
@ferada I think @SᴀᴍOnᴇᴌᴀ knows more about the FTPQ than I do. But IIRC the objective is for editing and commenting (to clean up mistakes) and voting (to make new users feel welcome with some nice +1s)
@ferada have you read this meta answer about the FPQ?
30
A: First Post Review Queue — what is it? Why is it a bad idea to click "No Action Needed"?

rolflWhat items appear in this queue? Overview: What are the Review Queues? History: New Review Queue: First Posts Help: Review privilege The first question a user asks, and the first answer a user provides, will be automatically added to this queue. First posts may also be added to the 'late answe...

I’m voting to close this question because this belongs on Code Review. — ApplePie 41 secs ago
@ApplePie Please do no use Code Review as an excuse to close reasons. Currently the question would be off-topic on Code Review. — Peilonrayz 6 secs ago
@Duga @Peilonrayz s/excuse to close reasons/excuse to close questions/ ?
0
Q: Writing a unit test for a maximum finding function

user10191234A while ago, I got this question as a part of an interview test which asked to write a function to find the biggest number in a vector and write all the unit tests required to show that the code works under any circumstance using any language or pseudo-code. To the best of my knowledge, one would...

00:11
I think someone needs some sleep...
@Peilonrayz I disagree and so does Code Review. codereview.stackexchange.com/help/on-topicApplePie 18 secs ago
@Peilonrayz thanks for fighting the good fight!
np ^^ should probably get back to fixing my bug then go to bed D:
Gniknom
01:05
Is this an academic exercise (i.e. professor gave you this a problem.)? Or is it because someone made an off-hand comment on your pull-request (code review) because they didn't understand your code? — selbie 33 secs ago
 
1 hour later…
02:29
Here at Stack Overflow we fix broken code. To get opinions about working code, post it at Code Review. — Klaus D. 51 secs ago
02:42
If you have working code that you're wanting to improve via peer review, you should ask your question on Code Review instead. It was created for that specific purpose. — Ken White 43 secs ago
0
Q: How to turn parameter pack to one long string function (C++)

HydrazerHi I found this code to turn a parameter pack into a string in C++ and I feel it is a bit clunky and it seems pretty slow. Does anyone have any suggestions as to how I could improve this? Thanks! Code: #include <iostream> using std::cin, std::cout, std::string; template <typename type> typename...

0
Q: Grabbing resolution and offset from xrandr

AlpGlide3(using GNU sed) I want to grab some output from xrandr and leave out everything but the resolution and offset. Input: eDP1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 290mm x 160mm 1366x768 60.02*+ 1280x720 59.74 ... 640x360 59.84 59.32 60...

04:01
0
Q: Fastest Way to Generate Dummy Data

akuaniJust out of curiosity, I have this code lying around a personal project in which I will generate lots of dummy customer data. Here's the code: faker = Faker() # Faker.seed(random.randint(0, sys.maxsize)) async def get_random_customer_login(count: int, user: CustomerLogin_PydanticIn) -> list: ...

04:27
0
Q: String tokenizer

cgoatesObjective: Create a function called wordsAndSpaces that splits a string on groups of spaces, preserving each group of space characters as a single token. Example: wordsAndSpaces "extra spaces" gives ["extra", " ", "spaces"] Rules: Input strings will contains only alphanumeric character...

Like @ScaryWombat said, code review is the best place to ask this kind of question. Just make sure first that your program has the desired output. — ublec 34 secs ago
 
2 hours later…
06:57
I’m voting to close this question because it will attract opinionated responses, this is better suited to Code ReviewChris Schaller 35 secs ago
07:26
0
Q: Is there a better way to write a extension method to get the Sunday date from current date based on weekOffset

CoderI want to write an extension method for getting Sunday Date based on weekOffset and current date. For example if weekOffset value is 1 that means next week sunday date and if weekOffset is 2 that means next to next week's Sunday date. I have come up with below code private static List<string> Get...

If there's no specific problem you have with this program then it may be a better fit for the code review stackexchange — mediocrevegetable1 15 secs ago
07:53
Any C++ library developer/enthusiast here ?
I'm looking for someone who can review - https://codereview.stackexchange.com/q/257196/238304
 
2 hours later…
09:34
0
Q: A better implementation of the `execvp` call: the code implements `execvp`

NostradamusI'm trying to implement execvp () using execv (). I don't know if the code is the best implementation. my code: #include <string.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include <stdio.h> extern char **environ; int my_execvp(char *file, char *argv[]) { char *p, *colon, ...

10:19
This question might be better suited to codereview.stackoverflow.comevolutionxbox 45 secs ago
There is a tkinter implementation that might be useful, I think I used it in the past with moderate success. codereview.stackexchange.com/questions/162920/…ac24 31 secs ago
@evolutionxbox codereview is for reviewing of existing and working code, for improvement. — Damien 23 secs ago
10:51
0
Q: In the shortest number of characters, display from 0 - 1000 - 0 each number in a separate lines

devinateI'm doing a course, currently learning php. The Brief - Prints the numbers 0-1000-0 (every number inbetween), with 1000 only once and each number on a new line in: The fewest PHP characters you can A unique way that no other team members have used My Current Answer - 62 characters long. echo impl...

@devinate delete your question now, as you have moved it to code review site already. — Alive to Die 55 secs ago
Is the double-checking-locking a problem or what? The best way to improve working code is codereview. — Sinatr 25 secs ago
11:17
0
Q: Singleton MongoClient instance provider

fuatA Java service that connects to MongoDB in production, but opened connection count is too much. It affects on MongoDb performance, so I have come up with a solution that provides a MongoClient singleton instance only once so that will reduce the connections. Here is my code, is it a good way to p...

0
Q: Fizzbuzz questions - job interview rejected

morry239I have done some programming tasks as a part of my candidacy for a web development apprenticeship. Unfortunately, my application was rejected as the hiring manager "didn't like my codes." I called up their office but no one was able to provide sufficient feedback for me. If any of you could tell ...

0
Q: Please take a look at my gem

Rafal Wegrzyniaki'm ruby developer, and I faced some issue in my app, I thought that is more generic issue so I wrote my first gem. I know that probably there are dozens of things which I can made better. So could you look at my code https://github.com/rwegrzyniak/redis_locker. I have doubts with mainly metaprog...

11:42
0
Q: Match multiple patterns in PYTHON regular expressions using or operator

mapperxI am trying to match either of two regex patterns using or operator in python but I am getting an error: match = re.findall(a|b, str3) TypeError: unsupported operand type(s) for |: 'str' and 'str' I am trying to write a code that matches either '17' or '17A' in the string '17A, thomas street' Pat...

11:55
possible answer invalidation by ferada on question by morry239: codereview.stackexchange.com/posts/257227/revisions
@Duga Does not invalidate the answer, fixed copy and paste problem in the code.
12:33
-1
Q: java program for a game

ChavaThe Pyramid Stack GamePyramid Stack is a game of strategy that works as follows: Two players take turnsremoving numbers from 3 stacks. On each turn, a player must remove at least 1 counterfrom any stack's block (and they may remove any value available from the same stack).The goal o...

0
Q: In Rcpp, dpois(x,theta) function, theta can not be a vector?

HappyLGFIn R, the function dpois can be used as dpois(x,theta) with both x and theta being vectors. However, in Rcpp, it can be used like that. Can anyone use some function to replace the loop in the following dtpoi0 function. #include <algorithm> #include <RcppArmadillo.h> using namespace Rcpp; using n...

@CaptainObvious I don't believe this question belongs on stack exchange on any site.
possible answer invalidation by Coder on question by Coder: codereview.stackexchange.com/posts/257215/revisions
12:48
Greetings, Programs.
12:59
0
Q: How to detect a collsion in Maze game C#

MansiI'm trying to check if my player can move to a position next to it or above/below it, if that position is not blocked by a wall. If the position that the player wants to move to, is blocked by a wall then I want the player to not move to into that position. I am not sure how to do this, could som...

13:53
@pacmaninbw You use a wrong comment? "We review code that is working as expected". Do you think the code isn't working as expected?
@Peilonrayz No, I don't know if the code works, but I feel the question is not appropriate. I was explaining what CR is about.
Maybe it belongs on golf?
@pacmaninbw Probably best to not make comments on things you don't know, and the code works. Do you think having a quibble with a user over the code not working is a productive use of either of your time? Additionally discussing working/not working can easily distract from the actual problem; is the user asking to golf?
14:15
0
Q: Handling a spinner for multiple REST calls

usr-local-ΕΨΗΕΛΩΝContext In an Angular application, I have three <select> boxes that are fed from the database with a relatively small data set. These boxes are part of a filter Component that is displayed next to a server-side data table. The component outputs the filter asynchronously to the parent component, w...

@KenWhite I flagged the question asking a moderator to move it. I did not know about Code Review, my bad. — Alessandro Morelli just now
14:55
Consider codereview.stackexchange.com if you have working code, and you are looking for people to suggest optimization ideas. — Drew Dormann 46 secs ago
15:32
0
Q: A recursive function to reverse string

op ol Write a recursive version of the function reverse(s), which reverses the string s in place. I'm studying K&R and wrote a code for the question. void reverse(char s[], int n) // The seconde argument should be always 1. { // The function should be always called as reverse(s, 1); ...

0
Q: Dynamic social media component w/ dark mode

Colby Hemond**Note: This is my first post for a code review, so any feedback on what other info would be helpful to post (if any) would be much appreciated! Thanks! React component: Social.js The component has an input of 4 properties: dark: Boolean - if dark is supplied, the component renders white icons f...

0
Q: filtering element of one List from another in Scala with different tuple structure

Ashish MishraI am trying to understand the best way to write this. I have ListA and ListB. val ListA: List[((String, String), Int)] = List( (("A", "B"), 1), (("C", "D"), 2), (("E", "F"), 5), (("E", "F"), 4), (("E", "F"), 3) ) val ListB: List[(String, String)] = List( ("A", "B"), ("E", "F") ) We...

15:50
possible answer invalidation by fuat on question by fuat: codereview.stackexchange.com/posts/257226/revisions
@Duga rolled back
0
Q: Optimizing a bit manipulation formula

AurealI previously posted this question in Stack Overflow, but I was told to post it here as my code is already working and I'm just trying to optimize it. Background: I'm developing a Game Boy emulator, and because most of it is done, I'm currently trying to optimize everything as much as I can. There...

-2
Q: ⦁ Write a class that has three functions, getMonthString, getMonthDays, isLeapYear

ClarencerinoYour program should ask the user for a number between 1 and 12 only and a year between greater than 1899. If an invalid month number or year is entered, loop until a valid value is entered. Once a valid value is accepted determined, use the getMonthString function to determine the name of the mon...

0
Q: Boost.MultiArray Based Two Dimensional Array to Markdown Table Converter Implementation in C++

JimmyHuI am attempting to implement a converter which can convert two dimensional array (using Boost.MultiArray library) into markdown table. The experimental implementation #include <boost/multi_array.hpp> template<typename T> concept is_multi_array = requires(T x) { x.shape(); boost::multi_ar...

@Duga rolled back by @TobySpeight
16:19
@CaptainObvious I just read the About me for that user - its quite interesting:
> Chuck Norris is the only one who can type my name on a keyboard by using my teeth as keys, courtesy of a roundhouse kick in my mouth
0
Q: Refactor bash script that conditionally redirects output

actual_pandaI have a piece of bash code that works fine. for thing in "$things"; do output=$(my_program "$thing" 2>&1) if [[ $? -eq 0 ]]; then echo "$(echo "$output" | tail -1)" else echo "$(echo "$output" | tail -1)" 1>&2 fi done The idea is to echo the last line of the out...

0
Q: A c++ program to check a string is a pangram

OcchimaIm a noob in c++ and decided to implement a simple program that checks if a string is a pangram (if the string contains all the English alphabet letters). It's my first program in c++ and i have some background with interpreted programming languages like python and R. I want to know what are the ...

@SᴀᴍOnᴇᴌᴀ lol, some people have some funny stuff in the about me section. I recall a funny one about a cookie policy, but can't remember the user now D:
16:52
Mzonking
@SᴀᴍOnᴇᴌᴀ Wow, you found the user. :O
> ...By reading my profile you agree to my cookie policy:
Chocolate chip cookies are the best. Cookies containing bananas are not acceptable.
If you would like to opt out of all cookies please contact your local bakery, if you ask them nicely they may give you a weird look and agree to no longer sell you their baked goods.
@Peilonrayz I searched that website created by Larry and Sergey for "cookie policy" codereview.stackexchange
Oh. Never heard of the website before. Do you have a link?
@Peilonrayz google.com
16:58
Oh... thought you were talking about a SE user 😂
17:16
Elegance is overrrated. Many people think clarity is more important. This code is pretty clear as it is. In C++ (and I think C# has it to) I like implicit conversion to bool, e.g., bool is_on = data & 0x80;. But I find in code reviews that my peers think that's too ... elegant. Or something. They prefer the clarity of bool is_on = (data & 0x80) != 0;. So I've learned from them. — davidbak 45 secs ago
17:42
@Peilonrayz Larry Page and Sergey Brin
18:05
0
Q: My first java project - GUI Snake game

user239206I just got started coding in java and I just made my first project. I was wondering if someone would review my code and show me the things I can improve in it. I am eager to learn and would appreciate any advice. Here it the code: package snake.app; import java.awt.*; import java.awt.event.*; im...

 
1 hour later…
19:19
Maybe Code Review will be a better fit for such question... — Tomerikoo 48 secs ago
Code Review is a better fit for this question, but to get you started: what must be true about the distinct character-frequency pairs in str1 and str2 so that those in one can be rearranged into the other? — crcvd 30 secs ago
19:56
Ben Popper on March 16, 2021
In the second edition of our Level Up series, we explore how to create shapes, animations, and art using p5.js.
20:13
0
Q: speed up Elias gamma compression

theonlygustiI wrote some functions to compress and decompress a list of ints using Elias gamma encoding. def _reverseBits(number: int) -> int: rev = 0 while number: rev = rev << 1 if number & 1: rev = rev ^ 1 # bitwise ^ 1 is faster than arithmetic + 1 number = num...

20:53
Thanks a lot for your answer biqrboy and sorry for the delay! I tried using a set() but it didn't speed up significatively my algorithm. I check my nextnodes() as you suggested, and you were right : I could optimize here. But still, no significative speed up. Since I modified a lot of the code I posted a new question here : codereview.stackexchange.com/questions/257267/…cuzureau 52 secs ago
21:04
0
Q: How can I speed up my IDA* algorithm for N-puzzle?

cuzureauI'm trying to solve the N-Puzzle problem using IDA* algorithm with a Manhattan heuristic. I already implemented the algorithm from the pseudocode in this Wikipedia page (link). Here's my code so far : class Node(): def __init__(self, state, manhattan): self.state = state self....

0
Q: Optimization of Code

ColinAll, Trying to get this to run faster, even marginally so. Right now to update 470 rows it takes about 90 seconds. It works, but I know there are better ways. I understand calls to Spreadsheet API are slow, and batching getRanges and setValues would speed things up, but doesn't seem obvious given...

21:20
possible answer invalidation by Miguel Avila on question by Occhima: codereview.stackexchange.com/posts/257256/revisions
possible answer invalidation by Miguel Avila on question by Occhima: codereview.stackexchange.com/posts/257256/revisions
@Duga Wat, was only one edit
Not AI but not allowed editing, but the OP accepted ugh...
1
Q: Rails. Order number creation

ViktorI'm having an issue optimizing it properly. So I'm having an order number generator that looks like this get_date = Date.today.strftime('%d%m%Y') last_value = Order.where(created_at: Date.today.all_day).order(:created_at).last&.order_number&.split('-')&.last.to_i + 1 self.order_number ||= "#{get_...

21:43
Also note that if you don't want solutions, and your code works, but it's just not efficient enoiugh, this is probably the wrong place to ask and codereview.stackexchange.com might be a better place for this question. A post to SO generally requires a real answer, not hints. — Mike 'Pomax' Kamermans 10 secs ago
Since you haven't appeared to post this to Code Review yet, I'll offer some suggestions as I've taken a look at the problem. First of all, and most important, is that it's critical to optimize your sequential code before looking at parallelization. If the algorithm is inefficient, parallel streams can only do so much. "250 seconds to play 10,000 games" is a red flag here and makes sense from your description of the algorithm. Constructing all n! permutations and iterating through them repeatedly is not the correct approach to take here. — bliss 11 secs ago
Thank you for those answers. Will consider link for those kind of questions in a near future. — chalatum just now
22:06
@CaptainObvious Not enough code to help optimize and the code that is provided is hypothetical.
Since it almost has no code in it I closed it as authorship.
22:19
@Peilonrayz This is C++ optimization requires a lot more code.
@pacmaninbw Source?
And the actual binary manip operation might look something like this
@Peilonrayz The compiler might already be optimizing the line of THEORETICAL code they provided. Stack Overflow obviously bounced it because there wasn't enough code to answer the question.
We have no way of knowing what the possible bottlenecks are.
@pacmaninbw The code is real, I can literally see it.
No you can't they prefaced it with And the actual binary manip operation might look something like this
There is no actual code in the question.
@Peilonrayz ^^
@pacmaninbw You've assumed SO bounced the question right?
22:30
@Peilonrayz The very first line in the question states that SO told him to bring it here.
Sorry I meant to say "for that reason" afterwards. Because normally they only bounce requests for Code Reviews not "there wasn't enough code to answer the question".
@Duga this was the comment on SO where users recommended that c++ question about binary manipulation be posted here
The question is no longer on SO, so I can't look at it closer.
@Edward @TobySpeight @Peilonrayz Do you have enough information to help this person optimize their code
> The question would be better with more code, yes.
What code?
There isn't any code in the question.
@Peilonrayz ^^
22:46
@pacmaninbw I quoted my response to your comment. "I sorry, but one line of hypothetical code doesn't give us anywhere near enough code to help you. If you could supply 3 or 4 functions or an entire class we might be able to help you optimize the code."
0
Q: Coding to trim off the first n and last n character from a string using if ... else (Python)

OrianeI am a perfect beginner in Python and I have to hand out an exercise to my teacher. The instructions are: def trim(s, n): """Trims off the first n and last n characters from string s, and prints the result. Prints the given string unchanged if parameter n is less than or equal to zero. >>> trim('...

23:44
@Peilonrayz 1) I'm sorry but I'm under a lot of stress this week. My car had to be towed to a shop on Friday, and Friday night the mechanic told me to sell the car because it was junk. 2) Were you agreeing with me or disagreeing on that post?
23:56
Hmm... you just built ints with 1000000+ digits, and now you call 150+ digits "huge"? :-P — Manuel 1 min ago

« first day (2873 days earlier)      last day (1442 days later) »