« first day (2846 days earlier)      last day (1186 days later) » 

12:00 AM
RELOAD! There are 7311 unanswered questions (89.6354% answered)
 
0
Q: Python speed up dataframe writes

johnny 5Sorry, I'm very new to python. I'm aware that iterating frames in pandas is a very slow operation. I've heard vectorization speeds things up. I found a project that I'm using for sentiment analysis on reddit. The Calculate dataframe method wasn't working for some reason, (maybe different vers...

 
12:59 AM
0
Q: Common named constants for shared use across project

tomocafeI want to keep some common default values in a header file to be shared across a project. I've come up with 2 approaches: Global constexpr expressions wrapped in a namespace Class with static constexpr methods, similar to std::numeric_limits Which of these is better? Or is there a better third ...

 
1:19 AM
Sounds like you want Code Review instead of SO. — SuperStormer 27 secs ago
 
 
1 hour later…
2:36 AM
you should go to code review stackexchange — mightyandweakcoder 34 secs ago
 
2:52 AM
Consider posting that as part of an answer on Decimal to binary conversion in ARM assembly on codereview.SE. — Peter Cordes 27 secs ago
 
 
1 hour later…
4:21 AM
0
Q: Find Permutations of String in Scala

Kevin Meredith Given a smaller strings and a bigger string b, design an algorithm to find all permuta­tions of the shorter string within the longer one. @ def findPermutations(large: String, small: String): Int = large.sliding(small.length) .toList .filter(_.toSet == small.toSet) .leng...

 
4:47 AM
0
Q: This code can run to send email & sms notification to customer. Need to make some changes, to ensure no emails sent if email in the object is null

user237808I'm stuck to make some changes on this coding, to ensure no emails sent via bpaNotificationService if email in orderContacts object is null, so it doesn't throw error logs? And also to include an info logger to say that "not sending email because no email is given". This is only if it's email not...

 
5:16 AM
Monking
 
 
3 hours later…
8:08 AM
0
Q: Stack of integers in C

NiingI'm learning C, and currently I follows C99 standard. Here is my implementation of integer-stack, which is just a stack you can do: push, pop, and print the content of the stack. I need some feedbacks to increase performance/readability or anything you think important, thank you. int_stack.h: #i...

 
8:53 AM
@Nastor I agree this question needs work, but that's not a very friendly way to say so, nor terribly accurate. Stack Overflow questions don't always have to involve already written code, like Code Review questions do. Often you have part of a function written and you need help with the rest, and that's a good question. But questions like "I have a Foo, and in Kotlin I'd just call bar on it, but Java's Foo doesn't have a bar method; what am I supposed to do?" can be fine too. — amalloy 9 secs ago
 
9:48 AM
0
Q: How to avoid "Trying to access array offset on value of type bool" with simpler code in PHP 7.4.14?

alevSometimes my code return an array, sometimes it's empty. In PHP 7.2.34 I can check if an array key value is set in specific way, even if the variable is no array. (when I get the array from the database, it can happen that the option doesn't exist and no array is returned, making my variable $my_...

 
10:07 AM
Improving existing code is more appropriate on Code ReviewTomerikoo 17 secs ago
 
0
Q: My widget-heavy matplotilb GUI atomic surface simulator is way too slow

uhohThis script simulates atomic patterns with hexagonal lattices on surfaces, and their Fourier transforms (FTs) and will be used to compare visually to measured data (the two currently blank squares). I'm using matplotlib widgets for a GUI to adjust many parameters, and after each change the image ...

0
Q: My solution for exercise 1-23 from the book "The C programming language"

mark coderExercise 1-23: Write a program that remove all comments from a C program. Key idea: if the start of a quoted string is detected, then I call a function that prints the entire string. handled '"', '\"' else if a start of a single line comment is detected, i use a second function to skip it. else ...

 
10:39 AM
I think that for your case Code Review is a more suitable place, as this is not even a question on your part. Only thing that I could tell you right away is that the use of s2 is completly useless when you already have the sheet at s1. — Raserhin 38 secs ago
 
11:04 AM
0
Q: Python - Inheritance: sharing objects across instances

svacxpythonUse case - motivation & challenge Hi all! I have been working with Python for the last two years, but never learned proper object-oriented programming and design patterns. I've decided for this year to close this gap by reading some books and applying the knowledge to a real-world problem. I am l...

 
11:47 AM
Hmm just reading about options.. Am I too far down the rabbit hole yet?
 
0
Q: Following up on: A simple multithreaded FileLogger in C++ is my code implementing the suggestions well?

