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
2008-02-15 04648, 2008
ruaok
an array of assoc arrays?
2008-02-15 04607, 2008
FauxFaux
Ohhh, I see the problem now. Smell of pizza really helps.
2008-02-15 04618, 2008
brianfreud ‘s trying to picture a pseduo-implementation of that...
2008-02-15 04619, 2008
ruaok drools
2008-02-15 04629, 2008
ruaok
vd dinner is still over 1:30 out.
2008-02-15 04646, 2008
ruaok
brianfreud: what is the end goal?
2008-02-15 04648, 2008
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
2008-02-15 04601, 2008
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.
2008-02-15 04621, 2008
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
2008-02-15 04633, 2008
FauxFaux
Go through the data you have, add any new information you have to that beastly structure.
2008-02-15 04640, 2008
brianfreud
and to do it in some way that doesn’t take 10 min to process :P
2008-02-15 04616, 2008
FauxFaux
(you can normalize out artist names if you want, but it's probably pointless at this stage)
2008-02-15 04654, 2008
FauxFaux -> remove food from oven and wave it infront of ruaok.
2008-02-15 04657, 2008
brianfreud
so [track][artist, role]?
2008-02-15 04613, 2008
ruaok goes to the kitchen to fetch a knife for FauxFaux
2008-02-15 04626, 2008
FauxFaux
track containing a set of [artist => role] pairs, yeah.
2008-02-15 04636, 2008
brianfreud
hmm, ok, I can see how I’d put it in there...
2008-02-15 04608, 2008
brianfreud
on the other end, then, how would I pull out each unique artist and each unique role? Sounds cpu expensive...
2008-02-15 04626, 2008
brianfreud
essentially --> for tracks.length( for artists.length( for roles.split(“,”).length( for(interpreted Track list).length ( store arrayFoo[Track][artist][role] )))) ?
2008-02-15 04615, 2008
brianfreud
hmmm, ok, I think I see how maybe to do it. :)
2008-02-15 04632, 2008
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.
2008-02-15 04650, 2008
FauxFaux
arrayBar[Artist] = true; ;)
2008-02-15 04633, 2008
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...
2008-02-15 04637, 2008
xlotlu has quit
2008-02-15 04613, 2008
xlotlu joined the channel
2008-02-15 04629, 2008
xlotlu has quit
2008-02-15 04659, 2008
xlotlu joined the channel
2008-02-15 04605, 2008
Infinito_ joined the channel
2008-02-15 04612, 2008
baijiutong joined the channel
2008-02-15 04619, 2008
`duckman has quit
2008-02-15 04620, 2008
nikki has quit
2008-02-15 04635, 2008
nikki joined the channel
2008-02-15 04615, 2008
Infinito_ has quit
2008-02-15 04619, 2008
nikki has quit
2008-02-15 04608, 2008
stochasticism joined the channel
2008-02-15 04631, 2008
nikki joined the channel
2008-02-15 04633, 2008
Amblin joined the channel
2008-02-15 04631, 2008
Amblin- has quit
2008-02-15 04639, 2008
brianfreud_ joined the channel
2008-02-15 04623, 2008
brianfreud has quit
2008-02-15 04646, 2008
stochasticism has quit
2008-02-15 04659, 2008
nikki has quit
2008-02-15 04613, 2008
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
2008-02-15 04619, 2008
brianfreud_
brianfreud_ is now known as BrianFreud
2008-02-15 04643, 2008
rpedro joined the channel
2008-02-15 04602, 2008
rpedro__ has quit
2008-02-15 04651, 2008
outsidecontext joined the channel
2008-02-15 04658, 2008
srotta joined the channel
2008-02-15 04614, 2008
BrianFreud
srotta, you have any experience with JSON?
2008-02-15 04617, 2008
petros joined the channel
2008-02-15 04637, 2008
outsidecontex1 joined the channel
2008-02-15 04601, 2008
outsidecontext has quit
2008-02-15 04610, 2008
mellum_ has quit
2008-02-15 04656, 2008
l8nite joined the channel
2008-02-15 04634, 2008
luks joined the channel
2008-02-15 04643, 2008
l8nite has quit
2008-02-15 04656, 2008
dsp has quit
2008-02-15 04626, 2008
soccos joined the channel
2008-02-15 04637, 2008
soccos
json
2008-02-15 04657, 2008
BrianFreud
hey
2008-02-15 04632, 2008
BrianFreud
I just emailed you back the queries I’m dealing with... just have no idea how to do anything with them
2008-02-15 04616, 2008
tciddAlateMriaH joined the channel
2008-02-15 04636, 2008
soccos
afaiui you can just eval json in your javascript and it will make some kind of object for u
2008-02-15 04651, 2008
BrianFreud
it’ll automatically send the request and wait for the response?
2008-02-15 04652, 2008
soccos
have you read anything at all about it?
2008-02-15 04647, 2008
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
2008-02-15 04624, 2008
BrianFreud
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
2008-02-15 04633, 2008
luks
you request it the same way you request xml
2008-02-15 04643, 2008
soccos
the thingy i was working on makes a javascript call to (a php script) which returns a json object
2008-02-15 04648, 2008
luks
but instead of parsing it as it, you parse it as json
but you definitely want to replace eval with something else later
2008-02-15 04604, 2008
luks
soccos: no
2008-02-15 04641, 2008
BrianFreud
luks: why’s that?
2008-02-15 04608, 2008
l8nite
you can use object.hasOwnProperty("blah") to test for existence (sorry if I'm joining late and not being helpful)
2008-02-15 04614, 2008
luks
because you don't want to execute arbitrary code from some random server in your script
2008-02-15 04628, 2008
BrianFreud
oh, and eval’s actually executing it, gotcha
2008-02-15 04653, 2008
BrianFreud
not that freebase likely will attempt it, but I definitely see your point
2008-02-15 04642, 2008
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 :)
2008-02-15 04611, 2008
BrianFreud
oh yeah, and amazon, but that’s mostly written already
2008-02-15 04622, 2008
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?
2008-02-15 04650, 2008
luks
outsidecontex1: because it's simple enough and widely used
2008-02-15 04600, 2008
luks
and less verbose than xml
2008-02-15 04605, 2008
l8nite
it's human-parseable as well
2008-02-15 04640, 2008
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
2008-02-15 04653, 2008
l8nite
It's also pretty reliable for places where you control the source... er
2008-02-15 04659, 2008
l8nite
Brian X_X
2008-02-15 04610, 2008
outsidecontex1
but there are prettier data representations than a programming language
2008-02-15 04640, 2008
l8nite
outsidecontex1: As usual, tmtowtdi and uww :)
2008-02-15 04644, 2008
BrianFreud
yeah, and maybe I’m wierd, but XML seems almost more readable to me than JSON
2008-02-15 04658, 2008
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