These are chat archives for arenanet/api-cdi

28th
Jun 2017
Archomeda
@Archomeda
Jun 28 2017 01:10
oh, gw2 updated, but no patch notes? :sob:
it would make sense to have that forum post under https://forum-en.guildwars2.com/forum/info/updates/Game-Update-Notes-June-20-2017 but i guess that's just me :smile:
(another plea for having a separate webpage for patch notes, instead of the forum :sob:)
Archomeda
@Archomeda
Jun 28 2017 01:26
i can't help but laugh about this comment :joy:
ChieftainAlex
@ChieftainAlex
Jun 28 2017 06:33
@Archomeda i totally fix this bug with MP calculationsevery month
raids have some dupes
ChieftainAlex
@ChieftainAlex
Jun 28 2017 06:39
definitely still bugged :/ I'll take a look after work
looks like a race condition ><
Archomeda
@Archomeda
Jun 28 2017 13:21
:(
i still don't understand what's happening :D
Archomeda
@Archomeda
Jun 28 2017 15:46
have you guys heard about the recent dmcas that's been going around?
leonard french has almost reached his funding goal already within 1 day
Darqam
@Darqam
Jun 28 2017 16:14
yt dmca have been such a shit show over the past year or two (if not more)
windwarrior
@windwarrior
Jun 28 2017 16:42
DMCA is a bit of a necessary evil
super powerful, but one of the only real solutions to online piracy
but that just means that abuse of DMCA should be punished very hard
yt doesn't use dmca
Archomeda
@Archomeda
Jun 28 2017 16:43
which isn't being done
people can take down stuff left and right, and no one is getting punished for it
at least, not in the cases i've seen
yt takedowns are not subject to dmca -- it's done via the yt ToS
maybe i should read the linked thing
because we're not talking about yt i bet
Archomeda
@Archomeda
Jun 28 2017 16:48
well, it is about youtube, initially
but it also extends to twitch
okay well youtube can do whatever they want
spoiler alert don't use youtube
twitch can also do whatever they want
though they haven't been nearly as bad as youtube (though they're still using contentID)
windwarrior
@windwarrior
Jun 28 2017 16:50
well eventually if the dispute is not settled, you can still send a takedown notice (DCMA) in case of YT
sure
Archomeda
@Archomeda
Jun 28 2017 16:50
this is not about the general takedown system of youtube or twitch, but rather one person that has gone way too far by issuing copyright strikes on youtube and twitch channels
honestly from my reading she might actually have reasonable copyright claims
In 2015, Don saw the opportunity to create Starr Mazer, a dream he’d had since he was nine years old. Don asked Alex to create the music and sound effect assets for the game.
the contract for that has to be worded in a specific way to actually assign copyright
(or to explicitly assign copyright)
otherwise you only have a license (and a potentially limited one at that) to the content you paid for
additionally, if Alex was not compensated for their work, the contract is invalid (since a contract must benefit both parties)
IANAL but this seems super shady to me
Archomeda
@Archomeda
Jun 28 2017 16:53
this whole stuff has been blown way out of proportions
apparently she's even admitted that she used the takedown system to have the content creators rally against the company because she wasn't paid
which backfired and created this whole explosion basically
i'm not going to say the yt system makes any sense but like
there have been abuses and rallies against it in the past, but it keeps chugging
Archomeda
@Archomeda
Jun 28 2017 16:57
yeah
i'm glad i'm not a partner or anything with youtube
i can't imagine how stressful life is for some of the people there that rely on youtube for income
you'll never know when a video of yours is being taken down
windwarrior
@windwarrior
Jun 28 2017 17:06
what I see as the problem is the collateral damage, Alex issuing strikes at people who have no part in the dispute
like, sure she can have the legal copyright, but using DMCA (or YTs weird ToS) to issue strikes at innocent reviewers should not happen
Archomeda
@Archomeda
Jun 28 2017 17:12
from what i've seen the past hour, she's literally gone insane and might need to seek professional help; the way she reacts to certain various things isn't healthy
that said, the people harassing her are also insane
fwiw it wouldn't surprise me if the collateral damage was just contentID doing it's thing
@Archomeda the entire world is insane, i think
Archomeda
@Archomeda
Jun 28 2017 17:13
heh, can't argue with that
a lot of these articles seem to conflate YT takedowns with DMCA takedowns
windwarrior
@windwarrior
Jun 28 2017 17:14
watching the ExtraPlay with Josh Foreman
but they are spoiling a Breath of the Wild Shrine I have not found yet :(
Archomeda
@Archomeda
Jun 28 2017 17:16
visually or are they talking about it?
windwarrior
@windwarrior
Jun 28 2017 17:17
visually
and talking
both :(
Archomeda
@Archomeda
Jun 28 2017 17:17
oh :(
windwarrior
@windwarrior
Jun 28 2017 17:21
oh was the textfixbrokealotoftext already hotfixed?
Archomeda
@Archomeda
Jun 28 2017 17:22
what?
you mean the patch from yesterday?
windwarrior
@windwarrior
Jun 28 2017 17:22
there was a build yday
yeah
that broke a bunch of strings
Archomeda
@Archomeda
Jun 28 2017 17:22
don't think so
image.png
yay, improved the wiki command of my discord bot
windwarrior
@windwarrior
Jun 28 2017 17:28
image.png
Archomeda
@Archomeda
Jun 28 2017 17:29
pff, sylvari
windwarrior
@windwarrior
Jun 28 2017 17:30
yeah and needing Demon's Demise for fractals
makes total sense too
... also Head butt is arguably stronger in Fractals
windwarrior
@windwarrior
Jun 28 2017 17:36
haha that group lowered their standards to "CPS"
Archomeda
@Archomeda
Jun 28 2017 17:37
lol
you should just create a sylvari warrior and call it Demon's Demise :P
Archomeda
@Archomeda
Jun 28 2017 18:13
well, rip the floor foundations then
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:14
NullPointerException
windwarrior
@windwarrior
Jun 28 2017 18:18
wanna merge a list of Things with commas? Sure says Java: things.stream().map(Thing::toString).collect(Collectors.joining(","))
smiley
@codemasher
Jun 28 2017 18:18
i just imagined q1dm1, the lava textures replaced with the java icon... (i can haz a quake mod for this?)
windwarrior
@windwarrior
Jun 28 2017 18:19
but if you import Collectors statically it becomes way shorter :') </nevermind>
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:21
class ThingMergingFactory
windwarrior
@windwarrior
Jun 28 2017 18:24
intercalate "," $ map show [1,2,3] #justhaskellthings
",",join(map(str, [1,2,3])) #justPythonThings
[1,2,3].join(",") #justJavascriptThings
windwarrior
@windwarrior
Jun 28 2017 18:26
:D
stringtyping ftw
smiley
@codemasher
Jun 28 2017 18:28
implode(',', [1,2,3]) #justPhpThings
windwarrior
@windwarrior
Jun 28 2017 18:29
Haskell's intercalate doesnt restrict types to be String. so intercalate 12 [1,2,3] also produces something sane The typechecker is not agreeing
thats pretty cool
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:31
int size, pos; size = 0; pos = 0;
for (i=0; i < things.length; i++) { size += (things[i].length + 1); }
char *str = malloc(size);
for (i=0; i < things.length; i++) { pos += snprintf(&str[pos], size, "%s", things[i]); }
snprintf considered harmful
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:32
fite me
what does that even mean D:
it can leave the buffer not null-terminated
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:33
grr
@windwarrior intercalate :: [a] -> [[a]] -> [a]
windwarrior
@windwarrior
Jun 28 2017 18:34
yeah
just figured
intercalate [12], [[1],[2],[3]] works
it works with strings because they're [char] or whatever
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:35
would sprintf be better?
@Eearslya no because that just stomps memory
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:36
gdi C you really just want me to write a 10 line function for this don't you
windwarrior
@windwarrior
Jun 28 2017 18:36
yeah, misread its type signature at first :)
@Eearslya no it should be fine as-is, I'm just teasing
windwarrior
@windwarrior
Jun 28 2017 18:36
just fork, load whatever bash tool, and use that :p?
the buffer should have sufficient size by my reading since you have the +1 when computing the length
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:37
(I did forget the commas though)
I think I'd just memcpy the strings into the buffer but that's just me
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:37
see I was gonna do that
but then I also have to manually put the commas in
also I'd probably realloc as I went rather than computing the total length
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:38
that was my first thought too
realloc isn't that expensive >_>
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:38
I dropped realloc because of expense XD
mainly because it has to copy the whole string every time
realloc rarely copies :P
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:38
orly
most of the time it fast-paths to just adjust the allocation bookmarking
windwarrior
@windwarrior
Jun 28 2017 18:39
I just made my online repl evaluate [1..] whoops
@windwarrior rip your online repl
lye @lye hands windwarrior take 3
windwarrior
@windwarrior
Jun 28 2017 18:40
I hope they terminate GHCis that take too much memory :')
Eearslya Sleiarion
@Eearslya
Jun 28 2017 18:41
char *str = malloc(0);
int size = 0;
int pos = 0;
for (int i=0; i < things.length; i++) {
  int newsize = size + things[i].length + 1;
  str = realloc(str, newsize);
  size = newsize;
  snprintf(str, size, "%s%c", things[i], (i==(things.length-1)) ? '\n' : ',');
}
you guys and your cushy languages
windwarrior
@windwarrior
Jun 28 2017 18:42
Haskell is also compiled
@Eearslya don't forget to check the return value of realloc!
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:09
if (str == NULL) yell_at_lye();
also initialize str to NULL
also you should probably not always snprintf to the beginning of the string
windwarrior
@windwarrior
Jun 28 2017 19:09
if (str == NULL ) panic();
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:09
oh shit
uh
I can't edit it
smiley
@codemasher
Jun 28 2017 19:10
@lye ever thoought about running a programming (and code golf) blog? :D
rip gitter it was good(???) while it lasted
@codemasher lol
but then what would i use gitter for
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:10
char *str = NULL;
int size = 0;
int pos = 0;
for (int i=0; i < things.length; i++) {
  int newsize = size + things[i].length + 1;
  str = realloc(str, newsize);
  if (str == NULL) error("Out of memory!");
  size = newsize;
  pos += snprintf(&str[pos], size, "%s%c", things[i], (i==(things.length-1)) ? 0 : ',');
}
smiley
@codemasher
Jun 28 2017 19:10
fair
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:11
there
wait
silly me
windwarrior
@windwarrior
Jun 28 2017 19:11
putting commas between words
entertainment for days
@Eearslya now in brainfuck
wait that might be annoying, because brainfuck has no clue about arrays... or strings...
you would first have to decide how you are going to put the string array on the tape
@Eearslya
char*
join(const char *sep, const char **strs, size_t num_strs)
{
    if (0 == num_strs) {
        return strdup("");
    }
    if (1 == num_strs) {
        return strdup(strs[0]);
    }

    size_t sep_len = strlen(sep);
    size_t *str_lens = calloc(num_strs, sizeof(size_t));
    size_t total_len = 0;

    for (size_t i = 0; i < num_strs; i += 1) {
        str_lens[i] = strlen(strs[i]);
        total_len += str_lens[i] + sep_len;
    }
    total_len -= sep_len;

    char *out = calloc(1, total_len + 1);
    char *pos = out;

    memcpy(pos, strs[0], str_lens[0]);
    pos += str_lens[0];

    for (size_t i = 1; i < num_strs; i += 1) {
        memcpy(pos, sep, sep_len);
        pos += sep_len;
        memcpy(pos, strs[i], str_lens[i]);
        pos += str_lens[i];
    }

    return out;
}
throw in a free(str_lens) somewhere in there too.
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:18
holy shit
I don't get you
3 lines for function declaration, but same-line everywhere else
is the indentation not enough? D:
/shrug
Quaggan BooOOoot
@QuagganBooOOoot
Jun 28 2017 19:20
¯\_(ツ)_/¯
makes it more likely to fit in 80 chars, and you can grep for ^join
windwarrior
@windwarrior
Jun 28 2017 19:20
void function (args)
{
    things();}
the convention that will get all CS people angry
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:21
okay wait
I can understand the 3 line functions
but
0 == num_strs
/tableflip
Quaggan BooOOoot
@QuagganBooOOoot
Jun 28 2017 19:21
(╯°□°)╯︵ ┻━┻
windwarrior
@windwarrior
Jun 28 2017 19:21
yoda comparison
char*
join(sep, strs, num_strs)
    const char *sep;
    const char **strs;
    size_t num_strs;
{
/* ... */
}
@Eearslya does that make you happier
I should probably switch to that instead
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:22
w-what
what?
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:22
is that
legal
why wouldn't that be legal
windwarrior
@windwarrior
Jun 28 2017 19:22
(It would probably be smart to move the strings back-to-front)
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:23
it's out of the parentheses D:
this isn't lisp
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:23
b-but
I have literally never seen that syntax
it's an old form, pretty sure it's still legal in C99
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:25
eearslya@chimera ~ $ gcc what.c -o what
eearslya@chimera ~ $
what
;3
windwarrior
@windwarrior
Jun 28 2017 19:26
(if you process the strings back-to-front you can get away with just extending your array once, but I must admit that I cant see too much through your alloc magic right now)
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:26
he's just using calloc because it zeroes the memory space
also it's good form
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:27
how so
avoids multiplicative overflows
malloc(nelts * sizeof(elt)) = potential overflow
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:28
overflow?
it's really only necessary because some people still run not-64-bit platforms
windwarrior
@windwarrior
Jun 28 2017 19:28
but if I understand correctly, you have alloc'd during the function 1) the source array and 2) a new buffer to which you are going to copy the strings intercalated with commas
but it's totally reasonable to request a 4GB buffer
@windwarrior size_t *str_lens = calloc(num_strs, sizeof(size_t)); allocates a an array of numbers to hold the length of each string so we only have to compute it once/string
windwarrior
@windwarrior
Jun 28 2017 19:30
oh yeah thats smart too
And char *out = calloc(1, total_len + 1); allocates an array of bytes to hold the output string + 1 (null terminator)
windwarrior
@windwarrior
Jun 28 2017 19:30
yeah but if you would realloc your passed piece of memory to fit also the commas
for each input string, total_len += str_lens[i] + sep_len;
windwarrior
@windwarrior
Jun 28 2017 19:33
meh, dont know enough about C, but I think you can get away with not alloccing that return array and just realloccing your input and moving the strings in it. That is under the assumption that a realloc is cheaper
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:37
also wait, wouldn't join(',',{"a","b","c"},3)return "a,b,c,"?
wait no
oh I see
windwarrior
@windwarrior
Jun 28 2017 19:40
Source array:
['s', 'p', 'a', 'm', '\0', 'b', 'a', 'c', 'o', 'n', '\0',  'e', 'g', 'g', 's', '\0']
Make room for the commas by increasing size:
['s', 'p', 'a', 'm', '\0', 'b', 'a', 'c', 'o', 'n', '\0', 'e', 'g', 'g', 's', '\0', '\0', '\0']
Move items back-to-front:
['s', 'p', 'a', 'm', '\0', 'b', 'a', 'c', 'o', 'n', '\0', '\0', ',', 'e', 'g', 'g', 's', '\0']

['s', 'p', 'a', 'm', '\0',  ',', 'b', 'a', 'c', 'o', 'n', '\0', ',', 'e', 'g', 'g', 's', '\0']
(read: desperate attempt to try to get it "in place")
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:46
but you gotta kill the 0s
windwarrior
@windwarrior
Jun 28 2017 19:48
my C knowledge failing me again, strings are NULL-terminated right?
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:49
yep
windwarrior
@windwarrior
Jun 28 2017 19:49
so those \0s make sense right
from a memory layout perspective
Eearslya Sleiarion
@Eearslya
Jun 28 2017 19:49
well, but the point is to end with a single string
windwarrior
@windwarrior
Jun 28 2017 19:50
oh yeah you are right
ah so if your seperator si a single byte, you can just replace all but the last NULL
ChieftainAlex
@ChieftainAlex
Jun 28 2017 20:24
for the amount of time spent discussing what looks like JSON.stringify you could have used your time to pay a guy in asia to write it out by hand
sorry :P
Eearslya Sleiarion
@Eearslya
Jun 28 2017 20:36
nah, we were discussing Array.join
ChieftainAlex
@ChieftainAlex
Jun 28 2017 20:45
shook the achievement tables on the wiki a bit, down to 184 mastery points in maguuma now.. it should be 185 right?
Eearslya Sleiarion
@Eearslya
Jun 28 2017 20:47
I believe so
ChieftainAlex
@ChieftainAlex
Jun 28 2017 20:48
well shit.
if only there was an api for such things
Eearslya Sleiarion
@Eearslya
Jun 28 2017 20:48
the last calculation just had a +1 for some reason
@Archomeda hlep
ChieftainAlex
@ChieftainAlex
Jun 28 2017 20:49
I went and deleted the +1
and added a hidden achievement for mayatl because I couldn't be arsed fixing this page for a fourth time in the future
Eearslya Sleiarion
@Eearslya
Jun 28 2017 20:50
I think he said there was some implicit mastery point that's not tied to an achievement
Don't you get a mastery point just by entering verdant brink?
ChieftainAlex
@ChieftainAlex
Jun 28 2017 20:53
wiki's got one called "Dismantled, Down, Down, Downed".. api has two called "Dismantled" and "Down, Down, Downed".. could be it
that was mayatl the fierce i expect
duplicate id
Archomeda
@Archomeda
Jun 28 2017 23:02
there was that hidden mastery point from that event in VB yeah; there's no achievement tied to it
and yeah, dismantled and down down downed are two separate mastery points
and wow
our wvw match is actually still close
Archomeda
@Archomeda
Jun 28 2017 23:07
Gandara 274 - Far Shiverpeaks 273 - Gunnar's Hold 197 (okay not that one)