All Questions

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

Custom C++ wxWidget Ranged Slider

I wanted to make a bounded slider since the ranged slider wxwidgets includes isnt very useful for my use cases. I got a good head start from a person who made a library in Python and ended up creating ...
1
vote
0answers
11 views

Minesweeper in haskell

I have recently been learning Haskell, and wrote a minesweeper project as an exercise. Here is link to the project. Basically the code is separated into two parts, the pure part (no monads) and impure ...
0
votes
0answers
13 views

Failing some test Case [closed]

two students are sitting beside him each having one string. Lets say student1 has string s and student2 has string t.Both strings are made up of just two signs − and + and they are wondering whether ...
1
vote
1answer
21 views

Filtering string by given keywords

Im currently working on a filtering keywords. I have two lists which I called positive and negative. Scenarios: if POSITIVE matches and NOT ...
-4
votes
0answers
22 views

What's wrong with the code? [closed]

Good day! The task is the following: GetSameParity implement a function that takes as input an array of numbers and returns a new, consisting of elements that have the same parity as that of the first ...
0
votes
0answers
44 views

Python case insensitive dictionary

This is a Python case insensitive dictionary that is ordered and has integer indexes for the keys and values. I just wrote it today. It is ordered because I am using Python 3.9.6 and plain ...
4
votes
2answers
381 views

Fizzbuzz in C lang

This is the first time I have recoded in C for several years and I would like to know how clean my code is. ...
2
votes
1answer
130 views

An implementation of the PIMPL idiom

I would like to ask you to verify the following implementation of the PIMPL idiom. In this dummy implementation the stream is read into a string. X.h ...
-3
votes
0answers
13 views

Unable to get required output in Backdoor and Listener with Remote Code Execution functionality [closed]

I am trying to code a Backdoor and for it, a Listener that can be used to remotely execute commands on a Compromised Machine. But I am unable to get the code right in Python 3. There are 2 codes in ...
0
votes
1answer
31 views

Java OOP Calculator (no GUI)

