I’m still at the “scraping the data into foo stage”, so as long as I end up with some ordered way to store that, right now, I’m not locked into any particular method
ruaok
an array of assoc arrays?
FauxFaux
Ohhh, I see the problem now. Smell of pizza really helps.
brianfreud ‘s trying to picture a pseduo-implementation of that...
ruaok drools
ruaok
vd dinner is still over 1:30 out.
brianfreud: what is the end goal?
brianfreud
I don’t have it in that snippet, but not only do tracks have the 1, 2, 3, thing, but they also store roles that way
FauxFaux
I'd have an array of trakcs (or, a map of albums -> an array of tracks, by number), each track being an object with a name, and a map of which artist did what.
brianfreud
ruoak: to be able to present the user with a list of people, to map each to an existing MB artist, and a list of roles, to be able to have the user map each role to an AR
FauxFaux
Go through the data you have, add any new information you have to that beastly structure.
brianfreud
and to do it in some way that doesn’t take 10 min to process :P
FauxFaux
(you can normalize out artist names if you want, but it's probably pointless at this stage)
FauxFaux -> remove food from oven and wave it infront of ruaok.
brianfreud
so [track][artist, role]?
ruaok goes to the kitchen to fetch a knife for FauxFaux
FauxFaux
track containing a set of [artist => role] pairs, yeah.
brianfreud
hmm, ok, I can see how I’d put it in there...
on the other end, then, how would I pull out each unique artist and each unique role? Sounds cpu expensive...
essentially --> for tracks.length( for artists.length( for roles.split(“,”).length( for(interpreted Track list).length ( store arrayFoo[Track][artist][role] )))) ?
hmmm, ok, I think I see how maybe to do it. :)
FauxFaux
arrayFoo[Track][artist] = role; yeah. Unique artist/roles can be kept track of while you're building the tree, or you could just scan it (only have to look at everything once, shouldn't be too slow) at the end.
arrayBar[Artist] = true; ;)
brianfreud
was thinking just, at the same time, store two other simple arrays, one of artists, one of roles, and use those values to store in the big array...
xlotlu has quit
xlotlu joined the channel
xlotlu has quit
xlotlu joined the channel
Infinito_ joined the channel
baijiutong joined the channel
`duckman has quit
nikki has quit
nikki joined the channel
Infinito_ has quit
nikki has quit
stochasticism joined the channel
nikki joined the channel
Amblin joined the channel
Amblin- has quit
brianfreud_ joined the channel
brianfreud has quit
stochasticism has quit
nikki has quit
brianfreud_ finally manages to get all Discogs release-level ARs split out to single ARs, assigned to the correct track numbers, and stored in a sensible array! O/
brianfreud_ has an array of all Discogs ARS! :D:D:D:D
brianfreud_ is now known as BrianFreud
rpedro joined the channel
rpedro__ has quit
outsidecontext joined the channel
srotta joined the channel
BrianFreud
srotta, you have any experience with JSON?
petros joined the channel
outsidecontex1 joined the channel
outsidecontext has quit
mellum_ has quit
l8nite joined the channel
luks joined the channel
l8nite has quit
dsp has quit
soccos joined the channel
soccos
json
BrianFreud
hey
I just emailed you back the queries I’m dealing with... just have no idea how to do anything with them
tciddAlateMriaH joined the channel
soccos
afaiui you can just eval json in your javascript and it will make some kind of object for u
BrianFreud
it’ll automatically send the request and wait for the response?
soccos
have you read anything at all about it?
BrianFreud
yeah, I was trying to dig out at least some idea of how to handle it, but everything just goes on about how it’s almost javascript already. Didn’t see anything about how to actually request it, or how actually parse out the data
there’s a pretty nice interface to wikipedia data, though, and I’d love to snag just a few crumbs using it... but it’s only JSON
luks
you request it the same way you request xml
soccos
the thingy i was working on makes a javascript call to (a php script) which returns a json object
luks
but instead of parsing it as it, you parse it as json
but you definitely want to replace eval with something else later
soccos: no
BrianFreud
luks: why’s that?
l8nite
you can use object.hasOwnProperty("blah") to test for existence (sorry if I'm joining late and not being helpful)
luks
because you don't want to execute arbitrary code from some random server in your script
BrianFreud
oh, and eval’s actually executing it, gotcha
not that freebase likely will attempt it, but I definitely see your point
BrianFreud just needs to finish up then parsing the data from freebase, snag the purevolume url, snag the myspace url, and snag some data at last.fm, and he’ll be ready to actually start to do something with all the data :)
oh yeah, and amazon, but that’s mostly written already
outsidecontex1
that's the thing i never understodd with json: it is actually JS code, which would make it easy to inlcude it with eval. but that's exactly what you don't want so you need a proper parser. why should you then use json in the first place and not something else?
luks
outsidecontex1: because it's simple enough and widely used
and less verbose than xml
l8nite
it's human-parseable as well
BrianFreud
well, just looking at it from not knowing much of JSON, it would seem to make more sense to use JSON when you control the source (intranets) and XML when you don’t (internet)... I can see outsidecontex1’s point
l8nite
It's also pretty reliable for places where you control the source... er
Brian X_X
outsidecontex1
but there are prettier data representations than a programming language
l8nite
outsidecontex1: As usual, tmtowtdi and uww :)
BrianFreud
yeah, and maybe I’m wierd, but XML seems almost more readable to me than JSON
luks
there is no reason to waste bandwidth with <date_of_birth>1963-08-22</date_of_birth> if "date_of_birth":"1963-08-22" will do just fine