All Questions

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

Vanilla Javascript: Chained AJAX request

I'd be grateful for a review of my AJAX request. If I have taken the correct approach here and especially any security concerns! I am creating a Purchase Order system for my manager (as part of an ...
2
votes
1answer
80 views

generic flyweighting function

I made this little function for flyweighting any type that has operator<. I followed the convention of make_unique and ...
0
votes
0answers
23 views

delete forms which are displayed as images [on hold]

I have a code where I create over a form, images which are supposed to be other forms which can be edited. That's the code how I create them: ...
2
votes
0answers
43 views

JAVA Shopping Cart Design

Recently, I have appeared for coding exercise to design the Shopping Cart which should have following features: handles barcoded (like Chips) and non-barcoded item (like Banana 400gm) Can add item, ...
4
votes
1answer
32 views

Simple income/expenses accounting program

I've decided to start working on a budget application for the purposes of getting started on Rust. In its current form this program takes given expenses and income and tells the user whether they have ...
-1
votes
1answer
30 views

HarckerRank 2D Arrays Hourglass challenge

About this 2D Arrays HackerRank problem. The task is to find the maximum sum of a region in a 2D array. Specifically, it is to find the maximum sum of an "hourglass" region, defined as a 3x3 square ...
3
votes
1answer
36 views

Ajax function with a callback

I have Ajax function with a callback which fetches all the Patient data however I have some perfomance issues and trying to figure out what it might be, does anyone have idea? That's my Code ...
-2
votes
0answers
23 views

Python Modifying a For Loop so that Loop Ends when condition is Met [on hold]

I have created a Python script that iterates through an HTML table.The script has an IF / ELSE section that looks for text with a decimal point. My goal is to determine if text on the HTML table ...
1
vote
3answers
32 views

`set_includes` (string subsequence-containment) in Python 2

I've implemented C++'s std::includes algorithm in Python, so that I can use it to efficiently implement a Scrabble "can I make this word" function: ...
-1
votes
1answer
64 views

Class Inheritance in C# (possibly generics) [on hold]

I'm working on a segment of code where it runs a number of tasks and then combine individual task results to construct a complete task result object, there's no concurrency involved so it's purely a ...
2
votes
0answers
27 views

Pure (almost) CSS Masonry

I developed this CSS Masonry. It works with a CSS grid with grid-auto-rows: 1px. There is a JS ...
4
votes
2answers
57 views

Displaying IP addresses in Go using Stringer interface

I am trying out some Go code examples (while coding a private project) to get more "in-depth" knowledge about the language. I have come across an exercise from the Go Tour website about displaying ...
3
votes
1answer
43 views

JavaScript function to categorize data by their “styles” attribute, and store the key-“unicode” pair

I have a JavaScript function to categorize data by their "styles" attribute, and store the key-"unicode" pair. Here's my current code: ...
2
votes
0answers
33 views

Powershell - Simplified Logging

Today I have dealt with logging in PowerShell as well as with the different streams and the pipeline. Unfortunately, none of these solutions really met my needs. My requirements are: I need to ...
7
votes
5answers
507 views

Grouping into more groups in one iteration

I had a need to group the same dataset in several groups. So instead of repeatedly query the dataset, I made an extension that could do it once. The caveat is, that the result is materialized in ...
0
votes
0answers
17 views

filter a select tag by an input able to find middle characters [on hold]

i have a select with dynamic options and values, and an input so user can type inside the input and select values get limited to those that has typed characters. i found this: similar question link ...
0
votes
0answers
18 views

Behavior of atomics in the copy constructor [on hold]

I am writing a class with atomic. Unfortunately I'm not an expert in atomics, and that gives me hard time. ...
-1
votes
0answers
27 views

Return as refernce or Return void , which particise is better? [on hold]

void func1(std::string& input , std::string& output) std::string& func2(std::string& input) { return output; } Which approach is good ...
4
votes
2answers
55 views

Arduino project to indicate soil moisture using LEDs

I've recently started going through the Head First C book. I'd like to get up to speed in terms of writing good, idiomatic, modern C. I have read the first few chapters of the Modern C book too but ...
2
votes
1answer
34 views

Store coordinates in 2d grid

