« first day (2942 days earlier)      last day (1371 days later) » 

00:02
RELOAD! There are 7586 unanswered questions (89.4390% answered)
 
1 hour later…
01:26
0
Q: Snake game MVC (Vanilla JS) - Help separating concerns

nax-p5I'm making a snake game for practicing the MVC pattern and also going out of my comfort zone (I'm in data processing / data science, mostly procedural coding) The game is available in https://nabla-f.github.io/ This is a classical snake game, but with obstacles in the board (called blocks in the ...

If you want your working code reviewed, I suggest posting it on Stackexchange's Code Review website — not here. — martineau 40 secs ago
01:47
I think your question is better suited for codereview.stackexchange.comBoris 57 secs ago
02:14
If this is working code that you're looking for general feedback on, Code Review might be a better choice. Stack Overflow is mostly intended for questions where you have a specific problem you're trying solve (e.g. if you have some issue with the code). — EJoshuaS - Reinstate Monica 20 secs ago
02:43
0
Q: Print out a small report identifying the account whose average withdrawal amount was largest. [PYTHON]

coder1532I need to recognize a new input file format and print out a small report identifying the account whose average withdrawal amount was largest. In case there is more than one account, print all. The file is in txt format: Here's an example of input data: Sample txt input: GTTB0001213929322 c74e460d...

 
2 hours later…
04:53
@Yunnosch please don't get in an edit war with OP. I agree with you that SO is not for code review, and OP should ask a more specific question if they have a specific problem implementing a more efficient solution. Otherwise, codereview.stackexchange.com would be a better place — Grismar 1 min ago
I’m voting to close this question because this belongs on codereview.stackexchange.comGrismar 33 secs ago
 
2 hours later…
07:23
0
Q: Longest common prefix for set of strings

DntFrgtDSemiClnQuestion: Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example : Input: strs = ["flower","flow","flight"] Output: "fl" Source: https://leetcode.com/problems/longest-common-prefix/ My Code: public S...

08:14
0
Q: Microsoft Academic API wrapper

political scientistDescription This is my attempt at writing a wrapper around Microsoft's research API (evaluate endoint). My goals were: learn how to write classes does it look ok overall? should all methods except for download_publications and save be private (start with underscore)? make it easier to downlo...

08:39
0
Q: Automate The Boring Stuff - Character Picture Grid

Tarun BetalaI understand there is another question on this already, however this is what I coded and wanted to know if this would raise any red flags? It's different in that it doesnt hard-code the length of the list. grid = [['.', '.', '.', '.', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['O...

 
1 hour later…
10:07
@divillysausages I understand what you mean. You want to save one copy. But in my opinion that's bad practice and I wouldn't accept it in a code review. — jabaa 32 secs ago
10:44
@RobG var is bad practice. Most static code analyzers and code reviews wouldn't accept it. What's the reason to use var today? — jabaa just now
11:24
Questions about improving working code are not appropriate for Stack Overflow. There is a sister site, Code Review, that you can use. Check their rules before posting. — Michael 23 secs ago
11:37
0
Q: A recent activity github action written in node.js

Puneet GopinathI and Abishek Joshi forked a repo, and improved a lot of code in it and published it, we did that because that original repo was last commited on 2020 december. For more info on history you can visit the repo readme's history section Anyway this action gets the recent activity of a user or org an...

Monking
possible answer invalidation by Gabriel Vendramini on question by Gabriel Vendramini: codereview.stackexchange.com/posts/261115/revisions
possible answer invalidation by Gabriel Vendramini on question by Gabriel Vendramini: codereview.stackexchange.com/posts/261115/revisions
^ Rolled back.
11:53
Monking
0
Q: I'm testing here ways to find prime number. But it looks weird because of repeating parts

ProperI'm testing here ways to find prime number. But it looks weird because of repeating parts. Are there any options to make it prettier. Probably I should use cycle or wrap it in an interface. start = System.nanoTime(); res = PoKrestyanski.letsUseit(numbers); duration = (Syst...

12:27
Greetings, Programs.
1
Q: Python persistant cache for non-pythonic objects

