All Questions

1
vote
1answer
16 views

CustomerIdentity class to bridge gap between internal and external CustomerIDs

Purpose This was designed to be able to seamlessly replace string SAPCustomerID and int CustomerID in parameter lists with <...
3
votes
2answers
34 views

Simple person manager console-app

The code below is for a coding challenge for a job. I have everything working as they requested, I've reviewed it myself and believe everything is good. I'm just looking to see if anyone see's ...
1
vote
1answer
20 views

Inverse mapping with bilinear interpolation on an image

The following is my solution for an inverse mapping with bilinear interpolation on an image. The original image is img and ...
-1
votes
0answers
28 views

Cleaning up Sequential Master Update [on hold]

I'm creating a version of the classic sequential master file update in java. There's some problems with it that I'm trying to clean up. Here's the code: ...
0
votes
0answers
9 views

Opening document link in new tab with other variable code [on hold]

I have a document set to display some "Thank You Code" for 10 seconds, after which it displays a document attached to a Pardot download form. The Pardot form is iFrame, which means the document ...
3
votes
1answer
36 views

A simplified Tetris solver

As part of an job interview process, I was tasked to write a solver for a simplified Tetris game using JavaScript. The game board size is 4x4 and there are 4 different pieces given in a .txt file. It ...
0
votes
1answer
30 views

Making EmployeeHistory ViewModel immutable as code analysis suggested

I want to display on a view the EmployeeHistory view model sorted by elements.assignEffDateNext and I want to instantiate and ...
-1
votes
0answers
17 views

Generating PHP code for web requests

I have a program that generates PHP code for web requests using a template and its output is like the code below. I was trying to make it a function that could be easily pasted and called in every ...
-1
votes
0answers
22 views

Enigma machine implementation (Python 3) [on hold]

So guys, maybe this kind of question has been asked many times before, but I finally tried to implement this Enigma machine. I have done it half the way: The algorithm is revertible. However, it ...
1
vote
0answers
11 views

Basic Kibana/Elasticsearch Search - Powershell

I am traditionally a Java/Backend Developer, and have recently been spending a lot of time dealing with issues that higher tiers of support should be able to handle themselves. To assist them with ...
-2
votes
0answers
16 views

How to optimize summarization linq query? [on hold]

Any optimizations that I can apply to that summarization? It seems to be slowing down my sql server even tho I am getting max 10 results from the query because of the ...
-1
votes
0answers
28 views

Function to check if received message matches any of the expected messages [on hold]

I have a message coming in and I need to match it against the expected messages. The program will eventually do something as a result of receiving those messages. I am not very experienced at ...
0
votes
1answer
19 views

Items and invoices query

I have invoices, invoices_items, order, order_items. <...
8
votes
3answers
537 views

XML node removal method with 5 arguments

I read somewhere that you should try to have as few method arguments as possible to make code easier to read, understand and use. I agree with this to a point but I'm not sure how I can make the ...
2
votes
0answers
17 views

setting up mock and fixtures for for multiple pytest unit tests

I've been implementing a MySQL client with the later purpose of automating monthly reports. At the moment, I've got two distinct use cases: Executing a query and printing the results in files. The ...
1
vote
1answer
50 views

Find an order with the minimum total price

We want to create an application for the analysis of the order history at an online store. Each order is made by a customer and concerns the purchase of one or more items. Orders are stored in ...
-1
votes
0answers
19 views

Python Test Quiz with Numeric Answers ranging 0 to 5 - Need help finishing the code [on hold]

The user must give a grade ranging from 0 to 5 for each question. Then I need to sum the grades of each block (A, B, C, D, E, F, G, H and I) and print each block and the highest block score. ...
1
vote
1answer
41 views

Encrypt data to be send from service to service

I'm working with another company in a new application for my company. My job right now is to send on demand to the other company the data that they need, ciphering some of it. I should point out that ...
2
votes
1answer
50 views

Finding recessions in US GDP data using pandas

For an assignment, I am identifying the first quarter of the 2008 recession in the United States. The Excel data I'm using can be downloaded here: gdplev.xls. How can I improve this pandas code to ...
-3
votes
0answers
17 views

I want to display the details of each existing team with buttons [on hold]

This component i already create by react-js . ...
2
votes
1answer
23 views

GIF/PPM to greyscale converter

This is my take on an image → greyscale converter. ...
0
votes
0answers
18 views

When slide show web page is reopen, the web page loading is very slow

Here is a script that opens about 200 pictures, the first time you open the webpage, loading of the 200 pictures is fast, However if you reopen the page, it takes about 4 minutes to load the same page ...
0
votes
0answers
26 views

Merge info from two sheets info one list

I've created a code that works but takes time to run. Is there any way of making this code work in a more efficient way? In short terms I want to: make a new copy of sheet 1 and 2 Select the row ...
4
votes
2answers
34 views

Parsing Bitcoin binary data file with Python

The script parses Bitcoin database (blkXXXXX.dat) files directly from raw binary to txt human readable view. And I think about how to encrease the speed of processing. Can anyone suggest how to ...
-3
votes
0answers
9 views

