# All Questions

73,172 questions
Filter by
Sorted by
Tagged with
4 views

### A simple java game engine

I'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 ...
5 views

### Code to plot chart with data

I 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 ...
7 views

### Counting domino tilings in C

This 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 ...
8 views

### Beginner Level OOP Web Scraping Code

I 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 ...
4 views

### Get list of buffers from current neovim instance

The 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 ...
9 views

### Clickpocalypse 2 automation script

Clickpocalypse 2 is kind of dungeon crawler game but with minor controls. Script's purpose to automate what is left. To try it out: Open "Clickpocalypse 2" as separate browser window (not a ...
9 views

### Python and Tkinter GUI - How to Add Id Automatically and Increment by 1 After Each Submission? [closed]

0 I want to make a GUI that user inputs customer information, but I want to add an id to each customer so that when I search for that ID I can find the customer. After each submission the id should ...
12 views

### Replace one element per row based on matching another list in R

I have a nested tibble with 106 tibbles in data_sensor. Every tibble has a column with temperature and another with dates. On the other hand I have a list of 106 dates in date_admin. By creating a ...
11 views

### Finding the difference in one column in a Pandas GroupBy

I am trying to calculate the time difference between samples that a satellite takes at the same location. I have data currently in a Pandas DataFrame that has latitude, longitude, and time of the ...
14 views

### Mergesort Inversion count implement? [closed]

What's wrong with this mergesort Inversion count implement? I am trying to implement an inversion count algorithm using python but I am not able to figure out why this not working for descending order ...
10 views

### TypeScript + React Native: Button Stepper Component

I built a ButtonStepper component and it's sharing quite a bit of the same logic, so I was wondering if it could be refactored better. It's sharing quite a bit of ...
10 views

### Library Program in Ruby with Class

I have been learning Ruby for 2 weeks. Today my bootcamp teacher taught Ruby Class and gave me homework. I coded simple library program. But I think the code is smelling bad. How can do better the ...
9 views

### Multiple types of documents with default behaviors from the base class

I'm trying to refactor some 15 years old code and I'm trying to think on which would be the best way to refactor and write it in the best way. Right now these files are really huge and they cannot be ...
61 views

### Generate possible combinations by range and length

I am learning Haskell and I implemented a recursive function that generates possible strings by length and array (e.g. ['a'..'z']): ...
24 views

### Tic Tac Toe game with an adjustable grid size in Tkinter

I've created a full Tic tac toe game in Tkinter that has single and multiplayer modes. The single player mode then has a hard and easy difficulty. The easy difficulty is just choosing a random open ...
85 views

### C++20 python-like "range" class

This is a range class, similar in functionality to the range function in python. It was originally made to work with just range-based for loops, like so: ...
20 views

### Rotate the matrix by 90degress - CTCI 1.7

The question is: You are an given an NxN matrix as input. Write a function that rotates the matrix by 90 degrees clockwise. Later on it asks me to do this in-place. My code works till 4x4 matrix but ...
31 views

### Simple implementation of various cache replacement policies

I am new to golang and I tried to implement various cache replacement algorithms (FIFO, FILO, LRU, MRU, LFU) in a generic or flexible fashion. I added some tests as well. My implementation uses the ...
50 views

### Python's enumerate for C++

I implemented an enumerate() method for C++ containers similar to Python's enumerate to iterate through a range with an index and the actual value. I have the following questions: Does the usage of ...
20 views

### HTML5 canvas spaceship game

I don't understand why my spaceship movement seems so laggy.. Could it be because of the JS function "setInterval" ? What is the best approach on game performance with HTML5 Canvas? The code ...
49 views

### A small python game

My teacher gave us this game to make. basically, the computer needs to generate randomly 5 letters and there would be 5 players if the player guesses the correct letter given by the computer It would ...
22 views

### Sort table with ascending or descending order without a library

This is my first day coding, and I need help with sorting a table in ascending/descending order. The idea is that when a column is clicked it will sort in ascending order, and then it is clicked again ...
51 views

### Find Kth Element in the merged two sorted arrays?

We have been given two sorted arrays and a number K . We have to merge the two sorted arrays in the sorted manner and return the element at the Kth position. My approach is to use two variables ...
44 views

### Linked List Implementation in C#

I wrote an implementation of the Linked list data structure. I mostly did this because it's the simplest collection data structure (at least the simplest to implement), and I wanted to practice ...
47 views

### Recursive quick sort in python

I was wondering if there is anything that I could do to make my code look cleaner and more descriptive for educational purposes? ...
43 views

