All Questions

Filter by
Sorted by
Tagged with
2
votes
3answers
70 views

Recursive Filter/Search function

JSFiddle: https://jsfiddle.net/EddTally/jsa69f7r/3/#&togetherjs=zMFpAQcRTt Those who cannot access JSFiddle: ...
1
vote
1answer
43 views

Printing reverse number triangle

I have to write a program in python that will take a number and print a right triangle attempting to use all numbers from 1 to that number. For example: ...
2
votes
1answer
95 views

Using fluent builder pattern for generating pdf

I'm testing to use a fluent builder pattern for generating a pdf file using AbcPDF. I've looked at several methods of accomplishing this and I'd be very glad to get some input on what I've written so ...
0
votes
0answers
22 views

Relational join of two datasets

Front Matter I'm learning Scala and have not gotten used to functional programming and the language. I'm hoping a review of my naively implemented code can help me bridge my object-oriented ways to ...
2
votes
1answer
85 views

Finding better logic for addition and removal of Nodes in a Linked List

Consider the following piece of code I wrote (a templated Linked List): ...
3
votes
0answers
38 views

How to remove a lot of the duplication in this JavaScript AST transformer?

I have put together this complete runnable source code with an example set of test expressions which it parses and prints. The code requires acorn, which is a JS ...
4
votes
2answers
1k views

VLOOKUP Macro to reformat data between sheets preserving the connection to the source

Hello I'm relatively new to VBA and I have this macro to VLookup information into corresponding cells in the sheet that works, the issue is that it depends on a For Loop to iterate through 10s of ...
0
votes
0answers
33 views

jquery function updated from javascript

This is original Code ...
2
votes
0answers
34 views

Fast git change sets with git wrapping scripts

After having a good experience with virtualenvwrapper built on top of the venv, I thought maybe it could be benefitial to have similar shortcuts for standard activities with git which could be time ...
0
votes
1answer
84 views

Convert month name to numeric string

This code converts a 3-letter English month abbreviation to its numeric equivalent (as a string). ...
-2
votes
0answers
54 views

Fibonacci string only through integer arithmetic, no string operations [closed]

I wrote a program to generate the Fibonacci string with only integer arithmetic to determine the output. I am fairly sure it is right, but my justification is inadequate. There is a commented-out ...
2
votes
1answer
56 views

Cholesky decomposition

This code is Cholesky decomposition in numerical linear algebra. ...
3
votes
1answer
30 views

Ansible playbook to install Docker Swarm

this is my first ansible playbook. it installs docker in swarm mode and automatically joins the cluster. could you guys please review my code and show me where it can be improved? ...
1
vote
0answers
42 views

Script to check a web service

I'm a Python novice. The system I'm using is called IBM Maximo Asset Management. In Maximo, we can write Python scripts that utilize Maximo's Java API/methods. So the script is technically a Jython ...
1
vote
1answer
69 views

Evaluating infix expression with brackets

My assignment was to write a function that computes the value of an expression written in infix notation. We assume that we are using the four classical arithmetic operations +, -, * and / and that ...
1
vote
1answer
96 views

How can I implement this calculator in a better way?

I have this calculator. The user is asked to provide three numbers as well as the numeric operation they wish to perform. Based on this input, a certain case will be executed. The calculator is ...
3
votes
0answers
45 views

Segment characters from license plate image according to regions with same height

I have (for example) the following license plate image: And I want to segment the characters. The code I have so far consists of me using cv2.MSER to detect ...
3
votes
1answer
50 views

Transposing an Excel sheet with pandas adding additional information for a different readability - Using Fake Pizzeria Data

The goal is to transpose the excel file that comes in the following form into this The code I created works properly, but I think it can be improved. I would also like to avoid using ...
-1
votes
0answers
53 views

get clean powers of ten, with C or as 'with C shareable library', for integer exponents, for 80-bit long doubles [closed]

[edit acc. a comment:] Goal: clean correct powers of ten acc. IEEE 754 definition 'nearest'. Useable also in a 'C' environment. As far as I could test evaluation of '1Ei' strings is nearest with most ...
0
votes
0answers
18 views

Wordpress Custom Block that sources files from the theme images directory

The Goal Current PHP version 7.3.5 The block will have a function that sources a defined set of illustrations that are stored in {themeName}/images/illustrations. ...
3
votes
1answer
162 views

Learning Sockets in C# (.Net Framework), Suggested Improvements?

I'm just learning how to allow interconnected apps via Sockets, watched a tutorial last night and based on that this is what I've gotten: Server.cs Code: ...
2
votes
1answer
75 views

Simple stack based interpreter, C# style

I wanted to see how simple it would be to implement a stack-based interpreter in C# based on this question: Simple stack based interpreter The program works with the command line arguments which can ...
-1
votes
2answers
63 views

Caesar's cipher decoder works but Valgrind shows many errors [closed]

The program is a Caesar's cipher decoder. It compiles and works ok, but in Valgrind, I receive a lot of errors and I have no idea how to solve them. I have tried with --track-origins=yes, but I still ...
0
votes
0answers
22 views

Possible to merge model method database calls?

I have an application using Django Rest Framework and a ListModelView for a model which I basically need to filter for in a MongoDB. The call for MongoDB is made in ...
2
votes
0answers
33 views

Undo/Redo implementation using Memento pattern Javascript

