Skip to main content

All Questions

Tagged with
6 votes
1 answer
134 views

Dynamic image gallery with filters pulling from a JSON file

I have an image gallery of old internet banner ads that pulls URLs and metadata from a JSON file and then displays them based on a set of user-selectable filters. The filters can show/exclude images ...
fish's user avatar
  • 160
3 votes
1 answer
91 views

Merge discrete integer intervals

What it does The code starts with a set of integer intervals, and can add new intervals (possibly by updating existing intervals). Essentially, it is a bit array whose index starts at ...
FromTheStackAndBack's user avatar
2 votes
2 answers
141 views

Faster regex to match all worded numbers from 1 to 99

I would like to know if there is a better regex to match all worded numbers from 1 to 99. With "better" I mean shorter with same performance, OR faster. I came up with this. I can't do ...
Bobby234's user avatar
5 votes
1 answer
130 views

Generate a Penrose tiling

I would like to know if it's possible to optimize the code the generate this type of Penrose Tiling. I finished programming this type in javascript / p5.js and the algorithm works very fine and takes ...
visionary's user avatar
3 votes
2 answers
86 views

Optimize Working Live Search & Highlight Function

I've written a custom Live Search & Highlight function in vanilla JS. It is working and does what I expect it to. The issue is that the more items I add to the page content to search, the slower ...
codejp3's user avatar
  • 31
5 votes
3 answers
121 views

How to optimize the algorithm of generating images in javascript canvas?

I added this question on Stackoverflow, but it was suggested that I post it here. Currently, I create 2000x2000 pixels canvas and tile the image on it, and then tiling the texture on top and applying <...
mrconcerned's user avatar
2 votes
3 answers
198 views

Efficiently tagging first and last of each object matching condition

How can I make the code more readable and more efficient? (provided code is O(n²) time, but intuition says it can be pre-processed and done in O(n) time) Description it tags the first and last of ...
FromTheStackAndBack's user avatar
1 vote
2 answers
116 views

A simple performant factorial function

I am new to algorithm and data structure. After a little introduction to the topic, I have decided to implement a function called calculateFactorial, which takes an integer and calculates its ...
Napoleon Bonaparte's user avatar
1 vote
1 answer
79 views

Extract each occurrence from an array of objects

I have a huge list of 4k+ software products. My goal is simple. I have a list of products. Each of those products has a software value. I would like to extract each software occurrence and covert it ...
Fpasquer's user avatar
  • 113
6 votes
2 answers
744 views

Lotto Number Generator - Javascript

Newbie to Javascript here and just practicing by making a random Lottery number generator. I am practicing by building simple, achievable projects. The aim of this project is to make 10 lines of 6 ...
Scottyonfire's user avatar
4 votes
3 answers
164 views

Efficiently generate a random position inside an outer rectangle but outside an inner rectangle

It should be a uniform distribution (ie: every point is equally as likely). I also don't want to use the simple solution of: "in a loop check to see if the current generated point is within the ...
Ryan Peschel's user avatar
3 votes
2 answers
95 views

Optimizing a Function to Check Pronic Numbers in JavaScript

I've written a function in JavaScript to check whether a given number is a Pronic number. A Pronic number, also known as an oblong number, rectangular number, or ...
TAHER El Mehdi's user avatar
4 votes
2 answers
66 views

Optimizing a Function to Generate a Row of Consecutive Odd Numbers in a Triangle

I've written a JavaScript function that generates a row of consecutive odd numbers in a triangle. The triangle looks like this: ...
TAHER El Mehdi's user avatar
3 votes
1 answer
123 views

Sorting the divisors of a given number

I am trying to sort all the divisors of a given number in the most efficient way. Below is my code for sorting the divisors: ...
Arjun Kumar's user avatar
4 votes
0 answers
75 views

Google App Script to take form responses submitted by teachers on their students and produce formatted PDF student reports

I'm not a programmer but, with help, I managed to make a Google Apps Script which takes reports, submitted by teachers on their students, to the Form Responses Sheet, and then selects all responses ...
StreetSavvypub's user avatar

15 30 50 per page
1
2 3 4 5
56