0:14 AM
kepstin-netbook_ joined the channel
0:47 AM
hawke_ joined the channel
1:33 AM
DWSR joined the channel
2:25 AM
CallerNo6 joined the channel
4:53 AM
ianmcorvidae joined the channel
5:57 AM
plaintext joined the channel
5:58 AM
plaintext
Hello!
5:59 AM
6:00 AM
But when I try to get the first element of the list ($var[0]), I get an error while running the server
6:01 AM
"Error while loading app.psgi: Global symbol "@decoded_data" requires explicit package name at lib/MusicBrainz/Server/Data/LogStatistic.pm line 36."
6:01 AM
Could anybody help?
6:11 AM
bitmap
maybe you're using the wrong sigil on @decoded_data? that usually the problem when I get that error
6:11 AM
*that's
6:13 AM
plaintext
I tried @var[0] but I got the same error
6:15 AM
bitmap
what's on line 36? it's complaining about @decoded_data
6:16 AM
plaintext
this is what I tried:
6:16 AM
$log_stat->data(Dumper($decoded_data[0]));
6:16 AM
I can put the code on gist
6:17 AM
if that helps more
6:17 AM
bitmap
is decoded_data an array reference? then you need to do $decoded_data->[0]
6:19 AM
plaintext
oh that might be the case
6:19 AM
thanks bitmap, I'll try
6:23 AM
yay, it works! I really need to learn perl properly :)
6:30 AM
plaintext joined the channel
6:38 AM
ijabz joined the channel
7:37 AM
Mineo joined the channel
7:58 AM
I have one more question if it's ok :)
7:58 AM
$log_stat->data(Dumper($decoded_data->[0])); this produces this hash on the output:
7:58 AM
{ 'count' => '9', 'percent' => '0.900000', '_tc' => '1000', 'mbid' => '60f7d020-9580-47c5-8839-a4f25659687d' }
7:59 AM
but this: $log_stat->data(Dumper(keys %{ $decoded_data->[0] } )); produces the single string 'count' for some reason
7:59 AM
however when I try $decoded_data->[0]{'percent'} it works without a problem
7:59 AM
why cant the keys function return all the keys in a list?
8:01 AM
warp
keys returns an array, not an array ref. is Dumper expecting an array ref perhaps?
8:02 AM
plaintext
I thought dumper would just output any variable
8:03 AM
bitmap
it does expect a reference iirc
8:03 AM
warp
oh, probably Dumper generates an array if given an array, and $log_stat->data() only uses the first argument.
8:04 AM
plaintext
That may be so
8:04 AM
That's right, thanks warp
8:05 AM
I was expecting Dumper to output the whole array like when it dumped $decoded_data
8:05 AM
which is an array of hashes
8:06 AM
warp
plaintext: well, it does. it's just that $log_stat->data() isn't expecting that.
8:07 AM
plaintext
oh I get it
8:07 AM
I think
8:14 AM
warp
plaintext: install Devel::REPL if you don't have it yet, it makes it easier to try these things.
8:14 AM
8:16 AM
plaintext
is this sort-of like a shell for perl?
8:16 AM
warp
yes
8:16 AM
plaintext
cool, thanks
8:17 AM
warp
see the screenshot :)
8:17 AM
plaintext
yeah
8:17 AM
that would be helpful
9:35 AM
djce joined the channel
11:29 AM
the_metalgamer joined the channel
12:03 PM
ocharles
happy birthday adhawkins-away !
12:59 PM
kepstin joined the channel
13:31 PM
lfranchi joined the channel
14:14 PM
lfranchi joined the channel
14:24 PM
CallerNo6 joined the channel
15:12 PM
dak180 has left the channel
16:20 PM
ijabz joined the channel
16:33 PM
kepstin joined the channel
16:41 PM
ijabz joined the channel
16:42 PM
ruaok joined the channel
18:05 PM
Leftmost joined the channel
18:38 PM
vinay_ joined the channel
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
19:01 PM
kepstin joined the channel
19:05 PM
navap
vinay_: If you set up your own musicbrainz-server you'll have local access to the web service
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
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
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
19:15 PM
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
19:17 PM
vinay_
19:17 PM
ianmcorvidae
that's a separate component entirely
19:18 PM
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
19:18 PM
if you want the API, you'll need the perl server setup
19:23 PM
vinay_
Basically I want to use the APIs to extract information , but the APIs need a webservice .
19:24 PM
Ok I will try the perl server setup
19:24 PM
Thank You
19:24 PM
ianmcorvidae
you could also just set up the database, if you just want any old access to the data
19:24 PM
but yeah, look into the perl server setup :)
19:25 PM
vinay_
And when I use the APIs musicbrains blocks us after some requests
19:26 PM
ianmcorvidae
there's a rate-limit, yes, one per second
19:26 PM
nikkimini
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
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.
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
19:49 PM
kepstin
the current etags implementation on the api doesn't actually stop it from doing the db request on 'cached' requests...
19:50 PM
unless there's some other caching in the server itself?
19:50 PM
ianmcorvidae
yeah, I don't mean etags, I mean object caching
19:50 PM
kepstin
I didn't think there was on the webservice, since invalidating such a cache on db updates is a problem.
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
19:51 PM
it's most effective for things like the list of languages though
19:51 PM
kepstin
I'm not familiar with that, though - and presumbly an application accessing the db directly could cache relevant stuff internally
19:51 PM
ianmcorvidae
yeah, it could
19:53 PM
19:53 PM
kepstin: it just does _delete_from_cache after any update, delete, or merge (from perl)
19:55 PM
but yeah, in general the database should be faster :)
19:55 PM
vinay_
I was just trying to see the performance but now I dont think its worth it :)
19:55 PM
I will stick to the database then
19:58 PM
Thanks Guys . I really apreciate it .
20:07 PM
ijabz joined the channel
22:31 PM
CallerNo6 joined the channel
23:28 PM
plaintext joined the channel
23:28 PM
plaintext
Hello
23:29 PM
Is it possible to do something like this in an entity?
23:29 PM
isa => 'ArrayRef[ArrayRef[Str]]',
23:30 PM
Because for some statistics I need to store a whole table of data
23:33 PM
ianmcorvidae
I think it should be possible, but I guess look at the Moose documentation to be sure
23:34 PM
plaintext
thanks
23:34 PM
ianmcorvidae
yeah, looks like you can
23:34 PM
23:35 PM
plaintext
great! I'll try now
23:37 PM
actually, I think I'll need ArrayRef[Map[...]],
23:37 PM
but if I need a weird structure like this
23:38 PM
there must be a better way to do it
23:40 PM
ianmcorvidae
hm
23:40 PM
probably
23:40 PM
I'm not sure what though
23:40 PM
ianmcorvidae defers to ocharles/warp/moose docs :)
23:41 PM
plaintext
where can I find ocharles/warp docs? :P
23:41 PM
ianmcorvidae
haha
23:42 PM
plaintext
I think I'll ask for some advice on monday
23:42 PM
ianmcorvidae
yeah, that's likely when they're back
23:45 PM
plaintext
in the meantime I'll look into moose docs
23:45 PM
but now I'm off to bed
23:45 PM
ianmcorvidae
cool
23:45 PM
sleep well :)
23:46 PM
plaintext
thank you
23:46 PM
bye!