0:14 AM
kepstin-netbook_ joined the channel
2012-07-21 20345, 2012
0:47 AM
hawke_ joined the channel
2012-07-21 20336, 2012
1:33 AM
DWSR joined the channel
2012-07-21 20341, 2012
2:25 AM
CallerNo6 joined the channel
2012-07-21 20340, 2012
4:53 AM
ianmcorvidae joined the channel
2012-07-21 20347, 2012
5:57 AM
plaintext joined the channel
2012-07-21 20312, 2012
5:58 AM
plaintext
Hello!
2012-07-21 20344, 2012
5:59 AM
plaintext
2012-07-21 20315, 2012
6:00 AM
plaintext
But when I try to get the first element of the list ($var[0]), I get an error while running the server
2012-07-21 20337, 2012
6:01 AM
plaintext
"Error while loading app.psgi: Global symbol "@decoded_data" requires explicit package name at lib/MusicBrainz/Server/Data/LogStatistic.pm line 36."
2012-07-21 20347, 2012
6:01 AM
plaintext
Could anybody help?
2012-07-21 20330, 2012
6:11 AM
bitmap
maybe you're using the wrong sigil on @decoded_data? that usually the problem when I get that error
2012-07-21 20337, 2012
6:11 AM
bitmap
*that's
2012-07-21 20316, 2012
6:13 AM
plaintext
I tried @var[0] but I got the same error
2012-07-21 20321, 2012
6:15 AM
bitmap
what's on line 36? it's complaining about @decoded_data
2012-07-21 20340, 2012
6:16 AM
plaintext
this is what I tried:
2012-07-21 20344, 2012
6:16 AM
plaintext
$log_stat->data(Dumper($decoded_data[0]));
2012-07-21 20355, 2012
6:16 AM
plaintext
I can put the code on gist
2012-07-21 20301, 2012
6:17 AM
plaintext
if that helps more
2012-07-21 20325, 2012
6:17 AM
bitmap
is decoded_data an array reference? then you need to do $decoded_data->[0]
2012-07-21 20353, 2012
6:19 AM
plaintext
oh that might be the case
2012-07-21 20358, 2012
6:19 AM
plaintext
thanks bitmap, I'll try
2012-07-21 20356, 2012
6:23 AM
plaintext
yay, it works! I really need to learn perl properly :)
2012-07-21 20329, 2012
6:30 AM
plaintext joined the channel
2012-07-21 20329, 2012
6:38 AM
ijabz joined the channel
2012-07-21 20331, 2012
7:37 AM
Mineo joined the channel
2012-07-21 20322, 2012
7:58 AM
plaintext
I have one more question if it's ok :)
2012-07-21 20353, 2012
7:58 AM
plaintext
$log_stat->data(Dumper($decoded_data->[0])); this produces this hash on the output:
2012-07-21 20355, 2012
7:58 AM
plaintext
{ 'count' => '9', 'percent' => '0.900000', '_tc' => '1000', 'mbid' => '60f7d020-9580-47c5-8839-a4f25659687d' }
2012-07-21 20327, 2012
7:59 AM
plaintext
but this: $log_stat->data(Dumper(keys %{ $decoded_data->[0] } )); produces the single string 'count' for some reason
2012-07-21 20351, 2012
7:59 AM
plaintext
however when I try $decoded_data->[0]{'percent'} it works without a problem
2012-07-21 20359, 2012
7:59 AM
plaintext
why cant the keys function return all the keys in a list?
2012-07-21 20356, 2012
8:01 AM
warp
keys returns an array, not an array ref. is Dumper expecting an array ref perhaps?
2012-07-21 20324, 2012
8:02 AM
plaintext
I thought dumper would just output any variable
2012-07-21 20319, 2012
8:03 AM
bitmap
it does expect a reference iirc
2012-07-21 20344, 2012
8:03 AM
warp
oh, probably Dumper generates an array if given an array, and $log_stat->data() only uses the first argument.
2012-07-21 20302, 2012
8:04 AM
plaintext
That may be so
2012-07-21 20356, 2012
8:04 AM
plaintext
That's right, thanks warp
2012-07-21 20321, 2012
8:05 AM
plaintext
I was expecting Dumper to output the whole array like when it dumped $decoded_data
2012-07-21 20326, 2012
8:05 AM
plaintext
which is an array of hashes
2012-07-21 20312, 2012
8:06 AM
warp
plaintext: well, it does. it's just that $log_stat->data() isn't expecting that.
2012-07-21 20305, 2012
8:07 AM
plaintext
oh I get it
2012-07-21 20315, 2012
8:07 AM
plaintext
I think
2012-07-21 20320, 2012
8:14 AM
warp
plaintext: install Devel::REPL if you don't have it yet, it makes it easier to try these things.
2012-07-21 20327, 2012
8:14 AM
warp
2012-07-21 20336, 2012
8:16 AM
plaintext
is this sort-of like a shell for perl?
2012-07-21 20349, 2012
8:16 AM
warp
yes
2012-07-21 20352, 2012
8:16 AM
plaintext
cool, thanks
2012-07-21 20300, 2012
8:17 AM
warp
see the screenshot :)
2012-07-21 20304, 2012
8:17 AM
plaintext
yeah
2012-07-21 20313, 2012
8:17 AM
plaintext
that would be helpful
2012-07-21 20310, 2012
9:35 AM
djce joined the channel
2012-07-21 20310, 2012
11:29 AM
the_metalgamer joined the channel
2012-07-21 20343, 2012
12:03 PM
ocharles
happy birthday adhawkins-away !
2012-07-21 20316, 2012
12:59 PM
kepstin joined the channel
2012-07-21 20314, 2012
13:31 PM
lfranchi joined the channel
2012-07-21 20327, 2012
14:14 PM
lfranchi joined the channel
2012-07-21 20325, 2012
14:24 PM
CallerNo6 joined the channel
2012-07-21 20348, 2012
15:12 PM
dak180 has left the channel
2012-07-21 20327, 2012
16:20 PM
ijabz joined the channel
2012-07-21 20356, 2012
16:33 PM
kepstin joined the channel
2012-07-21 20302, 2012
16:41 PM
ijabz joined the channel
2012-07-21 20317, 2012
16:42 PM
ruaok joined the channel
2012-07-21 20303, 2012
18:05 PM
Leftmost joined the channel
2012-07-21 20339, 2012
18:38 PM
vinay_ joined the channel
2012-07-21 20308, 2012
18:40 PM
vinay_
can anyone tell me if we can connect to the local musicbrainz database (which I have downloaded form the website ) using the APIs
2012-07-21 20357, 2012
19:01 PM
kepstin joined the channel
2012-07-21 20347, 2012
19:05 PM
navap
vinay_: If you set up your own musicbrainz-server you'll have local access to the web service
2012-07-21 20312, 2012
19:09 PM
vinay_
@navap : Thanks for your reply .. I am using my school network to install it on one of the servers. I read the documentation for setting up the musicbrainz server . Is there any way I can use the existing apache server to host this
2012-07-21 20313, 2012
19:11 PM
navap
There probably is, but I've only used the built in catalyst server so I won't be much help in setting up something else
2012-07-21 20323, 2012
19:15 PM
ianmcorvidae
you'll need to set up apache as a reverse proxy to running the server with FCGI -- apache will be an extra layer "around" the main server
2012-07-21 20353, 2012
19:15 PM
ianmcorvidae
you can't run it with e.g. mod_perl or such, as far as I know, but it's run using Catalyst/PSGI/Plack, so if you want to look at those docs they might inform you
2012-07-21 20316, 2012
19:17 PM
vinay_
2012-07-21 20326, 2012
19:17 PM
ianmcorvidae
that's a separate component entirely
2012-07-21 20304, 2012
19:18 PM
ianmcorvidae
that's used only for search -- the perl server talks to that one (usually just via
search.musicbrainz.org , even for external deployments) as a backend for the search functionality
2012-07-21 20317, 2012
19:18 PM
ianmcorvidae
if you want the API, you'll need the perl server setup
2012-07-21 20338, 2012
19:23 PM
vinay_
Basically I want to use the APIs to extract information , but the APIs need a webservice .
2012-07-21 20310, 2012
19:24 PM
vinay_
Ok I will try the perl server setup
2012-07-21 20323, 2012
19:24 PM
vinay_
Thank You
2012-07-21 20326, 2012
19:24 PM
ianmcorvidae
you could also just set up the database, if you just want any old access to the data
2012-07-21 20357, 2012
19:24 PM
ianmcorvidae
but yeah, look into the perl server setup :)
2012-07-21 20338, 2012
19:25 PM
vinay_
And when I use the APIs musicbrains blocks us after some requests
2012-07-21 20309, 2012
19:26 PM
ianmcorvidae
there's a rate-limit, yes, one per second
2012-07-21 20337, 2012
19:26 PM
nikkimini
2012-07-21 20302, 2012
19:27 PM
vinay_
I wrote programs to extarct data from the database but wanted to see if by using the APIs will it be any faster
2012-07-21 20337, 2012
19:47 PM
kepstin
the apis will be slower than directly accessing the data from the database, of course. All they do is add an extra layer between you in the database.
2012-07-21 20337, 2012
19:48 PM
ianmcorvidae
kepstin: probably -- the only exceptions might be if he's getting heavy usage of the cache or of the search indexes
2012-07-21 20335, 2012
19:49 PM
kepstin
the current etags implementation on the api doesn't actually stop it from doing the db request on 'cached' requests...
2012-07-21 20301, 2012
19:50 PM
kepstin
unless there's some other caching in the server itself?
2012-07-21 20325, 2012
19:50 PM
ianmcorvidae
yeah, I don't mean etags, I mean object caching
2012-07-21 20330, 2012
19:50 PM
kepstin
I didn't think there was on the webservice, since invalidating such a cache on db updates is a problem.
2012-07-21 20307, 2012
19:51 PM
ianmcorvidae
I don't know exactly how it plays out or how well it works, but I know that there is some sort of cache
2012-07-21 20318, 2012
19:51 PM
ianmcorvidae
it's most effective for things like the list of languages though
2012-07-21 20323, 2012
19:51 PM
kepstin
I'm not familiar with that, though - and presumbly an application accessing the db directly could cache relevant stuff internally
2012-07-21 20333, 2012
19:51 PM
ianmcorvidae
yeah, it could
2012-07-21 20303, 2012
19:53 PM
ianmcorvidae
2012-07-21 20333, 2012
19:53 PM
ianmcorvidae
kepstin: it just does _delete_from_cache after any update, delete, or merge (from perl)
2012-07-21 20301, 2012
19:55 PM
ianmcorvidae
but yeah, in general the database should be faster :)
2012-07-21 20341, 2012
19:55 PM
vinay_
I was just trying to see the performance but now I dont think its worth it :)
2012-07-21 20354, 2012
19:55 PM
vinay_
I will stick to the database then
2012-07-21 20332, 2012
19:58 PM
vinay_
Thanks Guys . I really apreciate it .
2012-07-21 20302, 2012
20:07 PM
ijabz joined the channel
2012-07-21 20332, 2012
22:31 PM
CallerNo6 joined the channel
2012-07-21 20343, 2012
23:28 PM
plaintext joined the channel
2012-07-21 20358, 2012
23:28 PM
plaintext
Hello
2012-07-21 20337, 2012
23:29 PM
plaintext
Is it possible to do something like this in an entity?
2012-07-21 20338, 2012
23:29 PM
plaintext
isa => 'ArrayRef[ArrayRef[Str]]',
2012-07-21 20316, 2012
23:30 PM
plaintext
Because for some statistics I need to store a whole table of data
2012-07-21 20345, 2012
23:33 PM
ianmcorvidae
I think it should be possible, but I guess look at the Moose documentation to be sure
2012-07-21 20314, 2012
23:34 PM
plaintext
thanks
2012-07-21 20325, 2012
23:34 PM
ianmcorvidae
yeah, looks like you can
2012-07-21 20330, 2012
23:34 PM
ianmcorvidae
2012-07-21 20334, 2012
23:35 PM
plaintext
great! I'll try now
2012-07-21 20353, 2012
23:37 PM
plaintext
actually, I think I'll need ArrayRef[Map[...]],
2012-07-21 20359, 2012
23:37 PM
plaintext
but if I need a weird structure like this
2012-07-21 20305, 2012
23:38 PM
plaintext
there must be a better way to do it
2012-07-21 20312, 2012
23:40 PM
ianmcorvidae
hm
2012-07-21 20314, 2012
23:40 PM
ianmcorvidae
probably
2012-07-21 20321, 2012
23:40 PM
ianmcorvidae
I'm not sure what though
2012-07-21 20328, 2012
23:40 PM
ianmcorvidae defers to ocharles/warp/moose docs :)
2012-07-21 20332, 2012
23:41 PM
plaintext
where can I find ocharles/warp docs? :P
2012-07-21 20356, 2012
23:41 PM
ianmcorvidae
haha
2012-07-21 20325, 2012
23:42 PM
plaintext
I think I'll ask for some advice on monday
2012-07-21 20340, 2012
23:42 PM
ianmcorvidae
yeah, that's likely when they're back
2012-07-21 20345, 2012
23:45 PM
plaintext
in the meantime I'll look into moose docs
2012-07-21 20350, 2012
23:45 PM
plaintext
but now I'm off to bed
2012-07-21 20357, 2012
23:45 PM
ianmcorvidae
cool
2012-07-21 20359, 2012
23:45 PM
ianmcorvidae
sleep well :)
2012-07-21 20303, 2012
23:46 PM
plaintext
thank you
2012-07-21 20304, 2012
23:46 PM
plaintext
bye!