# All Questions

5,445 questions
Filter by
Sorted by
Tagged with
1k views

### eBay listing generator

Here's my attempt at a script that will take user input and produce a custom interactive eBay listing. This is definitely still in progress, but I wanted to post the code I have since I'm sure there ...
351 views

### Rust exercise department employee management

Working my way through the second edition of the Rust Programming Language and did the exercise at the end of ch 8: Using a hash map and vectors, create a text interface to allow a user to add ...
528 views

### Leetcode 3Sum problem using hashmap in Python

For practice, I solved Leetcode 15. 3Sum question: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives ...
87 views

### A sequence of mistakes

This question is part of a series solving the Rosalind challenges. For the previous question in this series, see The Genetic Code. The repository with all my up-to-date solutions so far can be found ...
116 views

### Repository searching code duplication

A followup question to this: IQueryable Extensions working on expression for collection property I am working on a project for a family member which involves the use of a database and a repository, ...
2k views

2k views

### Improved brute force SAT solver in Java

(See the previous iteration.) I have this small library for solving the SAT (satisfiability problem) via brute force: we are given a boolean formula, which is a conjuction (...
1k views

### Find if a number is equal to the sum of its divisors

A number is perfect if it is equal to the sum of all its divisors. For example divisors of 6 are 1, 2, 3. I want to read numbers,...
40 views

### A value set data structure for rapid statistics queries in Java - follow-up

(See the previous iteration.) Now all operations of the data structure work in exact constant time, yet it came with the price: the state of this set maybe non-sensical. A user may end up with the ...
81 views

### VBA Class converter to eliminate strings being used as valid values, part2

My original question got an answer that helped me revise my code. Below is updated code with a converter that has a few more choices. These enum members are prefaced with ...
185 views

### Spotify API data to vk.com user's status

Just a simple script that puts a user's currently playing track(on Spotify) to his account's status on vk.com. And printing info about the track in the console. ...
121 views

### Project Euler # 52 Permuted multiples in Python

It can be seen that the number, 125874, and its double, 251748, contain exactly the same digits, but in a different order. Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, ...
458 views

### Non-blocking line-oriented input from several file descriptors

This is a follow-up to Extracting lines from a bytearray ; I got a pretty good answer to the narrow question I asked there, but was invited to show more of the code in case there was a simpler way to ...
107 views

### Transcoding of a large histogram

I'm currently working on transcoding a large histogram so that the lessened file can be used within a viewer style GUI. The transcoding works by using Tokens to define runs of bins. For example, ...
3k views

### Find a missing numbers, single missing number and two missing numbers, from consecutive range

Contains 3 options. Given an input array Unsorted and consecutive range, and array is 1 element short. eg: range is 6-9, and array = [7, 8, 9] output should be 6. ...
61 views

### Sign an EC2/S3 URL Version 2

Follow up on previous review: Sign an EC2/S3 URL I have fixed the previous comments. I have also added the code needed to sign HTTP header fields as part of the request. ...
614 views

### HackerRank - Array Manipulation - Follow-up

This is a follow-up question for HackerRank - Array Manipulation Problem You are given a list (1-indexed) of size $n$, initialized with zeroes. You have to perform $m$ operations on the ...
519 views

### SPOJ problem - The last digit of a number to a power

Here is the problem statement: Given integers $a$ ($0 \le a \le 20$) and $b$ ($0 \le b \le 2,147,483,000$), where $a$ and $b$ are not both 0, find the last digit of $a^b$. ...
41 views

### Connect elements of a list to elements of an other list using a two-dim array

Story: I build a kind of labyrinth. This labyrinth is divided in seven steps. You start with the first, then second, and so on to the seventh. You cannot go back to a previous step. Each step ...
1k views

### Tic Tac Toe game in Python 3.X using tkinter UI

I am learning to program in Python and as my first project I decided to create a simple Tic Tac Toe game. The game is working properly now and I am wondering if there is anything I could do to improve ...
151 views

### Vector replacer

I rolled an own vector-like construct with improved performance and got it reviewed. Here is the updated version. ...
1k views

### Using std::vectors to store textures

I need to write a TextureManager class which stores Texture objects; the problem is I'm using an ...
47 views

### SI type safe unit calculations (revised)

This is the continuation of the questions raised in this thread I did include the improvements that were mentioned but still feel like, I do more copies than I need to. Also I am unsure about the ...
156 views

### Optimisation of a forms.py for a survey application

This is my forms.py for a small survey application I am developing. I previously posted some of my models.py. I am completely self-taught and am just looking for advice on how to improve. Any advice, ...
1k views

### Test code for custom malloc

I've been working on a custom malloc where the test code is the following. ...
432 views

I've been looking for a solution to the may readers one writer in Java. I was intrigued by this question posted here and I read the Wikipedia entry about it. So far, I've reached a fine solution, or ...
253 views

### Recording a customer's shopping cart as an order

I have come up with the following method to post a transaction to a database, in the context of an e-commerce Java web application. The transaction consists in submitting a new order alongside its ...
143 views

### Stack implementation using vectors and templates with no overflow version 1.3

Below is the code for stack along with one or two extra options. Kindly let me know if there are any concerns/critical issues. Below are the links for previous versions. Version 1.0 Version 1.1 ...
445 views

### Typescript: Recursion file-system lookup

Previously I asked a question to find the best practice of recursively running a function to retrieve all import/export statements of files in NodeJs here. After some discussion I'm not satisfied yet,...
599 views

### Convert a String with comma separated latitudes and longitudes to a Seq[Coordinate]

I have a function that receives a String like the following: "-10.0 -10.0,10.0 10.0,0.0 0.0" And needs to translate that into ...
65 views

### Project Euler #11 Largest Product in a Grid | Cache-optimized + sliding window (C++14)

Source: HackerRank & ProjectEuler.net Problem: Largest Product in a Grid In the 20×20 grid below, four numbers along a diagonal line have been marked in red. ...
977 views

### Windows DLL Module Class

I am doing a project where I use DLL's as run-time modules or plugins. To do this, I use the Windows LoadLibrary() and ...
511 views

### Primes & Squares

Codeforces #230B Question Whether a number has exactly three factors. (i.e. 1, itself and its square root, thus squares of primes) [Time limit is 2 sec, Memory 256 MB] Input Number of testcases, n ...
632 views

### BaseRepository for EF6 - updated

Previous question: BaseRepository for EF6 I've update my code. Is it correct now? I've changed IEnumerable to IQueryable. <...
42 views

### POSIX-ly finding a specific Java process

In this code I find a list all of the running java processes and give the below function a name to look for, it will do its best. But since I find my approach a ...
45 views

### Rename and move images to a destination directory based on a text file

As a followup to this question, I removed the Repository class and do the copy in the Folder class. Suppose I have the ...
989 views

### Comparing columns from two CSV files - follow-up

This is the second part of a question, you can find the first part here: Comparing columns from two CSV files I've made some changes to the script and here is what it looks like now: ...
92 views

### Variables, references and pointers - Write the function zero (…) so that the following code works correctly

I have following homework exercise from lecture "Variables, references and pointers": Write the function zero (...) so that the following code works correctly: int x = 3; zero(x); ...
203 views

### Simple repository for a small/medium sized ASP.NET MVC site

I am about to start a small/medium sized project. I am by no means a software architect. But I tend to question every move I make at times, since I want to do things correct. I found a way to ...
74 views

### Simple lightweight object pool - follow-up

This question is in response to the code review here: Simple lightweight object pool. Please visit the original question for background. I have taken on board all the suggestions made and carefully ...
908 views

### Producer/Consumer implementation using condition_variable

Trying to implement producer/consumer problem in C++. I have one question: should I use nofify_all or notify_one method here? ...
373 views

### Factory design pattern with Shapes

I'm making the very common example of Factory design pattern which creates a factory of shapes and return an instance of the type Shape. I wonder which is the best way to replace that bunch of nested ...
2k views

### Play With Numbers Programming Challenge (mean value of subarrays)

I'm trying to solve this Play With Numbers. I have passed the test cases but, I kept getting time limit exceeded. Can someone help me improve its performance in order to pass the time limit, please? ...
46 views

### A simple Java class for implementing code stop watches - follow-up

I have received a nice answer for this post. Now, it is my attempt for some improvement: ...
374 views

### Encryption via multiplication of hex-converted, multiplied ASCII values

The idea behind the encryption is that it stores the key within the final encrypted password. When the user inputs a password for the first time, they also have to pick an element from a list of ...
1k views

### Lowest common ancestor in recursive tree traversal

LCA = Lowest Common Ancestor The following code finds the lowest common ancestor in tree of nodes, where a node can have two parents, left and right. The tree looks like this: ...
109 views

### Programs for different language learning - Python

I've created a program for my own purposes in three different languages, Perl, Python, and Ruby. Each program will be posted in with their own tag but I will add links to them through on each post. ...
670 views

### Practicing Java servlets, MySQL and JSON

(See the next iteration.) Introduction This is my attempt at a simplistic web application just for the sake of practice. I have three main servlets: ...