Which one of these two styles of type and class is more preferable in typescript? [on hold]

Here is the style 1 type AProp = {...} type BProp = {...} class A extends Component<AProp> {...} class B extends Component<BProp> {...} Here is the ...
-2
votes
0answers
24 views

I'm trying to make a collection class in C# [on hold]

As a side project i'm trying to remake one of my favorite games from the old days, moria/angband. I'm doing it from scratch and in C#. In order to store the inventory I have the following classes, ...
1
vote
0answers
48 views

Async SelectMany implementation

Async SelectMany takes an enumeration (length unknown) of tasks, each of which returns another enumeration (length unknown and likely different from one another), and returns results from the second ...
0
votes
0answers
23 views

Templated JSON parsing methods that work with an element or elements array

Consider the following two Java methods. The first takes a JSON string representing one element, the second representing multiple elements. gson.fromJson() can be ...
1
vote
0answers
19 views

Industrial Automation App with tightly integrated classes

I have written a Windows Forms app that interfaces with a variety of equipment to automate the testing of some gas sensors. The program has four main objects, and sometimes these objects have to call ...
1
vote
0answers
52 views

Extension “With” for immutable types

(My code is basically a rewrite of https://github.com/ababik/Remute so much of the credit goes there) The idea is to use lambda expression to provide a general With...
1
vote
1answer
29 views

Noughts and Crosses

My first program using C. I would appreciate pointers on how to improve the code. I exit just before turns reach 9 and the grid is filled because it causes all sorts of bugs. The computer is random. <...
-1
votes
0answers
17 views

MongoDB group product categories reduce complexity [on hold]

I made a MongoDB query that works and will produce what I need, but I want to make it shorter (refactor) for readability because it has some repetitive lines and I would like to follow the DRY ...
0
votes
0answers
14 views

adding jms in the rest api flow

In my spring boot app, I am trying to fit in the sender and receiver logic for JMS queue as described here I've put the content of "Sender.java" and "Receiver.java" classes from the above ...
0
votes
0answers
23 views

Weekly TextToColumns formatting, sorting, refreshing all pivots then copy/pasting specific rows to the bottoms of a series of specific columns

Firstly, this code works, but it is long and needlessly inefficient. I want to clean up the code. I am working on a spreadsheet (this code is part of) that I import two other weekly updated ...
3
votes
0answers
32 views

Socket chat room in Python

This is a Python chat room that I've been working on and it enables to you to chat to other people on the same network through Python. Server.py: ...
3
votes
1answer
39 views

Swap Elements in Array if first characters match but only once per first character

This is my solution to CodingBat problem p150113. My Java knowledge is from 2011 and I'd like to know if this is still the optimal way to approach such a problem. and if my code is clean and ...
1
vote
0answers
23 views

Python script to add unittest decorators to source code files

This is a simple Python script to add @unittest.skipUnless() decorators in a specified format above every function starting with ...
2
votes
1answer
44 views

Query builder with OOP design

I am designing a query builder, where the user can just add conditions or groups, and each group can, in turn, have conditions in it. I came up wit the below class design. Can this design be improved? ...
1
vote
1answer
26 views

Creating folders even if already exist or removing removing their content

I have a project where, every time I run it, I have to: test if some folders exist, and create them if they don't exists. remove their content if the folders already exist. This is the code that I ...
3
votes
0answers
39 views

Metaclass to run a __first__ method for the first instantiation of a class

I had an idea for a __first__ special method for a class. It would be run after __new__ and before ...
3
votes
3answers
109 views

Image filter for gradient detection

This filter is basically gradient detection (the variable gradImg) like an edge detection (Sobel or Prewitt filters) and also the direction of that gradient whether ...
1
vote
1answer
48 views

Simple DP problem solved in compile time

The problem is taken from one of recent SO questions: Finding max sum of matrix elements with following constraints: Exactly one row element has to be included in the sum If element at (i, j) is ...
-2
votes
0answers
35 views

Looking for more professional way to rewrite the code any suggestion? [on hold]

I am new in react js so I have done something but I knew that there are more clear and readable way to write the code. Can you please guys help me about this component. how to do state management. ...
-1
votes
0answers
14 views

Control Application Insight Logging [on hold]

I used TelemetryClient to sink my application logs in Azure Application Insight. Now I want to control my logging according to the environment. I tried to set ...
0
votes
2answers
21 views

“command preprocessing” with bash - string parsing and handling pipes

The following is a bash script named wrapper.sh: ...
3
votes
1answer
34 views

Hash table with complex variable-length keys

I'm trying to implement the game Snake in Javascript and getting the computer to play it by itself, and want to check whenever the snake loops (repeats the same set of moves twice) so I can kill it. ...
6
votes
3answers
94 views

C++14 std::array implementation

I invested an hour or so to reimplement the C++ header <array>. Most stuff is in the namespace my_std, but ...
5
votes
1answer
57 views

Linear regression on points specified by the user in a GUI

Here's my take on the Linear Regression exercise from John Zelle's Python book. Open a window, let the user click on as many points as they want. Upon pressing the "Done" button the regression line ...

15 30 50 per page