These are chat archives for arenanet/api-cdi

10th
Jun 2017
ChieftainAlex
@ChieftainAlex
Jun 10 2017 16:06
wracking my brains trying to think of a way to use the gw1 wiki to host map tiles for gw1.
if I upload them the normal way it would have a bunch of random text in the url that I'd have to hardcode in the leaflet widget somewhere
otherwise I'd have to convince Justin to stick a folder full of files directly in the filestore.
ChieftainAlex
@ChieftainAlex
Jun 10 2017 16:14
... wait no, https://stackoverflow.com/a/254972 it is a function. hooray :<
Archomeda
@Archomeda
Jun 10 2017 16:15
well, better than having random folder names
David Reeß
@queicherius
Jun 10 2017 17:01
@lye Any chance we could get Warbringer / Warcry whitelisted for making fancy recipes? puppy eyes
David Reeß
@queicherius
Jun 10 2017 17:06
(and General's Wings of War / Commander's Wings of War are missing too)
smiley
@codemasher
Jun 10 2017 17:10

... wait no, https://stackoverflow.com/a/254972 it is a function. hooray :<

you're better off hardcoding a translation list than hashing the values on each call...

(a.k.a. "rainbow table")
ChieftainAlex
@ChieftainAlex
Jun 10 2017 17:37
the real question is do i feel mean spirited enough to upload all the tiles.
and 1.5k hashes wouldn't be too bad to precompute I suppose
ChieftainAlex
@ChieftainAlex
Jun 10 2017 17:45
@codemasher - is it purely for speed you'd avoid doing the hashing on each tile call?
took my potato pc less than a second to hash all of them...
smiley
@codemasher
Jun 10 2017 17:45
you'd also have to provide a md5 lib
(yes, it's purely for performance)
ChieftainAlex
@ChieftainAlex
Jun 10 2017 17:46
5400 characters over 200 lines prettyprinted seems ok
smiley
@codemasher
Jun 10 2017 17:46
"unnecessary overhead"
i huess you could have a smaller tabble for the hashes
darthmaim
@darthmaim
Jun 10 2017 17:47
1.5k md5 hashes take up more space
ChieftainAlex
@ChieftainAlex
Jun 10 2017 17:47
precomputing the table results in 102k characters
^
smiley
@codemasher
Jun 10 2017 17:47
you can load the hashes per zoom level
darthmaim
@darthmaim
Jun 10 2017 17:47
thats just overengineering at that point
you probably look at every level anyway
smiley
@codemasher
Jun 10 2017 17:48
just calling a hash on each call keeps cpu load up
ChieftainAlex
@ChieftainAlex
Jun 10 2017 17:48
sub 1ms for each call
:/
anyway long story short tiles will work
smiley
@codemasher
Jun 10 2017 17:49
make that 200+ tiles in view (4k)
darthmaim
@darthmaim
Jun 10 2017 17:51
you can calculate 100k+ md5 hashes per second
smiley
@codemasher
Jun 10 2017 17:51
then again, when on a mobile you wouldn't see that many tiles anyway :D
(depending on net it'd probably take longer to load the tile than calc the hash)
darthmaim
@darthmaim
Jun 10 2017 17:53

found this: https://feross.org/hacks/md5-password-cracker.js/

my pc does 2,400,000 hashes/second

smiley
@codemasher
Jun 10 2017 17:53
(i'm not just thinking "pc")
you could easily end up with a couple thousand just when you drag the map around quickly
darthmaim
@darthmaim
Jun 10 2017 17:56
even my 3 year old phone does 240k/second
codemasher @codemasher watches spikes in task manager
darthmaim
@darthmaim
Jun 10 2017 17:56
there are only 1.5k tiles
you can cache the hashes
so you don't have to calculate them twice
it would only take 6ms on my phone to calculate all of them
smiley
@codemasher
Jun 10 2017 17:58
it's basically what i said before?
(you can sure calc the hashes on first load)
ChieftainAlex
@ChieftainAlex
Jun 10 2017 18:51
smiley
@codemasher
Jun 10 2017 19:29
lmao
but why jpg?
Archomeda
@Archomeda
Jun 10 2017 19:44
abusing wiki storage to its fullest :D
ChieftainAlex
@ChieftainAlex
Jun 10 2017 21:34
Well for jpeg 1541 files totalled 30mb. Same as three decent size gw2 zone maps, doesn't seem too unfair on the servers
Archomeda
@Archomeda
Jun 10 2017 23:20
oh, smaller than i thought