# All Questions

59,134 questions
416 views

### Finds a Character based on distance and health

I need to improve the efficiency of my program and, using the profiler, have narrowed the problem down to 2 key areas, but I am having trouble coming up with ways to make the program run better. ...
15 views

### c++ code for a new version of LIS A. K. A “Longest increasing sub sequence” [closed]

i need a review on a code i have wrote for a new version of the LIS problem. New Version of The Longest Increasing Sub-Sequence: you are given an unsorted array of integers as "A".the goal is ...
75 views

### Python, Rock, Paper, Scissor

Recently i wanted to test my Python knowledge so I'm taking some challenges. I came across a Rock Paper Scissor challenge and I wanted to make it with less code and reuse the same code over and over. ...
62 views

### Python - Random Mandala

I did a project in Python where I combined user-input, random, and the turtle module to make a sort of "Mandala Generator", or a program that can generate a simple design either randomly or by the ...
19 views

### When to couple output from one class as the input to another class? [closed]

I am trying to better plan the class structures of a large code base in python. The project is a data science project involving data cleaning, data analysis, etc. I model all the data cleaning tasks ...
22 views

### Load content from files (and sometimes parse) in Sapper

I am making my first Sapper app and the pages are all in routes. I am now extracting the content into a separate directory and unsure if I'm doing anything right. Here is an excerpt from my directory ...
25 views

### Wordpress plugin to create page-specific categories

I would love some feedback about this very simple Wordpress plugin (my first one). It's intended to create page-specific categories (via the creation of a custom taxonomy). It's working on my ...
71 views

### Statistical methods using PHP (mean, co/variance, standard deviation, skew, correlation)

Functionality This class has a list of statistical functions such as mean, variance, standard deviation, skewness, and it works okay. These functions are applied to arrays of charts data. It is an ...
61 views

### Binary genetic programming image classifier's fitness function

I am trying to figure out how to improve my binary image genetic programming classifier's fitness. It takes images and classifies them if it has some feature X or not in it. These are the main ...
41 views

### GUI that searches files using user inputted search strings [closed]

Basically, I've got a GUI where the user can select text files, enter in strings (that may or may not contain wildcards) and search those files for those strings. Currently, I take the user inputted ...
56 views

### Formatting integers with commas (12345 → 12,345)

Beginner/occasional C tinkerer here. (Reasonably comfortable with scripting languages, tend to avoid C due to its terseness, but trying to work past that.) I happened to want to insert commas into ...
67 views

### Cleanest way to get value from secondary form [closed]

I've written a simple program that reads barcodes from a page and will ask the user to select one to use. I have a few methods that use the results of that form and I was wondering if there is a ...
35 views

### Function that checks two objects with same fields and assigns old non-null values to new object if new values are empty or null

I have a function that checks two reference objects. They both have the same properties. The purpose of this method is to ensure that any non-null old values are not overwritten with null or empty ...
95 views

### Game to shuffle and guess a word

I'm new to C++ and while learning, I wrote a simple program that asks for a word, shuffle sthe characters and then asks another person to find the original word, given the shuffled letters. I would ...
41 views

### Fill /dev/random via Bitcoin exchange value [on hold]

I have written the following random numbers generator. I would like to know how safe this is and if it is suitable for use in computer engineering. For me, the result looks very random, but would like ...
22 views

### Onclick radio buttons to change background color

We are displaying two radio buttons in page. Click on Radio buttons, it will change background color. Is there any way to improve the quality of the code? ...
172 views

### Finding the upper and lower bound using binary search

I am trying to solve this InterviewBit question https://www.interviewbit.com/problems/search-for-a-range/. My code for this seems to be working properly and it does give me the correct answers on my ...
16 views

### Asking data to a Servlet from jsp and send them back to the jsp

Image that a user have to book a private lesson by compiling this form. Using MVC pattern I'm building a WebApplication to achieve this goal; I have a jsp wich contains the form and by using Ajax I ...
27 views

### Cleanest functional way to iterate a 2D Grid Co-ordinates in Scala? [closed]

A Solution using nested for loops is trivial. Here is my code to iterate over a 2D Grid in Scala using map ...
270 views

...
65 views

### Forming the best possible poker hand [closed]

This is what the function is doing: it gets two arrays of tuples with 5 items each - hand = [H1,H2,H3,H4,H5] and board = [B1,B2,B3,B4,B5] What I need to do is check all arrays formed by 2 items from ...
39 views

### Comparing 2 iOS and Android versions

Please review and let me know which version is better. I'm just trying to find any caveats or better ways to accomplish the a version comparison independent from Android and iOS. Formats accepted: '1....
80 views

### Implement Queue using fixed size array

