« first day (3060 days earlier)      last day (39 days later) » 

12:03 AM
REFRESH! There are 7822 unanswered questions (89.3107 answered)
Thank you very much @SomethingDark for review and additional information. By the way, I was not aware of Code Review section for such situations. I am going to take this into consideration from now on. — Murray 26 secs ago
12:39 AM
Q: Get list of buffers from current neovim instance

henriquehbrThe function below is written in Lua and returns the list of buffers from the current neovim session, it also allows the option to specify a optional table (object) as a parameter, with a listed property to filter the type of buffer returned by the function (only listed buffers, or every single o...

1 hour later…
1:54 AM
Q: Beginner Level OOP Web Scraping Code Design

agdealI am a trying to produce better OOP code, and I am practicing by building a class that will serve to scrape html tables. It's supposed to find the table element using the css selector (selenium) and then loop over the rows within the tbody and thead tags (where thead rows are optional). The reaso...

Q: Counting domino tilings in C

martinThis code counts the number of domino tilings for a given m x n-board. The result is also the number of possible positions in the game of Cram. This is the first C code I've written in a long time and I wonder whether there are better ways to solve it, especially in terms of: the handling of 2D ...

2:43 AM
Q: A Landsat Class for performing radiometric correction

gokdumanoFor personel use, I created a Landsat class to perform radiometric correction on Landsat Collection 1 Data. I mainly followed this website and created RGB images for my working area using Landsat 5-7-8 data. There is no cloud masking yet, and before adding that I have a few problem about my code:...

2 hours later…
4:47 AM
Q: Code to plot chart with data

DestroyerI am working on a program that the user can use to track the parameters of his body (such as weight, waist size). I have a code that builds a chart based on these data.I would like to hear criticism on my code.What i don't like : MeasurementCHartHelperю - It seems to me that this is not a very g...

Q: A simple java game engine

tuskiomiI'm starting an OO Java game engine which is meant to be able to split things easily into multi-core loads. The idea is that a unique (Interface with method GetUID) gets passed in. The Unique can also implement any number of other interfaces. In this case, the unique can also implement Entity (ha...

5 hours later…
9:19 AM
Q: Parametrizing routes in flask by multiple submit buttons

SarGeI am trying to make a website which has solutions of a book (5 chapters). Firstly, I want to open chapters.html with route /chapters which displays five submit buttons and chapter no. as their values. chapters.html <form action="/{{ chapter }}" method="POST"> <input type="submit" value="Chapt...

@SimonForsberg Alright, have fun :), and btw forget it, I dropped that project cuz it wouldn't be as useful as I'd thought it would be
If I happen to see another one having a potential for improvement, I'll create a new question ;)
1 hour later…
10:33 AM
Q: Refactoring duplicated code with abstraction and generics

SuuleI have written simple command line project with Spring. And from what I think quality of code is pretty poor. I see what I could improve to remove duplicated code, but somehow I have no idea what would be proper way to do it. So I will copy/paste only code which I think need refactoring. Thos are...

Q: Function to replace all "&int-int" with the respective string slices in an input string

Adam Firdaus TanI have a school project question (for Python) that goes like this: Given a string_input such as "abcd&1-4efg", the function must remove the "&1-4" and insert the string slice from 1 to 4 where the "&1-4" was. eg. if string_input = "abcd&1-4efg", "&1-4" is removed. The remaining characters are i...

11:01 AM
Code review questions are off-topic on Stack Overflow. They are however on-topic on Code Review, though be sure to read their What topics can I ask about here? and How do I ask a good question? help pages. — Ivar 26 secs ago
I’m voting to close this question because it belongs on codereview.stackexchange.comTed Lyngmo 23 secs ago
11:22 AM
Q: Contact Tracing Function

Adam Firdaus TanI'm doing a past-year lab test in preparation for my upcoming test and I came across this question that took me a while to solve. It asks the programmer to create a function, trace_contacts(), that takes in 2 parameters (patient, history), and outputs a list of people who may have been infected (...

This question would be a better fit on codereview.stackexchange.comBill Lynch 42 secs ago
1 hour later…
12:36 PM
Q: Patricia tree implementation in Rust

