« first day (2845 days earlier)      last day (1174 days later) » 

12:00 AM
RELOAD! There are 7303 unanswered questions (89.6452% answered)
 
12:33 AM
This sounds more like a topic for Code Review than Stack Overflow, as you've essentially posted what you claim to be working code and are asking for general feedback. If, through your testing of this code, you discover it is not behaving as expected, then that would be an appropriate question to ask here provided that you back it up with testing methodology, findings and an actual question. — paddy 46 secs ago
 
12:51 AM
@Phil1970 It was Pseudo code to illustrate what I was trying to achieve, it wasn't meant to be compiled. But, yes, you are right. The lambda would need a capture clause for the bool flag, and the arguments that are passed into the outer function body as its parameters. Last night I worked on a hierarchical structure related to this same application design that I presented here, with that in mind and the way it turned out. I may go with that instead. I may supply its implementation here as an answer, then follow up with a new question based on that, which may be posted here or on Code Review. — Francis Cugler just now
 
1:07 AM
0
Q: Simple read/write lock implementation without starvation

JMRCI've built a read/write lock and have been testing it without encountering any problems. It was made to avoid writer starvation, but I believe it works against reader starvation as well. I've seen alternatives online, but was wondering if this is a solid implementation. If you use a normal shared...

 
1:37 AM
Please go through the intro tour, the help center and how to ask a good question to see how this site works and to help you improve your current and future questions, which can help you get better answers. You're asking for a code review and open-ended advice, either of which is off topic here. — Prune 20 secs ago
 
1:57 AM
0
Q: Copy an array using pointers

TomIs this a correct way to copy elements from array origin to array location? #include <stdio.h> void copy(const int *origin, int *location, int n){ int i; for(i=0;i<n;i++){ location[i]=origin[i]; } }

0
Q: Snake game in C++17 with SDL2

Tom GebelI implemented a simple snake clone in C++, using SDL2 for the graphics part. Gameplay-wise, its pretty much classic snake: The player is able to control the snake with "WASD", food gets spawned randomly and if you eat it, you gain speed and length. The game is lost once you collide with yourself....

 
Hello, it seems like this might also be pertinent to post in codereview.stackexchange.com. SO is mainly for non-functioning code :) — Jacob Faib 16 secs ago
 
 
3 hours later…
4:39 AM
 
5:22 AM
Monking
 
 
2 hours later…
7:29 AM
Hello and welcome to SO! Please take the tour, and read How to Ask. Those kind of questions better asked in codereview. — Tomer Shetah 53 secs ago
 
8:13 AM
0
Q: Scala coding... easy reading and understanding?

David MartinezI am pretty newbie in Scala, my background expertise is basically Java and Python, and I'd like to know your thoughts about this code snippet written in Scala to know if this is a "regular piece of code written in Scala" or if this is something kind of "obfuscated" and overcomplicated. The code j...

 
9:04 AM
0
Q: axi stream data generator