I came across below interview question and I am working on it: Build a queue class with the enqueue and dequeue methods. The queue can store an UNLIMITED number of elements but you are limited to ...
31 views

### Recursive File Search Using the Dir() Function

There are plenty of examples of using the FileSystemObject to recursively search for a file in subfolders. I thought that it would be interesting to write one using the Dir() function. I was ...
31 views

### Simple command-line roulette game

I developed a simple command-line roulette game. Your only options are betting on color, but you can bet multiple times in one round ...
99 views
+50

### Golf Physics “Game”

Continuation of this post I wrote a program in pygame that basically acts as a physics engine for a ball. You can hit the ball around and your strokes are counted, as well as an extra stroke for ...
1k views

...
37 views

### Using IndexedDB as an in-browser cache

In my site: Users have many Activities Each Activity has encoded_polyline data I display these encoded_polylines on a map I want to use IndexedDB (via Dexie) as an in-browser cache so that they don'...
41 views

### 5 different inputs from same [closed]

im working with laravel and i want to ask you how can i insert more then one different input data from 1 form to same table field, for example: I have that 2 migrations: ...
13 views

### Google ChartWrapper bar formatted table

The end result is a bar formatted table chart that has expanding and minimising rows. The code below works fine but I'd like to know if there is a cleaner way to achieve the same result (see JSFiddle ...
63 views

### Create an isolated dependency scope with “overrides” in Asp.Net Core

Some of the classes in my multi-tenant Asp.Net Core application depend on database repositories which in turn depend on a delegate called GetCurrentTenantKey. In ...
49 views

### Correct Python script structure [closed]

I've been programming in Python for some time now and I've always used the below structure to organize my code. Lately, I've been wondering if this structure is an ideal and correct one to use ...
46 views

### ASCII Mandelbrot Set “image” producer

As an exercise, I decided to try implementing a Mandelbrot Set viewer that produces ASCII images. Small Example: ...
43 views

### Sum of two numbers in array

The task You are given two non-empty arrays representing two non-negative integers. The digits are stored in reverse order and each of their items contain a single digit. Add the two numbers ...
43 views

### What's the complexity of the algorithm to find median of 2 sorted arrays [migrated]

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be $O(log(𝑚+𝑛))$ Here is the code that I ...
36 views

### Quick sort in assembly x86 language [closed]

here is the link to the file below mboshart.dyndns.org/~mboshart/3410programs.html#prog3 Allow the user to enter a number of strings up to a maximum of 100 (MAX EQU 100). Set the maximum length of ...
27 views

### Python code for handling HTTP cookies [on hold]

We would like for a code review for our Python code. The code is written in Python 3.7 and is part of a class handling HTTP cookies. The code: ...
84 views

### Roman Numbers - The Functional Way

Yet another exercise in converting values between the decimal and roman number systems. I have tried the functional way. Any comments are welcome - but I'm especially interested in answers focusing ...
44 views

### Efficient way to add a colon before and after every word in strings inside a Series

I was working with twitter data, and extracted every emoji from the data. But, when I passed that data through CountVectorizer, colons where substracted from the ...
47 views

### ASP.net service that sends email whenever an entity is updated [closed]

I have an ASP.net MVC5 project which involve different domain services, and one of it are EmailService which will send email if entity is updated. ...
20 views

### PreparedStatement for closable recordset and connection

Following approach uses more Functional approach (non OOP), each method is passed DataSource as dependency. I've written this piece and I'm wondering if there's something that can be improved. I wish ...
44 views

### Aggregate Pandas Columns on Geospacial Distance

I have a dataframe that has 3 columns, Latitude, Longitude and Median_Income. I need to get the average median income for all points within x km of the original point into a 4th column. I need to do ...
9 views

47 views

### Improving speed of data clean process in vba

My code does exactly what I want it to. However, being relatively new to VBA, I feel it could be a lot more efficient - namely I think I have overused loops and worksheet functions which are slowing ...
38 views

### Controller and Model Session handling classes (MVC OOP PHP)

Models/Session.php This file performs basic conditional checks and defines a function for each distinct action regarding Session initialization and ID regeneration. Is it OK, in this context, to ...
31 views

### Multiprocessing a for loop in Time series [closed]

I want to use multiprocessing for a 'For loop'. So basically from a another dataframe I am passing ID,PID to main dataframe, so depends on ID,PID it will filter the dataframe & build a model. I ...
19 views

### Implement search for JPA and Spring

I'm trying to implement properly search functionality for database table. I tried this approach: Controller: ...
82 views

### Maze generator for teaching Python 3

I am teaching programming (in this case - 1 on 1 tutoring of a teenager interested in programming) and this code will be a final stage of a progression toward program generating a maze. Any comments ...