# All Questions

59,134 questions
40 views

### Hash table with dynamic sized array in C

To gain a broader insight in things many (high-level language) programmers nowadays take for granted, I decided to study some of the more basic ways of storing data in memory. I wrote a program which ...
32 views

### Python: Max function on dictionaries [closed]

This time, write a procedure, called biggest, which returns the key corresponding to the entry with the largest number of values associated with it. If there is more than one such entry, return any ...
2k views

### Extract all GPU name, model and GPU ram

I currently use this code to extract the required GPU data. Can you review this method for efficiency or best coding practices? Code ...
33 views

### Running an UPDATE SQL QUERY within VBA using DAO

I have a macro in Excel that updates a recordset using WHERE a primary key in MS Access matches a primary key in a UserForm label value. The macro is called from a ...
29 views

### I've got enums on top of enums, and then some more traits for those enums… it's getting unwieldy [closed]

So I have an enum wrapping an enum, but I have another enum talking about what that enum is. Which makes for a confusing English sentence, so here's an example. I got one enum: ...
71 views

### How to flatten a list of lists? [closed]

How to flatten a list of lists in more pythonic way? This is the code I tried. ...
47 views

### Bar graph of Easter date distribution

Computing Easter for a given year is a classic computational problem. It is also one of the few cases when code seems to just have to live with magic numbers. Alternative to magic numbers: Decoding ...
75 views

### 2-Player Tank Battle Game [on hold]

I've created a 2-player tank battle game. The code however seems like it could be greatly simplified and there are a few issues. One of which is the hitboxes of the tank seem a bit unreliable. ...
35 views

### Search customer by ID not printing [closed]

I dont know why my code is not working at all. In my Eclipse there's no errors shown at all. I want to use the id to print the name of my customers, and that's my goal ...
17 views

### Set background-color of image in css [closed]

Smart invert for the ipad inverts the colors of everything except images. This increases battery life. It works great except for latex math equations at wikipedia which wikipedia converts to png ...
30 views

### Simple Linked List N Insertion [closed]

Hey guys here is a pretty simple linked list insertion in C++ and I understand most of it, but I had a question. Why does changing markerPointer at the last line effect head which is returned by the ...
25 views

### Trying to output a game [closed]

I need help with the area I think I highlighted with arrows (static void updateTeam & processUpdate) Suppose to output a game where you type in a team and it will out put win, loss, and ties. ...
19 views

### Tictactoe minmax recursion causing confusion [closed]

I read a number of tic tac toe examples using the minmax algorithm but haven't found a good one that really explains what's going on. I've written one that works but need help understanding a small ...
69 views

### Java game: select numbered tiles to form a goal sum