### Pseudo random numbers generator in C++

Let's say I have following C++ code for generation of the pseudo random numbers uniformly distributed in range $\left<0,1\right>$ on 32 bits machine. ...
5 views

### Refactor typescript long switch case that run different code in according to property value

I have a typescript function that executes an array of actions on a given string value. This is the code: ...
22 views

### JavaScript change calculator

I'm new at coding and I'm learning it on freeCodeCamp, that's the most hardest problem that I have already do at that site. After finishing it (after I vibrated as if I had won a world competition of ...
50 views

### Rock paper scissors coding assignment

I had a coding assignment to write a Rock Paper Scissors game. The main task is not to show a solution but rather to test the coding style. The rules are such: Problem: rock is "O", paper is ...
30 views

### Avoid global variable due to executor.map()

I'm pretty new to python but after watching Mr Robot I felt inspired to make a CLI portscanner. With all the fancy console outputs you see in movies like a progress bar. It's finished and works nicely ...
26 views

### PHP processed, HTML-CSS, CMS-agnostic, contact now panel

I develop a CMS-agnostic PHP formatted HTML-CSS "contact now" panel, sticky in the bottom of a website screen. The code is tested and works as can be seen from the following image. I ask a ...
30 views

### Recursively unpacking a javascript object

I'm seeing a React course, we were studying fundamentals of javascript for a while. We saw how to access the content of an object and display it in console. My solution for the problem of displaying ...
254 views

### Is there a better way to apply a filter over an Either right value?

Suppose you have an IO (Either String (String, [Int])) and you want to filter the [Int]. Let's say we want to use the following ...
67 views

I am doing this problem: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version ...
22 views

### How to execute my stored procedure for event creation, event ID as primary key? [closed]

I have a stored procedure that I have inherited in my current company. It is used to create an event ID column that allows another stored procedure to bulk upload sales data to those events. (Event ...
51 views

### Is there a way to simplify getting the character that appears the most in a collection with Linq?

I have a collection of strings, all of which are three characters in length: ...
15 views

### Creating an order system for customers [closed]

I am having a little trouble with my order system. I believe that the approach that I am taking is all wrong. Basically I am trying to create an order system that allows customers to pick out a pizza ...
49 views

### Using arrays more effectively with numpy

I previously posted some code I've been working on and had a fantastic answer, but as I didn't post the full code I was then unable to bring it all together using the much faster numpy implementation, ...
21 views

### Convert string to object array javascript

I want to convert string to object array. Suppose I have following string. const str = "someValue,display"; I want to convert it like following. ...
33 views

### Server hosting single page site using TCP sockets in C

I have written a simple server to host my page and CSS (CSS file is 22KB). Using sockets and TCP. Can any one please review it and give feedback on how can I make my server reliable using TCP and ...
27 views

### JS icons animation

I've written a simple JS that takes care to animate an icon. At first I wrote it quickly and without paying attention to any kind of optimization: ...
31 views

### Build a mobile view from existing content on page load without creating duplicate content JS only

I want to check the viewport size on first load. If necessary build the mobile view from existing content (surround titles and text with summary/details tags), remove the desktop view from the DOM (...
519 views

### Implementation of Sieve of Eratosthenes in Java

I have implemented Sieve of Eratosthenes in Java as follows, is there a way I can modify the below code to make it more efficiently. The current execution time is 0.8481224 seconds ...
47 views

### Forms to enter trading information

My project has grown for a year and now comprises of 19 standard modules, 7 class modules 11 forms. Some of the forms appear to freeze when called but, in fact, they are just slow to respond, taking a ...
36 views

I'm reading a CSV using Haskell. I'm not sure if this is the appropriate way to do it. This is what I'm doing: Read rows from a CSV -> return lazy byte string Parse the headers and rows from the ...
18 views

### Is this a disadvantage of using sleep() or a problem with outputting the count every iteration? (Child process doesn't execute as far as expected) [closed]

Just a real quick question. Could someone either confirm or correct my theory as to why my child process does not execute as far as I would think? Given what I have, I would expect the child to reach ...
42 views

### Simple game of Chutes and Ladders

I recently made a new project for Chutes and Ladders (the Hasbro version of Snakes and ladders) and it is located here: https://github.com/vchittar/ChutesAndLadders BoardLogic (implements an interface)...
37 views

### Find common timeslots for consecutive days

Imagine you want to reserve a classroom over several days. You get a schedule, from the school, telling you when a certain classroom is still free. To make it easy for your students, you want to ...