« first day (2923 days earlier)      last day (1105 days later) » 

12:01 AM
RELOAD! There are 7534 unanswered questions (89.4757% answered)
 
 
3 hours later…
3:30 AM
0
Q: Multi-core OpenCV denoising

YehudaI have ~40,000 JPEG images from the Kaggle melanoma classification competition. I created the following functions to denoise the images: # Denoising functions def denoise_single_image(img_path): img = cv2.imread(f'../data/jpeg/{img_path}') dst = cv2.fastNlMeansDenoising(img, 10,10,7,21) ...

 
4:04 AM
@IgorZhirkov: Yup, same reason I left sub rsp in my version (and for the benefit of people porting it to 32-bit code). If you were actually optimizing for speed you'd use a multiplicative inverse (like this code-review Q&A, and that would save more cycles than avoid sub/add. :P See also other links at the bottom of my linked answer for some blogs where people have experimented with x /= 100 and splitting that up to get some ILP, and other things like that. — Peter Cordes 41 secs ago
 
 
2 hours later…
6:02 AM
0
Q: C++20 : Ndim Matrix, broadcasting, np.dot() and np.matmul()

frozencaI've improved my N-dimensional C++20 matrix project (C++20 : N-dimensional minimal Matrix class). Implemented general matrix addition/subtraction, elementwise multiplication/division, dot product, matrix product, reshape, transpose. There's a lot of code: ObjectBase.h #ifndef FROZENCA_OBJECTBASE_...

 
 
1 hour later…
7:18 AM
0
Q: Perform sum of squared numbers without using for loop

ashofphoenixI have to find the sum of number after performing square operation in the given input the negative numbers need to be ignored. The input Format is, first line is number of test cases followed by N as number of test inputs in new line followed by N space seperated numbers. The task need to be done...

 
Monking
 
I think this should belong in the CodeReview: codereview.stackexchange.comyunzen 37 secs ago
 
7:35 AM
Monking
 
7:55 AM
I’m voting to close this question because this question belongs more to Code Review community, not StackOverflow. — sophros 42 secs ago
 
8:33 AM
0
Q: An elegant way to handle Event subscriptions?

