All Questions

59,134 questions
6 views

LeetCode 773. Sliding Puzzle - DFS Logic

I tried to solve the LeetCode Sliding Logic Puzzle using BFS and DFS. My BFS solution worked, but my DFS solution did not ... and I cannot figure out why. Here is the original question: https://...
10 views

Extract the IP address from the output of ipconfig when connected to multiple wireless networks

I am trying to extract the ip address of my machine when connected to multiple wireless networks. The motivation here is then I can make a socket connection on that ip when I have two networks that ...
8 views

Putting a Queue Between HTTP Request/Response

We currently have two legacy systems: the Consumer and the Worker. These systems are massively complex in ways that are not important to this review, but it is enough to say that a large-scale re-...
12 views

Modal pops up after ajax call completes instead of before

I have a modal that I am using to tell the viewer "Please wait" while an AJAX call is made. It may be something as simple as how I am making the call. When I click my web link, it appears to be ...
9 views

What is the classes in MapReduce check for stragglers and speculate tasks? [on hold]

From my limited knowledge of Hadoop, I understand that the TaskTracker is in charge of Map and Reduce tasks. I am attempting to modify the decision to speculate slow reduce tasks by (1) checking for ...
32 views

Two cases for indicating consent for a ticket

I have two cases here: the person who ordered a ticket clicks on "Permission" and the OrderConsentUpdate View updates the database. is the attendee him- or herself ...
13 views

Primitive Full-Text-Search on some Properties of an Object

I am not a JS/TS Guru, so i wanted to ask if one could write this better. I needed a very primitive Full-Text-Search of some properties of an Object. What do you think? ...
19 views

Optimizing graph partitioning by connected components of generated subgraph

I'm trying to optimize a function in a process which is going to be run millions of times. The function is supposed to partition the vertices of a graph, which will be used to make a quotient graph. ...
21 views

Different payment details in a common list, to be casted

I need to be able to access a number of different payment methods in a common list. They can be different methods - credit card, cheque, direct debit etc. The only common attributes are the payment ...
10 views

feedback needed on c# data access library for mongodb [on hold]

i just pushed out v3.1 of MongoDAL which is a simplified data access layer wrapped around the mongodb c# driver. the api is quite easy to use compared to the official driver. an example query would ...
134 views

Simulate round-robin tournament draw

I decided to implement the round robin algorithm in Python. My code takes a list of teams as input and prints the schedule. This is my first try to write something by my own after taking some online ...
22 views

Parse through an xdocument efficiently and match values to matching object

Minimum viable test program: ...
12 views

Similar to boggle game [on hold]

Need help to edit this code to allow user to find words in the grid that are touching horizontally, vertically, and diagonally adjacent. For example, the board: Q W E R T A S D F G Z X C V B Y U A ...
19 views

How to make another function in a loop? [on hold]

Is there any way for for loop not to be repeated in every function which I make for seperate pages? Because I don't want for loop...
21 views

Beginning C character array explanation [on hold]

I have been following along the book 'The C Programming Language' 2nd edition by Kernighan and Ritchie. The below code is an exercise from the book. What I am confused about in this code is the ...
174 views

I'm currently writing an API to work with Bioinformatic SAM records. Here's an example of one: ...
8 views

Export OLEObject to a folder

I got this code from "https://www.pcreview.co.uk/threads/how-can-i-output-the-file.2824299/" The code launches each and every OLEObject in the sheet in new image viewer window, i tried to loop through ...
34 views

Insert into SQLite3 database

I have a tsv file containing the mapping for two kinds of identifiers. ...
34 views

Get a map containing elements which are present in unordered map A but are not present in unordered map B [on hold]

I would like to create a function which returns a map containing differences between two unordered maps. Here is the code: ...
16 views

Sort Array By Parity

The task is taken from leetcode Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You may return any ...
270 views

Compute all the permutations for a given vector of integers

The task is to compute all the permutations for a given vector of integers (but of course the specific integer type is not relevant for the solution) The strategy is based on recursion + iterations ...
21 views

I'm trying to make a login system for my website which I'll be releasing in public later on. I have inserted some main samples of my code in here and I would like some useful advise or suggestions. ...
15 views

Array Dynamic resize in heap [on hold]

I have answered a Question in Stackoverflow link. a) Create a function called resize that can be used to increase the size of integer arrays dynamically. The function takes three parameters. ...
47 views

Generically call static methods

I currently have two (core) classes : ...
27 views

Python breakpoints in Vim (Vimscript)

I recently decided that putting strategically placed print statements scattered about my python programs to debug was getting to be a little messy. I had thought ...
22 views

Angular 7 CRUD operations in bootstrap modal

I am trying to figure out the correct approach of loading crud components in bootstrap modal. I have a table with buttons in a UserListComponent. Each button click ...
17 views

performing SQL SELECT query inside the loop [on hold]

I have a table leave_muster inside which I have to update all the records of the previous month on every start of the new month. My Code ...
22 views

React To-Do App [on hold]

Github This is my first "real" React project, it's a simple to-do app with features like creating a new note with a timestamp, marking a note as done (this will add a timestamp to show when the note ...
20 views

It manipulate the DOM [on hold]

Recently had given an online interview, in which interviewer asked this snippet and , told to find the error. The program compiles successfully however there was no error, not that i know of. Here the ...
20 views

Django authentication against Exchange server

I wrote an authentication app for Django and my worry is primarily about the security of my app. My Django authentication app uses exchangelib to authenticate ...
20 views

Wrapper for LeagueAPI in Node.js

Full code is here: https://github.com/LionelBergen/LeagueReddit I'm creating a wrapper for the LeagueAPI in Node.js. This includes methods to call various endpoints and classes to map the outputs &...
28 views

How to make loops in scrapy? [on hold]

I'm scraping a webpage of Dmoz site. I want to make a loop in functions because the for loop which I am using in every function, I will have to put again and again ...
25 views

TLE error: Remove element from LinkedList [on hold]

I am working on an easy LinkedList basic operation problem on Remove Linked List Elements - LeetCode Remove Linked List Elements Remove all elements from a linked list of integers that ...
31 views

I'm trying to come up with a unit testing framework for Haskell that is small and self-contained produces TAP-compatible output exits abnormally on failure (instead of relying on the TAP consumer to ...
22 views

Initializing Reinforcement Learning Q-Table State Space-Python

The code below is a "World" class method that initializes a Q-Table for use in the SARSA and Q-Learning algorithms. Without going into too much detail, the world has "Pickups" and "Dropoffs" that can ...
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? ...
53 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 ...
14 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 ...
56 views

Unmanaged byte array to managed structure

I have a need to turn byte arrays into various structures. First version: ...
16 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. ...
33 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 ...
43 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 ...
25 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 ...
70 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. ...
12 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 ...
736 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 ...