#musicbrainz

/

      • aCiD2
        the latter being the most common approach, and the one used by cpan modules etc
      • 2009-04-19 10930, 2009

      • luks
        I'd like to keep the types in MusicBrainz::Entity::Types, since they won't cover other classes
      • 2009-04-19 10953, 2009

      • aCiD2
        MusicBrainz::Entity::Types then, heh
      • 2009-04-19 10919, 2009

      • czaanja has quit
      • 2009-04-19 10940, 2009

      • N[]vA joined the channel
      • 2009-04-19 10909, 2009

      • luks
        hmm, what do I need to do to be able to use 'subtype'
      • 2009-04-19 10919, 2009

      • luks
        just 'use Moose' doesn't seem enough
      • 2009-04-19 10921, 2009

      • aCiD2
        have you used Moose::Util::TypeConstraints?
      • 2009-04-19 10930, 2009

      • aCiD2
        that's where subtype and class_type are
      • 2009-04-19 10950, 2009

      • luks
        thanks
      • 2009-04-19 10915, 2009

      • luks
        heh, now the types are short, I'm tempted to put the has commands back to a single line
      • 2009-04-19 10937, 2009

      • aCiD2
        Heh, did you know you can have multiple attributes to one has?
      • 2009-04-19 10944, 2009

      • aCiD2
        has [qw/foo bar/] => ( ... )
      • 2009-04-19 10910, 2009

      • aCiD2
        if we're sure we won't need to put extra constraints on attributes like traits, metaclasses, whatever - then just stick them on one line
      • 2009-04-19 10915, 2009

      • luks
        I've seen it in your example from the mail first time
      • 2009-04-19 10933, 2009

      • aCiD2
        I just expand them from personal prepreference
      • 2009-04-19 10911, 2009

      • aCiD2
        prepreference? preference*
      • 2009-04-19 10903, 2009

      • luks
        the only reason I like them on one line is because I can see more of them
      • 2009-04-19 10910, 2009

      • aCiD2 nodes
      • 2009-04-19 10920, 2009

      • aCiD2
        I'm spoilt by a huge screen and good eye sight :)
      • 2009-04-19 10926, 2009

      • luks
        heh
      • 2009-04-19 10927, 2009

      • aCiD2
        that and I use folding
      • 2009-04-19 10941, 2009

      • luks
        hmm
      • 2009-04-19 10916, 2009

      • luks
        would be nice if the Collection::Array metaclass, when using provides => { push => 'add_stuff' }, automatically called the item class constructor if I pass it just a plain hash
      • 2009-04-19 10938, 2009

      • aCiD2
        What do you mean, pass it a hash?
      • 2009-04-19 10920, 2009

      • luks
        $artist_credit->add_name(MusicBrainz::Server::Entity::ArtistCreditName->new(name => 'Artist 1', join_phrase => ', '));
      • 2009-04-19 10923, 2009

      • luks
        vs
      • 2009-04-19 10932, 2009

      • luks
        $artist_credit->add_name(name => 'Artist 1', join_phrase => ', ');
      • 2009-04-19 10940, 2009

      • aCiD2
        Ah
      • 2009-04-19 10947, 2009

      • luks
        it knows the item has to be MusicBrainz::Server::Entity::ArtistCreditName
      • 2009-04-19 10905, 2009

      • aCiD2
        You could use coercion to get that
      • 2009-04-19 10934, 2009

      • aCiD2
        corce 'Whatever' => from 'HashRef' => via { Foo->new{$_) }
      • 2009-04-19 10940, 2009

      • luks
        yeah, but the metaclass could handle that automatically
      • 2009-04-19 10943, 2009

      • aCiD2
        yea
      • 2009-04-19 10946, 2009

      • aCiD2
        i agree
      • 2009-04-19 10903, 2009

      • aCiD2
        but I think add can take a list, so it wouldn't know whether you give it a hash or a list of items
      • 2009-04-19 10915, 2009

      • luks
        oh, right
      • 2009-04-19 10933, 2009

      • luks
        aCiD2: do you know where is Catalyst::Plugin::Cache used?
      • 2009-04-19 10942, 2009

      • aCiD2
        No, ruaok added that
      • 2009-04-19 10951, 2009

      • aCiD2
        I'd guess somewhere in the web service
      • 2009-04-19 10954, 2009

      • aCiD2
        but I'm not sure where
      • 2009-04-19 10914, 2009

      • luks
        ok, time to read diffs then
      • 2009-04-19 10918, 2009

      • aCiD2
        :)
      • 2009-04-19 10904, 2009

      • luks
        from what I can see, it isn't used anywhere
      • 2009-04-19 10928, 2009

      • aCiD2
        Nope, I can't find any references to $c->cache either
      • 2009-04-19 10932, 2009

      • aCiD2
        do you want to remove it?
      • 2009-04-19 10928, 2009

      • luks
        I don't know yet, I'd like to not make cache dependant on catalyst
      • 2009-04-19 10941, 2009

      • aCiD2
        yea, i agree with that
      • 2009-04-19 10942, 2009

      • luks
        but if the plugin does somethign useful, we might want to keep it
      • 2009-04-19 10901, 2009

      • Kr1stjan joined the channel
      • 2009-04-19 10908, 2009

      • luks
        what I wanted was to make some kind of Context object, with access to the database and cache, which can by used by tests and console scripts
      • 2009-04-19 10929, 2009

      • aCiD2
        something that maintains handles?
      • 2009-04-19 10930, 2009

      • luks
        and MusicBrainz::Server would inherit this, to make it available to the catalyst context too
      • 2009-04-19 10933, 2009

      • luks
        yes
      • 2009-04-19 10958, 2009

      • aCiD2
        mmm, I can't see any other way to do, and to get testing working easily too
      • 2009-04-19 10946, 2009

      • N|afk joined the channel
      • 2009-04-19 10941, 2009

      • gouchi has quit
      • 2009-04-19 10902, 2009

      • N[]vA has quit
      • 2009-04-19 10937, 2009

      • aCiD2
        luks: for completion (and mainly as an exercise for myself :)) I tried writing what I meant by using roles and traits for caching: http://gist.github.com/98016
      • 2009-04-19 10949, 2009

      • aCiD2
        like I said, just there for completeness sake, was fun to write :)
      • 2009-04-19 10911, 2009

      • aCiD2
        damnit, why is emacs using tabs >.>
      • 2009-04-19 10954, 2009

      • chefkoch has quit
      • 2009-04-19 10911, 2009

      • Kr1stjan has quit
      • 2009-04-19 10935, 2009

      • N|afk has quit
      • 2009-04-19 10916, 2009

      • luks
        aCiD2: one problem with the code is that it's not easily testable
      • 2009-04-19 10932, 2009

      • luks
        aCiD2: unit testing should test the simplest possible units
      • 2009-04-19 10959, 2009

      • luks
        aCiD2: so you should have tests for loading from the database, loading from the cache, serialization/deserialization
      • 2009-04-19 10907, 2009

      • luks
        and all these should be independant
      • 2009-04-19 10948, 2009

      • Munger
      • 2009-04-19 10933, 2009

      • luks
        I'd say Jive
      • 2009-04-19 10917, 2009

      • Munger
        That's what I thought, but I saw the existing RE on http://musicbrainz.org/release/bf594062-27f5-4500… and suspect that should be changed as well. Barcode seems to concur
      • 2009-04-19 10939, 2009

      • aCiD2
        luks: hrm, actually i'd argue it is *more* testable. If you want to make sure the right cache keys are set, make a mock using 'with CacheAccessor' and a mock cache implementation (provide from/to_cache)
      • 2009-04-19 10951, 2009

      • aCiD2
        but I haven't tried, so I'm most likely talking nonsense :)
      • 2009-04-19 10911, 2009

      • luks
        aCiD2: how are you going to test the path of Artist::load which is loading directly from the database?
      • 2009-04-19 10926, 2009

      • symphonick has quit
      • 2009-04-19 10930, 2009

      • aCiD2
        Give a mock cache implementation that returns undef, so it won't use the cache?
      • 2009-04-19 10950, 2009

      • luks
        how do you give it a mock cache implementation?
      • 2009-04-19 10903, 2009

      • aCiD2
        oh right, heh
      • 2009-04-19 10916, 2009

      • aCiD2
        how do you do it in yours?
      • 2009-04-19 10924, 2009

      • luks
        it's easier to have Artist class which only works with the database
      • 2009-04-19 10927, 2009

      • luks
        no cache involved
      • 2009-04-19 10940, 2009

      • aCiD2
        Oh, well I wasn't sure where you added the caching layer
      • 2009-04-19 10945, 2009

      • luks
        then you have a subclass, which caches te requests
      • 2009-04-19 10958, 2009

      • luks
        *the
      • 2009-04-19 10914, 2009

      • aCiD2
        So we have 2 storage classes and an entity class for every entity?
      • 2009-04-19 10931, 2009

      • luks
        no, not every entity is cacheable
      • 2009-04-19 10956, 2009

      • aCiD2
        ah, right
      • 2009-04-19 10921, 2009

      • luks
        and the second caching wrappers will look like: package CachedEntity; extends 'Entity'; with 'CacheMixing';
      • 2009-04-19 10933, 2009

      • luks
        -g
      • 2009-04-19 10936, 2009

      • aCiD2
        Well it would be pretty easy to take the caching out of artist, seeing as it is all in a role anyway. but I need to do revision instead, bah
      • 2009-04-19 10939, 2009

      • Alan_New has quit
      • 2009-04-19 10952, 2009

      • ps3 joined the channel
      • 2009-04-19 10910, 2009

      • aCiD2 has quit
      • 2009-04-19 10929, 2009

      • Munger has quit
      • 2009-04-19 10934, 2009

      • bfirsh joined the channel
      • 2009-04-19 10938, 2009

      • bfirsh has quit
      • 2009-04-19 10939, 2009

      • chefkoch joined the channel
      • 2009-04-19 10920, 2009

      • chefkoch
        chefkoch is now known as chefkoch_AW
      • 2009-04-19 10901, 2009

      • bfirsh joined the channel
      • 2009-04-19 10903, 2009

      • Sargun has quit
      • 2009-04-19 10944, 2009

      • cooperaa joined the channel
      • 2009-04-19 10912, 2009

      • cooperaa
        good morning MB :)
      • 2009-04-19 10912, 2009

      • cooperaa
        everyone sleeping?
      • 2009-04-19 10905, 2009

      • nikki
        no
      • 2009-04-19 10942, 2009

      • cooperaa
        hi nikki!
      • 2009-04-19 10952, 2009

      • nikki
        hey
      • 2009-04-19 10918, 2009

      • cooperaa
        I'm doing a cool project on cd sales projections
      • 2009-04-19 10939, 2009

      • cooperaa
        and was hoping to get some suggestions from the MB folks :)
      • 2009-04-19 10953, 2009

      • nikki
        what sort of suggestions?
      • 2009-04-19 10912, 2009

      • cooperaa
        I'm looking for interesting factors which we think do or don't affect CD sales
      • 2009-04-19 10922, 2009

      • nikki
        the exchange rate
      • 2009-04-19 10931, 2009

      • nikki
        for me at least :P
      • 2009-04-19 10937, 2009

      • cooperaa
        :)
      • 2009-04-19 10947, 2009

      • cooperaa
        well I'm comparing things to Canadian CD sales... so I could do the US exchange rate
      • 2009-04-19 10958, 2009

      • cooperaa
        So far, I've got per capita income, iTunes sales, Mininova downloads
      • 2009-04-19 10925, 2009

      • cooperaa
        will be adding in Other Format sales (substitutes)
      • 2009-04-19 10952, 2009

      • nikki
        I wonder how places like amazon deal with the exchange rates for usa/canada... I mean, for british people they're not going to go look at .fr or .de for something cheaper 'cause they're not in english, and .com would involve quite slow/expensive shipping in comparison to .uk
      • 2009-04-19 10936, 2009

      • fuppp
        How do I get a list of albums? I tried using this query, but then I got a list that includes singles
      • 2009-04-19 10938, 2009

      • fuppp
        SELECT DISTINCT name FROM album WHERE artist IN(SELECT id FROM artist WHERE name='Britney Spears');
      • 2009-04-19 10925, 2009

      • FauxFaux
        There's a table which stores whether it's an album or a single.
      • 2009-04-19 10949, 2009

      • cooperaa
        fuppp: you'll probably want to add a condition for what type of album you want (I assume the ALBUM table is actually the table for all "releases
      • 2009-04-19 10955, 2009

      • luks
        WHERE 1 = ANY(attributes[2:4]) AND artist IN (...)
      • 2009-04-19 10913, 2009

      • nikki
        hey luks!
      • 2009-04-19 10918, 2009

      • luks
        hi
      • 2009-04-19 10953, 2009

      • nikki
        I was wondering about my question yesterday (selecting just one release event per album)... you mentioned doing subquery in the select or something... do you have any examples of those?
      • 2009-04-19 10949, 2009

      • fuppp
        ah thanks, seems like that works :)
      • 2009-04-19 10900, 2009

      • FauxFaux
        select (select date from release_events where album_id = album.album_id limit 1) as pony, album_id from album?
      • 2009-04-19 10916, 2009

      • FauxFaux goes to install the postgres connectivity tools so he can actually test stuff. ¬_¬
      • 2009-04-19 10922, 2009

      • nikki
        hmm
      • 2009-04-19 10936, 2009

      • Muz
        FauxFaux: what, PHPpgadmin?
      • 2009-04-19 10940, 2009

      • luks
        + ORDER BY releasedate
      • 2009-04-19 10945, 2009

      • luks
        but yes, that's the one
      • 2009-04-19 10957, 2009

      • FauxFaux
        Muz: s/php// yes. :p
      • 2009-04-19 10907, 2009

      • Muz
        Haha
      • 2009-04-19 10935, 2009

      • luks
        I've written some kind of aggregate function, where you can do SELECT id, min_2(releasedate, barcode), min_2(releasedate, label) FROM album, release GROUP BY album.id
      • 2009-04-19 10945, 2009

      • luks
        but I couldn't make it work with any data type
      • 2009-04-19 10911, 2009

      • nikki
        :o
      • 2009-04-19 10913, 2009

      • nikki
        it works :D
      • 2009-04-19 10920, 2009

      • nikki
        thanks luks and FauxFaux :D
      • 2009-04-19 10950, 2009

      • Munger joined the channel
      • 2009-04-19 10901, 2009

      • Munger
        join #macosx
      • 2009-04-19 10907, 2009

      • Munger
        Ooops
      • 2009-04-19 10938, 2009

      • cooperaa has quit
      • 2009-04-19 10922, 2009

      • czaanja joined the channel
      • 2009-04-19 10901, 2009

      • ps3 has quit
      • 2009-04-19 10952, 2009

      • bfirsh_ joined the channel
      • 2009-04-19 10910, 2009

      • bfirsh_ has quit
      • 2009-04-19 10938, 2009

      • bfirsh has quit
      • 2009-04-19 10958, 2009

      • czaanja has quit
      • 2009-04-19 10900, 2009

      • daq4th
        hm, what are the guidelines to add a compiltioan track with "artist1 presents artist2"? It is not like feature and it is not a collaboration ...