All Questions

Filter by
Sorted by
Tagged with
3
votes
1answer
42 views

Code feedback on running app

I have made an Android app called RunTracker - https://github.com/michaelnares/runtracker/tree/master/app. The intended functionality is that the app saves runs to the local filesystem, shows your ...
2
votes
1answer
80 views

Interface and inheritance; creating download types for a download manager

I'm creating a download manager in C# (in combination with Unity 2019.1.8, running the .NET 4.x equivalent (MONO) scripting back end). To accomplish this I decided to start using interfaces and class ...
1
vote
2answers
72 views

Unit tests for anagram finder

I did this test for a job and the feedback was: "while many were added to test private methods, they did not do anything to ensure the public interface worked correctly, edge cases were missed" But ...
-3
votes
1answer
46 views

Please point out any improvement in it [closed]

Its a conference service code from controller to DAO for conference application. it contains controller, conference service, dao and entity class, I am seeking for any improvement or code review ...
1
vote
0answers
27 views

Media library project using Angular

Recently I created a small project: 'media library' (which allow to search, sort and filter items) and I will be glad if some give me constructive feedback about my code. The starting point is Angular-...
9
votes
1answer
173 views

Operation cancellation

Brevity is for kings as it requires context and context is for kings. Me. GitHub and NuGet How many times you have been writing something like this passing those tedious logger/token parameters? <...
2
votes
1answer
26 views

This is a Monoid instance I wrote for a Tree data type. Is this the most terse way to express mappend?

Here's my type: data Tree a = Empty | Node a (Tree a) (Tree a) Here's the instance declaration for Monoid: ...
3
votes
1answer
58 views

identifying pairwise groups from dictionary

I have a dictionary that looks like this ...
2
votes
0answers
19 views

Reorder items in a map

I'm attempting to create a Module, I've called it Timeline, that resembles a drag n' drop list. Given a Timeline, someone could continually add items (I'm not including removing or updating Items here)...
2
votes
1answer
104 views

LeetCode: Rotting Oranges in C#

https://leetcode.com/problems/rotting-oranges/ Please review for coding style in 40 minutes job interview. In a given grid, each cell can have one of three values: the value 0 representing an ...
1
vote
1answer
53 views

Finding the number of times a query string appears in a vector of strings c++

I wrote some code that iterates over some queries and counts the number of times each query appears in a vector of words. My first iteration iterated through all the words in the vector for each query ...
3
votes
1answer
34 views

Create a geometry automata

