All Questions

Filter by
Sorted by
Tagged with
1
vote
1answer
77 views

Controller with TemplateService

I am working on my template web api project. I just wanna hear any suggestion how to improve this code. I heard that repository pattern is anti pattern so I want to make code without it. Any opinion ...
1
vote
0answers
49 views

Race condition of initialization with fail safe

I have the following usecase, I have a multi threaded environment and I want to initialize some parameters only only. The thing is that when I initialize the parameters I call a function that ...
1
vote
0answers
246 views

Binary, octal, decimal, and hexadecimal conversion in Elisp

Every once in a while I need to convert numbers between bases. As far as I'm aware there are no existing commands that let you do this in Emacs, so I added some. These functions convert numbers at ...
1
vote
0answers
41 views

Home made additional array functions

I've written a class, for myself, with array functions that I find myself using more often than not. Since I'm always looking to improve myself, here I am. ...
1
vote
0answers
232 views

Binary Search Tree find_successor of inputNode

Wanted to ask for feedback for my coding challenge for BST. python find_successor of inputNode inOrder. https://www.geeksforgeeks.org/inorder-successor-in-binary-search-tree/ find the successor(...
1
vote
0answers
7k views

MIPS even or odd detection program

I am learning MIPS as a part of my Computer Organization class at school and I am writing a simple program that reads in a positive integer from the user and tells the user whether the number is even ...
1
vote
0answers
96 views

PDcurses wrapper module, with mvc or pimpl

I have been writing a library wrapper for pdcurses for a while and implemented each widget/class in it with the pimpl idiom, however I start to see that for large widgets it creates a god object and ...
1
vote
0answers
37 views

Touch Controls: Assigning Touches to Movable Objects within Rects

My game has a variable amount of vertically placed sectors (fields), each of which contains a cursor that moves up and down along a bar when the player touches within a given field. The sectors are ...
1
vote
0answers
341 views

Merge two unsorted array of numbers into sorted array using divide and conquer

I have done an implementation of merging two unsorted array of numbers into single sorted array. I have used the concept of divide an conquer. The code is as follows ...
1
vote
0answers
42 views

Box partitioning with arrays of boost::intervals

I need to write a function that takes a box in space, represented as an std::vector of boost::intervals, and split it into several smaller boxes. First, for convenience, I made some definitions <...
1
vote
0answers
1k views

Python class to save objects into MongoDB

I am new in Python, and I am writing a Python class representing a calendar entry, each entry contains 2 properties: the date and its type, which can be weekday/weekend/legal holiday/paid holiday/...
1
vote
0answers
95 views

A demo for Text widget's get method

In an answer to a question about Text widget's get method, I wanted to demonstrate how the method actually works and wrote the ...
1
vote
0answers
35 views

Testing the process of assigning offers to a customer 2

I asked this question earlier: Testing the process of assigning offers to a customer. Following on from the answerers comprehensive response. I have attempted it again. Please see the test code ...
1
vote
0answers
2k views

Swift/iOS component for label with clickable text buttons

