All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
4 views

Iterating over a tuple

I tried to write a small header-only library that provides a type similar to iterators for std::tuple as well as some stl-like algorithms. I would be grateful for ...
0
votes
0answers
5 views

Java multiple completablefuture

I wrote the following snipet code within Cumulocity platform. runForTenant must be in a separate thread. What is your an opinion about my code. is there any need for optimization? Thanks ...
0
votes
0answers
11 views

An RPN Calculator in Java

Brief I have asked this forum to review the previous versions of my code here. My calculator takes the input either separated by spaces or newline. If a command is not recognized, the program prints ...
0
votes
0answers
16 views

c# IndexOf string search

I have this code working but its using IndexOf I am not sure if that is the best or only option for search for a string value. What I have is a list that will need to remove a world from the child ...
1
vote
0answers
9 views

Prettier Pug Plugin - performance, documentation, splitting, regex improvements

I'm the creator of the plugin Prettier Pug Plugin Everything works fine and I have a lot of tests because I used TDD I currently have a large index.ts (permalink) In this file mainly an array of ...
0
votes
0answers
17 views

Slow performing subquery

This query executes very slowly and I wonder if it can be improved? We have an Access database split to front end / back end with around 50 users. BE is in a network folder and FE is on users' hard ...
-4
votes
0answers
25 views

guessing game in python not working [closed]

I have written a python script to guess anything which the question has asked....but there is a problem that I can't figure it out....everything is working well by giving a single character. But if I ...
-2
votes
0answers
27 views

Proper Python project setup [closed]

I was asked to migrate this question from SO here. I know there are already several questions regarding folder structures, relative imports, modules/scripts, and ...
-3
votes
0answers
17 views

Why flask blueprint not getting changes and routes aren't working? [closed]

I was working on a basic news flask application since one month. I was started get some 'ImportError', then I got help from stackoverflow to use 'flask blueprint' for better management of my ...
0
votes
2answers
27 views

Sorting multiple vectors based on a reference vector

I am trying to sort vectors based on a reference vector. First I am getting the indexes for the reference vector and then using that I am doing inplace sorting for the rest of the vectors. ...
1
vote
1answer
31 views

Finite State Machine / Scene Manager in C

I'm new to C programming but this is my attempt at a Scene/State machine. I haven't had a code review before so I'm guessing this is gonna hurt :D § Preliminary SceneFSM manages Scenes, one Scene "...
2
votes
1answer
116 views

Terminal-based Blackjack

