All Questions

1
vote
1answer
27 views

Generating all subarrays from an array of Integer

I want to generate all the subarrays from an array of integer as below: ...
0
votes
2answers
40 views

JavaScript DOM Implementation

I'm supposed to create a website that adds multiple forms to the page, is responsive and checks if the inputs are valid (validation is not important, just needs to show some attempt at regex). Below ...
1
vote
2answers
40 views
1
vote
2answers
55 views

Find an order with the minimum total price

We want to create an application for the analysis of the order history at an online store. Each order is made by a customer and concerns the purchase of one or more items. Orders are stored in ...
1
vote
2answers
43 views

Python program to find the topic with the most meeting time dedicated to it

I must create a program for information regarding schedules and topics of meetings at work. The data relating to the meetings are stored in an "M" matrix with 5 columns, in which the generic row [g, m,...
3
votes
0answers
30 views

Object-Oriented Breadth-First Search Implementation

My goal is to write a GUI application where a user can create a maze and select an algorithm. The passage of the algorithm from a selected start and end point should be visualized. The following ...
-3
votes
0answers
10 views

Python: cycles and indices [on hold]

Write a function which receives an "L1" list of integers and returns a list "L2", of the same length as "L1", whose generic element L2[i] is equal to the first major element of L1[i] present in "L1". ...
4
votes
2answers
39 views

Simple person manager console-app

The code below is for a coding challenge for a job. I have everything working as they requested, I've reviewed it myself and believe everything is good. I'm just looking to see if anyone see's ...
0
votes
0answers
6 views

Web server using syscalls in Go

I'm new to Go and wanted to implement a web server using system calls to get a better feel for how everything works. I'm looking for feedback on idiomatic go especially error handling and using ...
1
vote
1answer
20 views

De-bouncing a (Gray) Rotary Encoder Switch in C

I would like feedback on the correctness and performance of this code. My priorities are also are readability, simplicity and self-documenting code - but I'm happy with those as they are. I still ...
1
vote
3answers
30 views

SPOJ Adding reversed number in Java

I just started to practice for competitive programming and just started to solve the most solved problems on SPOJ. This is what I made for ADDREV: Adding reversed numbers in Java (https://www.spoj....
1
vote
2answers
26 views

Work out largest prime factor of a number

I am trying to get better at problem solving, so I am going through challenges on Project Euler. Problem: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of ...
1
vote
1answer
12 views

Print out numbers of increasing distance from center value in Python

I am trying to print out numbers by increasing positive and negative values around a center number, and I don't think I've found the best way. For example, say I want to find what number in a list my ...
4
votes
3answers
179 views

LRU implementation in C++ using a LinkedList

Explanation : I am adding new elements in the list until the window runs out. Head will have the earliest element and tail will have the most recent element. Once the window is over, every addition ...
1
vote
1answer
18 views

CustomerIdentity class to bridge gap between internal and external CustomerIDs

Purpose This was designed to be able to seamlessly replace string SAPCustomerID and int CustomerID in parameter lists with <...
2
votes
1answer
23 views

Hamming Distance in Python

I was solving this Leetcode challenge about Hamming Distance. Would love feedback on my syntax and code style. Here's the challenge description: The Hamming distance between two integers is the ...
-3
votes
0answers
34 views

Architecture Website Layout [on hold]

I'm a software developer trying to level up my front end skills. I used to be quite decent at it but haven't worked with front end for a long time so my skills are a bit rusty. As an exercise I'm ...
3
votes
0answers
41 views

get; set; in C++

I wrote a class that replaces the get and set functions: ...
0
votes
0answers
15 views

Esoteric programming language in Ruby

I have recently created an esoteric programming language called 01 and I will be grateful for a code review and any opinions or suggestions about the future of this language. GitHub ...
0
votes
0answers
12 views

React table with JSON

I'm pretty new to React and I was working on some JSON data. Now I just to understand basic concepts, so I wrote this little component, but in my eyes it's not efficient. ...
0
votes
0answers
28 views

Graph puzzle resolver

I've solved test task for job vacancy. Need your feedback about my solution. Task The image below shows the puzzle in the solved state. The puzzle consists of 10 cells. Among the cells one is empty, ...
0
votes
0answers
9 views
5
votes
1answer
14 views

Forcing the user to choose from a set of options (in Python)

First Code Review request =) I wrote this after making several projects that required a user to pick an option. I wanted to have a set way of forcing that choice in all of my projects. The module also ...
4
votes
2answers
37 views

Parsing Bitcoin binary data file with Python

The script parses Bitcoin database (blkXXXXX.dat) files directly from raw binary to txt human readable view. And I think about how to encrease the speed of processing. Can anyone suggest how to ...
0
votes
1answer
25 views

Insertion sort algorithm in Java

I have tested this code and it yields the expected outputs, but I want to verify if I have applied insertion sort algorithm correctly or not. ...
1
vote
1answer
24 views

CSS and React.js for a basic navigation drawer

I am trying to optimize my navigation drawer code. I have tried and followed the BEM naming convention for my CSS although I would like it reviewed with respect to the best practices being followed. ...
1
vote
1answer
144 views

Databinding entire objects between child Vue components and the root Vue instance

I have a form in which I am collecting data from two applicants. In order to minimize HTML duplication I built an applicant Vue component that generates each applicant from a template. Each ...
0
votes
1answer
16 views

Django functions to sanitize URL, return welcome message, redirect, compute HMAC, and manage profile picture

I wrote this code to to perform the following: I will remove the "spaces" within the url. Return welcome message. Redirect the user to different url. Compute HMAC for the request. Return and revoke ...
3
votes
1answer
31 views

Noughts and Crosses Version 2

Made the game much more user-friendly than previous version - has an example grid to demonstrate input, Xs and Os are now used. Game can now detect draw. Changed the algorithm to detect winner, it'...
0
votes
0answers
24 views

Find all starting indices in a string which are anagrams of a word

The task: Given a word W and a string S, find all starting indices in S which are anagrams of W. For example, given that W is "ab", and S is "abxaba", return 0, 3, and 4. My solution: <...
0
votes
1answer
14 views

Incrementing time in a discrete-event simulation of a supermarket queue

A method has been written that increments time in minutes that simulates how much time it takes to process item in a supermarket queue and if there is an empty queue, skip it and loops around to find ...
0
votes
0answers
6 views

Dynamic “compilation” of SQL stored procedures

I have a stored procedure which is called to create ( "compile" ) temporary stored procedures, code below, based on whether a flag in a database record is set - the various sub-procedures such as ...
2
votes
0answers
21 views

Codewars: N smallest elements in original order

I am consistently timing out on the mentioned kata: Task You will be given an array of random integers and a number n. You have to extract n smallest integers out of it preserving the original ...
3
votes
0answers
33 views

Chess move validator

I have written code for making a Chess Validator, which will validate the moves of a chess game. There is a Main class which is taking the input from the user, about the move. Problem The board is ...
-1
votes
0answers
35 views

Dynamic programming with 3D arrays

I am trying to solve a question given on Codeforces involving dynamic programming with 3D arrays. F. Trucks and Cities There are \$n\$ cities along the road, which can be represented as a ...
0
votes
0answers
14 views

Tracking when a column was last modified using a trigger (in SQL Server)

How can I improve the following code to track when an Azure SQL Database column value was last modified? ...
-4
votes
1answer
33 views

JavaScript Code - Your Opinion [on hold]

I wrote the following javascript code and I need someone to review it and give me his opinion about my stracture, flow, mistakes (if exits) and things I have to avoid. The code contains the following ...
1
vote
1answer
79 views

Calculating array size in C++

This code shows two ways to calculate size of array of any type. I would like to know, which should be preferred? Is there any advantage/disadvantage? ...
1
vote
2answers
36 views

Find maximum length of array where every entries are the same

Is the complexity of this code \$O(n^3)$? How can I improve the efficiency and reduce the complexity? ...
0
votes
1answer
27 views

Predicting credit card default

I have this code for predicting credit card default and it works perfectly, but I am checking here to see if anybody could make it more efficient or compact. It is pretty long though, but please bear ...
2
votes
1answer
59 views

Program finds the first almost matching string in a list - Advent Of Code 2018 Day 2 Part 2

Advent of Code 2018, day 2, part 2: The [two IDs you are looking for] differ by exactly one character at the same position in both strings. For example, given the following IDs: ...
1
vote
0answers
23 views

R code for inequalities row by row

I would like to efficiently calculate which coordinates (x, y) fall between (x1, y1) and ...
1
vote
1answer
646 views

Creating and calling objects sequentially in Tkinter with Python 3

I am trying to build a very simple user interface in Python 3 using Tkinter to be used in windows. and have written a code which is not efficient - it is excessively long for no good reason. I am ...
5
votes
6answers
2k views

Calculating Fibonacci numbers

The following problem is currently taking more than 8 seconds to execute. Please help me to modify the program, so that execution time will be reduced. ...
1
vote
1answer
22 views

CSV/JSON converter

This is my first Python script and I would like to hear the opinion of more experienced users, so I can do it right from the beginning instead of trying to correct my mistakes after months (years?) of ...
3
votes
3answers
80 views

LeetCode Problem 66 : Plus One

I have started practicing problems in leetcode and I solved the following problem on LeetCode. The challenge is : Given a non-empty array of digits representing a non-negative integer, plus one to ...
1
vote
2answers
11 views

Bash script to find included files in C code

I've got the following shell script (let say get_includes.sh): ...
-3
votes
0answers
8 views

How to store a range of generated numbers using IntStream to a text file [on hold]

I wrote a program to generate a range of numbers using IntStream (java 8) but can seems to figure out a way to store the generated numbers into a text file. I know how to store Strings to a file but ...
3
votes
1answer
28 views

Numbered lines list

I tried my hand at making a numbered line list. I would like some feedback on my use of CSS and if this approach (using a numbered list) is considered a good solution. ...

15 30 50 per page