drakonofAn Axi Stream Data Generator which can take data from both file or just an counter. This ip needed for me as a testbench component for interfaces which work on one hand as an AXIS slave and on the other hand Ethernet, pcie and etc. A struct module `timescale 1ns / 1ps module axis_data_generator ...

 
9:30 AM
possible answer invalidation by Chris on question by Chris: codereview.stackexchange.com/posts/256062/revisions
 
9:46 AM
That being said, Stack Overflow is a site not for code reviews or for general app architecture reviews but for specific programming problems. So maybe your question as it is now should better be asked somewhere else. Regardless of whether you plan to publish your app on Google Play, their quality guidelines may help you to decide which way to go Build high-quality appsBö macht Blau 1 min ago
This seems correct, as far as I can see. What's the question? If you just want feedback on the code and how to improve it, then you should probably try posting this on Code ReviewVLAZ 41 secs ago
 
10:19 AM
0
Q: How can I shorten this program using Luhn's algorithm to check credit card number?

Ole Henrik Flekstad Vikimport math def luhns_algorithm(num): argument_is_integer = isinstance(num, int) number = num #from this number we will get every other digit every_other_digit = [] #we will append every other digit to this list not_every_other_digit = [] #we will append ...

 
11:09 AM
0
Q: C# - Linq - Techniques for avoiding repeating same pieces of code

Muráncsik SebestyénI am writing a piece of code for C# Web Api, letting the clients to pass a column name and sort direction as parameter. Although there are, like, 30-ish properties, so the following code (despite it works) gets ugly after a while. What are my options to avoid repeating this seemingly same pieces ...

 
off topic for this site - for code reviews, post in codereview.stackexchange.com/questions/tagged/javafx :) That said: why questions are hard to answer - my (educated) guess is too much dissent about api and not enough resources to resolve them in time (for fx9, when the skins went public). BTW: conceptually, Control is the model, Skin is the View/Controller - the former must not access the latter (there are high-level design papers somewhere, searchable and findable <g>) — kleopatra 31 secs ago
 
11:26 AM
If this is working code that you think could be improved, see Code Review. — jonrsharpe 43 secs ago
 
12:12 PM
If this is production code, then there are a couple more issues apart from the SQL injection risk. I would think it has no use strict, because the variables aren't lexically declared with my. And there's no need to put quotes around $select when you pass it to prepare. If I got this code in a code review I would not pass it through. — simbabque 5 secs ago
 
12:43 PM
Maybe this question is more suitable for CodeReviewangel.bonev 30 secs ago
 
0
Q: Does this ARM assembly code to convert a decimal into binary follow “good practice”?

SimonHI'm "playing" with ARM assembly on a Raspberry Pi, reading various tutorials and posts to help - no, it's not a college assignment, I'm too old for college! I'm pleased with getting the following code to take a decimal value (between 0 and 255) and output the binary string equivalent to the scree...

 
Thanks. About the second approach, I'm thing something like RAII, which means I need to track all the call-stack of every function, if an inner function knows it has called from a toplevel function(like we need a locker in toplevel function call), then the inner function will not send the event, we can send an event in the destructor of the locker. Something like this: codereview.stackexchange.com/questions/66417/…. I am not familiar with the term Aspect Oriented framework, any good resource about this framework for C++? — ollydbg23 15 secs ago
 
1:41 PM
I’m voting to close this question because this is a question better suited for code review codereview.stackexchange.comwundermahn 20 secs ago
possible answer invalidation by Chris on question by Chris: codereview.stackexchange.com/posts/256062/revisions
 
didn't know, I'm correcting that. — Chris 2 hours ago
Manual RB
 
2:09 PM
I was hoping you'd use my feedback in comments to tighten up your code before posting on codereview.stackexchange.com and deleting this mostly-off-topic SO question. (It's ultimately asking for an opinion on good style, and/or a code review.) Not to answer this question :/ But yes that's an improvement to one thing at least. — Peter Cordes 27 secs ago
 
2:30 PM
0
Q: Dispatch a pod for each entry in CSV

Seanny123I use Argo Workflows to dispatch lists of jobs defined in a CSV. I accomplish this by chaining a bunch templates together, which involves: Breaking up the CSV file into individual JSON objects Parsing the JSON into parameters Actually passing the parameters to individual pods The YAML which acc...

 
3:20 PM
0
Q: Bisection search is giving no value

Shaurya GoyalI am doing the Assignment 1 part c from MIT OCW. The question is to find a percent of monthly income saved so that you can pay the down payment in 36 months. My code: salary=float(input("Enter your annual salary: ")) cost = 1000000 semi_annual_raise = 0.07 low = 0 high = 10000 down=0.25*cost #d...

 
Yes, apologies, newbie error. I jumped the gun following previous comments here and went to Code Review. I'll delete this from here anon. Thanks again. — SimonH 33 secs ago
 
Ben Popper on February 16, 2021
In today’s tech industry, statistics and data science are becoming increasingly important and valuable skills.
 
3:36 PM
Greetings, Programs.
 
3:50 PM
possible answer invalidation by chandu_reddim on question by chandu_reddim: codereview.stackexchange.com/posts/256064/revisions
 
4:09 PM
@Duga Rolled back with message.
 
When you have working code, but look for performance improvements, then the question is more suitable for Code Reviewtrincot 32 secs ago
 
@CaptainObvious broken
@pacmaninbw thanks
 
@Peilonrayz closed
 
4:25 PM
possible answer invalidation by Peilonrayz on question by ERJAN: codereview.stackexchange.com/posts/256058/revisions
 
@Duga I am the answerer. Also not the code
 
4:37 PM
0
Q: Efficient vector-like polymorphic container which retains type information

CyrusThis is my attempt of implementing an efficient, cache-friendly, vector for polymorphic objects. From now on I will refer to "virtual functions" as functions which are dependent on an object's underlying dynamic type, though they might not be strictly marked "virtual". MEMORY MODEL OF POLYMORPHIC...

0
Q: Lookup an array against another with performance

ÁlvaroI got an initial array, I am checking against another array to find how many objects have at least one instance of the Domain in data. I wonder if there is a more performant way to achieve the same goal. const data = [ { Domain: 'google.com', '# Reocurring Domains': 0 }, { D...

 
4:49 PM
Monking
 
5:21 PM
21
Q: Why does my PC crash only when my cat is nearby?

StuntddudeI have a cat and he likes to walk around behind my desk, which is where my PC is. Somewhat frequently (at a rate of several times an hour) while he is doing this, the screen will suddenly turn black and after a few seconds, the fans stop spinning and the computer restarts. At first I thought he m...

 
Working solutions that need refactoring would be a better fit for Code review. — El_Vanja 27 secs ago
 
6:02 PM
Code improvements are done at CodeReview. — Just learned it 47 secs ago
 
6:13 PM
Monking
ugh - darn winter storm - 36+ hours without power - now working at relatives house
 
0
Q: If print html code in php is correct?

user237785I'm just doing a community portal and I have a little problem. Well, on the main profile there will be a board with information about the user in three columns, each with three information. My problem is that I did displaying the html code in php. I have a question if this code is correct or it i...

0
Q: Finding prime numbers in C

TomSo, I wanted to make a function which will return nth prime number when calling it for the nth time(it should return 2 when I call it for the first time, 5 when I call it for the second time, then 11...). I had a problem with this until I discovered static int which solved my problem. Since I am ...

 
6:34 PM
colab is directly equivelent to an IPython Notebook, but you have no control over the compute resources you can access. It's possible you are only allocated a single cpu core, and therefore adding multiprocessing just adds overhead. hard to tell.... Otherwise I might recommend you take this over to CodeReview considering your code is already working at the moment. — Aaron 24 secs ago
 
7:14 PM
Improvement of working code usually belongs in Code Review, not Stack Overflow. However, due to the specialized application, you might get some responses here, as well. However, we need you to do more analysis of the problem. Since you are worried about execution time, you should provide your profiling statistics. — Prune 5 secs ago
 
7:25 PM
It looks like you should post it on codereview.stackexchange.com instead. — Zsolt Meszaros 52 secs ago
I’m voting to close this question because the code works. It should be posted on codereview.stackexchange.comZsolt Meszaros 1 min ago
@ZsoltMeszaros are you sure? Code review is for open ended feedback, this seems like a specific request. — VLAZ 5 secs ago
@VLAZ Now that you're asking, I'm not sure, but it seemed to me that OP asked how to improve an already working code and code review seemed to be the correct place for that. Wouldn't this question be flagged here as opinion-based? Should it stay here? — Zsolt Meszaros 59 secs ago
 
7:57 PM
Monking
@skiwi EMC
2
Electro magnetic cat
 
0
Q: Call by name untyped lambda calculus interpreter in Coq

Molossus SpondeeI made a very simple interpreter of the untyped lambda calculus in Coq. I'm still very new with formal methods and I'm sure I'm doing a lot of things very wrong. The spec is also very very weak currently. For example, a bug with the stack fully permitted by the spec caused an infinite loop. Fulle...

 
IMHO someone is just as likely to miss calculating the difference between the before and after test count as they are to miss an incorrect function name in the diff. I don't see any benefit to this, since tests should be automated and code review should be the norm, but regardless, there is no count output for go test. — JimB 43 secs ago
codereview.stackexchange.com might be a better place to post this question. — R. Richards 54 secs ago
 
8:48 PM
0
Q: how to rewrite double nested sql query for better readability?

ERJANI have solved the task of Delete the companies that made the least number of flights. the visual table diagram is here. The exercise is here This is my source code -it's "arrow antipattern" , what is more elegant solution? the inner most counts num of flights and groups by company, this is used...

0
Q: How to reduce cyclomatic complexity for this pipe in Angular 11

TimbaHow could I improve my code? Any idea? import { Pipe, PipeTransform } from '@angular/core'; import { Images } from 'src/app/interfaces/images/images.model'; @Pipe({ name: 'filter', pure: false }) export class FilterPipe implements PipeTransform { transform(value: Images[], filteringString:...

 
9:11 PM
It seems to me this question is more suited to be asked in the Code Review Forum. Code Review is a question and answer site for peer programmer code reviews. — itprorh66 1 min ago
Probably belongs on [codereview:se] — Seth 18 secs ago
 
9:38 PM
0
Q: How to clean up If-statements?

Joseph LeeSo I'm new to javascript and I made a discord bot that would serve food and drinks and wanted to have it reply without the need of a prefix which I have done. My issue is that I want to try cleaning up the code and get rid of all the If-statements but I don't know how to do so. bot.on("message", ...

 
10:28 PM
0
Q: Replacing removed secure empty trash feature

user237800Is this code reliable? Is there any extra precaution I should or should not be taking here? How is my code to securely delete a file by repeatedly overwriting the contents? #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <time.h> int main(int Argc, const char *Argv[]) { sr...

 

« first day (2845 days earlier)      last day (1174 days later) »