All Questions

59,146 questions
15 views

Copy files and folders from file share to SharePoint library [on hold]

I got below code from Phil Child's website. How do you add a delete block if files or folders do not exist on file share from below? ...
59 views

Mario Party Snake and Ladders Board

Context Was inspired from this LeetCode post to do my own System Design exercise of the common Snake and Ladders problem. As I was writing the code Mario Party kept coming to mind so I added a little ...
15 views

Ordered List insertion [on hold]

I am having trouble making the numbers that I put in the list go in order. I am making a program with a list where I can insert 3 numbers into that list. The 3 numbers should be sorted after inserted ...
60 views

Unmanaged byte array to managed structure

I have a need to turn byte arrays into various structures. First version: ...
18 views

Removing duplicate field entries from sorted csv data

Given the following input (cat i.txt), I want to remove duplicate field entries in each of the first three columns and none of the others. ...
36 views

Text-search optimization algo

The following code takes in two params. An array of sentences and an array of queries. Each query has one or more words. The function below prints out index of sentence for each query that has all the ...
44 views

How the code be more pythonic [on hold]

While this code is working fine, I am not sure if this is really well written, and pythonic. Also, I don't really need ase_mod ...
30 views

Prompting the user to input a data value into an element in a linked list

I'm working through a practice problem that is having me build and modify a linked list over a series of steps. I am particularly interested in knowing if there's a more elegant way of prompting the ...
74 views

Find the smallest element in a sorted and rotated array

I was solving a question asked in interview by Uber. It says: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. Find the minimum element in $O(\log n)$...
18 views

Implementing a Stack container adapter to check whether brackets are balanced [on hold]

I am a beginner and I wanted to implement my own Stack container adaptor that uses a function that checks whether brackets are balanced or not. I tried implementing the function but I get an error of ...
8 views

Reference in a nested struct [on hold]

I would like to find an way to express the append_message() method so that I can hide away the serialisation. ...
19 views

Accordion component with Angular 7

I have to made an accordion-, respectively "zippy"-component using Angular 7. I'm new to Angular. Just started with it a few weeks ago. But with some Google-usage I was able to implement the ...
755 views

Compiling and throwing simple dynamic exceptions at runtime for JVM

I've been using my Dynamic Exception with C# for quite some time already and it saved me a lot of time. This means, I don't have to create a new exception ...
23 views

Writing classes to withstand future business logic changes [on hold]

I have a processor class AbstractProcessor and multiple concrete classes of the same which gets called in order of the business logic. ...
53 views

Asp.net networking/restclient layer

I have been working on creating maintainable networking layer for our Asp.Net Core Web Api project. Right now I have created Generic methods for Get, Post, Put like this. ...
29 views

Refactor code to comply DRY pattern [on hold]

I have bunch of if's in my console app, which check if command line parameters are valid, it all looks like this: ...
23 views

“Detailed” exception class hierarchy

I'm designing an modular exception class hierarchy to use in various projects. I intend to inherit from std::exception in order to be maximally compatible with any ...
38 views

N-Repeated Element in Size 2N Array

The task is taken from leetcode In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times. Return the element repeated N times. ...
41 views

Finding a key from values (which are list) in dict

I have a dictionary: x = {'a': [1, 2, 3], 'b': [4, 5, 6]} and I have to extract a key based on an input. For example assume it is ...
20 views

Items also occurs in a set

The task You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how ...
73 views

New Year Chaos JavaScript, needs to be sped up

Similar to this question but this is for Python Original problem with description on hacker rank I am currently trying to iterate through a large number of arrays and count how many times numbers ...
17 views

inputMismatchException [on hold]

im designing a class that stores the name of three runners and time it took to finish the race. this class has methods that return the name of the runner in 1st, 2nd and 3rd place ...
83 views

