« first day (3093 days earlier)      last day (41 days later) » 

12:02 AM
REFRESH! There are 7883 unanswered questions (89.2773 answered)
 
12:19 AM
0
Q: Mean and variance of element-wise distances in a set of multi-dimensional arrays in Matlab - follow-up

JimmyHuThis is a follow-up question for Calculate distances between two multi-dimensional arrays in Matlab and Mean and variance of element-wise distances in a set of multi-dimensional arrays in Matlab. For avoiding calculating distances and average twice, I am trying to propose a different implementati...

 
 
3 hours later…
3:46 AM
Monking
 
 
1 hour later…
Monking
 
5:35 AM
possible answer invalidation by Xeнεi Ξэnвϵς on question by Xeнεi Ξэnвϵς: codereview.stackexchange.com/posts/269214/revisions
 
 
1 hour later…
6:58 AM
0
Q: date wise user login and logout time in django any querys?

prashanthI used this querys any help to solve this below query?? This is my model class AllLogout(models.Model): user = models.ForeignKey(Account,on_delete= models.CASCADE) login_time = models.DateTimeField(null=True,) logout_time = models.DateTimeField(null=True) def __str__(self):...

 
7:23 AM
0
Q: First C program - Tic Tac Toe

bobHi I am a beginner and l would love to hear your opinion on my first C project, how can it be improved in any way, for example dynamic memory allocation isn't used in the program because I didn't quite understand where to allocate it, also I couldn't figure how to solve the problem that if input ...

0
Q: Python weighted choosing that works with very large numbers

Xeнεi ΞэnвϵςI have written a function to choose randomly with weights from very large data sets in which the weight of elements can be several thousands. The input of the function is a flat dict, the keys can be any object and the values must be positive ints, and the values represent the count of the elemen...

 
 
1 hour later…
8:28 AM
I’m voting to close this question because it's asking for a code review and should therefore be posted to codereview.stackexchange.com — Rory McCrossan 31 secs ago
Python doesn't really have type checking, the "equivalent" is code reviews, testing, and error handling — Sayse 19 secs ago
 
9:13 AM
There's a Code Review site where this might be better suited (but check their on-topic guidance first of all before you post) — ADyson 16 secs ago
 
9:27 AM
-2
Q: How do I make this piece of code better?

