« first day (3132 days earlier)      last day (55 days later) » 

12:00 AM
REFRESH! There are 7938 unanswered questions (89.2603 answered)
@hamdikafali if you do post on CR please read the sql tag first - it has specific guidelines about how to include sufficient info. — Sᴀᴍ Onᴇᴌᴀ 41 secs ago
12:24 AM
Q: Given Array and 2 ints return the smallest distance between based on index

user252016public class Diff { public static int findMinDiff1 (int[] a, int x, int y) { // runtime efficenecy: linear o(n),depends on a.length // memory efficenecy: 1+1+1.. n int temp_x = -1; int temp_y = -1; int min = Integer.MAX_VALUE; for(int i = 0 ; i < a.length ...

1 hour later…
1:39 AM
Q: Safely and Quickly Trim a Byte Array of Audio in Java

Nerdy BunzI'm trying to take a raw byte array of audio and trim it. The user selects a start and end value using a range slider. // args are doubles from 0.0 - 1.0 // audio is uncompressed, 16-bit, 44,100hz, MONO public static byte[] trimBytes(byte[] fullLength, double from, double to) { int startingB...

Welcome to Stack Overflow. Code review is off-topic here. You might have better luck on Code Review. — Chris 8 secs ago
2:37 AM
@JohnKugelman, it may not be on-topic on Code Review, but this question is not on-topic here either. — Chris 25 secs ago
2 hours later…
4:09 AM
Q: Functional programming (Python)):Conway's Game Of Life

Brandon HamerThis is a working code of Conway's game of life. How can I translate the repeating lines into more concise code instead of checking the cell's neighbor manually? What are the best practices or functionalities that I can implement into my code to make it more readable and execute in fewer lines? i...

Q: Mergesort unstable as Implemented?

MPCI just had a realization about Mergesort possibly being unstable depending on how it is implemented while reading this post https://www.quora.com/Is-merge-sort-a-stable-sorting-algorithm. Would the merge method below lead to an unstable algorithm? private static void merge (Comparable[] arr, Comp...

1 hour later…
5:24 AM
Q: Converting Audio Bytes to Array of Floats for Visual Representation

Nerdy BunzI'm trying to write a Java function that will take a byte array (of PCM audio recorded on Android) and return an array of data of floats that is intended to be used to create a visual representation of the audio wave. The visual wave doesn't need to be super high resolution, so the number of elem...

7:04 AM
Q: strcat_new() function, not present in standard C library

Amitstrcat_new() function, not present in standard C library. Syntax: char *strcat_new(char *delim, long num_args, ...); The code is below. Can someone please do the code review: strcat_new.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include "strcat_new.h" /*...

1 hour later…
8:31 AM
possible answer invalidation by user252016 on question by user252016: codereview.stackexchange.com/posts/270505/revisions
8:44 AM
Q: ASP.NET Core dependency injection in class library with params

Enrico RossiniI know this question could be the new variant of other 1million questions but before you say that, let me explain what I'm trying to achieve. I have a lot of APIs and want to create an SDK. There is an API for each function (Statistics, ApplicationLogs, Transactions and so on). To use those servi...

9:02 AM
If you want feedback on your working code, post a question over on CodeReview. — maloomeister 5 secs ago
9:34 AM
Q: Given an integer N, returns the smallest integer greater than N, the sum of whose digits is twice as big as the sum of digits of N

Ashwani kumarWrite a function: class Solution { public int solution(int N); } that, given an integer N, returns the smallest integer greater than N, the sum of whose digits is twice as big as the sum of digits of N. Examples: 1. Given N = 14, the function should return 19. The sum of digits of 19 (1 +9 = 10) ...

9:52 AM
Sorry, but this not how Stack Overflow works. We don't do code review. Also code you want us to look at must be in the question, not a link. The is a code review site, but again they won't look at a project link, so review their rules carefully. — greg-449 just now
Q: How can I make this removelines script more efficient?

James GeddesI have written a Python3 program that looks for matching strings and removes them from files. import os path = os.getcwd() ignore_files = ["remove-lines.py", "to-remove"] with open("to-remove", "r", newline="") as pattern_file: remove_patterns = [l for l in (line.strip() for line in patte...

10:24 AM
Q: Merge two Dataframe with condition

mahdi h I have 2 datafarme And need result, date of datefarme 2 between date of dataframe 1 result = A of datefarme 2 add in datafarme 1 import pandas as pd df1 = pd.DataFrame( columns=["date", "C"], data=[ (pd.Timestamp("2020-10-10 10:00:00"), 0 ), (pd.Timestamp("2020-10-...

10:49 AM
Q: Resolving circular references in VBA via ObjectStore class and CleanUp cascade

PChemGuyResolving circular references in VBA via ObjectStore class and CleanUp cascade I have been working on a VBA database library and realized I had a few circular reference loops in my class hierarchy, as illustrated in the figure (left panel). I recalled reading an RDVBA blog post about the circular...

1 hour later…
11:57 AM
possible answer invalidation by Amit on question by Amit: codereview.stackexchange.com/posts/270524/revisions
1 hour later…
1:19 PM
Q: Type checking optional class properties

qouifyI'm using python3 + mypy in some project of mine. I have some classes in it of which the objects have some optional attribute, in the sense that the attribute can be None or contain, for example, an int value: import typing as tp class C: def __init__(self, a: tp.Optional[int]) -> None: ...

@Duga Rolled back and commented.
1:38 PM
@Peilonrayz This question has been edited, since you hammered it shut I'm not about to vote to reopen without your input.
2:07 PM
@pacmaninbw There's been no changes to the code since my hammer. The code is still nearly identical.
That's what I thought, is there a change between that question and the previous question?
If you are of the opinion wrapping things in a try and changing "\n\n\n\n\n" to "\n" * 5 makes the question not the exact same question then please do feel free to reopen.
I'm not, it is basically the same question. Leaving it closed.
2:26 PM
On a side note @pacmaninbw. I deleted the indentation comments yesterday on the dupe target; rev3 (when you commented on the post) fixed the code from having SyntaxErrors from bad indentation.
@Peilonrayz I think you may have caused an AI, there was an answer that commented on the indentation.
Answers to off-topic questions are already invalid - I can rollback to rev2 (to handle the AI), close the question (because the code is broken), rollback to rev{latest} (to fix the problem) and then reopen the question.
But I think leaving the question is probably the cleanest solution.
1 hour later…
3:37 PM
Side Note- you're using AzDev for PR's but doing the code review externally? Is that actually better than using the built-in review functionality in AzDev for the code reviews? — TTT 27 secs ago
"Just doesn't feel right" does not a good SO question make. Suggestions for code improvements are a better fit for codereview.stackexchange.comJuan Mendes 20 secs ago
4:09 PM
@pacmaninbw now RBA by OP
4:24 PM
This isn't a complete enough snippet for codereview.se either, though. — ggorlen 9 secs ago
5:10 PM
Q: Allow caller optional flags for returns

Glenn TeitelbaumChecking return flags is generally very important. But, when you don't need to based on meeting pre-conditions, the syntax gets unnecessarily ugly. This class allows returning a value with flags that the caller can ignore. #include <tuple> template <class T, class U> struct retval { T val; ...

1 hour later…
6:11 PM
1 hour later…
7:24 PM
I think you might get better answers on codereview.stackexchange.comJeffUK 35 secs ago
7:42 PM
Q: find max value in islands defined by other vector

shamalaiaI have a vector of values vals, a same-dimension vector of frequencies freqs, and a set of frequency values pins. I need to find the max values of vals within the corresponding interval around each pin (from pin-1 to pin+1). However, the intervals merge if they overlap (e.g., [1,2] and [0.5,1.5] ...

Q: good practices, tips and advice for JS code

OvodaI've been learning some javascript lately and I would like some opinion on a very simple code I wrote. Coming from C/C++ I want to make sure I'm learning JS the way I should. Looking for tips, advices and good practice guide. The entire HTML content is create from JS (asked by the exercise). I h...

7:52 PM
8:08 PM
Q: Suggestions on how to upgrade HTML and CSS making a hamburger icon that transitions to "X" in the code below?

jan horukI'm interested in how I can improve my HTML and CSS? I didn't yet learn JS, even though I used it for onclick function, so I'm not currently interested in how to improve the JS in this code. I was wondering: Is it alright to use spans inside button for accessibility? First I had all divs, than ma...

Q: Use an exception to check if item in dictionary

Bart FriederichsI am using a KeyNotFoundException to check if an item exists in a Dictionary, creating it when the exception is thrown: public Section GetSection(int plankNo, int sectionNo) { if (plankNo < 1 || plankNo > NumberOfPlanks || sectionNo < 1 || sectionNo > SectionsPerPlank) { return Se...

8:33 PM
Q: Calculate of the average of time discounted values

JossyGiven the current table: +------------+-------+ | date | value | +------------+-------+ | 01/01/2000 | 1 | | 03/04/2000 | 3 | | 05/08/2000 | 4 | | 07/11/2000 | 2 | +------------+-------+ For each date I'm looking to get an average of the values for the preceding dates where...

9:15 PM
This might be better suited for Code Review since you aren't looking to fix any code (which is what Stack Overflow is concerned with) — devlin carnate 29 secs ago
Q: Machine Learning Loss Functions In C++

craftycroftI was looking for C++ versions of the machine learning metrics implemented in Python's sklearn, but they were surprisingly hard to find. I came across a website that had most of the loss functions implemented in Python, so I did my best to translate them to C++. Below is what I have so far. I pla...

2 hours later…
11:45 PM
I’m voting to close this question because if the code is working, it belongs on CodeReview for improvement, not here. — TomServo 8 secs ago
The point is that there isn't a problem to solve. You already know how to solve your problem, now you're looking to clean it up. That makes it more suited to codereview.stackexchange.com, but not SO. — Ken Wayne VanderLinde 9 secs ago
@Peilonrayz Hey
(Thats me, Fmbalbuena i changed avatar)

« first day (3132 days earlier)      last day (55 days later) »