TyiloI've implemented a map using a Patricia tree, using u64 as keys. I would like general feedback on my code, but I have one thing that I think could be implemented in a lot cleaner way, but I can't figure out how to do it: As a Patricia tree is a full binary tree (meaning all internal nodes have ex...

Q: Increment x by 2 and y by 1,then swap it without code duplication

Edward KoulakidisI have a function which uses duplicate code and I want to refactor it. As you can see in the 2 for loops the difference is the way tempPosition.x and tempPosition.y are incremented. I was thinking of making an array with their references but I quickly realized that it's not allowed. Any suggesti...

1 hour later…
1:50 PM
Q: Printing the installation path of an external app with the winapps module

Tronzenwinapps module handles installed software. Here's a simple example, which looks for an app with name e-Invoicing System and prints it's location. import winapps for app in winapps.list_installed(): # .list_installed() is a generator of InstalledApplication objects if app.name == "e-Invoicing...

2:40 PM
Q: Simple expression evaluator in Rust

William LewisWhat follows is an evaluator for a toy expression language. The language includes functions of a single variable (with lexical binding), along with numbers and a way to apply functions to expressions. For the sake of simplicity, bound variables are represented using De Bruijn indices. The main qu...

1 hour later…
4:09 PM
4:45 PM
There is a call to _D_calc in the second function. This is better suited for codereview. — Michael Szczesny 18 secs ago
5:02 PM
I reposted my question in How to speed up this Numba-based code? with more detailed source code. — Daigo_diego111 48 secs ago
Q: How to speed up this Numba-based code?

Daigo_diego111It takes me around 0.5 seconds to run the following code on CPU: m = 1.336-2.462e-09j x = 8526.95 mu = np.array([-1., -0.7500396, 0.46037385, 0.5988121, 0.67384093, 0.72468684, 0.76421644, 0.79175856, 0.81723714, 0.83962897, 0.85924182, 0.87641596, 0.89383665, 0.90708978, 0.91931481, 0.93067567, ...

Your code works fine. So what is the question? Are you searching for Code Review? — Rabbid76 15 secs ago
Unless you are experiencing a simulation or synthesis problem with your code, this question is off-topic (opinion-based). If your code works and you want a critique, Code Review is more appropriate. — toolic 40 secs ago
5:58 PM
Q: Unable to connect channel Discord.py

Vipekso i tried a lot of things but none of them worked.As in title i have problem with bot connecting to voice channel. I want bot to connect channel at which is user actually sending message and play there something (part with music is not done actually but thats not problem) Code Sample: async def ...

6:20 PM
I doubt you will get much help on codereview. Much better is to create a minimal reproducible example - often it is enough to use rand or similar instead of calling real function which would lead to a non-minimal example. — ead 28 secs ago
Q: Is this code good enough (Clock in C language)?

RaLeOk, so here's the code: Please, comment if there are mistakes #include <stdio.h> #include <windows.h> main() { int h, m, s; int d = 1000; printf("Set the Clock time: \n"); scanf("%d%d%d", &h,&m,&s); if (h > 24 || m > 60 || s > 60) { printf("ERROR!"); exit(...

@CaptainObvious RBA
6:48 PM
Does anyone know some good websites where someone can start learning to program?
@skiwi There exist hundreds of them, you'll have to be more specific :-)
Good ones are scarce though.
What language, for starters?
7:05 PM
@Mast Not sure if that matters? Hmm
Don't know what most companies are asking for these days, Java or C# or something I guess?
Not sure I'd want to teach someone PHP lol, for their own sake
Q: 2048 in Python Pygame

Random_Pythoneer59I built 2048 in Python with Pygame and it works as expected. I wanted to know where I could - Optimize the performance. Improve the UX. Or just improve the code readability. My file directory - 2048 - | - constants.py | - app.py | - main.py Run using python main.py or python...

7:28 PM
@skiwi The way I learnt was I picked a project to make and built the project. Or well I built some of the project and then picked a new project to build ;) If Python is acceptable then one of these may help get the person 'primed'
I think project driven learning is best, but that may just be me. IDK
8:01 PM
Q: First time wring a Go Program: Check VPN status, get IP and flag emoji (with geoip-api), then print it to stdout

leyeva9807First time I wrote a longer Golang program. Since I'm learning alone and I don't have any extensive programming experience, I would love to hear some constructive criticism. What does this do: It's a command line utility for Linux to query nordvpn status, then query an external Geo-IP service, an...

8:29 PM
@Peilonrayz I think so too, that's why I was hoping for a site that has like both in one
9:15 PM
Q: The buying mechanic for a stock market simulator

dubberI need help making my Python code easier to read. My friend and I are creating a stock market simulator. This is the function for the buying mechanic. The purpose of this section is to simulate a buying process. If the user wants to buy a specific stock, they just type its name into the terminal....

2 hours later…
10:54 PM
Q: Sorting algorithm in the element cost model Python

Jacek Fanslau1. Task Using standard input I read four rows of data: number of elements (elements are numbered from 1 to n) n numbers corresponding to cost of moving each element n numbers corresponding to current position of each element (from 1 to n) n numbers corresponding to the position of each element i...


« first day (3060 days earlier)      last day (39 days later) »