i have created an object orientated Calculator without GUI. i have provided only the most important parts of the code. I want to add another review question for those parts (especially: ...
0
votes
0answers
17 views

implementing SOLID principles and oop

im reading clean code, and practicing SOLID principles, can someone help me to improve this code, suggestions are welcome: ...
4
votes
1answer
200 views

4x4 double precision matrix multiply using AVX intrinsics (inc. benchmarks)

Benchmark An optimised 4x4 double precision matrix multiply using intel AVX intrinsics. Two different variations. Gist For quick benchmark (with a compatible system) copy paste the command below. Runs ...
-2
votes
0answers
11 views

Monthly Cost for House Code - Output not coming out correctly [closed]

My output is returning 0 for the value for the costs and I am not sure why. ...
2
votes
0answers
22 views

Vectorizing a working custom similarity function further using numpy

I am new to python, and even more new to vectorization. I have attempted to vectorize a custom similarity function that should return a matrix of pairwise similarities between each row in an input ...
-1
votes
0answers
13 views

Error posting after an update with Supabase and Angular

The Problem I've been trying to learn Angular and Supabase for the past few months, and right now I'm trying to build a good ol' Todo app with CRUD functionalities using Angular and Supabase. I've ...
2
votes
1answer
34 views

Is this a true implementation of XOR in python?

I have implemented a simple XOR encryption in Python. However I am not sure this is the right implementation or it can be further improved ? ...
-3
votes
1answer
23 views

building a simple password program that leads to a main menu for a game just as practice and im having problems with the do while loop [closed]

I am working on making a program that just uses all the concepts I have learned so far. it starts out as just an input for a password (int spam) but for some reason its saving the users input when the ...
1
vote
1answer
23 views

Daily coding problem: Job scheduler invoking a function after specific time

This is a problem from Daily Coding Problem. I have implemented it in Java. For a function f I have used Runnable interface. ...
1
vote
1answer
46 views

Python Code Style If,elif, else

I have this Python code: ...
6
votes
1answer
353 views

Python code for eliminating options for random intergers as they get picked

My goal is to write code that picks several random numbers from a range without repeating any previously chosen numbers. I figured out a functional solution for my problem but it seems very bulky and ...
-4
votes
0answers
25 views

want to avoid return by value [closed]

I have a function that is returning a vector of set of vectors. This is quite expensive for the reason that the C++ version is C++03 or less, so there is no move semantics to take advantage of. The ...
1
vote
1answer
27 views

backup file script in PHP

I'm learning PHP and try to write some scripts as I go along. I wrote this script and it worked. I would like to know if this script can be improved. The purpose of the script below is to prompt the ...
1
vote
1answer
23 views

parse two csv files, calculate a product and sort the result by product

Problem: Given two csv files science_courses.csv and other_courses.csv, which has students name and their respective course ...
3
votes
0answers
11 views

pandas.DaraFrame resample OHLC based on a non-time value

I have a csv file that looks like this: ...
0
votes
0answers
5 views

Ratio of intra-class scatter by inter-class scatter is getting minimised by linear discrimination process

This question is complicated (at least for me who is new in machine learning and image processing). I need help in understanding, why my iterative process is minimising the ratio of inter-class ...
1
vote
2answers
22 views
0
votes
1answer
17 views

Reviewing my shader class for efficient use

Im just trying to setup my shader function in a class in a way that would make me work with it easier and in a more understandable way. In Shader.h: ...
1
vote
0answers
58 views

Python case insensitive three level nested dictionary

This is a custom case insensitive nested dictionary class created by me, its main usage is to populate QTreeWidget and keep track of said QTreeWidget, the main incentive behind this class is to ...
0
votes
1answer
16 views

Cubic Permutations | Project Euler #62

The cube, 41063625 (3453), can be permuted to produce two other cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the smallest cube which has exactly three permutations of its digits ...
3
votes
2answers
64 views

Rubik's Cube rotation with OpenGL

I've been trying to make a rubik's cube project and it succeeds nicely . The only problem(or something like that) is that i need to optimize my code for easier understanding and more flexibility. Here'...
1
vote
0answers
28 views

Is this a reasonable way to test/compare javascript loop speeds?

I'm playing around with understanding array looping speed. I'm trying to make the contenders equivalent and close to realistic. Is this a good approach? Are there other iteration approaches to test? ...
0
votes
0answers
11 views

Simple battleship game in Groovy

I am trying to learn Groovy and I did an attempt on implementing a simple Battleship game. Any feedback is welcome. I will start with the modal classes I have. Modal classes Coordinate.groovy ...
1
vote
4answers
54 views

Print a 10x10 times table

I have been on the C++ learning grind for the last 2 weeks using caveofprogramming videos so don't judge too hard if this seems like a dumb question. My last lesson covered arrays and the assignment ...
1
vote
2answers
33 views

Extracting items from comma/semicolon-delimited strings, discarding parts after a hyphen

New Scala dev here. Is there a more idiomatic or efficient way to accomplish this in Scala? Given a list of the following strings, I need to obtain the unique 'main parts' once any parts including ...
1
vote
1answer
43 views

My 3D to 2D graphics algorithm is being a bit slow

With my VB.Net Windows Forms application, I would like to rotate and project a 3D object. The program works so far, which is why I'm reporting here and not Stack Overflow, but it's slow. I've already ...
-2
votes
0answers
21 views

API for input stream with read until [closed]

I want to create a stream class The input stream should read/parse a continuous range from left to right providing convenience methods. The implementation isn't a problem but choosing a consistence ...
0
votes
0answers
11 views
2
votes
1answer
28 views

Simulating disease spread in a population

I am trying to build a model that allows me to estimate the spread of disease in the population. The setup is similar to the SIR model, with the difference that this model includes the stochastic ...
-2
votes
0answers
14 views

how to play again if there is wrong input/error [closed]

I'm working on my project called Tictactoe. It is working great. So to play the game there is a function call play which takes pair of ints and decide where to play, while there's another function ...
2
votes
2answers
49 views

floor modulo or modulo rounding towards negative infinity

The first function will always try to correct the final result, while the second uses a conditional to know when to compensate. I think that in general the second function will be faster, but it will ...
-1
votes
1answer
18 views

Rust: lazy_static the strings from evdev codes [closed]

So I have this piece of code that produces following error: ...
-3
votes
1answer
8 views

Send token from addressA to addressB through contract [closed]

Hello how can i send a token from the msg.sender to mycontract through a function inside my contract? i tried to do a transferFrom "...
6
votes
4answers
155 views

Bidirectional iterate over list in Python

I wrote a short function to iterate over a list starting at a given index, then flipping back and forth between left and right values. ...
0
votes
0answers
17 views

Identify what element got clicked on a form in JavaScript [closed]

I am trying to pass a ref to a function so that I know which html element was clicked. If I don't pass the 'this' (and remove the []'s from the html) it will always only hide the top TR. I need it to ...
0
votes
0answers
25 views

Maximum Profit in Job Scheduling - Performance Issue

I implemented the Maximum Profit in Job Scheduling algorithm in JavaScript, but I'm having performance issue. The problem: We have n jobs, where every job is scheduled to be done from startTime[i] to ...
1
vote
0answers
38 views

template Matrix class with Static or dynamic size

I started implementing the folowing Matrix class in order to get a better understanding of templates classes in general. For now, it lacks a lot of features, it does very basic things: addition ...
-2
votes
1answer
29 views

Find the path in 2D Matrix [closed]

If there is a proceeding 0's from the top left right bottom in the matrix then it return true, else returns false. How could I improve this solution? Is there any suggestion like BFS? Thanks. ...
0
votes
1answer
26 views

An efficient way for removing rows with zero elements iteratively while constructing the matrix

Based on a previous post, Accelerating creation of matrices and finding ways for optimal scaling, we managed to accelerate the way that I construct a matrix in Rcpp (inputs for example are at the end ...
0
votes
1answer
49 views

Given a 2d matrix with chars find the target string

I am looking for a simpler implementation of the following question. Could it get better? I am expecting the new solution via DFS again. Thanks. OA: Given a 2d matrix with chars and a target string. ...

15 30 50 per page
1
2 3 4 5
1452