« first day (2876 days earlier)      last day (1140 days later) » 

12:00 AM
RELOAD! There are 7429 unanswered questions (89.5309% answered)
 
 
1 hour later…
1:07 AM
What's wrong with pointers? Returning a pointer cculd pass code review, assuminng that the data held within the map is indeed const, and had no chance of being erased by some other thread. Otherwise, you have just created a bug. — Michaël Roy 29 secs ago
 
0
Q: C++ code structure

Felix MbikogbiaI saw the expression below in a dining philosophers problem, and I didn't understand it. What is this style of coding called(assuming there is a special name for it)? What does the expression do? Please help explain it to me. int right = i; int left = (i - 1 == -1) ? NO_OF_PHILOSOPHERS - 1 : (i -...

 
1:33 AM
If the code works and you're looking for advice on improving it, Code Review is the appropriate place. But see codereview.meta.stackexchange.com/questions/5777/… first. — Barmar 9 secs ago
 
0
Q: Doing a string replace

carl.hiassHow does the following look for doing a string replace in C? Is this approach more common than allocating memory within the function and returning a new string pointer, or is the bring-your-own-buffer more common? #include <stdio.h> #include <string.h> // return size of string, -1 if error such...

0
Q: Two sum brute force - works on Jupiter but not on LeetCode

mathsnovicenum = [3,6,11,15] target = 9 def twosum(numlist, target): for i in range(len(numlist)-1): for j in range(i+1, len(numlist)): if numlist[i]+numlist[j]==target: print(numlist[i],numlist[j]) return None print(twosum(num,target)) I got a runtime error, w...

 
2:02 AM
...but note that asking for code review is off-topic here. You might have better luck on Code Review. — Chris 51 secs ago
 
 
2 hours later…
3:40 AM
0
Q: Javascript Object Oriented Planner App

Morrison BowerI am creating a planner/scheduling app using objects. I am just a beginner with object oriented programming, so any tips on how to better structure my classes would be very helpful. Program Basics The program consists of "objectives" and "checkpoints." An objective is essentially a goal, and che...

 
4:05 AM
0
Q: How can I pipe two bash (shuf and nl) commands with execve?

Tech guyI'm trying to run a program that uses execve and the bash command shuf to produce a shuffled output with line numbers for each line of output in the terminal after I run shuf with execve. My program works for the most part when I run it in terms of shuffled output, but I need to make sure each l...

 
4:29 AM
0
Q: Merge two python lists that have some overlapping region

Nicole WavesI have several signals (the current one is delayed from the previous one). By properly compensating the delay, I can make an overlapping region between 2 successive signals. I want to create one signal by merging the two signals, so that overlapping region doesn't count twice. And I want to do th...

 
 
1 hour later…
6:31 AM
0
Q: Check equality between an objects array property and an object property and return a new object

user3378165On my app I'm checking the equality between an objects array property and a nested object property - based on the results I return a new objects array. The items objects array: [{name: 'test', value: 1, category: 'a'},{name: 'test2', value: 2, category: 'b'},{name: 'test3', value: 3, category: 'b...

0
Q: Determines the roots of a Quadratic Equation in C

KaizukeA code that determines the roots of a quadratic equation. Also, determine the following based on the discriminant b2 – 4ac If b2 − 4ac is positive, display: “There are TWO REAL SOLUTIONS.” If b2 − 4ac is zero, display: “There is ONLY ONE REAL SOLUTION.” If b2 − 4ac is negative, display: “There a...

 
6:57 AM
0
Q: Writing an itoa function

carl.hiassHere is a basic itoa function that I've written trying to use recursion: void itoa(int number, char buffer[]) { static int idx=0, size=0; if (number == 0) { buffer[size] = '\0'; idx = size = 0; // reset for next call } else { size++, idx++; itoa(num...

 
@PeterCordes The code reviewers at big companies can and WILL raise a red flag on this code, and you will have a hard time persuading them, and have to do very intensive tests to prove that the precision hits are in the tolerance range. — Jake 'Alquimista' LEE 6 secs ago
 
