#metabrainz

/

      • stanislas
        LordSputnik: How can I do "each val, key in d " in JS ? How would d be formatted ? https://github.com/bookbrainz/bookbrainz-site/blo…
      • 2016-01-25 02541, 2016

      • stanislas
        If JS have similiar syntax as C, I don't expect it to work like this.
      • 2016-01-25 02528, 2016

      • opatel99 joined the channel
      • 2016-01-25 02543, 2016

      • stanislas
        Hi opatel99 :)
      • 2016-01-25 02549, 2016

      • opatel99
        stanislas: Hey
      • 2016-01-25 02509, 2016

      • opatel99
        How's your React proj going?
      • 2016-01-25 02527, 2016

      • stanislas
        definitely final stage
      • 2016-01-25 02513, 2016

      • stanislas
        opatel99: Are you doing any more tasks ?
      • 2016-01-25 02516, 2016

      • LordSputnik
        stanislas: "npm run-script debug" runs the server, you'll want to navigate to the web page at whatever port it tells you it's using
      • 2016-01-25 02527, 2016

      • opatel99
        Just the review.
      • 2016-01-25 02534, 2016

      • stanislas
        good luck
      • 2016-01-25 02544, 2016

      • stanislas
        LordSputnik: Ok, I will do that after solving npm test issues
      • 2016-01-25 02532, 2016

      • LordSputnik
        stanislas: in JS, you can do "for(let key in object) { ... }" while will iterate over the keys
      • 2016-01-25 02500, 2016

      • LordSputnik
        *which will
      • 2016-01-25 02509, 2016

      • LordSputnik
        that each syntax is jade-specific
      • 2016-01-25 02553, 2016

      • opatel99
        I haven't had much of a chance these last few days... school and stuff.
      • 2016-01-25 02509, 2016

      • stanislas
        Assuming that I've a list of tuples ?
      • 2016-01-25 02535, 2016

      • stanislas
        I would do for(let tuple in list) {for (let tuple_element in tuple) {do_sth}} ?
      • 2016-01-25 02558, 2016

      • legoktm[NE] is now known as legoktm
      • 2016-01-25 02524, 2016

      • LordSputnik
        stanislas: no such thing as a tuple in JS
      • 2016-01-25 02533, 2016

      • stanislas
        just lists ?
      • 2016-01-25 02536, 2016

      • LordSputnik
        stanislas: what are you iterating over?
      • 2016-01-25 02538, 2016

      • LordSputnik
        yeah
      • 2016-01-25 02548, 2016

      • stanislas
      • 2016-01-25 02511, 2016

      • LordSputnik
        OK, so diff is a list of dictionaries
      • 2016-01-25 02544, 2016

      • LordSputnik
        So you can do diff.forEach((d) => {for(let key in d) { ... } })
      • 2016-01-25 02517, 2016

      • LordSputnik
        (or perhaps diff.map would be better if you're constructing a list of table rows)
      • 2016-01-25 02516, 2016

      • opatel99
        LordSputnik: Is there anything I can work on?
      • 2016-01-25 02546, 2016

      • stanislas
        d is a list consisting of old value and new value ?
      • 2016-01-25 02511, 2016

      • LordSputnik
        d is the dictionary (see https://bookbrainz.org/ws/revision/1/)
      • 2016-01-25 02535, 2016

      • LordSputnik
        opatel99: Well, porting jade pages is one thing on the list
      • 2016-01-25 02526, 2016

      • LordSputnik
        And we haven't had material UI tested out
      • 2016-01-25 02536, 2016

      • Nyanko-sensei has quit
      • 2016-01-25 02536, 2016

      • LordSputnik
        and also the deprecated relationships thing needs doing
      • 2016-01-25 02503, 2016

      • D4RK-PH0ENiX joined the channel
      • 2016-01-25 02539, 2016

      • stanislas
        LordSputnik: That is entirely different format then Jade is using. In revision.jade there is only old_value and new_value, right >
      • 2016-01-25 02528, 2016

      • LordSputnik
        Here's what I've got on the list for BB for now: https://trello.com/b/8gc7Rr8X/ben-s-todo and here's the (slightly out of date) long-term plan: https://gist.github.com/LordSputnik/05711e49f4d88…
      • 2016-01-25 02531, 2016

      • LordSputnik
        opatel99: ^
      • 2016-01-25 02515, 2016

      • LordSputnik
        stanislas: for each element in the dict, there is a list (or null). the list will contain two elements - one for the old value, and one for the new value
      • 2016-01-25 02522, 2016

      • LordSputnik
        so diff is [{'property': [old_value, new_value], 'other_property': [old_value, new_value]}]
      • 2016-01-25 02532, 2016

      • D4RK-PH0ENiX has quit
      • 2016-01-25 02536, 2016

      • LordSputnik
        stanislas: hmm actually, I think I might know what you mean
      • 2016-01-25 02540, 2016

      • stanislas
        LordSputnik: Ok, that's better. You've posted a link to some revision from ws. I thought revision would be equal to this.
      • 2016-01-25 02527, 2016

      • LordSputnik
        stanislas: so ignore what I just said, the revision property *isn't* straight from the WS
      • 2016-01-25 02542, 2016

      • LordSputnik
      • 2016-01-25 02519, 2016

      • LordSputnik
        so you can assume that old_value and new_value will always be primitive types
      • 2016-01-25 02525, 2016

      • Lingo joined the channel
      • 2016-01-25 02533, 2016

      • stanislas
        Ok. I have no idea now. See https://gist.github.com/stasszczesniak/43f89a9388… for my current code. It will tell you what I think now.
      • 2016-01-25 02516, 2016

      • Lingo has quit
      • 2016-01-25 02520, 2016

      • stanislas
        LordSputnik: ^
      • 2016-01-25 02527, 2016

      • opatel99
        You can combine !(oldValue && (oldValue.length > 0)) && !(newValue && (newValue.length > 0))
      • 2016-01-25 02537, 2016

      • LordSputnik
        stanislas: this is the sort of thing you're dealing with: https://gist.github.com/LordSputnik/8d21d92065cf8…
      • 2016-01-25 02556, 2016

      • opatel99
        De Morgan's Law states that
      • 2016-01-25 02531, 2016

      • LordSputnik
        opatel99: nope, not really
      • 2016-01-25 02538, 2016

      • opatel99
        why not?
      • 2016-01-25 02504, 2016

      • LordSputnik
        opatel99: well, you could, but it wouldn't gain you much, I think
      • 2016-01-25 02526, 2016

      • stanislas
        Ok, do you think much work is required still ?
      • 2016-01-25 02542, 2016

      • LordSputnik
        stanislas: shouldn't be, maybe an hour?
      • 2016-01-25 02516, 2016

      • LordSputnik
        firstly, you don't need get_values_from(list)
      • 2016-01-25 02527, 2016

      • stanislas
        LordSputnik: I am waking up in less than 5 hours
      • 2016-01-25 02545, 2016

      • stanislas
        LordSputnik: I've already deleted that.
      • 2016-01-25 02511, 2016

      • LordSputnik
        stanislas: you've got school tomorrow and won't have time to finish it tomorrow before the task submission deadline?
      • 2016-01-25 02550, 2016

      • stanislas
        LordSputnik: Yep :(
      • 2016-01-25 02557, 2016

      • D4RK-PH0ENiX joined the channel
      • 2016-01-25 02501, 2016

      • LordSputnik
        OK, and on what was line 75, you don't need for(d in diff) - and you can get val[0] and val[1] as d[key][0] and d[key][1]
      • 2016-01-25 02503, 2016

      • stanislas
        LordSputnik: I will try to do that for let's say 30 more minutes
      • 2016-01-25 02507, 2016

      • stanislas
        Than I am done
      • 2016-01-25 02520, 2016

      • LordSputnik
        stanislas: well, I have until Wednesday to approve it
      • 2016-01-25 02538, 2016

      • LordSputnik
        So you could always submit what you have, and then I can approve it when it works ;)
      • 2016-01-25 02507, 2016

      • stanislas
        That would be great.
      • 2016-01-25 02516, 2016

      • stanislas
        Let me work on it for a moment.
      • 2016-01-25 02531, 2016

      • stanislas
        and we will see if it'd be needed
      • 2016-01-25 02519, 2016

      • opatel99
        LordSputnik: BookBrainz's mission is to be the most expansive and reliable source of text information and to make that information accessible to everybody.
      • 2016-01-25 02513, 2016

      • stanislas
        It's completed https://gist.github.com/stasszczesniak/7c74e5bb0a… but npm tests gives 24 errors
      • 2016-01-25 02526, 2016

      • LordSputnik
        opatel99: I'd say the meaning of "text" is ambiguous there
      • 2016-01-25 02556, 2016

      • LordSputnik
        opatel99: it could mean "information about texts" (right) or "textual information" (definitely not right)
      • 2016-01-25 02536, 2016

      • LordSputnik
        stanislas: that looks much better
      • 2016-01-25 02548, 2016

      • opatel99
        reliable source of information regarding ... (Can one word define it all?)
      • 2016-01-25 02550, 2016

      • LordSputnik
        stanislas: easy to fix errors?
      • 2016-01-25 02559, 2016

      • LordSputnik
        opatel99: literature
      • 2016-01-25 02539, 2016

      • opatel99
        BookBrainz's mission is to be the most expansive and reliable source of literary information and to make that information accessible to everybody.
      • 2016-01-25 02544, 2016

      • stanislas
      • 2016-01-25 02503, 2016

      • stanislas
        I am curious about the 4th one
      • 2016-01-25 02524, 2016

      • LordSputnik
        stanislas: ahhh
      • 2016-01-25 02549, 2016

      • LordSputnik
        So if you do "if() { return... } else ... " the else is redundant
      • 2016-01-25 02517, 2016

      • LordSputnik
        Because if it enters the if, it's going to return, so the code after the if will not get executed (which is the reason for having an else)
      • 2016-01-25 02521, 2016

      • stanislas
        It is, but it makes code clearer.
      • 2016-01-25 02533, 2016

      • LordSputnik
        stanislas: that's a matter of opinion :P
      • 2016-01-25 02544, 2016

      • LordSputnik
        (which is all coding conventions are)
      • 2016-01-25 02518, 2016

      • LordSputnik
        In this case we've decided (or I've decided and Leftmost and Leo_Verto haven't noticed yet), that we shouldn't have if... return... else
      • 2016-01-25 02542, 2016

      • LordSputnik
      • 2016-01-25 02506, 2016

      • LordSputnik
        I mainly like it because it's more concise and gets rid of unnecessary code, which is generally a good thing
      • 2016-01-25 02511, 2016

      • Leo_Verto
        I think I agree with you
      • 2016-01-25 02550, 2016

      • LordSputnik
        opatel99: that's a good start. Take a look at http://www.idealist.org/info/Nonprofits/Gov1 and https://en.wikipedia.org/wiki/Mission_statement and google around a bit to get an idea of what else to put in it
      • 2016-01-25 02513, 2016

      • LordSputnik
        Ideally we want about a paragraph, summarising a few key things which mission statements apparently generally have :P
      • 2016-01-25 02538, 2016

      • stanislas
        LordSputnik: And the first one ?
      • 2016-01-25 02525, 2016

      • LordSputnik
        stanislas: it's saying you're missing a 'use strict' in a function, or you've got one globally
      • 2016-01-25 02541, 2016

      • LordSputnik
        We can't have it global in the .jsx files because browsers don't like that
      • 2016-01-25 02528, 2016

      • stanislas
        Ok, got it.
      • 2016-01-25 02532, 2016

      • stanislas
        21 errors left
      • 2016-01-25 02547, 2016

      • stanislas
        19
      • 2016-01-25 02501, 2016

      • stanislas
        15
      • 2016-01-25 02517, 2016

      • stanislas
        12
      • 2016-01-25 02515, 2016

      • stanislas
        What's Unexpected string concatenation ?
      • 2016-01-25 02515, 2016

      • LordSputnik
        stanislas: in ES6 (new version of JS), you can replace 'string' + variable + 'string' with `string ${variable} string`
      • 2016-01-25 02520, 2016

      • stanislas
        and The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype ?
      • 2016-01-25 02536, 2016

      • LordSputnik
        Similar to string formatting in Python
      • 2016-01-25 02545, 2016

      • LordSputnik
        wrap the bit inside the for with if (obj.hasOwnProperty(prop)) { ... }
      • 2016-01-25 02504, 2016

      • LordSputnik
        That ensures that you're only looping on the properties defined in the object, and not any it may have inherited
      • 2016-01-25 02554, 2016

      • stanislas
        wow, 0
      • 2016-01-25 02532, 2016

      • LordSputnik
        \o/
      • 2016-01-25 02547, 2016

      • stanislas
      • 2016-01-25 02558, 2016

      • stanislas
        after running the thing you talked about
      • 2016-01-25 02513, 2016

      • stanislas
        npm run-script debug
      • 2016-01-25 02552, 2016

      • stanislas
        I am telling you. "Tell the author that this fails on your system: npm ERR! DEBUG=bbsite node ./scripts/www"
      • 2016-01-25 02514, 2016

      • LordSputnik
        stanislas: ermmm OK, and what happens if you do "DEBUG=bbsite node ./scripts/www"
      • 2016-01-25 02523, 2016

      • stanislas
        where ?
      • 2016-01-25 02526, 2016

      • stanislas
        in bash ?
      • 2016-01-25 02531, 2016

      • stanislas
        in some config file
      • 2016-01-25 02532, 2016

      • stanislas
        ?
      • 2016-01-25 02535, 2016

      • LordSputnik
        Hmm, what platform are you using?
      • 2016-01-25 02541, 2016

      • LordSputnik
        (OS)
      • 2016-01-25 02544, 2016

      • stanislas
        debian
      • 2016-01-25 02505, 2016

      • LordSputnik
        Oh, no, it's nothing to do with that
      • 2016-01-25 02524, 2016

      • LordSputnik
        Copy config/development.json.example to config/development.json
      • 2016-01-25 02516, 2016

      • stanislas
        seems better
      • 2016-01-25 02540, 2016

      • stanislas
        Should I route it somehow now ?
      • 2016-01-25 02558, 2016

      • stanislas
        It doesn't matter how long I will sleep now really. The only thing that matters is which energy drink I am going to buy :)
      • 2016-01-25 02511, 2016

      • Lingo joined the channel
      • 2016-01-25 02524, 2016

      • LordSputnik
        stanislas: you should sleep, we can fix this tomorrow evening or something
      • 2016-01-25 02530, 2016

      • LordSputnik
        I have to go soon too
      • 2016-01-25 02533, 2016

      • LordSputnik
        the routing is pretty similar to https://github.com/bookbrainz/bookbrainz-site/blo… though
      • 2016-01-25 02535, 2016

      • stanislas
        I've even routed it.
      • 2016-01-25 02539, 2016

      • stanislas
        Just now
      • 2016-01-25 02541, 2016

      • LordSputnik
        Just with props
      • 2016-01-25 02546, 2016

      • stanislas
        you mean RevisionPage(props)
      • 2016-01-25 02547, 2016

      • stanislas
        ?
      • 2016-01-25 02554, 2016

      • LordSputnik
        stanislas: yeah
      • 2016-01-25 02510, 2016

      • stanislas
        and now ?
      • 2016-01-25 02537, 2016

      • stanislas
        Ok. Let's do it tomorrow.
      • 2016-01-25 02540, 2016

      • Lingo has quit
      • 2016-01-25 02553, 2016

      • stanislas
        No point in hurrying with it.
      • 2016-01-25 02508, 2016

      • stanislas
        Should I submit the task ?
      • 2016-01-25 02530, 2016

      • stanislas
        (No point for me, if we could continue doing it tomorrow)
      • 2016-01-25 02517, 2016

      • LordSputnik
        stanislas: will you have time to submit before 5:00 PM UTC tomorrow?
      • 2016-01-25 02529, 2016

      • stanislas
        my internet suddenly stopped working, sorry
      • 2016-01-25 02536, 2016

      • stanislas
        I am using my neighbour's now
      • 2016-01-25 02550, 2016

      • stanislas
        I can be home at 14:00 UTC+1
      • 2016-01-25 02555, 2016

      • stanislas
        So that's 13:00 UTC
      • 2016-01-25 02501, 2016

      • stanislas
        If I go out earlier from school