# All Questions

59,219 questions
6 views

### Python: Getting Service Rate based on time/day of service

i have a long list of roster that id like to categorized the rates by time/day of service. Most shifts ends the same date but there are some special case where the shift ends on a different date. I ...
3 views

### Search by parameters from multiple tables

This query searches people based on search parameters from 3 other tables (phones, emails, <...
5 views

### Simplified light Serialize/Deserialize to/from JSON for .NET

Just a very simplified and stright-forward way of serialize/deserialize to/from JSON using standard .NET 4+ libs. I was trying to avoid "complexity", so get rid of 3rd part libs and heavy-...
10 views

### Difference between functions written via Ruby and PHP

I have a little function written in Ruby: ...
7 views

### HTML, CSS and JS Boilerplate using Webpack, Babel, Sass and BrowserSync

I am working on a html, css and js boilerplate for my projects. My goal is to have a setup where I can fire off npm run watch and all files are watched and compiled....
9 views

### Combining arbitrary number of lists inside json

I have some JSON where each key stores an array, and I need to combine all those arrays into a single array. My current solution doesn't seem the most friendly to review, but without ...
18 views

### Need pointers on how to make my game code better. What would a professional do? Learning on my own

import random P_HEALTH = 100 E_HEALTH = random.randint(5, 40) potion function ...
16 views

### How to I make my code that interact with pivot table run faster?

I am new to VBA. I created these buttons that would only show the data that I want it to show. And on the graph, it would also change color and the chart title. This is all on the pivot table by the ...
20 views

### PHP MySQLi Prepared Statements: Can this select query be hacked/injected?

i want to know can this be hacked/injected? ...
21 views

### Looking for matching Elements in a List via loop. Can I gain speed, readability or cleanliness here?

The actual data types here are probably not relevant to post an answer. I use Qt types here, but the question should apply for other structured types as well. I ...
25 views

### Converting Array of Float32 (float) to Array of UINT8 (unsigned char) Using AVX2

Given input array of Float32 (float) with numElements how could one efficiently convert it ...
49 views

### Assigning values to array elements based on a look up table

HI i am writing a c# program where i need to populate a array based on a look up table and set of string arrays with metadata. My lookup table looks like this (Table with key: transmitter, value: ...
6 views

### Super-minimal implementation for inference only of fully a connected neural network in Python + Numpy

There are a lot of Neural Networks Frameworks available but in order to understand how things work internally reimplementing can be a good exercise In this case the goal is to develop a super-...
146 views

### Cyclomatic Complexity reduction JS

I have a function that checks user level and limits the data before saving it to mongoDB database (pre 'save' middleware for mongoose). It have been getting complexity warnings and tried to rewrite it,...
291 views

### Showing a welcome screen once per day

I have this method, which first basically shows a Welcome screen to user only once per day. The code I have so far is this ...
223 views

### Authenticating an internal API with Flask

I'm developing an internal API using Flask, although due to limitations with our platform the endpoints will be accessible over the public internet. It will only have a very small number of users and ...
15 views

### Split string into as few substrings as possible such that each substring is a palindrome

The task Given a string, split it into as few strings as possible such that each string is a palindrome. For example, given the input string racecarannakayak, return ["racecar", "anna", "...
6 views

### delete duplicate rows based on two column names [macro vb] [on hold]

Can anyone help with below? My code is running for around 5 minutes or more with data of only 10 records in the worksheet. ...
43 views

### Converting Array of UINT8 (unsigned char) to Array of Float32 (float`) Using AVX2

Given input array of UINT8 (unsigned char) with numElements how could one efficiently ...
33 views

### Straightforward tax calculator OO design

This question has been asked here before and my solution is pretty much in line with some of the answers to the question to this question. I wanted to work on this a bit. Scenario Basic sales ...
22 views

### 256-bit ASCII Color Encoded Hex Dump in C

I made this hex dump after being dissatisfied with the free hexdumps out there. The biggest dissatisfaction is that the encodings for the char bytes were not color encoded, just like the hexyl hexdump ...
11 views

...
11 views

### GUI Button Element with Unit Tests follow-up

This is my second attempt with unit-tests. Like my previous attempt, I would prefer a focus on the unit-tests, however I am always happy to improve my code in any way reviewers can help. Once again ...
10 views

### Bokeh app behaves oddly [on hold]

Below is code for a working snippet. This is what's odd about the behavior: Tapping the button frequently freezes the app. The bottom right cluster never contributes to the histogram when selected....
36 views

### JSON messaging queue with transformation and dispatch rules

I put together this code as part of a practice problem. The instructions for the program are to accept JSON messages, transform the messages and then dispatch them to the right queue according to a ...
18 views

### Struggling to do a math problem in PHP [on hold]

My teacher gave me a simple penny problem to use a loop to solve. You start with 1 penny on the first day it doubles for 30 days forming a cumulative total. I thought it was going well but I my code ...
10 views

### CSS organization with BEM

I've recently learned BEM & SASS, and I'd like to know if my BEM syntax is correct. I'm trying to create just the header of this page: https://blackrockdigital.github.io/startbootstrap-agency/ ...
8 views

### React onDrop function for a task manager

This a working function as part of a drag and drop task manager im playing around with. The function is working fine, but it just looks messy and long to me. I haven't added all the code as I'm ...
41 views

### Goldbach conjecture solution finder

The Goldbach conjecture says: any even number greater than two can be represented by the sum of two prime numbers. G(n) = { (p1, p2) | p1 + p2 = n, p1 and p2 are prime numbers with p1 < p2 } ...
21 views

### Caret Color and Movment Animation in Swing

I'm developing a new Look and Feel that is based on animation , so i'v decided to make animated text caret too ! the caret works as expected every thing is fine except that am worried about how i did ...
19 views

### Chandy/Misra solution to Dining Philosophers

I took a swing at Dining Philosopher Problem. Decided to use Chandy/Misra solution. However, it ends up with about 1/5 of the threads getting starved for no apparent reason. ...
25 views

### Search for a symmetrical inner portion of a list

What the code does: Takes a Python list of integers as input and searches for a 'symmetrical' inner-portion of the list. Example: ...
12 views

### needing assistance with a string arraylist with an input [on hold]

im having and issue with my input and storing it into and array how can i input this input and store it into and array and then see that same array? ...
43 views

### Consolidating several Excel sheets into one

I wrote a macro that is taking 20+ minutes to run on other computers, but when I run it on mine it only takes 5 mins. It is a larger macro and I am new to the VBA coding world. I was wondering if I ...
15 views

### insert child array for every item in parent array [on hold]

I have 2 loops for teams and sub team this is the code and need the second loop to be a child loop for every item in the parent ...
34 views

### Extract indices of visible nodes in a tree where only some nodes are expanded

A program that I work on constantly updates and modifies program state containing an arbitrarily deep and wide tree. The data looks something like this. ...
25 views

### Calculator in Python3 using Tkinter

I´m a beginner developer and I chose Python as my initial language to learn. This is my very first project: a calculator using tkinter for GUI. I´ve tried to apply some OOP and modules approach, as ...
31 views

### VBA code to import data, doing lookups to detect duplicates

I have an import macro, which creates ID by concatenating cells, then I compare using VLOOKUP with another sheet if any duplicate found. It's running very slowly, so I want to know better ways to ...
19 views

### Finite state machine for chasing and attacking a target

My questions are: How can I improve my implementation of the FSM model? Should Finite State Machines have functionality for Adding and Removing states from table? (Since I can only be in one state at ...
39 views

### Rotate a linked list to the right by k places

The task Given a linked list and a positive integer k, rotate the list to the right by k places. For example, given the linked list 7 -> 7 -> 3 -> 5 and k = 2, it should become 3 -> 5 -> 7 ...
16 views

### Interleave two lists, preserving the order of elements in their original list

I need to write an OCaml program that return all possible zip of two lists together while preserving the order of the element in each list. For example, if we zip the lists [1;2] and [3;4], we get [[1;...
76 views

### Hackerrank: Computer Game (max-flow problem with integer factorization)

I am working on a coding challenge from the Hackerrank site. Given two equal-length arrays of integers, with values from 2 to 109, find the maximum number of times we can remove a pair (Ai, Bj) where ...
12 views

### Placing long return hardcoded objects of a method

I have a static Hash object that can either be a constant or return of a method in a class. For example: ...
14 views

### Update Dashboard tabs to compare subcontractor to peers then email performance summary

My macro is cobbled together using some code from Ron DeBruin and various other sources and it currently works but I am sure it is not as efficient or bulletproof as possible. Currently it updates the ...
16 views

### VBA Copy and Delete Rows loop optimisation

I'm trying to identify which cells in Column C in a spreadsheet of data are dates and if they are, then check if that date is older than 2 years old. If the second condition is met then the below code ...
21 views

### Check if a web element has a specific property and apply changes to the DOM according to the property's existence

I wrote this Javascript snippet for a Polymer fronted, it works without issues. The only thing that it accomplishes is changing an icon's orientation whenever a user is clicking on any expandable-...
26 views

### Strongly connected component in graph

My goal is to calculate the length of each strongly connected component (SCC) I have an input that looks like this: ...
25 views

### Determine if a String can be parsed to LocalDateTime or Int

I have the following kotlin function that takes in a string "value", then attempts to parse "value" as both a LocalDateTime and an Int. It returns a Pair of the parsed value of "value" and an enum ...