All Questions

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

Board Rotation Problem - Best Practices

Problem: You are given a board containing letters and a word that you have to form. You can only take the letters from the front or the back, hence you have to rotate the board left or right. You have ...
0
votes
0answers
5 views

Calculator Object Oriented Design

I am aiming to implement a calculator in an object-oriented way. Here is the solution by using the strategy pattern. Looking forward to some valuable comments. ...
0
votes
0answers
3 views

jQuery form.find radio class

In my application we have four inputs radio controls and on the load the value is checked to true. When the user select another radio and then save the form I want to get the new value. I am using the ...
0
votes
0answers
3 views

naive bayes sentiment analysis classifier in clojure

attaching my try on implementing simple naive-bayes classifier for sentiment analysis as part of learning clojure and using functional programming on ML algorithms. I tried to invest more time in ...
0
votes
1answer
17 views

Reverse String : Recursion

we have to reverse char[] using recursion. Input: ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"] ...
-1
votes
0answers
4 views

concatenation of html from return functions

My controller is looking something like this. Is there a better way to generate my html to render coming from different functions: ...
-2
votes
0answers
10 views

code improvement suggestion on scroll function to check element in view

This chunk of code below look for the class name and apply in-view class when it does. I was looking for code improvement suggestion. Most of the time this code fires when scroll event happen. Code ...
-2
votes
0answers
16 views

Generating perfect numbers using for loops in Python3 [closed]

