All Questions

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

Heap corruption error in the following program? [on hold]

I'm trying to implement dynamic array in C++ for practice. Here is my implementation: ...
2
votes
0answers
29 views

SQL Code That Looks for Dupes with Confidence Score, 3hr / 1.2 BILLION Rows Returned. Optimize?

OK, I have a customer list that has approx 80k records. I need to search and compare looking for duplicates, but duplicates could be an exact match, or a similar match (only some data matches) so it ...
10
votes
2answers
630 views

Iterator for traversing a tree [v2]

this is an update of the implementation after I followed the feedback from Iterator for traversing a tree. After that I did changed quite a bit on the design and decided to ask for another round of ...
2
votes
2answers
47 views

Caesar Cypher Implementation

I am learning C# and for an experiment I tried implementing the Caesar Cypher cryptography method which just offsets every character of the string n characters. How can I make this simple program ...
6
votes
1answer
53 views

Boyer Moore Horspool Search Algorithm in Go

I am practicing Go and try to implement Boyer Moore Horspool Algorithm in Go, It returns all ocurrance of a "phrase" in a given text. This code is working, but I would be pleased to have any feedback ...
2
votes
0answers
38 views

A python script to plot a joint probability mass function table

Consider this example Suppose that 3 balls are randomly selected from an urn containing 3 red, 4 white, and 5 blue balls. If we let X and Y denote, respectively, the number of red and white ...
2
votes
0answers
22 views

Initializing Group Data Mess

This is my OnAppearingAsync method where I as a page load in Xamarin I filter data, group it together, set data based on it, order the groups e.t.c. However the code is rather long and looks a bit ...
-2
votes
0answers
16 views

Is Multi Authentication on one Endpoint Considered Bad Practice? [on hold]

Whilst this question is arguably opinion based, I am looking to gauge the opinions of other engineers on this matter in order to assist in settling a debate between two engineers. Consider the ...
3
votes
1answer
58 views

Webscraping cryptocurrency

In this class I made a webscraper for a cryptocurrency website to get the name and the price of each currency. There are maybe API's that I can also use, but I thought it is better to gain some ...
2
votes
0answers
28 views

JavaScript random BigInt

Problem: JavaScript does not provide a random BigInt so there is a need to generate a random BigInt within a given range that is evenly distributed. Solution I have tried many algorithms with a ...
2
votes
2answers
51 views

Color The Fence codeforces - TLE

I am trying to solve this problem: Igor has fallen in love with Tanya. Now Igor wants to show his feelings and write a number on the fence opposite to Tanya's house. Igor thinks that the larger ...
-2
votes
0answers
16 views

Removing key value pair from yaml in python [on hold]

we would like to remove the key and the values from a yaml file using python, for example ...
3
votes
1answer
33 views

Simple projects planner on PyQt5

My task was : Create a Python application to display the active status of your IT project. Everyone the project has its own unique number that is generated at the stage of receipt project into the ...
-4
votes
0answers
34 views

reading a file to create a Class maze consisting of 2d array of class cell [on hold]

I need to read a file ,but the problem i dont know the number of cells and rows, thus i will have to read it twice first to get the number of rows and columns and the second time in order to ...
-4
votes
0answers
20 views

Programming the infinite fraction of the golden ratio [on hold]