Melvin RoestI'm new to C++ and am following up on: A simple multithreaded FileLogger in C++ In there the top answer (made by uli) was an extensive review. I implemented his review and posted it as an answer. It was suggested to me that I post my code as a new question. I am curious to know if I implemented h...

 
12:19 PM
0
Q: How to optimize loops and apply reducer for array?

DenI have the follwing code: let drawRegistryPolygonsId = []; registryLayers.forEach((r) => { r.forEach((_r) => { const drawSourceId = this.MapLibraryService.interactiveMap.getSourceId(); drawRegistryPolygonsId.push(drawSourceId); this.drawPolygon(_r, drawSourceId); });...

0
Q: Is there a way to make this algorithm more efficient?

alex108The exercise i am working on requires me to read a binary sequence stored in a text file. The objective is to find the occurrences of all subsequences of length between a and b (their values are given in the function parameters) and put them in a list of tuples. For example: If the following bina...

 
12:53 PM
0
Q: Google Foobar - my code runs in IDE but fails in foobar

pr3ttykittyI'm completing the "Google Foobar" challenges - each challenge poses a question and provides two test answers to try your code with. My code returns the correct output in my IDE (thonny) on my computer, but fails the tests within Foobar. I think I am missing something about how the code is called...

 
1:06 PM
@Peilonrayz thanks for your comment. I'm not sure if you had time to catch my reply before I deleted so I'll cc here that I'll at least temporarily delete it and give the situation some more thought.
 
@uhoh Thank. Yeah I saw it straight away. :) Happy I could help some
 
1:19 PM
0
Q: Global Dictionairy Class

QoheletFor a Django-Server I use several custom Error-Codes, error-titles and descriptions, possibly other fields might follow. I'm using right now a basic global dictionary. {'512': { 'errorno': 512, 'errordescr': "Database Down", 'toDo': "Restart the database, Server: "+ser...

0
Q: Ιncreasing dice roll sequences

George DontasThe problem was How many sequences of 9 dice rolls are increasing (e.g. 223444556). Ok, I know the answer is given by choose(14,9) but i just wanted to play around with dplyr. A fast but not elegant way: library(tidyverse) expand.grid(data.frame(matrix(rep(1:6,9),ncol=9))) %>% filter(X1<=X2 & X2<

 
2:10 PM
possible answer invalidation by toolic on question by mark coder: codereview.stackexchange.com/posts/256133/revisions
 
It was -6F when I woke up where I'm at today.
 
Greetings, Programs.
@DerKommissar It was a balmy 19F here.
The NWS is calling for 6-12 inches of snow here starting early tomorrow morning.
 
I got 12" Monday evening / night
Well, 12.4"
Total snow on the ground is 17" here
 
2:27 PM
It was 45F here yesterday, so we had some melting.
 
2:47 PM
We don't "optimize" code either, thats what CodeReview.Se is for. — Paulie_D 16 secs ago
 
2:57 PM
"Is the linter correct and if so why?" -- It's correct in enforcing the standard Go naming conventions, specifically the part about Initialisms. As for why it didn't catch Js: No heuristic can be correct in all cases. — Flimzy 53 secs ago
 
0
Q: Cleaning up USB implementation & use - SysLat Cleanup #3

SkewjoHere's my open source project: https://github.com/Skewjo/SysLat_Software Today I'd like to attempt to clean up my USB implementation. Header file here: https://github.com/Skewjo/SysLat_Software/blob/master/USBController.h Implementation here: https://github.com/Skewjo/SysLat_Software/b...

 
3:24 PM
When you've worked out what you want to achieve and you have implemented it, maybe look at security.stackexchange.com/search?q=tls+config or codereview.stackexchange.com. If you're stuck trying to implement, you will likely find the answer in the docs or on this site. — sehe 36 secs ago
 
3:49 PM
0
Q: Cleaning up static member variable declaration and definition

SkewjoI have several static variables in my dialog class that I'm declaring in the header and then defining immediately in the cpp file. They are being used in an application with 2 threads, and these particular variables are mostly shared between both threads. Main thread that runs the dialog box and...

 
4:24 PM
@DerKommissar We had -17C (2F) last week.
Crashed a couple of highways, but the country survived.
 
4:46 PM
Ben Popper on February 17, 2021
There are benefits to being a technical lead at a less software intensive business.
 
Probably better suited for Code Review. — Seth 33 secs ago
 
@Duga Fine
@uhoh Let us know if you require further assistance with your post. If you're willing to put in the effort to make a good question, so are we.
Feel free to start with the obligatory FAQ.
 
5:10 PM
Probably better for Code Review. — Seth 31 secs ago
@Seth 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. — Sᴀᴍ Onᴇᴌᴀ just now
 
@Duga such a simple reply:
@SᴀᴍOnᴇᴌᴀ true... — Seth 29 secs ago
 
MOnking
 
@CaptainObvious I knew not of such a challenge - must be aware of that when seeing "foobar" and watching out for hypothetical code
 
@SᴀᴍOnᴇᴌᴀ It's quite popular.
 
Can't ask in Code Review, code is too short — Lucas Maracaipe 37 secs ago
 
@Mast I see it is by invite only.... I guess the one person who I know worked at Google never mentioned it to me...
 
You could look at some of the questions already posted on CR mentioning parameters. For example, I posted this question 5+ years ago using argparse. — Mast 59 secs ago
 
@Duga impeccable timing...
 
Then please add your code. Also, please consider posting your code at Code Review if it works in general, but you just want to optimize it. — Wiktor Stribiżew 29 secs ago
 
5:34 PM
@Duga A comment box called - said it's running out of comments...
 
@CaptainObvious @TobySpeight this is on-topic now, right? I believe I saw you had commented on it earlier, requesting more context and it appears more context has been added
 
0
Q: JavaFX Custom Control

DbSchemaI created my own JavaFX component, using the code below. I used the Behavior to intercept the keyboard shortcuts. The Behavior is accessible only using '-add-export' directive. This means is not intended to be accessible by default. Why? Maybe my approach is not the correct one? Can you please re...

 
6:10 PM
@CaptainObvious sounds like user doesn't fully understand why directive needs to be used? thus is off-topic?
 
6
A: Frequently Posted Comments

Nick UdellQuestion asking for help understanding code Unfortunately this question appears to be off topic because it is about understanding code. [The point of a code review is to identify things about the code that can be improved and discuss possible improvements](//codereview.meta.stackexchange.com/...

 
0
Q: Dirt Bash hack to run the ssh connections in the Parallel mode

Karn KumarA Few years back I used to opt the below method to run the shell program in a Parallel way to open multiple ssh session at a time to get a quick result. I know there are various other good utilities available, however due to some pressing needs I've to use this way, this dirty piece of code works...

 
> In it’s current state, you code wont compile (whilst you’ve removed the code that creates op2,op3,op4 you haven’t removed all the code that references them), so I’ve voted to close.
Posts an answer anyway...
@SᴀᴍOnᴇᴌᴀ Don't forget to VTC.
 
6:40 PM
@Mast done
darn internet connection issues
 
@SᴀᴍOnᴇᴌᴀ Is your power back on at home?
 
@Mast yes - will return later today
some people around the city still don't have power apparently
 
Do they know what caused it yet?
It has been cold before, I presume.
 
> A series of historic storms has hit our communities, bringing three waves of snow, ice and wind. As each storm rolls in, more ice builds up on trees and power lines, that causes more and more trees and power lines to fall.
 
Then again, around here the powerlines are beyond sturdy and a lot of the smaller ones have been dug up and replaced by underground wiring.
If the poles are so fragile, stop using poles.
I haven't seen a major outage in town since I was born.
 
6:53 PM
@Mast wat, I've not been following the weather but it's been pretty warm in comparison here. Does the golf stream or something go over the Netherlands?
 
@Peilonrayz The jet stream passed just south of us and everyone right above it got cold.
 
@Mast I'd be very worried if the overhead powerlines started failing here :P
 
@skiwi Considering there's up to 400 kV between them, yea, I'd be too.
Although I happen to know they're very, very securely watched and automatically shut off if they break.
 
@Mast Ah thanks. TIL the gulf stream and jet stream are different. One's nice and warm the other... not so much
 
@Peilonrayz Someone told me the jet stream is what's usually keeping the polar winds near the pole.
If it acts up and goes south too far, the polar winds get a bit south too.
They suspect it'll act up more often due to climate change, but I don't really understand how they're linked exactly.
 
7:00 PM
More instability basically
 
Probably.
 
That makes sense
 
-1
Q: Python: Compare the positions (x,y) of stars in two csv files of different length

mmfrancoI have two csv files containing the positions of stars (x,y) in pixels identified with photometry. I have generated the position (x1,y1) in pixels of artificial stars (file1), and added them to an existing image with real stars to test the photometry (file2). I want to compare the positions in th...

 
7:17 PM
While you're here anyway, have you tried JupyterLab? @Peilonrayz
I've always been a bit hesitant about the notebooks, but it looks like they got a fully fledged IDE around it nowadays.
It's even part of the Anaconda Navigator.
 
@Mast I've used Jupyter like once or twice, I was trying the new case match statements. It didn't seem bad, but I'm happy to dev in IDLE so... I have a sibling who likes Jupyter. But I've never tried JupyterLab.
That being said the mixed code and Markdown could make it a good tool for CR answers
 
I'm considering using it as an advanced debugger, writing markdown-annotated code in it during the discovery process of a program. You know, the phase where scope creep is still a major problem.
 
Since this code works, you're question really belongs on codereview.stackexchange.com. An SE moderator would have to move the question for you. Or you could just copy and paste. — villecoder 11 secs ago
 
Could be helpful for CR answers as well, indeed.
You can spin-up a virtual environment running any Python version in no-time nowadays with the navigator, have JupyterLab in it, write an annotated answer and nuke the whole instance afterwards.
 
@Mast What IDE/editor do you currently use?
 
7:27 PM
No, that is not expected. As I wrote, the time complexity is already at a minimum. If you have questions specifically about performance, then you should really go to Code Reviewtrincot 30 secs ago
 
@Peilonrayz It depends. Some of my projects are in Notepad++, some in Spyder/IDLE/Pyzo.
I'm about as bad with sticking to an editor as I'm with finishing my projects.
6
I also don't like closing tabs.
I'm starting to think me and @skiwi are related.
2
It's truly getting ridiculous at times.
I still have sketches of unfinished projects in a drawer that were started 7 years ago.
Doing something poorly is better than doing nothing at all.
I know that, I just don't do it...
The perfectionist in me has to shut-up more often.
 
I've never used Spyder or even heard of Pyzo. I'll admit I only used Conda when I didn't know how to set up a C compiler with pip. I'd give it a go. It also seems you don't really need most of the bells and whistles that come with IDEs, so it probably won't hold you back. And you could find some nice bells and whistles
 
I don't need whistles, I need organisational tools.
I think...
 
@Mast I feel that. I've use Notepad++, Atom, VS Code, PyCharm, vim, IDLE... I like VS Code and PyCharm (Professional) the most, because of the bells and whistles. I mostly use VS Code atm 'cause I'm on Windows with WSL atm
 
What are some of the bells and whistles you actually use a lot?
 
7:43 PM
I mostly use in editor linters, rename tools (PyCharm had a really good one I miss), documentation lookup from types. And then things like VS Code over SSH or WSL, git graphs and other language integration like LaTeX, graphviz and reST.
 
@Mast thanks for your encouragement, I think my script simply wasn't ready for review yet. I'll keep at it and wait 'till it's in better shape.
 
@uhoh No problem, you know where to find us.
 
@Mast Just imagine that it will get worse
 
@Peilonrayz That's nice.
 
8:22 PM
Please repeat on topic and how to ask from the intro tour. Until you have a demonstrable problem, you do not have a Stack Overflow question. This is not a code review site, nor a testing service. — Prune 43 secs ago
 
 
1 hour later…
9:41 PM
0
Q: Pretty print a tree from minimal data input

mindoverflowI'm currently working on an uncrafting tool for minecraft and got a neat output working that shows all the materials needed in a tree. I wonder if the code used to print that tree could be improved somehow. I only have the recursion depth as a measurement and the ArrayList gets filled in the same...

0
Q: How do I make the modal popup stay still on top of another modal?

Mireia FarreI am creating a company Directory and I've got the main page, with all the contacts, and two modals, so basically when I want to delete a contact from the directory I press on the delete button inside the profile page (1st modal), and a popup opens (2nd modal) asking if you're sure you want to de...

 
10:20 PM
possible answer invalidation by yeah22 on question by Joseph Lee: codereview.stackexchange.com/posts/256114/revisions
 
@Duga its okay- code fence
 
@phd in fact it does. we are using that to creat patches for code review — tainy 8 secs ago
 
0
Q: Performance issues in vanilla javascript game (no canvas)

Sarah PöhlerI tried to create a simple javascript game. I know that the recommended way to create a game is using canvas. I have lot of dom manipulations (seems like an issue). Maybe someone can have a look and give can explain me the problems. javascript: const KEY_CODE_LEFT = 37; const KEY_CODE_RIGHT = 39;...

 
10:57 PM
0
Q: Starting with OOP | Python

fijiI'm not very experienced with OOP and Python and I've been wanting to kind of professionalize my way of writing code, etc. I have a pretty big project but I can't post it all here, it's a bit much so I have taken two classes. My question is; in what departments can I improve? from datetime import...

 
11:22 PM
0
Q: Testing a javascript function that performs side effects

Samuel ColeApplication context I am working on a game I call "Apes and Snakes". So far the code only allows players to connect to a host using a room code and WebRTC. Players and the host send messages back and forth to each other over WebRTC. When a player receives a message, it is passed to a "handler". T...

 
11:47 PM
Lots of good improvements. UV. For deeper review and to get rid of other corner weaknesses, consider codereview.stackexchange.comchux - Reinstate Monica 34 secs ago
 

« first day (2846 days earlier)      last day (1186 days later) »