All Questions

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

Command line dictionary tool, using webscraping

This is my first proper Go program, after completing Go by Example and https://tour.golang.org. I have a background in Python. This program scrapes definitions from Wordnik, then prints them nicely ...
0
votes
0answers
5 views

Simple Card Reveal Game in react.js

I am new to this React.js and currently learning about 'State'. The task: Three ‘Cards’ components are displayed that can be clicked. When the user clicks on a ‘card’ the card should be ‘turned’ to ...
1
vote
0answers
8 views

String Permutation

Below is my permutation function and I'm looking to make it more elegant and efficient if possible. The function should return a string which includes all the permutations of the given string (...
0
votes
0answers
8 views

Decoding a telephone number that was masked with letters from the respective keys with APL

Legend says phones used to have keyscitation needed and in those times, a person could "encode" a phone number by creating a word from the letters in the keys with the given numbers. Below is the ...
0
votes
2answers
36 views

Prefix expression evaluator [C++]

Here's my code for this' weeks homework I had. The code should take an expression , preferably in prefix notation ( otherwise throws exception ), that evaluate prefix expression. I've given three ...
-3
votes
0answers
17 views

Python simple card game

1.At any point during the game, someone should be able to type "--help" to be taken to a screen where they can read the rules of the game and instructions for how to play. After they're done reading, ...
-4
votes
0answers
12 views

Creating a Finite State Machine of the verb 'do' in Python [closed]

I'm extremely new to programming and I just learned the basics. However, due to illness, I missed my advanced Python classes and did not learn the knowledge that is required of this course. I'm ...
-2
votes
0answers
5 views

Created a Mastermind game to practise OOP as well as PyQt5

I have created a mastermind game however the code is not amazing, at this point I'm not worrying about the front end programming (it could be neater) I just know I could have been a lot more compact ...
0
votes
0answers
28 views

Python COVID-19 Simulation with Markov Chain Random Walk

I have written a code to simulate a simple COVID-19 spread scenario. I create a little 2D world where the people walk around in a Markov chain random walk, I create a patient zero, then after they ...
-5
votes
0answers
11 views

Python - Input a list and store as list not string [closed]

How might I be able to input [1,2,3] into python and store it as a list and not as a string (i.e.'[1,2,3]'). ...
0
votes
0answers
13 views

Finding permutations efficiently

I have the following: A set of K time-series in a numpy array with dimensions T x K. A set of ...
0
votes
0answers
9 views

Heap selection sort in Javascript

I have (designed and) implemented this fancy sorting algorithm that combines natural runs in the input array with a heap data structure: ...
0
votes
0answers
20 views

Java - parser for html-table