This is a homework project (Soft. Eng.) which I have completed. My teacher gave me a 91, but I am unhappy with this grade because my code is quite messy. (Please excuse incomplete Javadoc, the code is ...
18 views

HTML & CSS ...
41 views

### Remove Code Duplication [closed]

I have a card class, my show image function has a lot of duplicated code, what would be the best way to simplify the example code below. each case statemen though return a unique value. ...
37 views

### Making Anagram Problem Implementation

Problem Statement Alice is taking a cryptography class and finding anagrams to be very useful. We consider two strings to be anagrams of each other if the first string's letters can be rearranged ...
45 views

### VBA - If value in sheet1 found in sheet2, then delete data from sheet2

I have 2 sheets setup: Exclusions and Issues Issues has a list of CASE ID's and Columns that list the "Issue" Exclusions will be populated with CASE ID's that are to be excluded (and removed) from ...
200 views

### Is there a way in Ruby to make just any one out of many keyword arguments required? [closed]

I am trying to write a method, that works with three types of arguments, but requires only one of them. def convert(arg_a: 1, arg_b: 2, arg_c: 'foo') end Please ...
27 views

### Edit button toggles modal and load data from PHP using AJAX and JQUERY

I've been working on an edit/update button that will toggle a modal that looks like this: Is there a better code for this JavaScript code that I made? ...
50 views

### MinMax Problem Implementation

Problem Statement: You will be given a list of integers, arr, and a single integer k. You must create an array of length k from elements of arr such that its unfairness is minimized. Call ...
30 views

### Haskell: How to split the main:: IO() to a main::IO() and a function [on hold]

This code is to recreate the game 'Earthworms'. The part I need help with is the main :: IO() part. I want to split this part ... ...
43 views

### Simple Asynchronous Dispatch Queue

I'm practicing C++11/14/17 and am teaching myself the STL multithreading library by writing an asynchronous dispatch queue for my simple use case. It seems to "work ok" but I want to know if it's ...
39 views

### A C++17 std::allocator implementation

This is an implementation of C++17 std::allocator under the name my_std::allocator, with deprecated stuff omitted for simplicity....
166 views

### Tic tac toe game in a web browser

I have this tic tac toe game which is very old project of mine, though I made some changes on this to improve the script to perform better. This game is functional, Any logic improvements or other ...
32 views

### Java local service with sockets

My goal was to create a Java service on Windows that runs locally and communicates with local programs using JSON. The service should be reliable and robust. The service runs a ServerSocket and ...
40 views

### Find indices of two numbers such that they add up to a target

The task ...is taken from leetcode Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ...
23 views

### Python- HTML comparing two HTML files and ignoring elements [closed]

I am using python to compare two HTML files and it spits out the difference, but i need it to ignore certain elements like ""... the value part as it will always change and be different. Please could ...
19 views

### Authentication and auto renewal of an API Token

Following is an https call to retrieve the token, once it's retrieved, it's cached. Callers call the addTokenObserver method that sets a timer based on the token ...
168 views
+50

### Windows keylogger in C++

Windows keylogger in C++ Known issues: Not implementing rule of five Having to use hack to use member variables, out_, in static method Pressing caps-lock won't ...
26 views

### Line segment intersection from the Berg et all, computational geometry

I've implemented the following algorithm (From "Computational Geometry : Algorithms and Applications"). The code is below: (All the code actually is here: https://github.com/lukkio88/...
5k views

### Check which numbers satisfy the condition [A*B*C = A! + B! + C!]

#include <iostream> #include <cmath> using namespace std; int s = 1; //Serial No. Should I use recursion for the factorials function? ...
83 views

### User interface HTML string generated using PHP

Goal This is very basic beginner script, only for prototyping, probably never to reach alpha/beta prototyping/production, is being designed/tested for performance. Its performance quality might be ...
59 views

### Given a list of coordinates, find the rectangle with minimal area

A problem on leetcode asks the coder to write an algorithm to take a bunch of coordinates in the xy-plane and return the minimum area of a rectangle made from four of these coordinates (or return <...
24 views

### Java Minimax Tic-Tac-Toe [closed]

I've been researching the minimax algorithm and how it's implemented in Tic-Tac-Toe. But for whatever reason, it loses, on average, 15% of the games against a random bot. Could someone help me figure ...
18 views

### Pascal's Formula Recusrion (not triangle) [closed]

So i am trying to recurse through Pascal's formula which is (n-1, k-1) + (n-1, k) but i am having trouble going through both the sides. i am thinking about it as a box trace ..here is what i have so ...
46 views

### ArXiV Technical Paper API Github Repo

My name is Ethan and I am trying to build an API for scaping technical papers to use for developers. Right now it only works for ArXiV but I would greatly appreciate some mentoring or a code review of ...
12 views

### Need help creating a continueGame method that will work with my NumberGame.java file [closed]

I'm trying to finish this program I have been working on for a bit but I am very confused on how to create the continueGame method when the return value should be boolean but its using an input as the ...
39 views

### Code Chef's Cleaning Tables: find the minimum number of tables to clean

Description: Haku has been newly hired by Chef to clean tables at his restaurant. So whenever a customer wants a table, Haku must clean it. But Haku happens to be a lazy boy. So in the ...
15 views

### Calculate mean of vector primitive numerical values generically

I'm trying to write a generic mean function for all values within an Vector of generic numerical primitive type. Could the following implementation be possible ...
60 views

### Combinational string search using Java

I wrote a program that receives 2 strings (Input and Search) in the Search string. The sign '+' indicates that if the substring before the '+' exists in the Input string. (The search string cannot ...
76 views

### A cartesian product of tuples in C++17

I would like to write a function that computes a cartesian product of two tuples in C++17 (the tuples can be of type std::tuple or ...
40 views

### Find all pairs of unique indices in a list such that the concatenation of the two words is a palindrome

The task Given a list of words, find all pairs of unique indices such that the concatenation of the two words is a palindrome. For example, given the list ["code", "edoc", "da", "d"], return ...
9 views

### A matrix-vector multiply parallelized using boost::MPI

This program performs a matrix-vector multiply using MPI to split the computation up. It is not extremely robust (for example, it doesn't handle the case where the number of MPI processes does not ...
21 views

### Puzzling SBCL Compiler Note

I’m having trouble understanding an SBCL compiler note about unreachable code in the following function. The referenced code is attempting to push a value into an Lparallel queue: ...
68 views

### Matrix class with space-optimized triangular (lower and upper) variants

I've written a class for square numerical matrices (of doubles, in this case), in C++11. Since I intend to use this class later ...
21 views

### How can I find gcd of two polynomials in c++ using long division [closed]

I am finding the remainder and the quotient of the two polynomials using the long division. I don't understand how should I calculate the gcd of those two. ...
19 views

### Single chars mapped to enums in Rust

I'm writing a simple program to parse lines read from a file. As I'm new to Rust, I wonder if I'm creating too much boilerplate. A sample line in the file looks like this: ...