Ad
  • Default User Avatar

    Great kata!
    Any progress on the Ruby front? I started coding my solution without paying attention that Ruby was not in the list :-(

  • Custom User Avatar

    It looks like my ruby port of this kata is flawed; I'm going to pull it until I can figure out what's wrong. Thanks for the heads up.

  • Default User Avatar

    Thanks for the advice. I used parseInt() because base + (+cards[0] || 10) looks funny; I didn't realize it made a difference, but having read your other comments on this kata I will use Number() in situations like this in the future.

    BTW, it's friendly to give people reasons to do the things you tell them to do, or at least a link to something you consider a good explanation.

  • Custom User Avatar

    Hmmm. I starting writing a long rant about different ways of converting strings to numbers in JavaScript. I'll save you from reading all that. Especially since you seem familiar enough with JavaScript to know how inconsistent it is, already.

    Thanks for the link. The big floating-point problem was new to me.

    What is your opinion on parseFloat? It works like Number except for translating null to NaN and not to 0. And since you don't have the radix parameter, it's safe to use with map.

  • Custom User Avatar

    Thanks for the idea. I wasn't sure that unary plus returned NaN for non-numbers, but it seems it does. I still like that parseInt makes it very explicit that there is a conversion taking place, but I agree that the radix should be specified.

    I'll use unary + for a while and see how it feels. :-)

  • Default User Avatar

    I must have missed that the first time I read "JavaScript: The Good Parts". Thanks for reminding me.

  • Default User Avatar

    I actually did it like this. But I think who made this kata should make a test like the one you mentioned so that other users will fail when trying it.

  • Custom User Avatar

    The rules haven't changed. It seems that there is a bug causing data loss with denormalized data (increment/decrement changes). To be clear, the data is there, but we use nosql so we incrementally update denormalized copies of the points for efficiency. When your profile's points/ranks got rebuilt using normalized data they were properly adjusted.

    Fixing this so that everything is consistent and real-time accurate is my highest priority right now.

  • Custom User Avatar

    This is an interesting point, I think I'll make a second kata. Thanks!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    +1 for the unary remark. I never knew that.