These are chat archives for arenanet/api-cdi

6th
Sep 2017
yeah, javascript type coercion is garbage
+[] === 0
[]+[] === ""
[]+(+[]) === "0"
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:02
I just don't get it
do you want the explanation? lol
it's actually really straightforward once you break down the expression
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:04
image.png
I've been trying to figure it out dammit
Is it like brainfuck where some part of this is incrementing a value up to the ASCII 'n'?

first subexpression:

+[] === 0 (integer coercion)
[][[]] === undefined (index past end of array)
[][[]]+[] === undefined + 0 === "undefined" (string coercion)
[[][[]]+[]] === ["undefined"] (need to do this because no parens)
[[][[]]+[]][+[]] === "undefined"

second subexpression:

[++[+[]][+[]]] === ++([0][0]) === ++0 === 1

so the whole thing

[[][[]]+[]][+[]][++[+[]][+[]]] === "undefined"[1] === "n"
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:09
oh god it's actually dereferencing the word 'undefined'
wow
yeah most of these javascript things either abuse undefined or NaN
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:14
ridiculous
Archomeda
@Archomeda
Sep 06 2017 00:26
[[][[]]+[]][+[]][++[+[]][+[]]]+[[][[]]+[]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]]+[++[+[]][++[+[]][+[]]]+[]][+[]][++[+[]][+[]]]+[!![]+[]][+[]][+[]]
hmm... i had to sneak in some ! though...
image.png
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:31
Where'd you get a t?
Archomeda
@Archomeda
Sep 06 2017 00:31
yeah... where did i get that? :smirk:
i already hinted at that :')
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:32
oh
I see
Archomeda
@Archomeda
Sep 06 2017 00:33
you should be able to figure it out with lyes explanation
[[][[]]+[]][+[]][++[+[]][+[]]]+
[[][[]]+[]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]]+
[++[+[]][++[+[]][+[]]]+[]][+[]][++[+[]][+[]]]+
[!![]+[]][+[]][+[]]
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:33
I figured it out
[!+[]+[]][+[]][+[]]
Archomeda
@Archomeda
Sep 06 2017 00:34
oh, even that is possible, with only 1 !
i seriously hate this javascript feature tbh :D
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:38
adefilnrstuN is the alphabet we get with this
Archomeda
@Archomeda
Sep 06 2017 00:39
well, that's most of the vowels
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:39
I don't think there's a way to get infinity with just symbols
but it'd only add y
++[+[]][+[]]/+[]
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:39
oh jesus
it also adds I
Archomeda
@Archomeda
Sep 06 2017 00:40
dividing by zero
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:40
oh forgot it capitalized
what about a space?
so... you can probably get more letters if you access properties on stuff
since Function.prototype.toString returns the function source
though for native functions it doesn't return anything useful
Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:43
hmm, you can't decrement a character's ascii value
I suppose if we could do that it'd be easy
I would be surprised if someone hadn't already written a tool to generate arbitrary strings using only operators, fwiw
it sounds like something a crazy person would spend a weekend on
Archomeda
@Archomeda
Sep 06 2017 00:56
yeah, no doubt

also:

The Super Adventure:
 - Unlocked skins: 16/16

The King Toad:
 - Unlocked skins: 16/16

The Storm Wizard:
 - Unlocked skins: 16/16

The Kaiser:
 - Unlocked skins: 2/16
 - Super Adventure Weapon Box: Tyriqq - Inventory (x5)
 - Kaiser Snake Weapon Box: Zane Reay - Inventory (x1)

The Crimson Assassin:
 - Unlocked skins: 0/16
 - Tokens required: 22/200x Crimson Assassin Token
 - Tokens to collect: 178x Crimson Assassin Token
 - Crimson Assassin Token: Zane Reay - Inventory (x22)

i'm sad with the last two collections :sob:

Eearslya Sleiarion
@Eearslya
Sep 06 2017 00:57
I'm pretty sure that's as deep as the rabbit hole goes
I can't think of any way to get spaces or other letters
or punctuation for that matter
Archomeda
@Archomeda
Sep 06 2017 00:58
i'm calling it now, next SAB festival we'll get a sixth color that requires even more stuff
Eearslya Sleiarion
@Eearslya
Sep 06 2017 01:22
Well, I'm convinced there's no way to do it with just operators
but
if we add in keywords
a whole new world opens up
this["string"]() basically gives you access to every base JS function
if you can scrounge up the proper characters
I'm taking this way further than is sane
Eearslya Sleiarion
@Eearslya
Sep 06 2017 01:46
[++[+[]][+[]]/+[]+[]][+[]][+[]]+[this+[]][+[]] [[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[++[+[]][+[]]][+[]]]+[![+[]]+[]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[!![+[]]+[]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[!![+[]]+[]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[this+[]][+[]] [[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]+[++[+[]][+[]]][+[]]]+[![+[]]+[]][+[]][++[+[]][+[]]][+[]]+[![+[]]+[]][+[]][++[++[+[]][+[]]][+[]]][+[]]+[![+[]]+[]][+[]][++[++[+[]][+[]]][+[]]][+[]]
Darqam
@Darqam
Sep 06 2017 04:51
@codemasher do you still maintain https://github.com/codemasher/gw2api-tools if needed? Or do I need to remove that from list of active API wrappers?
smiley
@codemasher
Sep 06 2017 09:02

@Darqam

NOTE: This repository is no longer maintained! Please use GW2Treasures/gw2tools instead. Thanks.

(gw2tools is basically unmaintained, too :D)
you can link this one instead https://github.com/codemasher/gw2-database
Darqam
@Darqam
Sep 06 2017 13:22
lol not sure how I missed that note
database is already linked iirc, but I'll check for both
Eearslya Sleiarion
@Eearslya
Sep 06 2017 17:43
spf records yaaaaaaay :gun:
ugh are our spf records broken again?
Eearslya Sleiarion
@Eearslya
Sep 06 2017 17:44
no
ours
okay jesus man you scared me but also i am sorry for you
email can die in a fire
Eearslya Sleiarion
@Eearslya
Sep 06 2017 17:45
siiigh
ah here it is -- https://dmarcian.com/spf-survey/ -- that's the tool I used for visualizing the SPF include chains
it also does flattening but that's dumb
i found that most of the domains we were including also included their personal mailservers and stuff (e.g., outlook and google and etc) which pulled in more records
just trimming it down to the actual SPF records was enough, so it might be easy
Eearslya Sleiarion
@Eearslya
Sep 06 2017 17:49
nah, we don't have too many, we just...didn't have SPF
and I had to figure out how our mail gets routed
☆magic☆
Eearslya Sleiarion
@Eearslya
Sep 06 2017 17:52
also, relational databases get very tightly interwoven very quickly
windwarrior
@windwarrior
Sep 06 2017 18:23
oh btw, banner skills are not in the API
I think
conjures are in the API tho
windwarrior
@windwarrior
Sep 06 2017 18:29
also, the conjure skill itself ("ice bow") lists bundle skills pointing at 1-5, but the banner skill itself ("banner of defense") is not considered a bundle. Maybe because you place banners before picking them up, and you also place conjures, but they get forced into your hands too
ChieftainAlex
@ChieftainAlex
Sep 06 2017 18:44
that is monstrous.
Eearslya Sleiarion
@Eearslya
Sep 06 2017 18:50
makes me wonder how much I could obfuscate C @lye
you know about http://www.ioccc.org/ right
Eearslya Sleiarion
@Eearslya
Sep 06 2017 18:50
oh shit
here goes my afternoon
yeah people have done some amazing stuff
Eearslya Sleiarion
@Eearslya
Sep 06 2017 18:51
what the everloving fuck
JamEngulfer
@JamEngulfer
Sep 06 2017 18:55
I remember there being a contest to create the shortest program that output its source code and someone won with a blank program in a language where a blank program both compiles and runs
Eearslya Sleiarion
@Eearslya
Sep 06 2017 18:56
I still remember the shortest C program you can write that will be valid enough to compile
main;
@JamEngulfer you need to go deeper: http://mamememo.blogspot.com/2010/09/qlobe.html
Eearslya Sleiarion
@Eearslya
Sep 06 2017 19:05
oh my god
I want to dissect that code now
JamEngulfer
@JamEngulfer
Sep 06 2017 19:08
That is absolutely amazing
And here I am, just sitting writing unit tests...
windwarrior
@windwarrior
Sep 06 2017 19:12
empty c file compiles too right
doesn't link though
Eearslya Sleiarion
@Eearslya
Sep 06 2017 20:46
strings = [<<END, "short", "strings"]
a long string
END

=> ["a long string\n", "short", "strings"]
that is weird to me
is that normal for heredocs?
string = [<<ONE, <<TWO, <<THREE]
  the first thing
ONE
  the second thing
TWO
  and the third thing
THREE

=> ["the first thing\n", "the second thing\n", "and the third thing\n"]
smiley
@codemasher
Sep 06 2017 20:47
this is ...interesting
darthmaim
@darthmaim
Sep 06 2017 20:47
huh
smiley
@codemasher
Sep 06 2017 20:48
i've never used heredocs, so i can't tell
(protip: always use quoted strings)
Eearslya Sleiarion
@Eearslya
Sep 06 2017 20:49
ruby makes it even weirder
you can do stuff like this
%q&string of words&

=> "string of words"
replace the ampersand with literally any non alphanumeric character
including CR/LF
Ruby has a couple heredocs
<<EOT
    this
    is
    text
EOT

=> "    this\n    is\n    text
Eearslya Sleiarion
@Eearslya
Sep 06 2017 20:54
vs
<<-EOT
    this
    is
    text
EOT

=> "this\nis\ntext"
smiley
@codemasher
Sep 06 2017 20:55
Nowdocs are to single-quoted strings what heredocs are to double-quoted strings. A nowdoc is specified similarly to a heredoc, but no parsing is done inside a nowdoc
in php
Eearslya Sleiarion
@Eearslya
Sep 06 2017 20:56
oh wait, I'm wrong
there's 3 heredocs
<<LABEL is a standard heredoc
smiley
@codemasher
Sep 06 2017 20:56
:point_up: 6. September 2017 22:46 this shouldn't happen in php from what i get
Eearslya Sleiarion
@Eearslya
Sep 06 2017 20:56
<<-LABEL allows the ending 'LABEL' to be indented
<<~LABEL strips whitespace up to the least indented item in the heredoc
and then technically %q is a type of heredoc too I guess
I've been trying to decipher that one ruby globe program
it makes heavy use of the %q heredoc
and the whole thing's wrapped in an eval so I'm trying to figure out how it all works
smiley
@codemasher
Sep 06 2017 20:59
ew :D
smiley
@codemasher
Sep 06 2017 23:53
omg housing communities in wildstar
image.png
FORGET GUILD HALLS