Roland DeschainIf I have a class instance as Property, which has events and changes based on user input (for example, the user selects one from a list), I often find myself doing the following: public MyClass MySelectedInstance { get { return mySelectedInstance; } set { if (mySelectedInstan...

 
9:23 AM
0
Q: JS diff algorithm simplify

DmitriVTo get an interview for my first job junior position I have been asked to make algorithm diff that shows difference in two texts, and shows output in one line below ( https://dmitri.fi/diff.html ) code here ( https://github.com/DmitriVlassenko/Diff-algorithm ) Only JS,Html & CSS for some reason !...

 
 
1 hour later…
10:51 AM
~mumble ... Monking.
 
11:05 AM
0
Q: Java GUI numbers to letters converter

DenijsI have this program, where I have java GUI and I wanted to ask if anyone would help me with a code in private class ActionRun to let user input numbers and output it's alphabetical order. For example - input - 135 output - ace How would I build this using Stringbuilder, I've tried anything but I ...

 
11:19 AM
@Mast Yes! that's my question, was wondering if my question was too vague or if I did something else wrong
 
@barryodev I have no experience in Go so I don't know what is required to provide a good review, but I think you're at least missing some module, require or import statements.
Apart from that there's nothing wrong with your question. Could it be better? Sure. It could be more complete and the text could be more descriptive, for example.
If you're looking for a checklist of sorts, you could start here.
I still look at that from time to time when posting questions.
 
12:03 PM
okay thanks mast, I'll keep that in mind
 
12:38 PM
@Vogel612 Did you just wake up?
 
1:05 PM
Ugh my company's infrastructure team is pissing me off
Everything is designed around Mac, and I have a PC, so I have to make a bunch of blind assumptions about how it works on PC and shoot-from-the-hip constantly
"Here's a .sh which does some of the stuff for you" thanks but...I don't have a .bashrc because Windows and PowerShell...so I guess I'll rewrite it.
 
1:22 PM
Is a VM an option?
 
For a Mac? No. And I have to build COM-compatible DLL's for some platforms, which means I would have to run a full Windows + Visual Studio in a VM, which is...complicated.
 
VM the Mac on the PC, not the other way around.
And yes, I realize you'd be opening a completely different can of worms.
 
You can't run OS X in a VM IIUC
Well, you can (there are methods) but it's "illegal" / TOS violation
 
Exactly.
Which totally stops every developer from even attempting it /s
 
So I would have to VM my PC, but i would need a pretty significantly powerful system.
I have a one-on-one with my manager today, going to broach the subject and see if we can't find a reasonable resolution
 
1:36 PM
The easiest solution might be using 2 systems.
 
Yeah, that's the only other thought I have. Literally no other team has to deal with this type of issue >.<
 
Medi Madelen Gwosdz on May 05, 2021
A look at how to get started with TypeScript.
 
@DerKommissar If there were more people dealing with this, I'd probably recommend setting up a Remote Desktop Server. That's the enterprisey method of getting everyone a Windows environment.
But if you're the only one and developing on an already good working PC, just put a Mac next to it.
 
We refuse to use any VDI-style environment here (thank god)
I'm not the only Windows user, I am however the only one who has to use Windows.
 
Good. I hate them. But they can be useful at times. Rarely for developing though...
 
1:48 PM
Most other teams (first off: are bigger) have one or two people who are their designated "infra" people and those members usually have Mac's. They're also the team SDET and other things.
 
@pacmaninbw ya. ... Sun was already up when I went to sleep
 
2:22 PM
If it's fully functional without bugs, post on Code review instead. — Llama 41 secs ago
Try codereview.stackexchange.com because that site is better suited for this kind of "how can I optimize my code" questions. — Rickard Elimää 19 secs ago
Thank you very much for replies, thanks for link to codereview, I will try it next time — MetropolisCZ 16 secs ago
 
@DerKommissar You can run a windows in a VM on Mac, not great but does work.
 
Yeah but I want to avoid that
If the options are:
1. Windows VM on a Mac;
2. Rework the documentation for PowerShell / etc.;
I choose 2 lol
 
2:41 PM
This question may be better suited for the Code Review stack exchange — C_Z_ 24 secs ago
@C_Z_ is there a Code Review stack exchange? I was unaware! Sorry, then! ':) — Fabio Craig Wimmer Florey just now
 
0
Q: Efficiently read a file into a (C) string using POSIX APIs

Ray HamelExactly what the title says, this is a C++ class that attempts to read a file into a null-terminated string as efficiently as possible, using POSIX APIs. Obviously this is not intended to be portable code (other than between POSIX-compliant operating systems and GCC or clang), and the Slurp class...

 
3:03 PM
Monking
 
3:15 PM
0
Q: How to refactor a method with many prameters that sets a bit array

MassI've written a method that is going to set a bit array by passing bool parameters to be able send correct command private byte _mode; public void SetConfiguration( bool mode1, bool mode2, bool mode3, bool mode4, bool mode5, ...

0
Q: How to make this algorithm faster. Calculates and searches through large arrays

BreakwinIve got this algoritm thats quite. The comments in code give examples of how large the various data types could be. My cpu usage is less than 10% when running this and ram usage is good. no leakage or anything. I have a list of arrays. where each array is x coordinates. We are storing a list of s...

 
maybe we could play language bingo- e.g. spot three posts in a row from Capt. Obv. with a common language (or tag) and mark a spot.... I guess we would need to have a board of some sorts...
 
3:31 PM
Are we bored yet?
 
Mznonkg
 
3:54 PM
Years ago now I had the pleasure of stumbling across a strange rule in a coding standard: No arithmetic in a return statement. Turns out a few years earlier one of the programmers found a bug in the compiler that cranked out hilariously wrong assembly for 64 bit math in a return statement. The compiler vender wasn't interested in fixing the bug, but they did fix it in the next version, and the dev team couldn't just dump the compiler and use a different one, so an administrative fix got bolted onto code reviews. To this day I rarely do anything significant in a return statement out of habit. — user4581301 15 secs ago
A better implementation of this: codereview.stackexchange.com/q/138557/146810, and another approach using real function pointers: codeproject.com/Articles/204509/Functors-in-VBAGreedo 40 secs ago
Are you asking for a Code Review? — Fred Larson 37 secs ago
 
0
Q: Num++: A numpy implementation written in C++

LinnyI've recently found myself in need of several numpy functions in C++. I've decided to write my own header-only implementation of the numpy.array, including functions that I most commonly use in my projects. The biggest piece of advice I'm looking for is memory management. I create a lot of tempor...

 
yes, i'm asking for a code review. i'm new here, would appreciate any help.thanks. — raja 51 secs ago
My previous comment was a hint that we have a separate Stack Exchange site specifically for code reviews. I think this question would be better asked there. — Fred Larson 42 secs ago
I’m voting to close this question because it is asking for a code review, and therefore should be asked on Code ReviewFred Larson 13 secs ago
 
4:36 PM
You'd be better off asking this on codereview.stackexchange.comevolutionxbox 27 secs ago
Welcome to Stack Overflow! if you post on Code Review please read the help center pages like How do I ask a good question? - in its current form this post would be considered off-topic because the code to be reviewed must be embedded in the question itself. — Sᴀᴍ Onᴇᴌᴀ 33 secs ago
In fact HashMap::new() does not require the key to be Hash. Note that in the docs there are several impl blocks, and only this one requires the key to be Hash. About your code, maybe it is more appropriate in CodeReview? — rodrigo 37 secs ago
Keep an eye on your goto use. goto is an almost-never tool because it almost always leads to convoluted code. And even when it is the right tool for the job, the social stigma makes it exceptionally hard to get through a code review. I find that on the few times I've used it, I've spent more time defending that use that I would have rewriting the code to not use it. — user4581301 53 secs ago
thank you for your comment. I don't know what is code review is it a platform or a tag on stack overflow ? — khalilw1 28 secs ago
 
raf
Hi, I was wondering if there's a way to display line numbers in the code blocks in the questions, answers, and chats. I think it would be great to have that feature. Quora is providing that feature already. Is showing line numbers possible in SE too?
 
4:53 PM
@raf Probably won't happen. You could ask on Meta Stack Exchange. We have two questions on Code Review Meta which are unlikely to be resolved.
17
Q: Code Prettify - Line numbers?

PhrancisSE sites use Google Code Prettify for code formatting. While it's still up in the air as to whether we would be able to get SE to use community-voted code formatting, I've been experimenting with Prettify. There are a few options for line numbering in Prettify, and I was interested to know what...

 
Best bet is likely a browser extension
 
@raf yes a former CR moderator created a userscript to add checkboxes next to each line... that could be modified to just add numbers instead of checkboxes
s/yes/yes - the best bet is likely a browser extension/
 
@SᴀᴍOnᴇᴌᴀ :D
 
0
Q: I wonder why there is an r prefix in REGEX, Prints REGEX output

sherloock print (re.sub('\s+', ' ', 'hello there there')) print (re.sub(r'\s+', ' ', 'hello there there')) These Two codes print same output. hello!!!!!!there!!!!!!!there I wonder why I should use r prefix in REGEX and why output is same. Is it bad to use r prefix in REGEX? (What would ...

0
Q: InterviewBit Problem: Stringoholics

Setu Kumar BasakI am trying to solve https://www.interviewbit.com/problems/stringoholics/ InterviewBit problem. But I got Time Limit Exceed Error. I followed the below approach: With respect to a single string, the total number of bits rotated after N operations is 1+2+3+….+N which is (N*(N+1))/2. We get back t...

 
@raf What I do when I need line numbers, is copy the code to my IDE or editor.
 
5:21 PM
Questions asking for feedback on working code are not on topic for Stack Overflow. Instead, please see Code Review. — Shepmaster 29 secs ago
 
0
Q: Request for suggections/corrections - Simple number guessing game in python

rajaThe problem is to ask the user to guess a number between 1 to 100 and compare it with a random number of that range. If user guessed number is lesser/greater than the random number print "too low" or "too high" accordingly. Take new input asking the user to guess the correct number again. When th...

 
raf
@Peilonrayz oh okay!
@DerKommissar which extension?
@Mast yes, I didn't think that way at first! :)
 
5:47 PM
0
Q: Rust Book Ch 13 Closures with Generic Parameters and HashMap for memoization

khalilw1I have been reading through the rust book. I have made it to chapter 13, at the end of the section called (Storing Closures Using Generic Parameters and the Fn Traits) a couple of improvements are described and left as kind of an exercise. The task at hand is to change the cache implementation to...

 
You don't happen to have a decent Python program laying about that's good for copying entire folders/directories including their metadata, do you? @Peilonrayz
I keep running into PermissionError with my shutil-based one.
I'm tempted to os.system("xcopy") the darn thing.
 
6:13 PM
@Mast No, but I'd be using shutil so... we'd probably run into the same problem
What's the error?
 
PermissionError on write.
xcopy with some proper parameters doesn't fail though, so I'm blaming shutil.
This project doesn't have to be cross-platform luckily.
 
SO have a good comparison question between all the shutils but... I can't find the darn question now. Why are unanswered posts getting higher results than the 500 vote one 🤦‍♀️
@Mast Never come across the error before, how are you making directories?
 
Perhaps you may like to check this discussionRedu 41 secs ago
 
@Peilonrayz I created the target directory by hand, I'm not sure whether shutil will create a directory if it's not already in existence.
Anyway, xcopy source destination /i /s /e /h /z seems to work.
So, who needs proper functions anyway...
sigh
It's too easy to write crap that just works.
 
Hmm, I think shutil.copytree should be a one-liner
 
6:23 PM
now = datetime.now()
big_function()
then = now
now = datetime.now()
print(then, now)
@Peilonrayz Oh, I was using copy2
 
copytree uses copy2, so... probably have the same problem then D:
Note: I found the shutil answer, stackoverflow.com/a/30359308
 
@Peilonrayz And copytree (not listed) is basically a layer above copy2?
 
IIUC copytree is basically just copy2 but walks child directories
@Mast Yeah, subprocess.run() is probably the easiest. subprocess.run(["xcopy", "src", "dest", ...]) or subprocess.run(..., capture_output=True).
 
6:38 PM
@Peilonrayz That would be slightly safer than just using an os.system, right? More feedback options.
The program can't continue until the backup is done either way, so it doesn't matter for me if it's a blocking call.
 
subprocess.run is the preferred option now. IIRCos.system spawns a shell, but subprocess.run doesn't unless you use shell=True. Should also have more bells and whistles too.
 
os.system runs in the same windows as the rest of the program, I have no idea what it does under the hood.
I'll see if I can integrate subprocess.run without unfortunate async side-effects.
 
run is blocking
 
I didn't think I'd ever say this, but, good. That's actually good here.
 
I've been working on a project where we don't want any blocking. Yeah... strange XD
 
6:46 PM
Oh, that was strangely easy to integrate.
Just swap it out 1:1
I wonder if it's going to make a difference speedwise too.
Doubtful, it's an I/O-heavy operation, but still.
 
I think you meant to post this on codereview.stackexchange.com. Questions like "does this look correct?" are not really on-topic. But a little feedback: it doesn't really make sense that you supply 4 points for the constructor of every type (new Square(0, 0, 0, 1, 1, 1, 1, 8) should not be allowed) — Xerillio 58 secs ago
SO is for questions that have an objective answer to a specific problem, which isn’t possible for code review. Check out: stackoverflow.com/help/dont-ask Try posting here instead: codereview.stackexchange.comJBallin 40 secs ago
This might be a better fit at Code Review. codereview.stackexchange.com/help/on-topicRetired Ninja 15 secs ago
 
7:05 PM
0
Q: Quadratic Probing Hash Map - questions about implementation and testing

jkoskelaQuadratic Probing Hash Map Looking to improve my quadratic probing hash map. Here are some design considerations and questions. Implementation is made such that the hashing function, probing function and load_factor can be changed. Changing them can be done by switching macros in the header for ...

 
7:55 PM
0
Q: Bin-packing-problem - is there a way to do it better?

Jan DvořákI have finished our first version of bin-packing-problem script, but would like to ask you, if there's a better way to organize boxes? Boxes should be organized to save as much space as possible, to make the "main" (blue) box as small as possible. But in some cases boxes do not organize well. ...

 
8:11 PM
If you're looking for feedback, then post your question on codereview.stackexchange. It's a community like SO but for feedback instead of issues. — Emiel Zuurbier 46 secs ago
If you are still interested, I wrote a related question on code review : codereview.stackexchange.com/questions/260122/…Eric Duminil 37 secs ago
 
0
Q: Incorrect Output. Can't get the largest and smallest number

SanjanaThe title is pretty self explanatory i guess. I keep getting the wrong max and min numbers. largest = None smallest = None while True: num = input('Enter a number: ') if num == 'done': break try: y=float(num) except: print ('Invalid Input') continue if largest...

-1
Q: Extremely inefficient code written in C++

HelloI am moving this question from stackoverflow https://stackoverflow.com/questions/67407274/extremely-inefficient-code-written-in-c?noredirect=1#comment119145723_67407274 . The computation time for the following function is very high. I am calling the following function from R using Rcpp package. I...

 
8:33 PM
you could probably ask this in code review community, not stack overflow. — aSaffary 31 secs ago
if you post on Code Review please read the help center pages like How do I ask a good question? - in its current form this post would be considered off-topic because there is little context about what the code does and how the function is used, plus the title is about CR goals instead of describing what the code does — Sᴀᴍ Onᴇᴌᴀ 17 secs ago
Thank you all for the tipps. Im new and didn't know the difference with Code Review ! Barmar: it works, thank you ! — Latiole 22 secs ago
 
9:36 PM
possible answer invalidation by klmr on question by klmr: codereview.stackexchange.com/posts/260270/revisions
 
0
Q: Minesweeper in Python Needs Flags and Smiley Face amid small tweaks

Javesike1262Me and a friend of mine started coding a minesweeper game in Python but we need help on adding the right click function of the flag and the smiley face. Here is the code: import random import tkinter from tkinter import * from tkinter import ttk from tkinter import messagebox root = Tk() root.ti...

 
@Duga Fine
 
 
2 hours later…
11:57 PM
@pacmaninbw not bored... just think it would be cool to be able to capitalize on trends
 

« first day (2923 days earlier)      last day (1105 days later) »