All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

Improving a filter array function with Set and objects, to match elements and conditions

I've posted a similar question on: Link With the help of the other users, I was able to improve the code, but I don't think is the "ultimate" form. Thats my code now, any help? Conditions ...
0
votes
0answers
16 views

Python Game of Life

Following 'automate the boring stuff using Python', in chapter 4, there's a practice project coding Conway's Game of Life to run in terminal. I hand typed into VScode, when ran it populates a board, ...
0
votes
0answers
20 views

A contact form with CodeIgniter and Twig

I am working on a online newspaper/blogging application with CodeIgniter 3.1.8 and Twig. I use the Twig template engine for the front-end views. I have put together this simple contact form which uses ...
0
votes
0answers
5 views

Angular Typescript Async queue service

i've implemented a waiter service in Angular for syncronice multiple calls to one async function and i want to know if there exists a simplier way of atchiving the same result or if it's over ...
0
votes
0answers
37 views

Multiplication math game using classes/constructors

I've done some coding in the past but nothing with OOP and honestly, I cannot wrap my head around using classes and constructors to tidy up my code. I'm used to "calling functions" instead ...
6
votes
1answer
25 views

Using templates to wrap variardic JNI method calls into type-safe C++ functors

I am working on a project which uses JNI. More than once I fell over the absence of type safety working with the variardic function calls. So I came up with this module. It wraps the variardic JNI ...
2
votes
2answers
45 views

Hangman Game with Python

I'm super excited to share my hangman game with you. (haven't added the graphics yet...) I will be using this program as my final project (for school), but I would like to have this polished before ...
0
votes
1answer
29 views

Noughts & Crosses (Tic Tac Toe) OOP Design

I was wondering if someone could review my object oriented design for my Noughts & Crosses program. Yesterday I posted a procedural version and now I've done an OOP version. Can someone tell me ...
-4
votes
0answers
19 views

Can someone help me create an untwist function for my program? [closed]

would love feedback on this! I’m trying to create a untwist function out of the following program. I also need to calculate the length of the path through the points. Any feedback will be greatly ...
0
votes
0answers
24 views

Simple to-do list application in React

I'm getting started with React, so I took a React tutorial for creating a simple to-do list app. After finishing it, I read "Thinking in React", and tried to improve what I did during ...
1
vote
2answers
16 views

Convert boolean array to integer in Typescript

I have a database object that has a field called workdays, it's a array boolean that contains 7 elements representing whether the user is active on the ...
-3
votes
0answers
25 views

8 arguments in method [closed]

I'm developing a networking library for C++ based on sockets. I have the method Send for sending data to a remote peer. Signature of this method: ...
1
vote
1answer
26 views

Simple http helper in Go

Can you please share your thoughts on the following simple httphelper in Go? Thanks in advance. I mainly would like to know whether returning a channel of a custom type seems like a good idea and if ...
4
votes
2answers
74 views

Improving a filter array function, to match elements and conditions

I have to do some check/match elements with conditions. A have a list of conditions, each with a specific ID. I've put for each of my elements an array with the ids of their respective affirmative ...
0
votes
0answers
13 views

Neural network predicting straight line

here is the code it is predicting most of time straight line but some time it gives a good fit. I have attempted to use a variety of different network configurations, with anywhere from 1 to 3 layers, ...
3
votes
1answer
35 views

Find plane (walls, floor, ceiling) that a falling car will land on

I have a function that takes a falling car's location & velocity as well as the world gravity. The world has a floor, ceiling, and walls that are in fixed positions. The car's x & y velocity ...
5
votes
1answer
72 views

A Various Container Type Arbitrary Nested Iterable Generator Function Implementation in C++

This is a follow-up question for std::array and std::vector Type Arbitrary Nested Iterable Generator Functions Implementation in C++ and std::deque and std::list Type Arbitrary Nested Iterable ...
0
votes
0answers
16 views

PowerShell - Convert English words describing numbers to their values in Arabic numeral

I am extremely new to programming, and I am a really fast learner if I am interested, I have only started using PowerShell in less than a month, to improve my programming skill, this is a script I ...
-3
votes
0answers
12 views

How to update the record to CSV file using angular http? [closed]

I have a requirement of reading the data from the CSV file and allowing the user to update only one column using inline editing. I am able to read the data using the angular HTTP module but I am not ...
0
votes
0answers
11 views

PowerShell - Find Least Common Multiple of a series of numbers

I am a Windows power user, a system tweaker, my idol is Leanardo da Vinci, and now I want to be a hacker. I am extremely new to programming, but I really am a fast learner if I am interested in the ...
1
vote
1answer
24 views

Operations on nested data

Problem description. I have JSON which comes in bad shape: ...
1
vote
0answers
15 views

PowerShell - Calculating date difference between two given dates in days without builtin and with builtin

The title says it all, I have written two scripts to calculate dates to test my abilities in programming, one from scratch, without [DateTime], New-TimeSpan and even [math]::Ceiling, and it's really ...
-4
votes
0answers
11 views

sympy in jupyter notebook cannot give answer in latex form [closed]

I encountered a problem when using sympy in Jupyter Notebook. Here is the code [![enter image description here][1]][1] ...
1
vote
1answer
17 views

user-facing email validation

I'd like to have a generic way for validating user provided email with a bias toward ease of use. Does the following do so in a clear way for implementations that have the ...
1
vote
0answers
24 views

My TicTacToe attempt in C++ Console [Intermediate]

I saw another user post their implementation of C++ TicTacToe game and thought what a coincidence! I was just in the process of making one myself after picking up Programming Principles and Practice ...
-1
votes
1answer
28 views