I wrote a program that saves the data from the first table of this wikipedia-article (in german) and then saves the column "Gesamt" (contains daily update of absolute numbers of Covid-19-infected ...
0
votes
0answers
17 views

How to implement the F# InitInfinite(Async) functions in C# without disabling ReSharper warnings?

When coding in C# I often miss some functions from the F# world. One of them is Seq.initInfinite, others are its counterparts with the ...
2
votes
0answers
9 views

Pairwise hamming distance for binary data with missing values

I just started learning Rust and my first project is a command line tool generating a pairwise distance matrix for binary data while ignoring missing values. The input files look like so: ...
1
vote
1answer
14 views

F# Array with tuples or Map

I have a sample code and some question. Simple type property ...
-6
votes
0answers
23 views

health care managment application using java enums [closed]

Write a Health Care Application in which use an enum to store the available doctors with attributes name, consultation fee and specialization. Ask the user to enter the patient_name, age and create ...
3
votes
3answers
33 views

Copy and in-place transformation of strings to lowercase/uppercase

I have the following code that transforms a string to upper/lowercase: ...
1
vote
0answers
14 views

Fast way to calculate Standing Wave modes in NumPy

I am trying to plot the standing wave modes in a 2D box over time. The equation for this is: $$ A(x,y,t) = \sum\limits_{n,m} sin \left( \frac{n \pi x}{L_x} \right) sin \left( \frac{m \pi y}{L_y} \...
-4
votes
0answers
19 views

Sum of all the values which comes in the path of a graph [closed]

I have written a code. In which I created a graph. Then traverse from source to destination using DFS. I sum up all the values of nodes which I have visited. But I could not know why it is wrong ...
1
vote
1answer
24 views

Python code for checking request headers [closed]

I am trying to validate a HTTP REST API request in my python code. It checks for some request headers (X-Foo and X-Bar) and two ...
-3
votes
0answers
13 views

I am trying to understand the code given below that implements trie using unordered_map in C++. Can someone please explaing few things in it [closed]

I found this code for the implementation of trie in C++ using unordered maps but was not able to understand few things in it. ...
3
votes
2answers
129 views

Refactor the code which performs “cross-product”, “reduce”, “product of list” and “sum of list”

I have come up with a sequence of steps to find the maximum product of y positive numbers which add up to x. But the program is ...
0
votes
1answer
12 views

Advice on taming a slow loop required for visualization of large GIS dataset

I'm working towards plotting a large GIS dataset of which I've shown a sample above of about 1/6 of the data. I'm happy with how quickly the data loads in, and bokeh...
2
votes
0answers
21 views

Simple Tic-Tac-Toe game in Javascript (NO A.I.)

After some hours of coding trying to implement "algorithms" to make a Tic-Tac-Toe game, I came up with something I'm not really proud of. Here's the code: ...
0
votes
0answers
11 views

Roman numerals isomorphic conversion in Go

I always try to port the roman numeral conversion algorithm to learn new languages. Reading the Go manual as a beginner, this is the most idiomatic way I've been able to write it. I would love it if ...
-1
votes
1answer
23 views

Python code interacting with rest api

Please help me with code review of a simple python function interacting with rest API ...
2
votes
1answer
17 views

(Js) Schedule Conflict Detection Algorithm Logic & Length

First post here - I hope I understand the purpose/intent of the community. I am trying to create a scheduler WebUI using Js. I am hoping to see if there are any suggestions for improving my schedule ...
-1
votes
0answers
16 views

Implement a to do list using the HeapPriorityQueue for c++ in visual studio [closed]

I am supposed to create a to do list using the HeapPriorityQueue and my code seems to keep popping up with errors and I can't figure out how to make it all compile and run. Can you look through and ...
0
votes
0answers
29 views

Nonsense program written in Go [closed]

I felt like messing around with Go and I was wondering how I did. What do you guys think? https://github.com/MattIzSpooky/goroutines I am also really wondering how I can improve this. ...
0
votes
0answers
18 views

Split word file in multiple word documents by renaming each generated .doc documents VBA [closed]

hope that Everyone is doing fine. I have a word document containing some text (see below). I would like to split the document in multiple word documents with a specific name for each document ...
-3
votes
0answers
14 views

passport.authenticate is not a function TypeError [closed]

I have been having an issue with an error, I have tried to add var routes = require('./routes/index')(passport); to my app.js file , after I read about others having this issue, but it did not help. ...
3
votes
2answers
65 views

Simple Python and SQLAlchemy Text Password Manager

Out of boredom, I decided to start my personal project and I've chosen a simple Text Password Manager. Note: For anyone out there, I strongly recommend you NOT to use this for any sensitive storage ...
1
vote
1answer
29 views

The most minimal way to retrieve live data using setInterval

I am writing a script that is supposed to retrieve some data from a MYSQL database but I need to make it happen live and after lots of research I learned that this thing can be done using something ...
9
votes
4answers
917 views

Basic Blackjack game in Python

I've only been learning Python for a few days after a Humble Bundle book sale, but I made a functional Blackjack game on which I'd like some constructive criticism as far as my coding structure and ...
4
votes
3answers
392 views

Check header files for namespace usage

To ensure there are no naming conflicts within our project (C++) I was tasked with writing a python script to check all of our header files for any occurrences of a ...
4
votes
1answer
20 views

Is this an optimal implementation for the knapsack algorithm?

I have implemented a solution for the knapsack problem while breaking an item is allowed. I've used the dictionary data structure where I used weight as a key and value per weight as a value. After ...
0
votes
0answers
39 views

Correct use of an interface when two different classes are valid as parameter?

In one of my projects I wrote a little tournament platform, but the way I handle participants is a bit messy and I want to clean this up. So in my case a Tournament can have participants, but either ...
4
votes
1answer
27 views

Simple rainfall animation in Pygame

I made the following code. It's a simple animation of 'raindrops' falling and splattering once they reach the ground. The images I use can be found here: https://imgur.com/a/VYV07ef ...
-2
votes
1answer
14 views

How to test that an event will not be fired in xUnit? [closed]

I have two questions. Does it make sense to test that an event will not be fired? If yes, what is the best way to accomplish that using the xUnit framework? For ...
-3
votes
0answers
11 views

Python's UnboundLocalError and inline variables' assignment [closed]

Here's a method which returns a method which each time called returns the next fibonacci number (0, 1, 1, 2, 3, 5, ...). ...
-4
votes
0answers
16 views

//Implement Mystring class so that following driver code runs succesfully [closed]

//Implement Mystring class so that following driver code runs succesfully Please help me! ...
0
votes
1answer
36 views

Best approach on handling function that returns either a promise or just synchronous code

I wrote some code and I'm trying to get some feedback on it. I'll try to summerize the essential only. I have a function that based on a condition returns a promise or something else: ...
-2
votes
0answers
25 views

Design decision for clone scenario [closed]

As part of my application, I am maintaining a cache which is structured like below, ...
-2
votes
0answers
20 views

Vending Machine Project - Python OOP [closed]

I have been working on a vending machine project which is outlined below. After selecting 'b' in the first menu, I am having trouble with comparing the selected item cost with the total amount ...
-4
votes
0answers
19 views

List always stay empty after recursive call C# [closed]

I am confused by this problem, why my IList type variable res always stay empty after each recursive call. After calling "res = new List(tmp);" the res should has value However, right after return ...
1
vote
0answers
22 views

Looking for any enhancements to avoid a stackoverflow exception in a C# program [closed]

The program below results in a stackoverflow exception in C# for the input provided. I am trying to see if there are any enhancements that can be made to avoid the stack-overflow. When using BFS ...
2
votes
1answer
42 views

Visualize virus infection against population on a webpage

...
3
votes
1answer
48 views

Building an email generator using abstract factory pattern

I'm trying to build a customer email generator in java using the abstract factory pattern. I understand how to use the factory method pattern; however, I'm a bit confused about the abstract factory ...
3
votes
1answer
26 views

Name Mashup Program Improvement in Python

I am learning python and trying to solve different problems i came across this program which is name mashup which is in Get Programming:Learn to code with Python. problem statement: Write a program ...

15 30 50 per page
1
2 3 4 5
1310