Top new questions this week:
|
I have created a program in python that calculates forces between bodies (i.e earth, moon and a hypothetical moon) and make them move according to the changes in velocity and forces. This is the code …
|
Let’s say that we have a list of strings and we want to find the steps (pair representing swaps to be made) to sort it. Here is my current implementation: …
|
The following is my solution to the Pylons problem from Codejam 2019: codingcompetitions.withgoogle.com/codejam/round/0000000000051635/0000000000104e03. Our Battlestarcraft Algorithmica ship …
|
I have written the following simple scoped timer struct in order to help me measure the execution time of arbitrary scopes. Here is the code (live): …
|
I have a lexer (program that turns source code into tokens) written in Go that I am re-writing in Rust. The lexer should take in a sequence of tokens, generally different special characters, integers, …
|
As an exercise I’ve implemented malloc and free in Python as a first fit free list as described here. This tracks which blocks are free in a doubly linked list that is sorted by the address of the …
|
I have a known hierarchy of the organization units, by descending order: …
|
Greatest hits from previous weeks:
|
I am a self – taught coder, and have been learning Java / C# for the last 2 1/2 years (inconsistently). I have recently created a snake game in Java with the help of an online tutorial. I have …
|
I want some recommendations or something I could add to the game. Please tell me what I could do better or what I did wrong. I made this during the time I learned Python. …
|
I made this as a personal challenge. It seems to work fine as I can’t find any bugs and am happy with how it runs, but I am interested in what I should do to make the code more professional. I think …
|
I am learning to use Java Swing and have made a simple animation that makes a small shape bounce around the predetermined borders of a panel. The program works well, but I am looking for feedback in …
|
To learn more about OOP, @nhgrif challenged me to implement a Shape abstract class (more details in code remarks below. Here is how I did it. Any and all advice appreciated! Shape.java …
|
I am dropping rows from a PANDAS dataframe when some of its columns have 0 value. I got the output by using the below code, but I hope we can do the same with less code — perhaps in a single line. df:…
|
I have two lists of objects Person and PersonResult. Both are linked through the property …
|
Can you answer these questions?
|
I am trying to make an AvaloniaUI user control. I want to be able to set a property at design time from inside my XAML files and see the result in the designer in Rider, such as the “Hello World!…
|
I wrote a neural network in python using pytorch, which determines the gender of a word in Russian. As a training set: a file containing a word and a number from 0 to 2 (0-masculine,1- feminine and 2-…
|
I have been working hard trying to learn Haskell, or at least understand it enough to make simple programs. This is my first program. I have been working on it for about a month now. I had already …
|