TIME complexity issue in python code

Below code is for Given an even number (greater than 2), return two prime numbers whose sum will be equal to the given number my task to reach the lowest time complexity I tried it differently, but I ...
0
votes
1answer
14 views

Is there a condensed way of adding multiple event listeners each with different functions to the same group of elements?

I would ideally like to add event listeners to a single group of elements, topLevelDesktopNavDropdownItems , in some kind of object syntax like {event: function, ...
1
vote
1answer
17 views

Abstracting async hooks out from components

A component displays a list of values and I'm trying to hide everything about how those values are gotten, essentially divorcing concerns about state away from the component itself so that in the ...
2
votes
1answer
42 views

Extract values from English numerals, e.g. “nine million and one”

Though many have done it the other way around, I have not seen such code in many places. And, to be honest, I don't know why this cluster of if-statements, ...
1
vote
1answer
23 views

How to use smart pointers with SDL2 (SDL_RWops)?

I want to write read savefile function with smart pointers and SDL2. I have little expirience with smart pointers and just want to ask is my code good, correct and no memory leaks. this is my code: <...
6
votes
2answers
236 views

3-Digit Narcissistic Numbers Program - Python 🐍

Just wanted to share my Narcissistic Numbers Program with y'all (not sure if it's good, but I gave it my best). Hope you like it! This program prints out all the narcissistic numbers from the smallest ...
0
votes
0answers
28 views

HMRO - Help the Military Recruitment Office

I am solving this problem on SPOJ but I am getting Time Limit Exceeded Error. https://www.spoj.com/problems/HMRO/ Here is my code on Ideone with its input and output https://ideone.com/h1RAiS anyway ...
1
vote
3answers
28 views

Count the status messages in a column VBA

Can someone review my code and provide feedback. For context in column A will be a status message of "OK" or "NOK" and this little function just counts the number of times this ...
4
votes
1answer
87 views

Noughts and Crosses (Tic Tac Toe) C++ Console Application

I was hoping someone could review my C++ console based noughts and crosses (Tic Tac Toe) application. I have not looked at any other documentation, this is purely programmed from the top of my head. ...
-2
votes
0answers
20 views

What is the common practice (if there are any) of implementing barrels in nodejs [closed]

Well, by doing some research I realized that this is something that nobody is doing) But if there are some common practices I would like to know about them. Just for sake of example here is how I'm ...
-5
votes
0answers
17 views

Can someone help me port easy-pie-chart js library to a react component. I'm new to react and thought can it be done [closed]

easy-pie-chart repo : https://github.com/rendro/easy-pie-chart I tried to search how to port a js library to react component but failed. Can you help me with how can I port this js library to a react ...
2
votes
1answer
24 views

Colour-model classes using CRTP

I want to implement color space logic. So I started with creating some structs: ...
0
votes
1answer
19 views

Complex number class in Lua

This is my first attemp with Lua. I decided to create this class, because it have lots of "tweaks" and "tricks". I want to know if I did it as best practices Lua ways. My Lua ...
-3
votes
1answer
43 views

how can i avoid all of those if statement in python [closed]

I made this code but it's too slow, I found that if statement causes the code to run low. How can I write this in an alternative way? ...
3
votes
2answers
104 views

Merge arrays in objects in array based on property

I have the following code which takes an array that might have duplicate ids and will merge the items of those duplicate, and ...
0
votes
0answers
16 views

Attempt on basic input validation and functional programming in a POSIX shell

In spite of all the POSIX shell disadvantages, I am still sticking with it and I love its portability. Recently, I was searching for a way of code re-use, which turns out to be functional programming ...
0
votes
0answers
4 views

Basic Erlang chat server

Newish to both network programming and Erlang, and I'm not familiar with the best practices of either. I wrote a simple chat server to try and educate myself. If anyone could tell me how to improve ...
0
votes
0answers
19 views

BNF for a number

I'm looking to learn and practice parsing, and so I have started with writing an EBNF for a number (using the python interpreter as an example of possible inputs). Here is what I have so far (also ...
3
votes
0answers
29 views

Better way to provide data to UIKit component from Combine pipeline

Today I'm researching how to provide data to UIKit component when using Combine pipeline. I could see tons of tutorials about how to use SwiftUI + Combine from internet, but not found anyone helpful ...
3
votes
1answer
75 views

Beginner python program to get data from string

I'm new to this, but after learning some of this in class I decided to try my hand at creating a program to get the info from a Zybooks signature which stores the run data for your project. it takes a ...
1
vote
1answer
24 views

Setting a query for MongoDB

The following function sets a query for MongoDB, but that's not very important. It takes 2 arguments key can be either - which ...
0
votes
2answers
62 views

Random Number Guessing Game Code Efficiency - Python

UPDATE: I have added: a play-again option score keeping thing difficulty levels **(but I still need help with the functions part). I don't feel it's necessary to explain what my code does, as it is ...
1
vote
1answer
31 views

Simple state machine

I tried implementing a state machine in C. This is for a Stratosphere Balloon and I wanted to use a state machine to make it better. This will be later implemented in ARM CMSIS. The state function ...
-4
votes
1answer
42 views

What does %s mean in a python strings? [closed]

I'm not sure what %s means in Python strings. I came across this line of code somewhere a while ago: ...
-3
votes
0answers
11 views

Running gcc c code does not work/ can't import python.h [closed]

I'm running some c code on a raspberry pi. The gcc compiler is having trouble with this: #include "Python.h" It says: ...

15 30 50 per page
1
2 3 4 5
1392