Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
1 answer
85 views

OpenProcessing.org JavaScript program - Building a list of matrices

My openprocessing.org JavaScript code listed below produces the output I want but doesn’t seem very elegant to me especially the “.M” in “matrices[mat].M[row][col]”. Any comments to improve the ...
Will.Octagon.Gibson's user avatar
3 votes
0 answers
97 views

Speed up a JavaScript function for inverting matrices using Gauss elimination

I wrote this function and I'm interested if it can be sped up by improving the code. The function accepts either column major 1D array or 2D row major array. Maybe there are some obvious JS tricks ...
user9163823's user avatar
3 votes
0 answers
36 views

How would you convert this code to best take advantage of CSS transform for panning/zooming?

I am using react-flow-chart for a job project, but it doesn't implement zoom, and I would like to take the reigns and try applying it myself. I took a linear ...
Mehdi Saffar's user avatar
1 vote
2 answers
461 views

JavaScript Spiral Matrix Coding Challenge

A whiteboarding challenge: Given a 2D array (matrix) inputMatrix of integers, create a function spiralCopy that copies ...
MadHatter's user avatar
  • 865
0 votes
1 answer
122 views

Combine Matrix Columns JavaScript

I did this Codepen to combine all the columns from one matrix in JS. ...
Edgar Ordóñez's user avatar
2 votes
0 answers
131 views

Dijkstra in JavaScript

I am writing the solution of Dijkstra's algorithm in JS. This is what has happened so far. I need to make it so that the choice of nodes is by recursion. Tell me how to do this better. ...
Aletagro's user avatar
6 votes
3 answers
14k views

Rotate an N × N matrix 90 degrees clockwise

Given the problem from "Cracking the coding interview" Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees ...
PDStat's user avatar
  • 345
0 votes
2 answers
2k views

Simple Matrix Rotation

I needed to rotate a non-square matrix in my program to transpose some spreadsheet data and decided to make a function to rotate 90, 180, or 270 degrees. It doesn't rotate the matrix in place, but ...
Douglas Gaskell's user avatar
3 votes
1 answer
535 views

Find largest connected cells of value 1 or greater

My goal is to find the largest connected "cell" of 1's in a matrix. My approach has been to search the surrounding area of a cell that is not on a border and then if it hasn't been visited, and has a ...
willredington315's user avatar
1 vote
2 answers
2k views

Multiplying 4*4 matrices

I'm multiplying 4x4 matrices for learning purposes. How can I optimize this for performance? HTML ...
Ahmed's user avatar
  • 113
7 votes
3 answers
15k views

JavaScript solution for diagonal difference

hackerrank.com - diagonal difference: Problem Statement You are given a square matrix of size N×N. Calculate the absolute difference of the sums across the two main diagonals. Input ...
Vishwajeet Vatharkar's user avatar
2 votes
1 answer
91 views

Net health monitoring

This is a little net health monitoring project I made in NodeJS. It pings Google every second and stores the result (true/false) along with the date in a database (MongoDB). I've collected enough data ...
laggingreflex's user avatar
4 votes
2 answers
1k views

D3 Matrix table

I am able to develop this matrix but I think code can be improved. I am creating a map on which each rectangle may have zero through many list items with their titles (still need to add code for ...
Mathematics's user avatar
6 votes
1 answer
824 views

Linear algebra, reduced row echelon form - function 1

This is a derivative post from here. This is just a general review, so the question is the same: Is there something... That you would consider as a bad practice and why? That is just bad in some ...
user1235831's user avatar
5 votes
1 answer
2k views

Linear algebra, reduced row echelon form

The code that I am sharing here for you to review today, is a segment of a JavaScript library that I am going to write as time goes by for fun. It is only the two functions in the following code: <...
user1235831's user avatar

15 30 50 per page