All Questions

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

Multilingual React Application using typescript

I'm learning react-typescript programming. Developed a sample application, which supports in multi language. github Souce: https://github.com/phanivaranasi/sownikbackend.git Review the code and ...
0
votes
0answers
6 views

how to write kernel in OpenCL

I am new to OpenCL and I am asked to implement a kerenl (device code) for the attached c++ code. I tried to start writing kernel but not sure if this is correct try or not. Can you please read my c++ ...
1
vote
1answer
18 views

Password generator - different solutions

I made a simple password generator (once again). ...
0
votes
0answers
3 views

Reusable/extensible deisgn of toggle to be used for switching dark mode on/off

I though of defining the following module that I could use to govern the dark mode on/off on a website. Probably I would use it only for that in the whole page, but in the case I don't (i.e. I end up ...
1
vote
1answer
7 views

Setting Wallpaper with Xlib and ImageMagick cli

This program reads raw pixels from the pipe/stdin in a loop and set the root window background. ...
0
votes
0answers
9 views

Hackerrank Gridland Metro - using Interval Cover Solution

Hi there I was hoping to get a better grasp of greddy algorithms while trying to solve this problem: Hackerrank: Gridland Metro and I was trying to apply an algorithm where each grid could be ...
1
vote
0answers
15 views

Matlab vs C: Tensorproduct or Vec-trick (multiple times)

I am searching for a more efficient way to calculate the so called vec-trick used in Tensor algebra, see Wikipedia. Introduction: Suppose you have a matrix vector multiplication, where a matrix C ...
2
votes
1answer
22 views

Python loading image into memory (numpy arrays) from database bytes field fast

I am looking for feedback on the function below to load a png image stored as bytes from a MongoDB into numpy arrays. ...
2
votes
0answers
24 views

How could this indentation-based lexer be simplified?

I finally got this lexer working. How can the parse function be simplified? The goal is to take a tree of indentation-based text, and convert it into parentheses-...
-1
votes
0answers
21 views

getting negative numbers in some inputs [closed]

...
1
vote
1answer
50 views

Select 3 items from list, print different messages based on selection order

I want to see if I can find a way to have the system work the same way when it runs, but condense it, as if I don't I will be constantly writing a lot of code that I believe I could just write in a ...
0
votes
0answers
15 views

Small combinator parsing library in Haskell

I recently wrote code to parse lambda expressions in a lisp like format, using a small hand-rolled parsing library. The goal This code was written as a part of this code-golf challenge not as code-...
1
vote
1answer
18 views

create script to convert array to string with array elements uniquely with randomness

I have written a python script that generates random rows with a provided array. To better explain ...
0
votes
1answer
35 views

Replacing a char in the file name

I am formatting my TV series archive and can not do one by one. I wrote this code and it's working like what I want. I am a beginner and want to improve my knowledge of algorithm. What can you ...
0
votes
0answers
19 views

UPDATEIT SPOJ problem using Segment tree

UPDATEIT on SPOJ: UPDATEIT - Update the array ! #bitmasks You have an array containing n elements initially all 0. You need to do a number of update operations on it. In each update you specify l, r ...
0
votes
0answers
32 views

VBA OOP design patterns: factory, constructor, returned interface

While working on my demo database manager app, I have coded a previously presented Storage Library. The structure of the library's code and employed design patterns partially follow that of the Secure ...
5
votes
3answers
330 views

Refactor JavaScript nested if-else

I'm really new to code optimization and JS. I would like to ask for help on optimizing my code. Thank you in advance. Here is my code: ...
-1
votes
0answers
12 views

How can I wait till the Batch Insert completes? Right now program exists and inserts are happening after [closed]

Below is the code to insert data to mong client, Right now it works, however the successful message appears even before all the data is migrated. Migrating the data happens after that. ...
-1
votes
0answers
18 views

How to get concurrent.futures ProcessPoolExecutor work with a dictionary?

I watched the python multiprocessing tutorial on youtube, here's the link https://www.youtube.com/watch?v=fKl2JW_qrso&t=2316s&ab_channel=CoreySchafer Then, I tried to apply that method in my ...
1
vote
0answers
11 views

Output webscraping results to BibTex file

Here is my attempt to output webscraping results to a bibtex file. I would like to use this format as input to the Zotero database. As BetterBibtex already has a ...
-3
votes
1answer
36 views

Need to verify what mistakes I have made as per the comments I received [closed]

I need to know something. I applied for a job, There I was given a take-home assessment. The test is here on this below GitHub URL https://github.com/lokoArt/xanpool-full-stack-assignment But I was ...
2
votes
1answer
52 views

Multithread or multiprocess

This is my code: ...
2
votes
1answer
43 views

Merge in list from another list that are not present in the former list

The two list have different structure. The list originalPgs is a list of PGRatingConfig and has this structure: ...
1
vote
0answers
18 views

Showing synced lyrics of mp3 music in vb.net

I wrote a program that syncs the lyric of an MP3 song and displays the text as a subtitle when playing the song, but my code for this is too Unprofessional and weak. Is there a way to display it more ...
-3
votes
0answers
14 views

Prerelease IGCSE Computer Science Train Q, Im not sure why im getting this synntax error [closed]

I am getinng a syntax error on the while part, im not too sure why though, the question is IGCSE Cambridge International Computer Science 0478/22. I am new to coding and am not sure why this is ...
0
votes
0answers
12 views