I tried to generate perfect numbers from 2 up to 500 with some simple "for loops" (which I've learned recently) in Python 3 and I've faced a wrong answer in addition to the 3 correct answers. input: ...
4
votes
0answers
20 views

Code to support different measurement systems

I am developing an application in which the user can use different measurement systems. Currently, there is support for the metric and imperial measurement systems. To support these systems, I wrote ...
0
votes
1answer
20 views

Simpson's method for numerically computing the integration of a function

I have implemented the Simpson's rule for numerical integration. Check this video for the implemented function. ...
1
vote
0answers
14 views

Modelling user preference system with categories

I am modelling a user preference system with the following requirements a user can have attributes (foods they eat) a user can have dynamic categories of preferences users which have all their ...
-2
votes
0answers
14 views

Create View in iOS - Swift

I've started creating views Programmatically and I am not sure if I am doing it right. My questions are at the bottom. I got a working Login View via the following code: ...
-1
votes
0answers
13 views

When to require and when to provide through arguments [closed]

I've been wondering what is the preferred way of injecting dependencies in node.js code. I've been working on a project where there is no dependency injection. This is why i have 2 ways of providing ...
1
vote
2answers
41 views

Extended Euclidean algorithm

I have programmed the extended euclidean algorithm. Is this a good approach? ...
0
votes
2answers
31 views

Binary exponentation with modulo

I have implemented binary exponentiation. Is this good? ...
1
vote
0answers
12 views

Random Quote Machine with React and Bootstrap

For my first solo React exercise project I decided to recreate a quote machine from the example that uses vanilla JS/jQuery. I also used a mix of Bootstrap/plain CSS. I got it to look how I wanted and ...
0
votes
1answer
16 views

Importing data from spreadsheet

Not really an issue I am stuck on (the code works) but I just really don't like some code I wrote, if you're bored in lockdown maybe you might like to help. Context: I am import some data from a ...
-4
votes
0answers
16 views

Continue url string after search query [closed]

Apologies for the day 1 basic question, I'm just trying to build a simple tool that searches the same query across multiple sites. However some sites have a string that needs to be entered after the ...
1
vote
2answers
38 views

Mastermind game

I've just finished one of my first projects with a GUI using PyQt5 and I recreated mastermind, the board game. The game is played by inputting 4 numbers and getting a return of how many of the numbers ...
2
votes
1answer
29 views

Download pictures (or videos) from Instagram using Selenium

Python script that can downloads public and private profiles images and videos, like Gallery with photos or videos. It saves the data in the folder. How it works: Log in in instragram using selenium ...
-1
votes
2answers
13 views

Securely implementing AES/RSA hybrid crypto with PyCryptodome

I wondering if anyone could give me feedback on whether or not this is a secure way to implement AES/RSA hybrid encryption and signatures in python 3 with the PyCryptodome module. All of the encoding ...
-2
votes
1answer
38 views

Efficient way to find the greatest result of A mod M in a range of numbers

I am writing a code that takes two numbers N and M and finds the greatest result of A mod M for all the numbers of A in the range 1,2,3,...,N-1,N. 1 ≤ N,M ≤ 10^9 My code is: ...
8
votes
1answer
302 views

Stack Exchange rev​iew queue notifications

A couple of days ago a user in chat asked us to spend more time in the queues. Kick starting my desire to get notifications for new items in the queues. Reviewing the queues has been something I've ...
2
votes
1answer
14 views

Reading and Storing Integer from Serial Monitor

Description I wanted to understand how integers can be written and stored inside variables without the use of Serial.parseInt(). I couldn't find any code examples about this. Perhaps this is the ...
3
votes
0answers
27 views

purrr::partial() but keeping function signature

I quite like purrr::partial(), which allows us to easily create partial functions. However, the partial function loses its remaining arguments from its signature (...
1
vote
0answers
9 views

How to optimize code to take advantage of NumPy broadcasting when calculating pairwise correlation?

I'm trying to take advantage of NumPy broadcasting and backend array computations to significantly speed up this function. Unfortunately, it doesn't scale so well so I'm hoping to greatly improve the ...
4
votes
0answers
40 views

Dangers of increasing fishing on a fish population simulation

Setup The following code implements the algorithm described in this and this paper. The first paper describes how the evolution of a fish population can be simulated, while the second paper introdues ...
-2
votes
1answer
19 views

How generate a random pojo value using reactor.core.publisher.Flux and reactor.util.function.Tuples [closed]

Firstly, take in account is my first question here in CodeReview. Any purpose misuderstanding will be highly appreciated if orientaded. Scenario: I want to answer randomly a pojo (json with two ...
-4
votes
0answers
20 views

Visibility of Variables in Methodes [closed]

I am working on a students management program which lists the names(VN), surnames(NN) and degrees(Noten) of the students / a specified student after entering his name In this code there is a java ...
2
votes
1answer
24 views

(Feedback) Finding bridges in an Undirected Graph implementation in C#

I am implementing fundamental data structures in C# while trying to learn techniques in the language to make my code cleaner, more concise while using good programming practices. I have implemented ...
5
votes
1answer
54 views

C++ Template to implement the Factory Pattern

Design A template class that will create a concrete instance of an interface class when given the name (as a string) of the concrete class. This design is often seen in code, so the purpose of this ...
1
vote
0answers
9 views

Google apps script Exceeded maximum execution time issue or 29k rows

I built some code to update dates from a Dump file. I am commonly running into an "Exceeded maximum execution time" message. Otherwise the code works fine. It imports & updates statuses for 16.5 ...
3
votes
1answer
39 views

How do I make the search in the typeahead widget more efficient

I have a typeahead widget to get the state or city's population according to what the user types Instead of issuing a GET request every time the user is done typing, the way this typeahead widget ...
2
votes
1answer
14 views

React Component Reuse with 2 similar components

I have 2 variations of components that I wanted to create in React. They both use Radio buttons with the only difference is one adds an image to one side of it. The first method will use just one ...
1
vote
0answers
23 views

Racket FFI for looking up the group and passwd databases

This is my first foray into FFI. It annoyed me more than it surprised me to learn that the definition of struct passwd is not portable; I've stuck with the GNU ...
2
votes
1answer
21 views

Find How Many Times Numbers Repeat on a Digital Clock

Project Overview: See how many times numbers would repeat x times on a digital clock output. This particular code only counts from 12:00 to 11:59, so it's technically only half of a day, I could take ...
3
votes
3answers
95 views

An entire file size retriever using a recursive os function in python

I'm a beginner and i just started with automate the boring stuff with python course and reached his first os lesson, so i decided to make a recursive directory size finder since apparently os.path....
1
vote
0answers
12 views

Code for tracking changes and deletions to tables

I have written a SQL server stored procedure to generate "log" tables which store the old values of rows when a table is updated, and also record when rows are deleted ( and by who ). It's quite ...
1
vote
2answers
48 views

Tokenizing a large document

I'm currently trying to process a corpus of a million patent text files, which contain about 10k non-unique words on average. My current data pipeline works as follows: Load the patent texts as ...
4
votes
0answers
35 views

PHP MVC login page

I am quite new to the MVC concept. I already know how to program object-orientated from other languages like C++ or Java. I have implemented a little login system for test purpose. I am not sure if my ...
-4
votes
0answers
29 views

What should I return as response for asp.net core 3.1 web api with ef core 3.0 and repository pattern [closed]

What I am basically asking is that what is the proper way of returning data from a controller implementing repository pattern. Here is the code of my controller - ...
3
votes
1answer
21 views

Brute-force electronic component selection space search

Yesterday I hacked up a simple component selection program. An example is shown at the bottom for the application, though this can be used generally for a lot of different simple circuits I come ...
4
votes
0answers
43 views

Sharing User Inputs via Dependency Injection

This code solves the problem of how to share user inputs throughout a large application when using dependency injection. To achieve this, I'm using a static (through DI) store and injecting it at ...
0
votes
0answers
22 views

Fetch HTTP wrapper and API

I have written a basic HTTP wrapper around the fetch. Then a API service which add some default options/parameters. the idea is ...
0
votes
0answers
28 views

Custom view to select a value

I created a Custom view to select a value. I use horizontal Recyclerview to select an integer value and 2 buttons that decrease or increase the values. Could you consider the code and tell how it can ...
3
votes
1answer
23 views

Python script for refreshing and preprocessing data in Excel report files

I wrote some code to create marketshare reports. However, I'm sure it can be improved. The tasks performed are: Open the global data file, refresh the data, import its content as a DF. Create a ...
1
vote
0answers
17 views

Existential quantification versus explicit types

I developed a card game engine for a german three player card game called Skat. The operating code lives in a StateT SkatEnv (WriterT [Trick] IO) Monad. ...
1
vote
0answers
44 views

Awaiting the completion of a server request

I faced the following problem. I have a Server object server which exposes TriggerStateChangeAsync() which return an ...
-2
votes
0answers
16 views

Opening a New Window on a Button click - MVVM WPF

I am new to MVVM architecture, and I would like to keep the standard of MVVM without violating its rules. So I implemented an approach to open a new window on a button click using Services. I don'...
3
votes
0answers
17 views

Django migration script to add metadata

I made a simple django migration that adds two field to our Invoices model : first_payment and first_paying_month. ...

15 30 50 per page
1
2 3 4 5
1312