I plan to build an online map for markers (pins) of a game and I don't manage to set the correct latitude of my markers. Original map is a square of 2048*2048px Then I got markers (many thousands) Map coordinates are set with a x, y notation f...

s o o o o o o o o o o o o o o o o o o o o o o o e How can I calculate all possible paths, without using the same square twice, that a person could take to get from s to e? I've created a grid array [[1,1]...[5,5]] but i dont know if that will...

I want to convert meters to miles in JavaScript. For example 12700 meters is 7.8867 miles. What formula can I use to do the conversion?...

I need some help how to make this math formula in javascript. i have tried searching but couldn't really find cause i dont even know what ^ is called in English. Thanks in advance Math.floor(20*(1.1^(x-10)));...

Just a quick question, can this sum be written in one short line: a = (b / c) * 100; if (a < 0) a = 0; Apart from the obvious way which is equally long: if ((b / c) * 100) > 0) a = (b / c) * 100; else a = 0; EDIT: And the ternary ver...

Assume i have a function checkTime like the one below where i have to check for multiple condition simultaneously. var result=0; function checkTime(time1, time2) { if (time1 >= 0 && time2 <= 0) { result = 1; } els...

I'd like to be able to calculate the length of the shortest sub-string required to achieve complete uniqueness. Lets say I have a varying length list of 32 character UUIDs, but what I'd like to achieve is shortenening them during reference...

When the viewport is at a 1:1 width-to-height ratio (e.g. 1000x1000 resolution), I want a variable to be set to 0.22. When the viewport is at a 2:1 width-to-height ratio (e.g. 2000x1000 resolution), I want that variable to be 0.33. This should scal...

Not sure of the best way to ask this question other than: I'm writing a function that will accept a variable called 'x'. function doIt(x){ var y = someformula; //this is just a placeholder for the correct formula return y; } And h...

So, I have two dates, which come from the UI: var start = new Date(self.Start()), end = new Date(self.End()); We need to figure out the number of days between that range, which is easy enough: var days = Math.max(0, Math.floor((end - start) / tic...

©2020 All rights reserved.