Relatively new to the Design patterns, Generally my works are writing function for the needs. But now i need to implement a undo redo functionality, so i just read about the different patterns which i ...
0
votes
0answers
20 views

view only INFO in console and save CRITICAL, ERROR, WARNING to log file

The following code log INFO in terminal and WARNING, ERROR or CRITICAL in file. my python file looks like: ...
0
votes
2answers
91 views

Is there a neater, more elegant way to format this output?

I have this code that writes the initial configuration of a simulator I'm writing to stdout. args is an instance of type ...
0
votes
0answers
10 views

Start / stop animating activityIndicatorView for many dataTaskPublishers

I consume a RestApi with few Combine Publishers and want to visually represent ongoing progress with UIActivityIndicatorView. My current logic uses ...
0
votes
0answers
56 views

query data from mapping name but use many memory

In my class the constructor queries data from the database. In the database there is a table containing more than 400k records. After the query I tested memory size- it uses more than 10m++ bytes. so ...
0
votes
0answers
16 views

Why is this MongoDB query so slow in comparison to python + in general?

There are 1.3M documents in my collection (5.0 and hosted directly on mongodb.com) and there is an index on "topic" and a combined index on "topic" and another field. However the ...
4
votes
5answers
1k views

C++ AES Encryption Class

I am working with OpenSSL and writing an AES256 encryption module. My knowledge of cybersecurity is not vast and I would like to know whether there are any obvious holes I'm leaving. The intent is for ...
0
votes
2answers
112 views

Java class loader for new instance

I at one time used class forname newinstance but newinstance is deprecated. I wanted to be able to pass a class name as a string and be able to load a class, so I came up with: ...
0
votes
0answers
14 views

Implementing Reddit-like comment links

I tried to recreate Reddit's functionality of replacing r/* on a comment with a link to the subreddit and I came up with this: ...
0
votes
3answers
768 views

Use less memory and make it runs faster (if it is possible)

I have to improve this code that searches for missing and duplicates values in a list: ...
0
votes
0answers
13 views

Go middleware for logging with ZAP and elastic APM

Please be brutal with my attempt at logging middle ware. The aim of the middle ware is to tag all the logging with the same tracing detail as the apm modules from elastic that are sent to apm-server ...
0
votes
0answers
23 views

Rust infinite loop in Tokio tasks join_all() made concurrency?

(From stackoverflow.com, they suggest me to post this question here) I'm trying to build a bot to check with accounts the status of a service connected to each of ...
2
votes
2answers
53 views

JS Menu Post Get method

I have this JS ajax GET that returns menus to be used in a view. I wanted to see if there is any more way to write this method. Its a lot of code and just wanted to make sure there is no better way to ...
4
votes
1answer
112 views

Return the biggest loss a client made from prices list

A hiring company gave me the following challenge: We want a function which accepts a very large list of prices (pricesLst) and returns the largest possible loss a ...
1
vote
2answers
58 views

my idea of validating data and bussiness logic

I'm experimenting with some variations of validation pattern. I've created Validator class: ...
0
votes
1answer
35 views

Is using except TypeError the right way to do this? [closed]

I have some code that uses a lambda to enhance the functionality. For backward compatibility reasons, this lambda can take one or two arguments. To handle these ...
0
votes
0answers
62 views

Kosaraju's algorithm is too slow

I just implemented the Kosaraju's algorithm in Go. I tried to implement the same algorithm that is described in the relevant Wikipedia page: ...
1
vote
1answer
17 views

Optimize Tests in Rails6 - Minitest - Factory

I finally got this working but I am concerned I am being 'too' specific in my tests, and also that I am repeating myself a significant amount. I could also combine all of the failures into a single ...
2
votes
1answer
74 views

Gallery template class

I have created a template class Gallery which is intended to be used as a container for objects. I used a private member of type...
1
vote
1answer
46 views

JsonResult Building menu

This logic checks different method and adds links to response that is returned to a view. I there a better way to do this ? ...
1
vote
1answer
36 views

When I try to re set up my code after failing in the game I cant get it to run the function without its own file being undefined [closed]

I know my code is ugly and unreadable. I originally had the game working without class functions but when I had to implement class function it all went downhill. TennisMaster.py ...
1
vote
4answers
96 views

Sorting based on multiple fields using IComparer

I use the below code to sort List<DataAccessViewModel> list. Here is the sort order : PriorityScore ...
-2
votes
0answers
47 views

How to pass input data from ReactJS (Frontend) to Flask-Python (Backend)

I'm trying to build a directory website with ReactJS as a frontend and Python Flask as a backend. I'm trying to pass the text inputs in my searchbar.js to my Python script but I cant find a way to ...
-1
votes
1answer
87 views

HOW can I optimize this FFT C++ Code without using external libraries? [closed]

I have this assignment with the goal of improving the performance and execution time of a FFT C++ code without the use of external libraries. The code is as following: ...
3
votes
1answer
49 views

Monte Carlo Simulation of 7 Card Stud Poker

I've completed this as part of an online programming course (in which code review is supposed to be done by fellow learners, but it's been a very long time and none of them have reviewed this), and ...
0
votes
0answers
39 views

Python 3 Table Improvements

(reposted from another forum, AoPS) I have made a "Table" data structure with fast mean, median, and mode calculations. To my knowledge there's no built-in function that does this. Here's my ...

15 30 50 per page