I`m writing a function for small pygame program. The ideas is that I have a 500 pixels square screen and I want to place 5 objects per row with the size of width and height in random order and I need ...
0
votes
0answers
41 views

Is having a collection of predicates on a resource in an interface vs on the resource itself a code style or is there a best practise? [on hold]

I am working on a project using Java 8. I recently came upon this interface that has a number of static methods returning predicates for a class. My first inclination was that it doesn't look right ...
-2
votes
0answers
37 views

Using Generics in a Method correctly [on hold]

I need your help on how to refactor this. I'm currently "playing around" (if that's the proper way to say it) with generics. So I have 2 classes (...
1
vote
0answers
16 views

Implementing a thread pool for task execution

I wanted to experiment with a reusable thread pool that allows to add tasks and execute them repetitively. After going through, https://github.com/progschj/ThreadPool and another Stack Overflow post ...
3
votes
0answers
18 views

Symfony 4 controller with multiple forms

I have several pages in my app that have multiple forms. In this example, the 'account' page has 2 forms: allowing the user to change their password allowing the user to contact support I am new to ...
1
vote
0answers
10 views

Laravel controller methods for registering businesses and stylists

I use the Laravel API and want make messy code cleaner. I have a form for registering business and businessOwner. And stylist who is working under this business registering from same function. And ...
0
votes
1answer
54 views

Bowling Kata in Java

I am sharing my Bowling Game Score Kata made in Java, it is available for whoever wants to code review it. I appreciate any comments. ...
7
votes
5answers
989 views

Finding all possible pairs of square numbers in an array

I am writing a program that allows me to find all possible pairs of square numbers including duplicates. We can also assume the array elements to be of positive integers only. e.g an array of {5,25,3,...
6
votes
1answer
42 views

Basic Reinforcement learning in a grid environment

I am implementing the Bellman equation for utilities, in a grid environment as follow. It is an example on Chapter 17 of Artificial Intelligence: A Modern Approach 3rd Edition. There are some math ...
4
votes
0answers
58 views

Type & Thread-safe Logger Implementation

So I had previously posted this question and asked for some feedback regarding my (now) header-only logging system and figured it would be a good time to go back to the changes I made it and see if it ...
3
votes
1answer
52 views

Hurst Exponent calculator

I am aiming to compute the Hurst Exponent of a 1-D signal time series in Python. For now, I have one existing function hurst(sig) which returns the Hurst exponent ...
0
votes
1answer
25 views

leetcode 987. Vertical Order Traversal of a Binary Tree

anyone can provide some suggestion about my answer for the questions 987. Vertical Order Traversal of a Binary Tree Given a binary tree, return the vertical order traversal of its nodes values. ...
1
vote
0answers
50 views

Managing millions of objects in a MMO game server [on hold]

A litle context: This game server is coded entirely on C-with-classes (plain C code using basic C++ features like classes, templates and such, to avoid any possible overhead). At startup the server ...
9
votes
2answers
104 views

Implementing Linked lists in Python from scratch

After finishing my ds and algorithms course I wanted to implement what I've learned through the semester so here is my try for Linked lists, both regular (one way) and double one (two way). code: <...
0
votes
1answer
72 views

Adding a Node to the Linked List is taking a longer Time when using a reference to the Tail Node

I am trying to add two numbers in the form of linked List and return their result in a Linked List as given in https://leetcode.com/problems/add-two-numbers/ Question: You are given two non-empty ...
-3
votes
1answer
25 views

Display errors without static function calls [on hold]

I'm trying to avoid using static functions as much as possible. But the code is so clean when I use them. How would you cleanly refactor this without static functions? ...
-4
votes
1answer
39 views

Generate random letter without repetition [on hold]

I have this code but it brings repeated results. I want it to generate without repeating the letters ...
-1
votes
2answers
29 views

Please help refactor these jQuery code selectors for checked and unchecked checkboxes [on hold]

As you can see below, the following code has redundancies: ...
2
votes
2answers
90 views

Staircase challenge - Python

Your task is to print all unique ways to climb a staircase of length n where, from each step, you can take steps of size x where ...
-2
votes
0answers
34 views

Building a Vehicle object from Excel data using Apache POI [on hold]

I have the following code which is working but I am not satisfied with it and it seems like an ugly hack. NppColumn is an enum which contains the column indexes. The problem is when a POI row cannot ...
1
vote
1answer
35 views

Dynamically inserting html from external file and updating the database

I need some suggestions on how to approach this. I want to allow users to create sections of website. The code so far is working but since I am new to back-end I feel like there is better, more ...
2
votes
1answer
48 views

Find Todos by Line Number (or any other reference) in Python - Revised as functions

A new function based version of the code from this question as suggested by @Hlib Babii I write a lot of TODO's but I never keep track of where they are. This program will search through files (and ...
2
votes
1answer
76 views

Collecting numbers in ascending order

What kind of algorithm wold solve the following problem from https://www.ohjelmointiputka.net/postit/tehtava.php?tunnus=junar ? I have been given a positive integer n. Take the n first positive ...
0
votes
1answer
84 views

Abstracting an Email Notification Service & testing the the logic of the used abstract factory

In my application I have an Interface IEmailNotification that represents an Email and the concrete implementations have nothing to do with ...
-2
votes
0answers
37 views

Request to get more efficiently and clearly function [on hold]

I have function that create token depends on the giving parameters, the JwtSecurityTokenHandler tokenHandler will include different parameters each time the ...
1
vote
0answers
47 views

Making text based Blackjack game in Java. Can't figure out how to deal with Ace(1/11) and Splitting [on hold]

I've been learning java for about a year in University and decided to start this Blackjack game which I can hopefully animate into a full app in the future, although I'm still working on the ...
1
vote
4answers
113 views

Rock, paper, scissors game in Python 3

as a beginner in Python I made a rock, paper, scissors game and was wondering if my code was a bit weird and could be simplified??? ...
8
votes
2answers
991 views

ROT13 encoder/decoder

This is a simple utility, intended to sit on the desktop for when needed, that does the simple ROT13 encoding and decoding. I am used to coding in VBA, and I am interested in more .Net idiomatic ...
0
votes
1answer
34 views

Triangle of numbers maximum path - Greedy algorithm Python

A triangle of numbers path maximized using a greedy algorithm. It's not the most efficient way since I'm a beginner this is the best I could do. I need your feedback on how to make it better in terms ...
2
votes
0answers
75 views

Attendance using biometrics in php

I'm currently developing a system for attendance using biometrics in PHP. ...
-2
votes
0answers
26 views

Making a function for a tie game in Tic Tac Toe [on hold]

I am making a tic tac toe game, and so far there is complete functionality except for a tie game instance. The program doesnt end when there isnt a winner. I am not sure how to approach this, maybe I ...

15 30 50 per page