najeemI am trying to implement a cache which can be persisted. Also, some of the functions that I am trying to cache takes arguments that are not python objects (external library objects). But they seem to have a hash value. My first try was to use lru_cache but it didn't have an option to persist acro...

Another resource you may want to use is codereview.stackexchange.comGulzar 11 secs ago
12:50
Hi Boris, Thank you for taking the time to respond. The Range part and Len(winename) is great I can use that. Also thank you for the advice re the codereview.stackexchange.com commmunity. I will take a look and pose this there. thank you. — Gomes Gomes 32 secs ago
0
Q: Improving Speed of VBA Code - Copy paste two sets of variable, Excel does a calculation using FILTER,INDEX and MATCH then copy/paste the output value

user253932I am attaching the code here. I am very new to VBA and trying to do a complex calculation using Macro. Please help me improve the speed of the attached code. The code works fine and produces the end output. The program is intended to do the following Copy and paste two sets of variable in two spe...

13:19
0
Q: How to have <picture> elements with different links on each image?

CJ NimesTime ago I had a header implemented with a Bootstrap carousel: You know, something like this: <div class="carousel"> <div class="item"><img src="pic1.jpg"></div> <div class="item"><a href="example.com"><img src="pic2.jpg"></a></div> </div> Pay attention to that link on "pic2.jpg", this w...

0
Q: Web-scrape. BeautifulSoup. Multiple Pages. How on earth would you do that?