CaraAre there any things that could be improved? How can I make it more efficient? <!DOCTYPE html> <html lang="id"> <head> <meta charset="utf-8"> <title>Theoretical Test</title> <style> .body { background-color: blue; } li.q { color: green; } .m { font: italic 100% "Comic Sans MS"; } div.s { border:...

 
9:48 AM
I’m voting to close this question because this is a review request, which belongs on CodeReview.SE — MSalters 25 secs ago
 
10:17 AM
1
Q: Serializing (nested) data structures in a human-readable format with all bugs fixed

Xeнεi ΞэnвϵςSee Serializing (nested) data structures in a human-readable format for more details. This is the latest version, I have fixed all bugs and now this piece of code works completely as intended. And I have added many more test cases. So far all tests are successful. I think I can't find an edge cas...

 
 
2 hours later…
11:54 AM
If you want us to review your code you better go to [codereview.so]. But be sure to take their tour and read their faq first! — Ocaso Protal 5 secs ago
Code review: when you test for <200 in the if, you don't need to test for >=200 in the next else if. Right now a 200 value falls between the cracks! — Hans Kesting 18 secs ago
 
 
1 hour later…
1:05 PM
I’m voting to close this question because it isn't a programming question. It might be on-topic on Code Review. — Chris 13 secs ago
 
 
2 hours later…
3:17 PM
0
Q: "Namespacing" project names

MikeTI see this all the time. For example, if I create a new Blazor WASM solution, it comes with 3 projects: MyApp.Client MyApp.Server MyApp.Shared Is there any particular reason or advantage to this as opposed to MyAppClient etc?

0
Q: Design of a threaded class in C++

user1538798I am designing and coding for a class which should handle the following task Connection to A (first task I should be doing, I believe every other task should be blocked before Receiving of commands from A (asynchronous) Detection of drop of connection from A (asynchronous) Issue of commands to s...

 
Perhaps better relocated to code review. — S3DEV 30 secs ago
Appreciate it guys, I'll move it to code review! — SnazzyJoe 41 secs ago
You might consider posting this on Code Review, that site is more suited to giving detailed feedback to code that has been completed and works. StackOverflow is more geared towards helping solve people's problems/bugs in their code. — Random Davis 32 secs ago
 
3:36 PM
Monking
 
See also Haskell functions to extract and reverse integers hiding in strings. (I have the same naming complaint here as there: your "toDecimal" is actually "fromDecimal" and vice versa! (Plus of course you intend to support more than just decimal.) — Daniel Wagner 52 secs ago
 
3:57 PM
"it feels clunky" is not a specific problem - Stack Overflow is for specific questions with definite answers. For general feedback on working code, please ask on codereview.stackexchange.com instead. — kaya3 47 secs ago
 
0
Q: How to restart the entire program until the user chooser '0' for an input

SnazzyJoeThis is my first question on codereview and was hoping for some input from you guys. I'm currently working on my first mid-term project for my first programming class with no programming background. The basic gist of the project is to collect information from the user about the size of a group of...

posted on October 22, 2021 by TKoL

I've ran a few tests, not extensive though, and it apparently works. Like many standard binary search algorithms, if the number returned is < 0, you can take the complement (~) of the returned value to find the insert point, eg const ix = bs(arr, 5); // ~ix is the insertion point interface bsRange { min: number; max: number; } const bs = (arr: number[], value: number,

 
4:31 PM
0
Q: Recursive Binary Search in Typescript

TKoLI've ran a few tests, not extensive though, and it apparently works. Like many standard binary search algorithms, if the number returned is < 0, you can take the complement (~) of the returned value to find the insert point, eg const ix = bs(arr, 5); // ~ix is the insertion point interface bsRang...

 
4:52 PM
This is not for review. Use Code review Stack Exchange instead. However, note that badly formatted questions also will be downvoted there. — tacoshy 16 secs ago
 
5:21 PM
0
Q: VSCode Python formatting 'black' - Disable if I use matrices

ZPlaya7I use VSCode with Python and the formatter 'black'. If I code a matrix, I use line breaks, after running the code the line breaks disappear and black does what it wants... Is it possible to disable this with a simple command? I saw some examples (for Java with 'prettier') like: write above the li...

 
5:33 PM
Once the code works, you can try posting it on the Code Reviews stack for some critical feedback. — JDługosz 55 secs ago
 
5:46 PM
0
Q: C# Console Application with Try Catch in Main Program That Does Not Throw the Exception

ADHI have inherited a C# console application with a try catch in the main program that does not throw the exception. What is the advantage of not throwing the exception? It seems to me that it would make more sense to throw the exception. public class Program { private static readonly ILog _log ...

 
6:08 PM
if the code reviews maybe code review SE site would be better — depperm just now
Please review the details about asking on the CodeReview stackexchange — OneCricketeer 18 secs ago
"Can I override a method in Java to let in do nothing?" - Yes, you can. --- We do not do reviews over here. This post might be better suited for Code Review. — Turing85 33 secs ago
 
6:29 PM
FYI: there is CodeReiew.SE where you can ask review of your code with requirements... — kelalaka 6 secs ago
 
6:44 PM
possible answer invalidation by AwokeKnowing on question by AwokeKnowing: codereview.stackexchange.com/posts/269231/revisions
 
6:57 PM
I love that you're excited about your code and that you're enthusiastic about making it better! Unfortunately, Stack Overflow is meant for helping you with code that isn't working. If you'd like recommendations about improvements, check out Code Review instead. (And if they don't like it for some reason, the batch subreddit is always happy to receive new content.) — SomethingDark just now
I’m voting to close this question because it belongs to codereview.stackexchange.comAivean 36 secs ago
 
0
Q: Best practice for overriding a method in Java to let in do nothing

Reid CI have some code to refactor, this is how it looks right now: class A { public void foo() { //do A //perform validation //do B } } I need to implement a new method bar that does exactly what foo does, and skip the validation step: ...

 
7:19 PM
"Better" according to what criteria? Without objective requirements, "better" is entirely subjective. For code improvements, visit CodeReview.SE. SO is meant for code correction. — outis 37 secs ago
Is there a problem with it? Does it compile, does it do what you need it too? If so, you could post this on Code Review to get a better response. — ryyker 28 secs ago
Perhaps this should get moved to CodeReview? — Joshua Voskamp 55 secs ago
 
7:50 PM
@Joshua Voskamp: I am kind of new on StackOverflow. I hope I didn't break any unspoken rules posting it here instead of CodeReview. Since I am curious: simply put: what is the difference between CodeReview and StackOverflow? (Although I have my suspicion that CodeReview is more for noobs such as my self :-p) — fredericoamigo 43 secs ago
@ryyker thanks for the suggestion! I've never heard of code review, I'll check it out now. it works mostly, unless under 10 miles which wasn't the intended design. — Ethan Banks 26 secs ago
This kind of question where it works, but you want to improve it, is probably better suited to Code Review. — Chris 31 secs ago
 
8:06 PM
@EthanBanks "it works mostly, unless under 10 miles which wasn't the intended design." means your code is not working as intended, and so is off-topic on Code Review. Please do not post on Code Review. — Peilonrayz 43 secs ago
 
0
Q: How to optimize the Scipy correlation code in order to reduce the run time

ApexThis script is to calculate the Spearman correlation of genes that are rows of the original data frame. The original df has around 2000 row names which with my code 2000*2000 loop should be run in order to have the correlation value for each possible comparison row-wise. With that said I would li...

 
@Chris The question as posted would be off-topic on Code Review. Question on Code Review must have the code in the question, not a description of an algorithm in English. When recommending other sites please at the least note any major changes required to prevent the question from being closed in a heartbeat on the other site. Otherwise your good intentions are likely to cause the user to have a bad experience on not just one but two Stack Exchange sites. — Peilonrayz 53 secs ago
 
8:41 PM
0
Q: How to check if an email address has StringDiacritic

dcazI want to generate a report of every email address that has a diacritic. I know how to get every email address and I have a nice function that will remove the diacritic if there is one. I have an no idea on how to generate a report that tells me the following people have the following email addre...

0
Q: How do I structure a reusable react component from this code?

sbadenI have redundant code that I'm trying to figure out how to refactor into a reusable react component. Not sure if that's the best solution... I would appreciate any guidance. I'm making an HTTP request to get data multiple times from different components in my react app. case 'feed': const ngs...

0
Q: Batch/Powershell program to retrieve system info

BoogershutThis is my first time coding! My intent for this program was to be able to give my technicians a flash drive that will pull system info and email it to me. Currently everything is working, but I was hoping for suggestions or tips on what I can improve on or add to it. I'm sure there is a lot of m...

 
 
1 hour later…
9:56 PM
0
Q: How can I redirect iframe javascript code to an external site?

Adam_GI am struggling with the code below. It was given to me by another researcher, and while I have a lot of coding experience. I have very little web development experience. The code below runs an experiment, which is embedded in an iframe. When the experiment concludes (prompt >= 4), the webpage sh...

 
10:12 PM
 
10:27 PM
Since this code works, it probably belongs on codereview.stackexchange.comStephen Newell 45 secs ago
 
10:46 PM
0
Q: How to avoid excessive for loops in C++

BrianI have been trying to write a small test program and I was trying to think of any potential optimization I could do, especially if there is any chance to avoid some of the for loops. The program has Dad class, a Child class and a DadChild class that holds the IDs of the Dad and Child objects that...

 
11:11 PM
0
Q: How to proper implement HasChanges patter for model

Roman MarusykThere is the following method that should get record from the database, apply new data, and if at least one value has been changed, update database and send event We don't use EntityFramework, it uses CosmosDb SDK in the repository. I'm not sure how is the proper way to implement hasChanges. publ...

 
11:24 PM
If your code works, try submitting to Code Review. — Thomas Matthews 16 secs ago
 
11:58 PM
You should create a minimal reproducible example with only one button and nothing else and get that to work. You can edit the question to add your mcve if you continue to have an issue. StackOverflow is also not for code review, to get your math calculations checked you could post to codereview.stackexchange.com or perhaps math.stackexchange.com though I think the latter is usually just math notation not algorithm source code. — jewelsea 57 secs ago
 

« first day (3093 days earlier)      last day (41 days later) »