So I'm creating a component based on UILabel, which I'm calling RichLabel. The main goal is to add support for clickable links (...
1
vote
0answers
44 views

Analyze the image of the database relation and create the original database

I've sorted out an image relational database, and created its original database in phpmyadmin (I use XAMPP). Here is a picture of the database relation: This is a database image I created myself in ...
1
vote
1answer
373 views

Implement a queue class in Python

Problem:Implement a queue class in Python: It should support 3 APIs: queue.top(): prints current element at front of queue queue.pop(): takes out an element from front of queue queue....
1
vote
0answers
106 views

Immutable Queue with Bulk-Enqueue

I recently needed a data structure with FIFO queue semantics that supported efficient bulk-insertion (often need to enqueue thousands of messages at once). I took a look at Purely Functional Data ...
1
vote
0answers
92 views

Ruby Sudoku Solver without classes

I'm writing a Sudoku solver in Ruby to complete a coding challenge with the following restrictions. Failing to follow the following restrictions will result in an invalid submission: Do ...
1
vote
0answers
580 views

Python Merge sort count inversions

...
1
vote
0answers
794 views

NodeJS Random sentence generator using Markov chain

Program generate sentences using Markov model and 3 text files Text file example: Antoine de Saint-Exupery, who was a French author, journalist and pilot wrote The Little Prince in 1943, one ...
1
vote
0answers
159 views

Multi Site Concurrent web crawler using gRPC

This is the server portion of a gRPC implementation of a multi site concurrent web crawler. ...
1
vote
0answers
54 views

JavaScript/Angular 1 - Multiple complex ng-if conditions properties

I have 4 ng-if which are related with the same conditions properties: ...
1
vote
0answers
21 views

Link/Bookmark app Javascript Backend

This is the backend "API" in Socket.io for my links/bookmarks app. Error handling in this and verifying a path to the link seems pretty verbose. I want to improve this. ...
1
vote
0answers
36 views

Handling an array of Promises where we care about the outcome of each

Given some data (a job) like, which is from listening in on a RabbitMQ queue: ...
1
vote
0answers
102 views

thread safe queue with watermarks

A thread-safe queue suspending/resuming the producer when respectively upper/lower watermark has been crossed. Intended usage - interchange between a non-blocking IO loop thread and a consumer running ...
1
vote
0answers
31 views

Asynchronously receiving data from a connected socket

Can anyone tell me if this is the right way to call BeginReceive asynchronously? The code works fine but I want to make sure. ...
1
vote
0answers
171 views

Implementation of a cellular automata to model breast cancer

I've created a program - it's an implementation of the cellular automata described in this paper (can't find a free PDF, sorry - anyway it's not really relevant to this question). The CA is ...
1
vote
0answers
37 views

3 state switch for a table sort

I have a data table with 7 columns. The first column is the index that increases from 1 to N and is considered to be in ascending order by default. The remaining columns are unsorted. I need to be ...
1
vote
0answers
480 views

Continuous queue with delay support

I'm new to programming in Python, and I have a task to try and create continuous queue but with delay support. I need to use this for a messaging queue and simulate network latency at different rates ...
1
vote
1answer
2k views

Changing object attributes by calling getters and setters using reflection

We have a class with 10 attributes (longs, Strings) the following method should change any attribute to any value of an object specified by the client, It mimics the SQL update statement ...
1
vote
1answer
60 views

Ensuring array of worksheets are present

I have a sub which should only continue running if 4 specific worksheets are present. From online reading, such as @Tim Williams's comment in Test or check if sheet exists, I know that using an error ...
1
vote
0answers
215 views

Numerical differentiation on sphere with Python

I have ported from Fortran to Python an algorithm that calculates the numerical derivative along the x direction (longitudinal) of a scalar function s on a ...
1
vote
0answers
62 views

Digital clock with many functions - follow-up

This is a follow-up from Digital clock with many functions I used the review mentioned above to optimize the code, but the code can still be made better. I made a digital clock with the use of an RTC ...
1
vote
0answers
3k views

Async test client for TCP socket

I've made some modifications to the async client example found on MSDN for the purpose of testing a server application. It works entirely as I expect and/or want, even running multiple clients, but ...
1
vote
0answers
77 views

Reform PHP associative array

I have an associative array: ...
1
vote
0answers
158 views

Rules and targets in a makefile for data science in R

I am analysing some data (from bioinformatics) with R scripts. I created my first makefile to be able to redo them easily. There is a Figures folder in the root folder and for each analysis a folder ...
1
vote
0answers
22 views

S3 Bash Tools Part 2

This is a follow on to a previous question: Part 2: Upload/Download All the code I am submitting here is available in github The reason to write these tools is so I can prototype and quickly verify ...
1
vote
0answers
77 views

S3 Tools in Bash

This is a follow on to a previous question: Part 1: Signature All the code I am submitting here is available in github The reason to write these tools is so I can prototype and quickly verify ...
1
vote
0answers
477 views

Protection from SQL injection

I have this code, which is working correctly, but I am sure that it allows SQL injection attacks. ...
1
vote
0answers
31 views

Save Position on the cloud or locally

I have a tracking software. At first I just send the position to the web Service ...
1
vote
0answers
103 views

Knuth Morris Pratt substring search algorithm Implementation in Kotlin

Below you can find a Kotlin based implementation of the Knuth Morris Pratt substring search algorithm. Here is the corresponding Wikipedia article. ...
1
vote
0answers
187 views

Linear Regression Model with Python 3

I am trying to create a python module calculating correlation and creating regression model for single independent variable and two independent variables. The program works correctly, I use lots of ...
1
vote
0answers
195 views

Insertion Sort Algorithm

Here is my insertion sort algorithm: Note: Insertion sort works by starting off with the first item in the list and then inserting the next item in the original list into the correct place in the ...
1
vote
0answers
993 views

Fast implementation to output nested dict to JSON

Each line of the JSON has a structure looks as the following ...
1
vote
0answers
113 views

Update WebApp Time with GoRoutine + Websocket

I have created a Golang WebApp that shows the time. I am new to the Golang programming language so thought this little app would allow me to use golang as a webserver, learn about goroutines and ...
1
vote
0answers
529 views

C++11 CLH Lock Implementation

As a hobbyist programmer I have been reading "The Art of Multiprocessor Programming" (Herlihy, Maurice; Shavit, Nir) and converting the Java spin locks into C++ - I have enjoyed this and learned a lot....
1
vote
3answers
2k views

Reversing the words order of a string

A couple of weeks I had a coding interview and the problem to solve was very simple: reverse the words order of a string. What did I do wrong here? ...
1
vote
0answers
61 views

Improving code for image manipulation

I'm fairly new to coding and am developing a set of functions to allow mammologists to progrmatically collect data from photos of specimens. The special issue with mammals is that their coats are ...
1
vote
0answers
565 views

Applies the Largest Remainder Method to a number property in a list of objects

I need to round BigDecimal numbers according to the Largest Remainder Method (LRM). Please reference this SO post with this answer. Here's my version of the algorithm in Java: ...
1
vote
0answers
173 views

F# Operation Framework (Railway-Oriented Programming + Task/Async/Lazy)

I recently published the initial version of what is effectively my first open-source software package, a Railway-Oriented Programming Framework for F# that encapsulates Tasks, Async Workflows, and ...

15 30 50 per page