The infinite fraction form of the famous mathematical constant (phi) is as follows: 1+1/(1+1/(1+1/(1+1/(........ I tried to program it in C using a recursive function (and calculating the fraction ...
-2
votes
0answers
14 views

Comparing Schema Version from Database Table with version.php [on hold]

(I apologize in advance if this questions is posted in an improper or non-optimal venue.) I am trying to compare the version number of the database schema from the table below with that of $...
7
votes
2answers
261 views

Inventory coding interview exercicse

This past week, I had a coding interview where I have failed badly. The feedback that I get from the recruiter was that my code reminded the team of older ways of coding in C#. This led them to ...
-3
votes
0answers
9 views

If the lower limit were inclusive and the upper limit exclusive, which expression would properly generate values for the secret number? [migrated]

I'm trying to find out which one is inclusive and exclusive. I know that this code segment is inclusive //Generate a secret number between the lower and upper bounds (inclusive of both) ...
1
vote
0answers
40 views

LeetCode: Daily Temperatures C#

https://leetcode.com/problems/daily-temperatures/ Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until ...
5
votes
1answer
67 views

Fetch, plot, and send security incident statistics with Excel

TLDR: I don't develop for a living. If someone could point me in the right direction to make my script more readable/pythonic I would appreciate the assistance. In particular I'm struggling with the ...
2
votes
1answer
19 views

Synchronous use of Mongo-Scala Driver

The Mongo-Scala Driver (v2.6) currently only supports asynchronous operations, although my use cases often seem to lend themselves well to synchronous reads. This may be to block downstream code ...
5
votes
2answers
190 views

Magic Square (Python)

Problem Write a method to return a boolean if an input grid is magic square. A magic square is a \$NxN\$ square grid (where N is the number of cells on each side) filled with distinct positive ...
-1
votes
2answers
57 views

Hackerearth challenge - Roy and Code Streak

Roy is working on HackerEarth Profile. Right now he is working on User Statistics. One of the statistics data (Code Streak) is as follows: Given the User Activity Data, find the maximum number ...
-1
votes
1answer
36 views

Code reuse when generating dynamic variables [on hold]

I have some code that I want to repeat in the best way possible. I'm looking for some advice to an approach. Function, object, other? Thanks! ...
-3
votes
0answers
29 views

Call the function multiple times [on hold]

I have a requirement where I need to make a database call to get sales record count(GetRecordCount in code) and then process 1000 records at a time(ProcessNewOtranRecords in code). If the salesrecords ...
3
votes
1answer
36 views

Handling heavy conditional rendering in react

I have a general question pertaining to a component from one of my apps. I have a function, renderConditionals that is at the core of my UI. It's incredibly ...
-4
votes
0answers
20 views

Not using 'Service' as suffix in class names [on hold]

Suppose I am writing a class that is finding/fetching employees that have their birthdays matching the input date. I have chosen to keep the class name as ...
0
votes
1answer
36 views

Convert generic class into XML string of specific structure

There is a need to have a specific structure of XML string when interacting with 3rd party system. Here are two examples: ...
-2
votes
0answers
12 views

Creating a dynamic menu from JSON with multiple nested and sub nested objects [on hold]

The menu is building except for the section GroupName: Employment Department Reports. I create the first sublevel with the SubGroupName menu name have problem adding the reports information under ...
3
votes
1answer
34 views

JSON to CSS in JavaScript

Hello Im working on a JSON to CSS converter in nodejs, which takes a .json file and generates a .css file with its utility classes from it. .json example ...
0
votes
0answers
35 views

Tips about Project architecture, Inheritance, Files names [on hold]

I am writing some application what I want to use later to help me gather tweets, extract some data from it, manage, make some machine learning on it. This is my structure so far. I always did like ...
3
votes
1answer
132 views

overlapping rectangles c#

I had to write code for a competition which calculates sum of the perimeter of three overlapping rectangles in a 2D space. rectangle A and rectangles B and rectangle c is overlapping each other.They ...
3
votes
2answers
93 views

Fetching counties and localities using JSON API calls

I'm using the below code to call different methods from an API: ...
-4
votes
0answers
30 views

generate 10 random numbers that are not duplicates between 0 to 20 using arrays [on hold]

i have to generate a list of 10 random numbers between 0 to 20 using arrays.When i run the program, there are still duplicate numbers what am i doing wrong? ...
11
votes
3answers
3k views

Simple code that checks if you're old enough to drive

I made this small system that checks if you're old enough to drive. I'm new to C#, but I do know most of the basics since I also know Java. I'm trying to make my code more efficient. Any suggestions ...
3
votes
1answer
79 views

Simple todo script

This is my Todo script. It's working well. I'm looking for feedback on what I've done well, and what I could have done better. ...
1
vote
1answer
76 views

PDO Is this registration secure and well coded?

i finally have been moved to PDO (from MySQLi) and i m now trying to make simple login and registration page (for training purposes). This code does work! But i want to know if it is secure? Also ...
3
votes
1answer
49 views

a Python script to format plain text to markdown title

I wrote a Python script to format plain text to markdown title. for example, modify multiple lines ...
2
votes
1answer
60 views

Binary file reading and plotting data

This code reads binary file. Read data is converted into signed values and gets plotted if the user wants it. Data looks as below: ...
-2
votes
0answers
24 views

Collision Detection Code doesn't detect all the collision [on hold]

I am doing capsule-capsule collision detection. It's not perfect; it lets through some collisions. I'm thinking it may have to do with floating point error, but I don't know how to correct for that. I ...
7
votes
1answer
62 views

An explicit cast for narrowing numeric conversions

Inspired by gsl::narrow_cast, I created my own implementation with the addition of a couple of features: a static assert on the types to ensure the cast is actually narrowing (if future changes to ...
1
vote
0answers
24 views

program options from command line initialize [v3 - after CR]

After my previous code review, I'm sharing my new code, and asking for better ways (which always exist) to improve the code, even with new libraries. The only thing that important to me, is the way of ...
1
vote
1answer
34 views

Remove outliers from N dimensional data

I have created a function that will remove outliers from a series of data. Generally the data n dimensional. Loosely, an outlier is considered an outlier if it +/- deviates by 1.5 standard_deviation's ...
-4
votes
0answers
25 views

Code is returning an eigenvalue of 0 but should not [on hold]

The code I am writing is for the Jacobi method of approximating eigenvalues. I keep getting eigenvalues of 0 for any size matrix even though by hand I am not getting eigenvalues of 0. I think that my ...
10
votes
2answers
129 views

The Best™ class

Have you ever wanted to get just not one "best" element from a list, but all of them, or a random element of the best ones? That's what the Best class is here for. Opinion-based? Definitely not! ...
-4
votes
0answers
21 views

Printing character in a string based upon index inputted by user [on hold]

The issue I'm having is, if I put in a string such as 'red' and then ask for index of 3 which is larger than the length, I get no output, but if I enter an index of 4 I will then get my intended ...
1
vote
1answer
73 views

Capitalize the First Letter of Words in a String (JavaScript, Python)

Problem Write a function that accepts a string, capitalizes the first letter of each word in the string, and returns the capitalized string. Examples ...
-2
votes
0answers
45 views
2
votes
1answer
61 views

Improving the speed of loop in javascript for objects

So I have a loop that works great, but doing some testing I notice it is a bit slow. I get an average time within the loop of about 0.11 seconds. Include that with some arrays containing a length of ...
2
votes
0answers
29 views

Token Bucket context manager for rate limiting async calls

I've written a class that implements something akin to the token bucket algorithm so that I may rate limit aysnc HTTP requests made from my application. The code works but I'm still not sure if it ...

15 30 50 per page