Gomes GomesHi I am a Newbie to programming. So I spent 4 days trying to learn python. I evented some new swear words too. I was particularly interested in trying as an exercise some web-scraping to learn something new and get some exposure to see how it all works. This is what I came up with. It works (to a...

0
Q: How to get a "train or test" slicing elegantly after splitting?

cmpltrtokI am learning numpy, pandas, and sklearn for machine learning now. My teacher gives me a code like below, but I guess it is ugly. This code is for splitting the data into training set and testing set, and later we could manipulate on the entire data or just training/testing set by the [True, Fals...

0
Q: Calculate intersection point of 2 or 3 moving averages

user3017869I want to calculate the intersection point, in time, of 2 or 3 moving averages. To solve this problem I decided to transform the moving average(ma) data into geometrical lines and calculate the intersection point via the formula for lines in the slope/intercept form. X coordinate is the unix time...

14:17
Ryan Donovan on May 24, 2021
Many companies run parallel development and operations organizations. But what you just ran one team that did both?
15:00
Then you might want to ask on Code ReviewTomerikoo 55 secs ago
15:12
Monking
I suggest you go ask this on the Code Review website here on SE. — Have a nice day 30 secs ago
15:26
0
Q: Codewars: Make a spiral

dettolasLink to full problem description: https://www.codewars.com/kata/534e01fbbb17187c7e0000c6 My code: def spiralize(size): def get_change_values(): change_x = 0 change_y = 0 if direction == 'right': change_x = 1 elif direction == 'left': cha...

0
Q: Picking a random item from a enumerable

vtscopI have an enumerable source for which I do not know how big it is. I want to select a random element from it, without having to hold the whole collection in memory and with uniform distribution. I read about the reservoir sampling algorithm, and created a simple implementation for the very basic ...

16:08
16:50
If the code works as expepcted, the question might be better suited for Code ReviewTuring85 36 secs ago
17:34
1
Q: Make better solution for Bean counting example from "Eloquent JavaScript" book

maxiwerHow can this code be improved by "closuring" of functions here? // Your code here. let countBs = countChar(); function countChar(str, letter = 'B') { if (letter === 'B') return (str, letter = 'B') => String(str).split('').filter(ltr => ltr == letter).length; return String(str).split('')....

18:00
1
Q: How can I filter and sort LinkedList faster and more effective?I have list of orders that should be processed

JusttoasktheneededquestionsI have method that fetches all orders from Database and filtering, sorting that data(I know better to do It by specific query to Database but I dont know how). I have Order entity that has following public class Order { private int orderId; private int userId; private int carId; p...

0
Q: Choosing between a Template Wrapping vs. Inheritance Technique

Tyler KellyI wanted to introduce logging to potentially many classes in the future and I am curious about the best techniques. Personally, I would go the AOP way, but within C++, and having my compiler constrained, using a AOP compiler/library is not feasible. At any rate, I was playing around with some pot...

18:23
You would probably get better answers at codereview.stackechange.com — Charles Bamford 17 secs ago
0
Q: How to get Chart.js into engineering notation?

LukeI have been trying to take my x-axis labels and turn them into engineering notation. They are currently in scientific notation using a callback function. x: { ticks: { callback: (val) => (val.toExponential(3)) } This above puts it into ...

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 (DoSomething is too vague) and how the function is used, plus the title is about CR goals instead of describing what the code does — Sᴀᴍ Onᴇᴌᴀ 48 secs ago
18:51
0
Q: Improving C++ Connect-four game with little AI

Ahmed ElsayedHere is the code for the game : #include <iostream> #include <sstream> #include <string> #include <cstdlib> #include <ctime> #include <algorithm> #include <vector> using std::vector; using std::cout; using std::cin; using std::endl; using std::time; using std::stringstream; using std::string; us...

19:05
This question is too broad and opinion based for Stack OVerflow. It might be a better fit over at Code Review. Please read their help center and make sure your question is on-topic there. — Tomerikoo 14 secs ago
I’m voting to close this question because it is a better fit for Code Review. Before being accepted on that site it should make clear what the exact goals are. — Igor 25 secs ago
 
2 hours later…
20:44
Hello
I have some structs defined for doing spectral graph theory using armadillo
everything works
but I am reading about classes and I am wondering if I should move everything I can to classes
I feel like I shouldn't
I read that structs are unsafe
but I think this is more in the "large scale company" enviorenment
is this the case?
I just have a couple of .h files with a bunch of functions that are useful for me
Is this SO question helpful?
1082
Q: When should you use a class vs a struct in C++?

Alan HinchcliffeIn what scenarios is it better to use a struct vs a class in C++?

"use class when you make use of features such as private or protected members, non-default constructors and operators, etc."
I have never needed anything like that
So I guess struct is the way to go?
@Onir unsafe as in other code being able to modify data that perhaps shouldn't be modified?
0
Q: How are classes more secure than structures?

Asad HanifStructure's member are public by default ans class's members are private by default. We can access private data members through a proper channel (using member function). If we have access to member functions we can read/write data in private data member, so how it is secure...we are accessing it ...

20:58
Other code?
yeah but I write all of the stuff myself.
21:12
@Onir If you have some files you'd like a review of (best to include .c files too) you can ask on Main. Having code in front of our eyes can help give better pointers for you than just general best practices.
 
1 hour later…
22:40
0
Q: Python script that make my .bash_aliases file MUCH more readable and clear

Monty_emmaMy .bash_aliases file contains several aliases. In the beginning, when I wanted to see the aliases, I print the .bash_aliases file, The output wasn't readable at all, so I created a python script to make it better. To call my python script, I use the alias print_aliases_manual What is the most py...

Please repeat on topic and how to ask from the intro tour. Your title seems to ask someone to do your homework. Your link text asks for a code review. Either of these is off topic here. — Prune 34 secs ago
23:05
0
Q: The Blacklist: Blocking Malicious domains using Bash

T145I've made this script to automate blocking some deviant hosts on my router, and was curious if there's anything much else that can be done to make it quicker and more efficient. Presently I'm restricted to using packages available on the Entware repository and the latest Busybox/ash shell environ...

23:17
Questions about improving otherwise working code my be better suited for Code Review, but be sure to follow their content guidelines. — jmoerdyk just now
Please repeat on topic and how to ask from the intro tour. You seem to need Code Review, not Stack Overflow. — Prune 1 min ago
23:47
Hi Boris , Thank you for your help I am so grateful to you. Just to let you know the outcome, I reached out to codereview.stackexchange.com they where so rude and unhelpful.."You should Know Code ....!" Maybe I was just unlucky and got the most unhelpful person on the planet. I'll keep looking for more help and encouragement. — Gomes Gomes 21 secs ago

« first day (2942 days earlier)      last day (1371 days later) »