7:10 AM
possible answer invalidation by Björn Lindqvist on question by Björn Lindqvist: codereview.stackexchange.com/posts/257325/revisions
 
 
1 hour later…
8:35 AM
0
Q: Wondering about my solution with a try-catch

exer240I'm currently doing old exams from my course to train for my upcoming exam. What I'm wondering is about a code block which I will specify after I've presented the different files with code. //upggift1.cc aka the main #include "date.h" #include <iostream> using namespace std; int main() { Da...

 
8:53 AM
@Soonts Yeah, it's more or less a tradeoff. Did you ever work with multi billion companies btw? I did. I'd let your code pass if I were the code reviewer at HTC after reviewing hundreds of pages of reports filed (by you), but not at all at Samsung, GM, Ford, Boeing etc. — Jake 'Alquimista' LEE 59 secs ago
 
9:48 AM
0
Q: How to merge bulk data using EF

thomsanI have following method, public void InsertMembers(List<UserDTO> members) { List<EFModel.ClientData.Member> membersInEfModel = new List<EFModel.ClientData.Member>(); mapper.Map<List<UserDTO>, List<EFModel.ClientData.Member>>(members, membersInEfModel); using (TransactionScope scope =...

0
Q: What would be the idiomatic F# way to write optional parameters?

aloisdgIn the context of a library to generate random credit card, it would be nice to let the user the possibility to set some optional options on some cards. Lets take Visa. Two lengths are availables: 13 or 16 digits. In C# a common implementation would be: enum VisaLengthOptions { Thirteen, ...

 
10:38 AM
Optimizing working code belongs at code review — mplungjan just now
 
10:54 AM
Note that the ask for suggestions on working code, doesnt belong to stack overflow. Consider posting this on codereview.stackexchange.com the next time — Yannick Funk 49 secs ago
 
11:52 AM
Maybe check codereview.stackexchange.com if this would be on-topic there. — Fildor just now
 
12:30 PM
For refactoring help, there's codereview.stackexchange.com. Check their "What's on-topic" page before posting. — Fildor 42 secs ago
 
0
Q: Optimizing large WP Query

Olsz4kI have WP Query like this: $map_args = array( 'post_type' => 'spots', 'post_status' => 'publish', 'posts_per_page' => -1 ); $markers_query = new WP_Query($map_args); ?> <?php if ($markers_query->have_posts()) : ?> <?php while ($m...

 
 
1 hour later…
1:46 PM
Greetings, Programs.
 
0
Q: Finding mersene primes

LOHOAn attempt to find mersene primes using the Lucas-Lehmer series n=int(input("Enter n to check if 2^n-1 is a prime:")) a=4 for i in range(0,n-2): b=a**2 a=b-2 if i==n-3: c=(a)%((2**n) - 1) if c==0: print((2**n) - 1 ,"is a prime number") break if ...

 
2:03 PM
Morning!
 
3:04 PM
@Malachi Ahoy! Happy Friday!
 
0
Q: How can the code be improved?

IvanI have been studying front-end development for 2 .5 months, I decided to switch to practice and wrote a todo list in 8 hours Please write your opinion about the code and how it can be improved (preferably in html, css too, but JS is a priority) I want to start learning React, is it already possi...

 
3:34 PM
0
Q: Abstracting device IO / glue logic in a CPU emulator

AlnitakIn my 6809 emulator, written in C++, I'm working on an abstraction to represent the wiring between emulated devices, such as the ports on a 6522 VIA, or the interrupt lines connecting a peripheral to the CPU. The abstraction uses functional composition. Each OutputPin encapsulates a developer-su...

 
3:50 PM
@TobySpeight thanks for updating that title
 
0
Q: Can't tell exactly what does this class do, the responsibilities of it?

Muhammad AhmadSo I Have this class: public class GeneralService : IDisposable { private readonly LoggingService _logginService; private readonly DataService _dataService; private readonly IServiceProvider _serviceProvider; public GeneralService(LoggingService loggingService, DataService dataS...

 
@Malachi are you still using Brave? if so, are you still liking it?
 
I use it on my personal machine, I love it. it has one drawback to Chrome though....
welll, wait maybe not....
I was going to say that I cannot sync it. but I think that maybe I can through Brave's sign in functionality.... I will try to set up Brave from this machine later
oh and the BAT Tokens..... taking off!
they are up like 1000% from when I started, and you can give them to content creators through the browser on just about any social media platform
 
yes I started earning some BAT recently
 
it has TOR functionality built in to, but I don't know much about that
when I started BAT was around like 20-30 cents
 
4:04 PM
I tried using torrents a few years back but didn't get into it much
 
I have a little bit of free money sitting in my BAT account.... LOL
are you using Brave then?
 
yes - on my phone, tablet and work laptop
it has most of the features Chrome on iOS does; periodically I wish there was a button but its not hard to type for more chars
I do find myself typing with one hand periodically...
 
does it have the cool tab group functionality? I haven't tried to use it on my Brave browser
I have been smelting aluminum lately and cut my finger trying to liberate some Copper from the guts of an electric motor, I was handicapped for a day or two until I got down to just a bandaid on it
it was a pretty good cut
any of you all use Salesforce?
 
@Malachi according to this video it does... I haven't tried it though
sorry for the double ping- I forgot that copying that URL might not include the protocol
maybe that is one thing Chrome does that Brave doesn't....yet
 
4:28 PM
lol, it's all good
are you able to sync the browser across all your devices? like the bookmarks and stuff?
 
I can see the desktop bookmarks on my phone
so it appears to be so
 
4:49 PM
and I see history from my desktop when I open the history on my phone so that appears to be syncing as well.. When I open a new tab in Chrome one option is Recent Tabs so that is a nice feature that I don't see in Brave ... yet
 
If you have working code, you just want something more efficient, SO is not the right place to ask and you might be better off on codereview.stackexchange.comMike 'Pomax' Kamermans 58 secs ago
 
5:39 PM
0
Q: Roast my program that generates random password where I implemented prng as well[Rust]

PadritonSo I wanted to start learning Rust and after 8th chapter of book I wanted to start to implement stuff so I thought of building password generator. I thought using crates will be not cool so I coded every aspect of this on my own. Feel free to roast the code to the hell this will help me. Project ...

 
Your question must be self contained. When that link rots the question and any answers become useless to future readers. Please edit your post and include the actual text of the question. Also, if the code works this question belongs on codereview. — Jim Garrison 52 secs ago
What's your problem? What isn't working? What have you tried to fix it? Is this something that should be on Code Review instead of Stack Overflow? — Craig just now
 
 
1 hour later…
6:53 PM
0
Q: Calculator in C - Parsing arithmetic expression using the shunting-yard algorithm

Andy Sukowski-BangThis is a simple arithmetic calculator, which parses mathematical expressions specified in infix notation using the shunting-yard algorithm. This is one of my personal projects and I would love to get expert advice. After compiling, you can run the program with one command-line argument: $ calc <...

0
Q: Python script that getting list of all files with specific ext starting from the current folder. Using timer for reporting about the process

SlavaBI am using a function that returns a list of all files (full path for each of them) with the given extension in the given folder and all subfolders. As the process is quite long and user can get feeling that the app freezes, every 5 seconds I write to the output the name of the file the script is...

 
7:18 PM
0
Q: 3D object in OpenGL

ArianKGI made a 3D object in OpenGL. But I think my code is extremely bad and now, I want to make my code better. Here is my code: #include <GL/glut.h> void display() { glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_POLYGON); glVertex2f(0.0, 0.0); glVertex2f(0.5, 0.0); glVertex2f(0.5, 0.5...

 
7:43 PM
0
Q: Efficiently calculate value of Pascal's Triangle using memoization and recursion

Martin BorosSo reading about functional programming, applications to dynamic programming, and learning Scala. I figured I would try it out with a popular example, Pascal's Triangle, tests against known values work out fine. Any tips for optimization? Am I doing anything totally wrong? Is there a way to do th...

 
8:08 PM
0
Q: C# Unity - Need help fixing up simple script for 2d mobile game

JJ MI am making a small phone game in unity, and the whole idea of the game is that every 3 seconds you automatically jump, and all you can do is control where you go. You stick to walls and die when you hit enemies. You have to navigate the level and hit the goal to move on to the next. This is my s...

 
StackOverflow is a site for getting help with specific issues with code, not doing code reviews. maybe you could take this to codereview.stackexchange.com instead? — Random Davis 9 secs ago
 
8:24 PM
 
0
Q: Pyramid sorting with С++

Andrij Matviivvoid heapify(int arr[], int n, int i) { int largest = i; int l = 2*i + 1; // левый = 2*i + 1 int r = 2*i + 2; // правый = 2*i + 2 if (l < n && arr[l] > arr[largest]) largest = l; if (r < n && arr[r] > arr[largest]) largest = r; if (largest != i) { ...

 
9:10 PM
@AndreasRejbrand As I pointed out in my answer there are always different opinions available, including your opinion on how experienced programmers need to be not to trip over complex code. If all programmers had limitless talent there would be no need for stack overflow, or for code reviews either. — Rob Lambden 37 secs ago
 
9:23 PM
0
Q: computed row for every row

JoffreyI had an Excel tab, but it took 4 second per cell to calculate the result... So, I have tried to make it on Panda, but now I don't know how to do that. I'd like to have the same thing that I have on Excel, but on panda. My missing row is: (Jeu - Coupon) / Total HT I need it below each cell from "Jeu

 
9:40 PM
Note that there's Code Review for this kind of questions. — Jimi 36 secs ago
@Jimi when suggesting users post on CR it would be great if there was also a suggestion like "Please read the relevant help center pages like 'What topics can I ask about here?' and 'How do I ask a good question?". In the current form the code above would likely be closed as off-topic because it is missing context, which happens frequently. — Sᴀᴍ Onᴇᴌᴀ 11 secs ago
 
0
Q: Indicating a lost signal when streaming live video with GStreamer and Qt

PatrickThe goal of the code is to display a live camera feed sent by GStreamer over UDP, and to give an indication of when the signal is lost by displaying a static blue screen instead of the last frozen frame. Qt is used to display the image, and to provide a label, and a button for taking snapshots. I...

 
@Sᴀᴍ Onᴇᴌᴀ Yes, I know. I didn't flag the question as more suitable for that site. I suggested that in Codereview this kind of question is more likely to find an non-opinionated answer (per SO requirements). I assume the OP, should they opt to migrate, will format the question in a way that is appropriate for that site. — Jimi 44 secs ago
@Zyend I think I might have needed to wrap 1000000000 in G_GUINT64_CONSTANT in data.udp_source. That is, "timeout", G_GUINT64_CONSTANT(1000000000),. I'm not sure, it has been a while. This code seems to work: codereview.stackexchange.com/questions/257417/…Patrick 20 secs ago
I’m voting to close this question because questions about how to improve working code belong on Code Review, not Stack Overflow (which is for narrow, specific questions about broken code). — Charles Duffy 12 secs ago
 
10:34 PM
Pretty interesting article about Thorium reactors :o
 
0
Q: Printing out shapes

HTML402So I had used a while True: and implemented break, because I didn't figure out a cleaner solution that infinite loop. Is that a bad practice? while True: z = int(input("Y: ")) if (z >= 0 and z <= 20): break for x in range(z): print("-" * (z-x) + "*" * x + " " * x + "-" * (z...

 
10:58 PM
I’m voting to close this question because it is asking for a code review. ask on Code ReviewDaniel A. White 29 secs ago
 
11:28 PM
0
Q: decode `IEnumerable<uint>` to string made of 1 byte characters (eg., ASCII)

SoleilI'm looking for a more elegant or more efficient way to transcode a IEnumerable<uint> (~ array of 32bits int), which is a compact way to represent a byte[4] array, into a string as array of 8bits char: public static string UintArraytoString(this IEnumerable<uint> x) => string.Concat(x.Select(o =

 

« first day (2876 days earlier)      last day (1140 days later) »