Results for How to implement a particle swarm optimization algorithm for optimization problems

December 2nd, 2023

Can I implement a generic From<> trait for a generic type for any other implementation than from itself?

I made a generic Vector struct, used with different T types : struct VectorT> { data: [T; 3], } I already implemented some generic traits for math...

December 1st, 2023

How to implement a Macro that can be in a comma operator

A Macro, say logging something I want it can be used independently with ";" followed LOG("hello world"); and it can appear in a “operator,()” int i = ...

November 28th, 2023

I'm having a hard time solving problems using try-catch syntax in Java

If the length of the string exceeds 20 because the string is inputted with str Generates RuntimeException with string "More than 20 words" If str is n...

November 28th, 2023

MultiObjective problems using gurobi solver - which method is used?

I'm coding a mathematical model in Julia, using the packages JuMP and Gurobi. So, first I create my model and set some parameters, as below: model = M...

November 28th, 2023

Optimization Challenge- Merging arrays

I'd like to host a challenge, I've made a JavaScript function that is very unoptimized and can be improved in a million ways, Could you optimize it to...

November 28th, 2023

Optimization of Python Nested loops with Two Arrays

In an assessment, I got the following question: "There are two teams of size N, and the skill values of each player on the team are stored inside an a...

November 29th, 2023

How can I see "problems" in VS Code code for all files- not just the ones opened

Pressing ctrl-shift-m in VS Code you can open the "problem" tabs, which display all the problems found for all the open files. is there some way (plu...

November 27th, 2023

algorithm for find lowest subsequence of items in 2 sets

N item are in a queue. There are two set with same capacity. Each item in this queue wants to enter the set that the item in front of him entered unle...

December 2nd, 2023

Is possible to implement interaction to stack one object on top of another in AR?

I'm working on graduation researc and i was assigned to implement new function in AR mobile app, it works like furniture showroom/catalogue or somethi...

November 25th, 2023

Bellman Ford Algorithm not detecting negative weight cycles and won't work with alternate sources

I've been trying to implement a bellman ford algorithm in python but I'm having two issues: it won't detect negative weight cycles, nor will it proper...

November 28th, 2023

Problems with Kerberos auth to Active Directory from Ubuntu 22.04

I get the error KDC_ERR_S_PRINCIPAL_UNKNOWN when I try to authenticate to an Active Directory realm from an Ubuntu 22.04 machine joined to the domain,...

November 24th, 2023

Depth first search implementation: algorithm keeps on searching out only to the right

I have a Depth First Search exercise. The goal of this exercise is to find a valid path from the beginning of the maze to the end. This is my code: No...

November 23rd, 2023

Problem removing from Java-HashSet while implementing Kruskal's algorithm

in the following code I am trying to implement Kruskal's algorithm to compute the minimal spanning tree of a graph. The problem is that removing sets ...

November 22nd, 2023

Can i implement a Pause and Resume function to my Slideshow Javascript?

I am having a Javascript Slideshow. I need to implement a Pause and Resume button on my slideshow where in the slideshow is Paused when i click the Pa...

November 22nd, 2023

Bayesian Optimization for a multi-dimensional vector

I get difficulties when trying to use Bayesian Optimization package (https://github.com/fmfn/BayesianOptimization) for parameter optimization. The tar...

November 27th, 2023

How to implement union in spring-graphql? I get error that I'm requesting object but its rather a 'graphql.schema.GraphQLUnionType'

I wanted to create a union named Tables, that holds all the other tables and the user can request the table accordingly. I get the error: You have ask...

November 21st, 2023

How deeply should i study algorithm?

I am a shopomore in university. And I‘m learning algorithm alone. I have a question that how deeply should i study? (working with normal performance)...

November 21st, 2023

Problems to calculate the angle of the arrows to simulate a magnetic field

Im programming a magnetic field simulator with a max of 4 charges but i dont understand what is wrong with the angle calculation. function generarCarg...

November 22nd, 2023

Why does Rust stop detecting dead structs if they implement/derive some trait?

Under normal circumstances, Rust warns if a struct is dead by generating a warning like: struct `Foo` is never constructed This is nice to detect unus...

November 24th, 2023

How to implement Poisson regression with scikit-learn for count data prediction

I'm looking for a way to couple Linear Regression with Poisson distribution. After a simple Linear Regression, its result is a numerical value that i ...

November 20th, 2023

HttpClient, implement progress when uploading File

I'm working on a UWP app that uploads files to a server using a custom API method. The file upload itself is functional, but I'm having trouble implem...

November 19th, 2023

Optimization of MySQL query with LIMIT

I have this setup; tables: CREATE TABLE `invoice` ( `invoice_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `offer_id` BIGINT(20) UNSIGNED N...

November 19th, 2023

How to implement a SpinLock

I was trying to implement my own custom SpinLock, but the SpinLock seems to misbehave. I have two files, main.rs and safe.rs. The test was done in Ubu...

November 17th, 2023

Using the A* search algorithm to solve Theseus and the Minotaur puzzles

I recently watched this video which used the BFS search algorithm to solve a Theseus and the Minotaur puzzle. If you are not familiar with it, it is a...

November 19th, 2023

How to speed up optimization using parallel

I am doing optimization using optimize.minimize from scipy, say the objective function is fun. I need to do optimization for each row of my dataframe,...

- 25881
How do I undo the most recent local commits in Git?

- 11618
How can I remove a specific item from an array in JavaScript?

- 20343
How do I delete a Git branch locally and remotely?

- 7387
How can I find all files containing a specific text (string) on Linux?

- 7330
How to find all files containing specific text (string) on Linux?

- 7611
How do I revert a Git repository to a previous commit?

- 2671
How do I create an HTML button that acts like a link?

- 8481
How do I check out a remote Git branch?