Where and how can I speed up this config-driven ezstream script?

I've put together this script to check through various location and pick the next media file to play on an internet radio station: ...
2
votes
1answer
29 views

Python Service with USR1 kill signal handler

I have a Python script that runs as a service, like this: ...
1
vote
0answers
47 views

converting from byte arrays to strings of integers, and back

I have this code to go from an array of bytes (arbitrarily long) to a "bigint" string (really, an arbitrarily long string composed of integers 0-9), and go from that long integer string into ...
0
votes
0answers
33 views

Alternative C# Design Pattern

I've come up with a design pattern that's a mix of other patterns like Mediator, Repository, Factory. The idea is that instead of passing a specific object like a UserViewModel from the UI to the BL ...
0
votes
0answers
18 views

Refactor Javascript filter that handles click and changing together dropdown filters

I'm looking to rework and make it easier to read this handleFilterChange function This is helper being used in the function ...
-1
votes
3answers
139 views

Next prime in c?

I create a function that returns the next prime number greater or equal to the number given as an argument and my code works well but I have one issue when I run multiple tests I got a long run time. ...
4
votes
1answer
57 views

Algo to return a vector of available time slots for scheduling a meeting between two persons

There are 2 persons and their already booked meeting schedule is given and also time bound for both the person is given. Now, we want to schedule a meeting between them in an available time that suits ...
1
vote
2answers
44 views

A function to find all the primes between two numbers whose reverse is also a prime and doesn't include palindrome, in JS

I am trying to solve a challenge in which I have to write a function that takes in two numbers as arguments and returns an array containing numbers between them which are prime and their reverse is ...
1
vote
1answer
34 views

psycopg2 ThreadedConnectionPool implementation

I am currently using a ThreadedConnectionPool from psycopg2 to lease transactions to a PostgreSQL database and would like a ...
1
vote
1answer
36 views

Comparing Three Columns and Copy Pasting data

I am using below code which is comparing three columns values and copy pasting the 4th column data into other column. My code is working fine but it is slow to perform the processing and takes much ...
1
vote
1answer
46 views

Scoring system for events

A newbie here. I have done this assignment that my university gave. Requirements Participants may enter the tournament as individuals or as part of a team** It is expected that will be 4 teams each ...
1
vote
0answers
17 views

Combine several calculations on several variables

This is my very first time here, I am coming from stackoverflow.com thanks to @r2evans. So I apologize in advance if I don't follow all the rules. I wrote a code in ...
2
votes
1answer
39 views

watchdog for c++11

I created a watchdog/notifier in C++ and wanted to make it better so it could be used by multiple people. The idea is that there is a timer class and event. client create events and pass a lambda ...
0
votes
1answer
26 views

Detecting supported browsers in ASP.NET MVC (Server side vs. Client side)

I want to check client's browser version, and if it's too old, display a message that the user should update their browser in order to use the website. The website is built using ASP.NET MVC. I have ...
0
votes
0answers
15 views

Chain the same Runnable using Handler in Android

Which approach to creating repeating Runnables is better? ...
2
votes
1answer
45 views

Leetcode 1584. How to make my Kruskal&Union Find algorithm faster?

The question was on Leetcode 1584. Min Cost to Connect All Points. My answer to this question is: ...
18
votes
7answers
5k views

The car plate problem: generate from AAA0001 to ZZZ9999 skipping the 0000

I was given the problem (called "car plate problem") to write all the values that go from AAA0001 to ZZZ9999 with the following premises: Create all the possibilities from AAA0001 to ...
1
vote
0answers
39 views

“streaming” messages to a broker from a batch-like source (eg sql database), optionally acknowledge back to the source

I am writing library code to help other developers send messages to a pub-sub event broker. In many cases, the message source will not be "stream-like". Specifically, most messages are ...
1
vote
0answers
21 views

Logistic Regression for Fashion MNIST T-shirt vs. Shirt

I wrote a Logistic Regression for Fashion MNIST to classify T-shirt vs. Shirt. here is the class ...
3
votes
0answers
38 views

Text-based Monopoly in Java

I am currently creating a Java console program for a text-based Monopoly game as a personal project. Since this is my first project that I have worked on, I would like to know what kind of object ...
-2
votes
0answers
20 views

Python Tkinter program not stopping/closing properly [closed]

I am trying to collect weather data via API and then send it to a PLC through VPN in a loop every 50 seconds. Everything works fine except the GUI freezes when I click the "Start Sending" ...
0
votes
0answers
15 views

Historical Volatility from Prices of many different bonds in same column

I have a csv file with bid/ask prices of many bonds (using ISIN identifiers) for the past 1 yr. Using these historical prices, I'm trying to calculate the historical volatility for each bond. Although ...
0
votes
0answers
27 views

Optimizing Fetch and Manage Errors on Golang

I have done this little Program in Golang: ...
2
votes
0answers
18 views

AI learning to drive (simplistic) needing optimisation

So I have done a little program where the goal is trying to teach some cars (red and blue rectangles) to "drive" through genetic algorithm. It works well and I haven't seen any bugs, but the ...
3
votes
0answers
36 views

Text Based Blackjack

I wanted to make a blackjack game to use while bored, but it turned out to be far more complicated than I thought. ...

15 30 50 per page
1
2 3 4 5
1458