Normally I code in Java but have recently been trying to teach myself C for a university course I will be taking next semester. (I'm about to enter my third year). I wouldn't consider myself the best ...
-3
votes
0answers
22 views

align with spaces [closed]

There are two cases. Case 1: ...
2
votes
1answer
49 views

Python - Hexadecimal to Decimal conversions

I have written a python 2 program for a school project to convert from hexadecimal to decimal without using built-in functions and vice versa in python. I would like to know how I can make my code ...
1
vote
0answers
9 views

Terraform/HCL - First element (or any arbitrary element) from a list of sets, combined into a list

So I am working with Terraform and I feel like there must be a faster or, at the very least, a prettier way to perform the operation I'm attempting. For some boilerplate, I have a data block that ...
1
vote
1answer
11 views

Statistical sampling from a vector

I have written a function/script to simulate data for sample size estimation. The following code samples from a vector of generated values with varying numbers of sample sizes and then concatenates ...
10
votes
2answers
572 views

Better way to iterate through a dictionary and comparing its keys with itself

I have a dictionary with author names as keys and values of None. I want to use fuzzywuzzy ...
2
votes
1answer
35 views

Encrypting an AES key

This encryption class RSA encrypts an AES key and then when the encrypt method is called it decrypts the AES key and uses the key to encrypt the message and basically the same thing with the ...
2
votes
4answers
56 views

Storing function metadata

In a project, we have a file that contains something like a script which we need to parse. At the moment the validation is tough since we have an array of functions returing ...
3
votes
1answer
21 views

Laravel - Repetitive code in store and update functions

I am working on a system and I can see myself using repetitive code that does not look right. I want to clean up my code but I don't really know many ways to do so. I have 2 methods (store and update)....
3
votes
1answer
62 views

Messy Hangman Game

As it is now the end of my semester for my programming class, we had a final test were we were supposed to make a short hangman game. I have since added some small improvements, such as showing the ...
-4
votes
0answers
20 views

React Link passing ref to animation library [closed]

I am currently been for 2 days now attempting to get react-reveal to work where it does not require a refresh. Currently what is happening is when I change page via Link it does not trigger some of ...
4
votes
2answers
56 views

Calculate compounded interest

My job for now is to teach a trainee how to program. I told him to solve the following task, given by a book (I try to translate it): Write a program for compound interest calculation. The user has ...
1
vote
1answer
82 views

Connect 4 class in C#

I wrote the following class for a connect four game in C# ...
1
vote
0answers
20 views

Faster Google Spreadsheet access and direct use of Named Ranges for code readability

This object structure, that I think might be useful for a number of projects, attempts to: learn the use objects (classes are not available in Google Apps Script) and inheritance minimize calls to ...
5
votes
1answer
51 views

Beginner 'Peg Solitaire'' game

This time I wanted to make a board game that is very popular in Brazil, it's called 'resta um', it means 'there's only one left'. The idea of the game is that there are holes in which there are pieces ...
2
votes
0answers
30 views

Create Word Document in C++

I am new to COM programming in C++ and while this code works welcome suggestions to improve readability/reliability. This creates a blank word document and adds the text Hello, World. ...
3
votes
1answer
71 views

Matrix Transpose in Golang

I have write a normal programm "Transpose the matrix" in go. Suppose input are always correct. I also read the article An Efficient Matrix Transpose in CUDA C/C++. So I keen to know how I can use Go-...
-1
votes
0answers
15 views

sqlalchemy filter by different number of parameters

Is it posible to rewrite this condition to one line? ...
4
votes
0answers
27 views

almostIncreasingSequence

This is assignment from codesignal: Given a sequence of integers as an array, determine whether it is possible to obtain a strictly increasing sequence by removing no more than one element from the ...
1
vote
0answers
47 views

get better performance [closed]

I have this code that works, but I'm sure that it can be done better, any suggestions? ...
2
votes
0answers
20 views

django add comment to article

I have recently finished a "django for beginners" book that ended with creating a small articles site. The last chapter adds a Comment model which is linked to <...
8
votes
3answers
629 views

Custom Logger class

My custom Logger class works just fine. However, the class is not intended for making instances of. Because there is really no reason to make instances of my class, ...
3
votes
1answer
36 views

User Class and MySQL Connection Handler

Mainly used Stack Overflow, so first time over here for a code review. I am trying to make some enhancements to a legacy application. I have some minor experience using Laravel, but this application ...
-3
votes
0answers
20 views

Simple clock with React Hooks

Is hook usage in this code fragment correct? ...
1
vote
1answer
50 views

Shortest distance between two words in the list

Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. Example: ...
0
votes
2answers
39 views

Assign key name based on row while loop

Is it possible to automate the array inside the while loop and automatically assign the key name based on the row so I don't have to spell out each one? ...
3
votes
0answers
23 views

Rust List comprehension macro

I'm very new to Rust and as I've been going through the book I became very interested in its macros. To better understand them I tried to write something of a usable list comprehension like those in ...
1
vote
0answers
15 views

Generating packaging slips with Node

I was tasked with writing a script, in any language, to generate packaging slips. These slips would be sent to our printer and printed. The scripts functions are as followed: Read in data from ...
1
vote
0answers
17 views

Minimum router Peripherality Breadth First Search (BFS) Algorithm performance

I have solved the MinRouterPeripherality task in codility using javascript using Breadth First Search(BFS) approach. However time complexity is O(N^2). I am really ...
1
vote
0answers
9 views

auto-fold deeply nested parts of a file (vimscript)

Folding in vim has bugged me for a while. What I intuitively want is for the details to be folded, but the overall structure of a file to remain unfolded. This way I can navigate around a file to see ...
1
vote
0answers
17 views

Check balanced brackets

Yes, I know we have a lot of these. I'm new to Clojure, but not to lisps. After the recent (javascript?) parentheses-balancing Q, I decided to do an implementation in Clojure for practice with the ...
3
votes
1answer
36 views

Multi-threading with TPL - Access Internal Class Properties

I am using the TPL library to parallelize a 2D grid operation. I have extracted a simple example from my actual code to illustrate what I am doing. I am getting the desired results I want and my ...
2
votes
0answers
7 views

npm package as amqp client helper

I would like to build a common helper for my application that will manage all the amqplib calls from all of my nodeJS microservices. I would like to import my amqplibHelper to every micro service and ...
2
votes
1answer
43 views

Validate implementation of ECIES

I've created a basic implementation of ECIES (Elliptic Curve Integrated Encryption Scheme) based on http://www.secg.org/sec1-v2.pdf section 5.1. ...
1
vote
3answers
131 views

Facebook coding interview [closed]

I have joined the Facebook interview recently. And the following question has been asked on the coding interview. ...
1
vote
0answers
57 views

Abstract vacation time tracker with states

I am writing a program for vacation in a company and the time that is allowed to be in a specific holiday I used an Abstract class with an abstract method: ...
3
votes
1answer
55 views

Sorting and Filtering Maps Using Generics

I had a test for a Java-position where they asked me to manipulate JSON-data from an API. Once my overall parsing of the data into Maps were done. The test required me among other things to ...
4
votes
3answers
74 views

Seconds into readable time information

I had an exercise to solve, written in German. I try to translate it: Write a program that takes an amount of seconds. The program than has to output the number of years, days, hours and seconds. ...
-2
votes
0answers
22 views

15 30 50 per page