These are chat archives for arenanet/api-cdi

29th
Jul 2017
Archomeda
@Archomeda
Jul 29 2017 00:00
granted, it's only that, didn't know c had more stuff regarding structs
and i see it also works on arrays
C++ (even before C++11) and C89 both have undesignated initializers that depend on field ordering, e.g.
foo_t foo = { 1, 2 }; // this breaks if you ever reorder fields in your struct
Archomeda
@Archomeda
Jul 29 2017 00:00
right, i remember that
yeah for arrays it's great
foo_t foos[] = {
    { .bar = 1, .baz = 2 },
    { .bar = 3, .baz = 4 },
};
_Static_assert(sizeof(foos) == sizeof(foo_t) * 2);
David Reeß
@queicherius
Jul 29 2017 00:02

Speaking of projects...

root@DESKTOP-POJMR02:/mnt/c/David/Projects# ls -l | wc -l
52
root@DESKTOP-POJMR02:/mnt/d/David/Memories/Projects# ls -l | wc -l
147

Send help

works in C++ without the designated initializers, but that has the same struct field reordering problem
Archomeda
@Archomeda
Jul 29 2017 00:02
lol
if you work with structs a lot, and can be annoying yeah
i remember i came across something like that, you can initialize structs positionally, but that just screams to break in the future
unless you somehow never touch that struct again
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:07
this guy's making C++ tutorials and he thinks a signed int uses a full byte for the sign
Archomeda
@Archomeda
Jul 29 2017 00:07
well then...
full byte's complement
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:09
255's complement
not using int32_t in 2k17 lul
most C++ programmers I see don't know what size_t is, it's great
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:10
what
right?
they just use unsigned everywhere they should be using size_t
and then "oh wow this doesn't port to 64-bit" lol
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:10
90% of memory management uses/returns size_t
what
Archomeda
@Archomeda
Jul 29 2017 00:10
oh, size_t is amazing if you don't know what it is
not on Windows :>
Archomeda
@Archomeda
Jul 29 2017 00:11
ERRORS ALL OVER THE PLACE IN X64
on Windows everything uses unsigned
Archomeda
@Archomeda
Jul 29 2017 00:11
well, warnings rather
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:11
definitely coding on debian
Archomeda
@Archomeda
Jul 29 2017 00:11
isn't it more like DWORD?
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:11
it's technically platform-dependent
Archomeda
@Archomeda
Jul 29 2017 00:11
god that winapi is awful sometimes
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:12
what
on any other platform that returns ssize_t
welcome to Windows where we make everything up and the standards don't matter!
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:12
malloc(-1)
Archomeda
@Archomeda
Jul 29 2017 00:12
oh, i actually didn't know that a signed size_t exists...
Windows is literally the only reason that people still use size_t
err, s/size_t/C++/
it doesn't make sense on any other platform, and Windows APIs basically require C++
(not to mention that Windows didn't even have a C compiler until recently, lul)
(hence the "C compiles with C++ all the time" misconception)
Archomeda
@Archomeda
Jul 29 2017 00:13
ah
I think VS2015 is the first compiler with actual C99 support
and even then, Window's POSIX support is so bad you might as well install literally any other OS
Archomeda
@Archomeda
Jul 29 2017 00:15
which compiler are you using for gw2?
actually, i think that's saved in the binary
MSVC 2015 IIRC
might still be 2013, not sure
Archomeda
@Archomeda
Jul 29 2017 00:15
oh, then you updated during gw2's lifespan :D
yep
that was a lot of fun let me tell you
Archomeda
@Archomeda
Jul 29 2017 00:16
hehe
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:16
my only problem with C/C++ is I've gotten accustomed to unit/feature tests and statically compiled languages throw a wrench in it
libcheck is pretty solid
Archomeda
@Archomeda
Jul 29 2017 00:16
when 2017? :D
something something we're tied to havok
Archomeda
@Archomeda
Jul 29 2017 00:16
oh, that's what forced you as well?
that might not be holding us back, but it's pushed us forward
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:17
Does GW2 actually have a test suite or just QA?
there's no test suite that I know of
games are hard to test
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:18
be a pretty massive suite
Archomeda
@Archomeda
Jul 29 2017 00:18
ah... well that's what i meant with you being forced
server bits have integration tests
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:18
factorio shows some of their feature tests and those look fun
yeah turns out no one wants to support pre-2015 anymore because holy crap C++ features
yeah factorio's test suite is pretty neat
Archomeda
@Archomeda
Jul 29 2017 00:18
haha
stonehenge has a similar thing going on
err not stonehenge what was that game called
Archomeda
@Archomeda
Jul 29 2017 00:18
how active is havok in development actually these days?
no idea
Archomeda
@Archomeda
Jul 29 2017 00:19
then again, those are press releases hmm
oh right
havok was acquired by microsoft 2 years ago
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:20
microsoft owns gw2 confirmed
Archomeda
@Archomeda
Jul 29 2017 00:20
and then no more press releases hmmmm
stonehearth, that's the one
@Eearslya we are in seattle, so...
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:21
microsoft owns seattle confirmed
Archomeda
@Archomeda
Jul 29 2017 00:21
lol
nah just asserts influence from the east side
amazon owns seattle
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:21
fair
and facebook/google are kind of nestled in a bit
Archomeda
@Archomeda
Jul 29 2017 00:21

https://en.wikipedia.org/wiki/Havok_(software)

Stable release
2011.2.0 / September 14, 2011; 5 years ago

uhhhhh

Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:22
pretty sure anet has a local copy they've updated/fixed
Archomeda
@Archomeda
Jul 29 2017 00:23
can you do that with a license?
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:23
depends on the license
but it'd seem silly to me that if havok happens to have a bug/incompatibility that they would have to contract out to havok to fix it
Archomeda
@Archomeda
Jul 29 2017 00:25
i suppose most engines allow you to have full access to the source code
and allow you to modify it under non-disclosure agreement, i think?
at least, that's what i took away from most engines during that period where every company gave away their engine with a new price model
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:26
makes sense to me; pay once for the license to get the code in its current state, then just do anything except resell/release/claim it as your own
Archomeda
@Archomeda
Jul 29 2017 00:27
i really don't want to be that person who needs to change something in the engine's code
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:27
scary
Archomeda
@Archomeda
Jul 29 2017 00:28
it is kind of sad to see that there hasn't been a new havok version in 5 years though
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:29
I'm sure things like unity didn't help it
I think we lost @lye to king county metro
Archomeda
@Archomeda
Jul 29 2017 00:30
although, even if newer versions existed, it's quite an effort for a game to update to it
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:31
also true
Archomeda
@Archomeda
Jul 29 2017 00:31
especially major versions
i'm still curious... what's actually the biggest roadblock for gw2 to support DX12, OpenGL or anything else?
Eearslya Sleiarion
@Eearslya
Jul 29 2017 00:32
probably havok
Archomeda
@Archomeda
Jul 29 2017 00:32
might be
Eearslya Sleiarion
@Eearslya
Jul 29 2017 01:36
is the map running at 8x its normal speed or something? :D
JC123
@JC123
Jul 29 2017 04:16
that late night build
ChieftainAlex
@ChieftainAlex
Jul 29 2017 13:22
Getting all the weird bugs this weekend it seems. Error 503 Backend fetch failed Backend fetch failed Guru Meditation:XID: 451969027 Varnish cache server >.>
darthmaim
@darthmaim
Jul 29 2017 13:24
same here
windwarrior
@windwarrior
Jul 29 2017 15:17
:fire:
Quaggan BooOOoot
@QuagganBooOOoot
Jul 29 2017 15:17
:fire_engine:
K900
@K900
Jul 29 2017 16:19
@BoyC got the daily data to look something like this:
"example": {
        "title": "Example daily",
        "art": "kryta",

        "waypoint": 100500,
        "poi": 100501,
        "vista": 100502,

        "timer": "Shadow Behemoth",
        "show_timer_title": true,

        "hints": ["Blah blah"]
    },
"art" is what decides what card art to show on the tracker, can probably be in its own file, but I can't be arsed to move it around right now
Darqam
@Darqam
Jul 29 2017 16:55
that's great hint btw, very useful
K900
@K900
Jul 29 2017 16:56
It's pretty great for debugging
There's also one that goes "blah blah, blah, blah blah blah blah. blah blah" etc for 6 lines
Darqam
@Darqam
Jul 29 2017 16:58
perfect
K900
@K900
Jul 29 2017 16:59
It's for debugging layout issues
Darqam
@Darqam
Jul 29 2017 17:06
nah, you should just keep it in production
K900
@K900
Jul 29 2017 17:30
Also I did figure out how to generate chat links
In JS
It involves this piece of programming as an art form
function uint16ToByteStringLE (val) {
  let lo = val & 0xFF
  let hi = (val » 8) & 0xFF
  return String.fromCharCode(lo) + String.fromCharCode(hi)
}
K900
@K900
Jul 29 2017 17:31
I know, I know
Too many dependencies
Archomeda
@Archomeda
Jul 29 2017 17:31
:smile:
K900
@K900
Jul 29 2017 17:31
I'm not exactly sold on the whole npm thing
So if I can roll my own in 30 lines of code, I'd rather do that than pull in 50kb of deps
Archomeda
@Archomeda
Jul 29 2017 17:32
i have 25 dependencies for my discord bot :P
K900
@K900
Jul 29 2017 17:33
JS?
Archomeda
@Archomeda
Jul 29 2017 17:33
yes
K900
@K900
Jul 29 2017 17:33
Yuck
/shrug
Quaggan BooOOoot
@QuagganBooOOoot
Jul 29 2017 17:34
¯\_(ツ)_/¯
Archomeda
@Archomeda
Jul 29 2017 17:35
fun part, i apparently have the same amount of dependencies on my master branch with the old code
but i changed a lot of it :P
babel-polyfill is what scares me the most still
thankfully i got rid of it
got rid of bluebird as well and instead using async and await
i love that feature
although unhandled exceptions are my nightmare
David Reeß
@queicherius
Jul 29 2017 17:42
The issue with rolling your own 30 lines of code is that you have to either write tests for them or live with the untested one
And I'd be up for accepting a PR in that one to remove the 1 dependency if you get all tests to pass :)
I personally go by the mantra if it's more than like 20 lines of trivial (!) code then I just write it myself (lodash.get anyone) but for more complex stuff i prefer working and tested
Archomeda
@Archomeda
Jul 29 2017 17:44
you don't like living on the dangerous side? :)
K900
@K900
Jul 29 2017 17:44
I mean, the code is pretty trivial
Eearslya Sleiarion
@Eearslya
Jul 29 2017 17:44
but what if I don't want to write leftpad myself? :D
K900
@K900
Jul 29 2017 17:44
And MDN says atob works fine with any characters in 0x00-0xFF range
Which is exactly what I wanted there
Now, decoding it would be a whole other story
Eearslya Sleiarion
@Eearslya
Jul 29 2017 17:45
I actually kind of like writing tests. Moreso than writing code. Which is a problem.
Archomeda
@Archomeda
Jul 29 2017 17:46
then you're the 1% 0.01%
David Reeß
@queicherius
Jul 29 2017 17:50
Ah yeah decoding is a must in the thing. Tho if you want you could add it just for encoding and a propper module bundler would rip out the unused dependency when you are not decoding
leftpad is in the language now!
:D
I really enjoy writing unit tests, I really hate writing acceptance tests
Eearslya Sleiarion
@Eearslya
Jul 29 2017 17:51
I like writing tests, I just..sometimes I fear I test too much
from my research, opinions are divided on controller and view testing
whether or not it's testing implementation rather than behavior
David Reeß
@queicherius
Jul 29 2017 17:54
I try and just test the public API and some very iffy parts of the private api. So function(x) -> expected result. I tested a library with a lot of internals very deeply once and then when I wanted to refactor I had to change all the tests even tho the public API was the same. Basically whenever I go in and do something like testedModule.__getInternalFunction__('x')now I tripple check if that is really neccessary
But i think it's all dependent on context, just as performance optimisation
Eearslya Sleiarion
@Eearslya
Jul 29 2017 17:56
Yeah, a lot of the things I've read basically push testing models and then just feature specs
everything else is implementation and not important to behavior
David Reeß
@queicherius
Jul 29 2017 17:56
A collegue of mine wrote code/reviewed for a atomic power plant at a previous point in his carreer and they have way different opinions on testing then webdevs usually have lol
Eearslya Sleiarion
@Eearslya
Jul 29 2017 17:57
..Well, I would certainly hope so XD
I mean, code testing an executable application is waaay different than testing a website, for one thing
Archomeda
@Archomeda
Jul 29 2017 18:00
urgh, i want a way to load a UI component on a separate thread instead of the main GUI thread :(
K900
@K900
Jul 29 2017 18:00
My systems programming professor at university worked on military something or other
He didn't know what a unit test was
I feel uncomfortable even thinking about it
Archomeda
@Archomeda
Jul 29 2017 18:01
lol
K900
@K900
Jul 29 2017 18:02
I just hope his code doesn't run on anything with the word "nuclear" in the name
BoyC
@BoyC
Jul 29 2017 18:36
i so, so hate untraceable release build heap corruption bugs
windwarrior
@windwarrior
Jul 29 2017 19:06
hmm I was hoping to store /v2/items in localStorage
but its 44M already
ah 48M total
OH
gzipped its 3M
this is doable
windwarrior
@windwarrior
Jul 29 2017 19:12
if an item id is on the nth index in /v2/items, then I can rely on it also being on the n/pageSize page right?
Archomeda
@Archomeda
Jul 29 2017 19:25
well, the item ids are sorted; so i would say yes
but an item can get whitelisted in the future that might squeeze it in between the existing ids; so you need to keep it synced i suppose
windwarrior
@windwarrior
Jul 29 2017 19:31
oh thats a good point
well I think I will always query /v2/build and /v2/items
just cache the pages
windwarrior
@windwarrior
Jul 29 2017 19:59
can an item change without incrementing /v2/build?
dont think so right, it can only get whitelisted
windwarrior
@windwarrior
Jul 29 2017 21:15
hmm I should probably store my index in some sort of balanced tree