Generating Biased Random Values (Walker's Alias Method)

Am simply wondering if I made any egregious mistakes while implementing the Alias Method as an IEnumerator<TElement>; would also like to know if there are any ...
36 views

Delete directory tree function

I made this function to delete a directory with all its contents recursively, will it work as expected in a production environment ? is it safe ? I don't want to wake up one day with ...
43 views

Calling a Function to Calculate Multiple Coefficients

I'm working through a practice problem and am wondering if there's a more efficient way of writing my code and/or if the syntax for my pointers looks correct. The practice problem: Given the ...
17 views

Linked list with memory leak issues [on hold]

The nodes seems to connect just fine until implementing my getName() function for variable assignment: ...
17 views

my kotlin code is to display an onboarding screen when app is launched [on hold]

but instead it keeps stopping even before it starts... this is the code(this is the fragment adapter class) ...
45 views

Trellis Generator

I've been tasked with writing a simple trellis generator. The user is prompted with entering the height and width of the desired trellis, and gets a printed result of a trellis with the entered ...
38 views

Create the logic game Mastermind using a GUI

This code uses a single Mastermind class to hold everything needed as a tkinter widget that inherits from tk.Frame. Is this the best way of organising something like this or would it be better to use ...
126 views

Searching extreme points of polyhedron

In my Uni, my scientific professor asked me to make some researches about the extreme points of polyhedrals. And I did them. I found that there is still no code in public for searching extreme points ...
26 views

Super fancy list constructing in Python

Out of curiosity I was discovering the potential of the Ellipsis object in Python (...), and I discovered it doesn't do a whole ...
22 views

Presenting a “wait for input”-type message before exiting program (on multiple OS's) [on hold]

Includes for std::string and cstrings: #include <string> #include <string.h> Preprocessor code testing for ...
20 views

Average histogram combining multiple files and vector of vectors (in c++)

I run a program of simulation N times (I use each time a different random numbers to initialize it). The results of the program are stored in 2N directories: every run produces two approximations. The ...
51 views

Design a sustainable home tracker and calibrater for power, water, gas to minimize the expense

Problem Statement Following are the various scenarios to be considered Track energy - Track consumption of water, gas and electricity. We should be able extend to capture other type of ...
24 views

Implementation of std::experimental::observer_ptr (library fundamentals TS v2)

I made an implementation of std::experimental::observer_ptr (library fundamentals TS v2). observer_ptr basically behaves like a normal pointer and does no ...
32 views

Find max path sum from two leaves

I am working on one question, Find max path sum from two leaves Given a binary tree in which each node element contains a number. Find the maximum possible sum from one leaf node to another. ...
32 views

Battleship game in python for a project in school [on hold]

I'm a beginner at programming and I want to build a warship game in python 3.6 for my school project, I have some mistakes but I don't know how to fix it. If you try to run my code, run it until there ...
25 views

I can't continue where I finished [on hold]

First of all I'm a kid who found this code as a base for me and then I edited it but then whenever I load it the first time and teach it, it will save the pickled data but at the second time the data ...
15 views

File is exist but dowload code gives FileNotFoundException error [on hold]

I want the user to download docx. documents from the website. ...
363 views

Determine whether an integer is a palindrome

The task Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: ...
34 views

Segmented Sieve Spoj

I tried(trying...) to solve the SPOJ prime number problem PRIME1 so i learned and implemented Segmented Sieve correctly but this program works in time for 10^8 but getting Time limit exceeded (TLE) ...
32 views

C++ return: brackets considered harmful? [on hold]

(Preliminary note: we had an interesting side discussion here, but obviously the question has deserved an own place.) Take this innocuous C++17 code: ...
18 views

Ensuring referential integrity in child, group relationship

I'm not going to lie - Sql Server is not in the top 10 of my skill set, but it's something that I have to do from time to time. What's more, I'm using Entity Framework, so there is a workaround ...
61 views

Beginning C, hangman

I have been working on this hangman game for a little while trying to get familiar with C programming. The game seems to work fine but I am looking for some pointers on my code. Are the global ...
20 views

Select a value other then currently selected drop down value

Scenario:Select a any other value other then currently selected from a drop down. Please help/review the code and tell me whether this is a efficient solution? ...
70 views

C++17 <span> implementation

C++20 added the span library under the header <span>. As voluntary exercise (not homework!), I spent approximately 1.5 ...
52 views

GUI Button Element with Unit Tests

I would like a review on just a single class today. More important to me than a review on the class itself, however, is a review of the unit-tests I wrote for it. You see this is my first attempt at ...
66 views
+50

ASCII code decode to string

I am working on this question and have my answer as following? A string is encoded by performing the following sequence of actions: Replace each character with its ASCII value ...