I am trying to draw 2d patterns onto grids of different geometric units. I have a small example for a halfmoon pattern on the grid below. In the future, I will add different kinds of movement (eg. ...
1
vote
2answers
73 views

LeetCode: Spiral Matrix II C#

https://leetcode.com/problems/spiral-matrix-ii/ Please review for performance, how can this code run faster Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 ...
4
votes
2answers
103 views

Get list of all combinations from a set

Given a tuple of elements, in elementTupleParam and the number in each combination r, we compute all the possible combinations ...
5
votes
1answer
53 views

BitBoard class In TypeScript for chess logic

I'm working on writing a Chess Logic Library in JavaScript for learning purposes and was wondering how good these two slightly different implementations of a BitBoard are. The first stores the board ...
6
votes
4answers
188 views

Building a toy from Lego toys

I recently attempted a coding problem, but my solution was not well received during the interview (modified slightly to reduce Google-ability). Suppose a child has several Lego blocks, and wants to ...
10
votes
4answers
744 views

Shuffling multiple iterators in order

I have a Python function w/ specified functionality, and two proposed approaches - which do you prefer, and why? (performance, simplicity, clarity, etc) (both use ...
4
votes
2answers
66 views

Heap Sort and Binary Tree Sort Algorithms (Python)

Heap Sort A Binary Heap is a Complete Binary Tree where the items are stored in a special order such that the value in a parent node is greater or smaller than the two values in the children nodes. ...
2
votes
1answer
38 views

d3.js canvas performance

I've just rewritten this code (a simple gravitational restricted n-body simulation) to display using canvas, rather than SVG. The reason being that I'd like to be able to run it with many thousands of ...
7
votes
2answers
110 views

Letter Combinations of a phone number using a Dictionary

Problem statement (online source) Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone ...
5
votes
3answers
420 views

Comparison of values in dictionary

I have the following dictionary: ...
1
vote
0answers
29 views

Spring Boot - JPA query execution Time

Any one suggest me right way to write mapping more then one table using spring-boot (jpa), i was done it, but its required more time to extract result, Following are the Mapping of Pojo: First:- <...
3
votes
1answer
44 views

How to optimize the for loop for finding a matching 2 string using fuzzywuzzy

I am getting the probability of a string being similar to another string in Python using fuzzywuzzy lib. Currently, I am doing this using a for loop and the search ...
1
vote
0answers
25 views

Overloading both for (non) constant access [closed]

I'd offer a couple of iterator accesses to the class member, both constant and non-constant. I came to the following solution, but it seems to me far more verbose than needed. I'd like somehow to ...
2
votes
1answer
36 views

Redis work queue processor

I frequently encounter the need for creating services that concurrently process messages from Redis queues. So I decided to share the knowledge I learned and help others easily bootstrap such a ...
2
votes
0answers
55 views

Function to match the case of a text as per another text

I am translating a text into another language using Google APIs. Sometimes the translated text returned from the API does not match the case of the text provided - e.g. when translating the text "...
4
votes
1answer
88 views

Chuck Norris Joke Teller

I've created a command line joke teller which makes Chuck Norris jokes after communicating with the Chuck Norris API. It also allows you to generate a random person by communicating to the names API ...
6
votes
2answers
446 views

Determine if input word can be created from a list of letters

I am looking for a more elegant way to validate in an input word can be created from a list of letters. ...
3
votes
0answers
41 views

Playing music in the background while another task is running

Sometimes some tasks can be taken a lot of time to end up. This code is created in order to play a random radio music in background while the script is running another task until to finish up and the ...
5
votes
3answers
363 views

identify groups of congruent points

I have two sets of points in lists list1 and list2 given below ...
1
vote
1answer
60 views

A GapHelper static class to create unique (non-existing) size restricted names

I am working with a 3th party library which has following interface defined for a processing task: ...
25
votes
4answers
6k views

My first random password generator

I'm making a simple program that generates a random password of some length with or without special characters, just for the sake of learning the C language. Finally I've got this working very well ...
5
votes
2answers
50 views

Creating pages containing grids

I'm making an app that creates pdfs of images layed out in a grid. I know the size of each grid element and how many fit on a page, it works out to a 5x6 grid. The syntax is not the real focus, but ...
4
votes
3answers
59 views

Finding indices of CSV headers in Java

I'm working on a project where I needed to extract the indices for the headers of a CSV file to initialise objects. I thought that I should work on my documentation process and learn how to document ...
1
vote
1answer
80 views

Flatten binary tree to linked list

I'm trying to flatten a binary tree into a linked list. I have a working, correct solution: ...
3
votes
2answers
61 views

Binary Tree Sort Algorithm (Python)

A Binary Tree Sort is an algorithm that builds a binary search tree from the elements to be sorted, and then traverses the tree (in-order) so that the elements come out in sorted order. Average Case ...
2
votes
0answers
44 views

Compute angular distances between data points in a matrix

I am having a hard time speeding up a function that I use to compute angular distances between data points in a matrix. More precisely, I want to compute $$\sum_{r=1}^n|\pi - \arccos\left(\frac{(X_{i}-...
3
votes
1answer
98 views

Word frequency analysis: Python

I wrote a very rudimentary code that counts sentences and words in the arbitrary text. Code: ...
2
votes
1answer
60 views

Storing data in a map that can be retrieved by N keys

I often have data stored in a Map that I need to retrieve by something other than the Key, so wanted to write a generic class that lets you define up to N keys (with the possibility of each key having ...
6
votes
1answer
148 views

Universal string conversion

Below there is a function eating all strings and convert it to Unicode. It works fine. But is it the best way to do so? Is there maybe already an existing function for it? The reason was a German ...
-3
votes
0answers
44 views

A problem: HackerEarth says it is TIme limit exceeded

I have written a solution to Memorise me problem on Hacker Earth but it takes a lot of memory space and time limit exceeds in the last test case. The first line of input will contain N, an integer, ...
0
votes
1answer
61 views

using a cast in an overriden equals method should I use generics and if so, how? [closed]

here is my issue when trying to override my equals method. this is what I have currently ...
2
votes
3answers
84 views

update object in list

Q: I have a Bank class containing multiple loan accounts (LoanAccount class). I've create a ...
4
votes
0answers
80 views

Backup script for Linux (full and differential backups)

The backup script itself. Make it executable and place it somewhere in your path: ...
1
vote
0answers
44 views

Anti XSS code encapsulated inside model class, does it belong there?

I had some XSS protection code I wanted to add into my Web API/MVC application, the model that was used to bind was EditLocationViewModel as below. My initial plan ...
7
votes
1answer
205 views

Map unique raw words to a list of code words

Problem Write a function that replaces the words in raw with the words in code_words such that the first occurrence of each ...
1
vote
0answers
71 views

Fast matrix transpose

I would like to improve the naive matrix transpose algorithm by using a cache friendly algorithm. So far there are 4 variants. Iterate over the source matrix: ...
3
votes
2answers
76 views

Get a notification when questions get posted

I like to help people on StackOverflow, matter of fact nowadays it depends on how quick you are when answering question. With that being said, I can't always keep a tab and an eye to refresh the ...
11
votes
4answers
1k views

Python Bingo game that stores card in a dictionary

I am super proud of this python bingo game I wrote. I am posting it here to make get some help reviewing it to make sure I'm using the best practices. This is for a class, and my professor is a ...
4
votes
1answer
92 views

The best way to unwrap the optional in java [closed]

Instead of using the null checks I tried using Optional and safely unwrapping the optional. Approach 1 My first approach of unwrapping the ...

15 30 50 per page