{"action":"created","issue":{"url":"https://api.github.com/repos/timoxley/functional-javascript-workshop/issues/191","repository_url":"https://api.github.com/repos/timoxley/functional-javascript-workshop","labels_url":"https://api.github.com/repos/timoxley/functional-javascript-workshop/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/timoxley/functional-javascript-workshop/issues/191/comments","events_url":"https://api.github.com/repos/timoxley/functional-javascript-workshop/issues/191/events","html_url":"https://github.com/timoxley/functional-javascript-workshop/issues/191","id":308389714,"number":191,"title":"Replace npm package dependency sprintf -> sprintf-js","user":{"login":"todd-dsm","id":2463935,"avatar_url":"https://avatars0.githubusercontent.com/u/2463935?v=4","gravatar_id":"","url":"https://api.github.com/users/todd-dsm","html_url":"https://github.com/todd-dsm","followers_url":"https://api.github.com/users/todd-dsm/followers","following_url":"https://api.github.com/users/todd-dsm/following{/other_user}","gists_url":"https://api.github.com/users/todd-dsm/gists{/gist_id}","starred_url":"https://api.github.com/users/todd-dsm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todd-dsm/subscriptions","organizations_url":"https://api.github.com/users/todd-dsm/orgs","repos_url":"https://api.github.com/users/todd-dsm/repos","events_url":"https://api.github.com/users/todd-dsm/events{/privacy}","received_events_url":"https://api.github.com/users/todd-dsm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-25T21:56:10Z","updated_at":"2018-04-11T19:34:29Z","closed_at":null,"author_association":"NONE","body":"npm complained on the install:\r\n\r\n```bash\r\n$ npm install -g functional-javascript-workshop@latest\r\nnpm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in favor of sprintf-js.\r\n/usr/local/bin/functional-javascript -> /usr/local/lib/node_modules/functional-javascript-workshop/functional-javascript.js\r\n/usr/local/bin/functional-javascript-workshop -> /usr/local/lib/node_modules/functional-javascript-workshop/functional-javascript.js\r\n+ functional-javascript-workshop@1.0.6\r\nadded 68 packages from 30 contributors in 3.289s\r\n```\r\n\r\nWe'll know shortly if this is a technical complaint and everything still works - or not. "},"comment":{"url":"https://api.github.com/repos/timoxley/functional-javascript-workshop/issues/comments/380570362","html_url":"https://github.com/timoxley/functional-javascript-workshop/issues/191#issuecomment-380570362","issue_url":"https://api.github.com/repos/timoxley/functional-javascript-workshop/issues/191","id":380570362,"user":{"login":"RavenHursT","id":496983,"avatar_url":"https://avatars3.githubusercontent.com/u/496983?v=4","gravatar_id":"","url":"https://api.github.com/users/RavenHursT","html_url":"https://github.com/RavenHursT","followers_url":"https://api.github.com/users/RavenHursT/followers","following_url":"https://api.github.com/users/RavenHursT/following{/other_user}","gists_url":"https://api.github.com/users/RavenHursT/gists{/gist_id}","starred_url":"https://api.github.com/users/RavenHursT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RavenHursT/subscriptions","organizations_url":"https://api.github.com/users/RavenHursT/orgs","repos_url":"https://api.github.com/users/RavenHursT/repos","events_url":"https://api.github.com/users/RavenHursT/events{/privacy}","received_events_url":"https://api.github.com/users/RavenHursT/received_events","type":"User","site_admin":false},"created_at":"2018-04-11T19:34:29Z","updated_at":"2018-04-11T19:34:29Z","author_association":"NONE","body":"I can't get through Exercise 8(Call):\r\n\r\n```\r\n$ fjs run 8.js\r\n/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:163\r\n\t\t\t\t\tthrow new Error(sprintf('[sprintf] expecting number but found %s \"' + arg + '\"', get_type(arg)));\r\n\t\t\t\t\t^\r\n\r\nError: [sprintf] expecting number but found undefined \"undefined\"\r\n    at str_format.format (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:163:12)\r\n    at str_format (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:77:28)\r\n    at Object.vsprintf (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:244:17)\r\n    at _defaultTranslation (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/node_modules/i18n-core/index.js:28:15)\r\n    at Object.defaultTranslation (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/node_modules/i18n-core/index.js:34:9)\r\n    at Object.__ (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/node_modules/i18n-core/lib/createTranslator.js:30:15)\r\n    at /usr/local/lib/node_modules/functional-javascript-workshop/exercises/basic_call/exercise.js:56:19\r\n    at obtainResult (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:100:21)\r\n    at Exercise.<anonymous> (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:66:27)\r\n    at next (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/exercise.js:188:19)\r\n```\r\n\r\nI've set up an alias for `functional-javascript`.  \r\n\r\nWhat's odd.. is that once I run this.. all the rest of my previous exercises stop working as well:\r\n```\r\n$ fjs run 7.js\r\n/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:163\r\n\t\t\t\t\tthrow new Error(sprintf('[sprintf] expecting number but found %s \"' + arg + '\"', get_type(arg)));\r\n\t\t\t\t\t^\r\n\r\nError: [sprintf] expecting number but found undefined \"undefined\"\r\n    at str_format.format (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:163:12)\r\n    at str_format (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:77:28)\r\n    at Object.vsprintf (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/sprintf/lib/sprintf.js:244:17)\r\n    at _defaultTranslation (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/node_modules/i18n-core/index.js:28:15)\r\n    at Object.defaultTranslation (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/node_modules/i18n-core/index.js:34:9)\r\n    at Object.__ (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/node_modules/i18n-core/lib/createTranslator.js:30:15)\r\n    at /usr/local/lib/node_modules/functional-javascript-workshop/exercises/basic_call/exercise.js:56:19\r\n    at obtainResult (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:100:21)\r\n    at Exercise.<anonymous> (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:66:27)\r\n    at next (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/exercise.js:188:19)\r\n\r\n$ fjs run 6.js\r\n/Users/matthewmarcus/dev/functional-js/6.js:2\r\n  return inputWords.reduce((agg, word) => {\r\n                    ^\r\n\r\nTypeError: inputWords.reduce is not a function\r\n    at countWords (/Users/matthewmarcus/dev/functional-js/6.js:2:21)\r\n    at /usr/local/lib/node_modules/functional-javascript-workshop/exercises/basic_call/exercise.js:56:44\r\n    at obtainResult (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:100:21)\r\n    at Exercise.<anonymous> (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:66:27)\r\n    at next (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/exercise.js:188:19)\r\n    at /usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/exercise.js:195:7\r\n    at Exercise.<anonymous> (/usr/local/lib/node_modules/functional-javascript-workshop/exercises/runner.js:34:5)\r\n    at next (/usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/exercise.js:188:19)\r\n    at /usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/exercise.js:195:7\r\n    at /usr/local/lib/node_modules/functional-javascript-workshop/node_modules/workshopper-exercise/execute.js:110:7\r\n```\r\n\r\nIf I run `functional-javascript-workshop` again, and \"go back\" to the 7th test.. it works again :/\r\n\r\n```\r\n$ fjsws\r\n\r\n\r\n    FUNCTIONAL JAVASCRIPT IS GOOD\r\n    Select an exercise and hit Enter to begin\r\n    ─────────────────────────────────────────────────────────────────\r\n    » Hello World                                [COMPLETED]\r\n    » Higher Order Functions                     [COMPLETED]\r\n    » Basic: Map                                 [COMPLETED]\r\n    » Basic: Filter                              [COMPLETED]\r\n    » Basic: Every Some                          [COMPLETED]\r\n    » Basic: Reduce                              [COMPLETED]\r\n    » Basic: Recursion                           [COMPLETED]\r\n    » Basic: Call\r\n    » Partial Application without Bind\r\n    » Partial Application with Bind\r\n    » Implement Map with Reduce\r\n    » Function Spies\r\n    » Blocking Event Loop\r\n    » Trampoline\r\n    » Async Loops\r\n    » Recursion\r\n    » Currying\r\n    » Function Call\r\n    ─────────────────────────────────────────────────────────────────\r\n    HELP\r\n    CHOOSE LANGUAGE\r\n    EXIT\r\n\r\n\r\n FUNCTIONAL JAVASCRIPT IS GOOD\r\n───────────────────────────────\r\n Basic: Recursion\r\n Exercise 7 of 18\r\n\r\nRecursion is a fundamental programming concept which can lead to elegant and efficient solutions to algorithmic problems. In fact, recursion is so powerful, all iterating behaviour can be defined using recursive functions. You will find recursion indispensable when iterating over nested data structures.\r\n\r\nA recursive function is a function which calls itself. For example, this recursive function will take an array of words, and return an array of those words, uppercased.\r\n\r\n    function toUpperArray(items) {\r\n       if (!items.length) return []             // end condition\r\n       var head = items[0]                      // item to operate on\r\n       head = head.toUpperCase()                // perform action\r\n       var tail = items.slice(1)                // next\r\n       return [head].concat(toUpperArray(tail)) // recursive step\r\n    }\r\n\r\n    toUpperArray(['hello', 'world']) // => ['HELLO', 'WORLD']\r\n\r\nThe point of this exercise is to familiarise yourself with recursion by implementing a familiar interface using a recursive function.\r\n\r\n# Task\r\n\r\nImplement Array#reduce using recursion.\r\n\r\nTo test your reduction works correctly we will use your reduce implementation to execute our solution to the previous basic_reduce problem. i.e. your reduce function will be passed an array of words, and a function, and an initial value which will return an object containing the counts for each word found in the array. You don't need to implement this functionality, it will be supplied to your reduce implementation.\r\n\r\nFor simplicity, your implementation of reduce need not replicate the behaviour of a reduce missing an initial value. You may assume the initial value will always be supplied.\r\n\r\n## Arguments\r\n\r\n  * arr: An Array to reduce over\r\n  * fn: Function to use as the reduction step. Like regular Array#reduce, this function must be passed previousValue, currentValue, index and the array we're iterating over.\r\n  * init: Initial value of the reduction. Unlike Array#reduce, this value is required (and you may assume it will always be supplied).\r\n\r\n## Example\r\n\r\n    // Your reduce function should behave the same as a\r\n    // regular Array#reduce, but it will take the array\r\n    // to operate on as the first argument:\r\n\r\n    reduce([1,2,3], function(prev, curr, index, arr) {\r\n      return prev + curr\r\n    }, 0)\r\n    // => 6\r\n\r\n## Conditions\r\n\r\n  * Do not use any for/while loops.\r\n  * Do not use any Array methods like Array#map or Array#reduce.\r\n\r\n## Resources\r\n\r\n  * https://en.wikipedia.org/wiki/Recursion\r\n  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce\r\n\r\n## Boilerplate\r\n\r\n    function reduce(arr, fn, initial) {\r\n      // SOLUTION GOES HERE\r\n    }\r\n\r\n    module.exports = reduce\r\n\r\n\r\n » To print these instructions again, run: functional-javascript print\r\n » To execute your program in a test environment, run: functional-javascript run program.js\r\n » To verify your program, run: functional-javascript verify program.js\r\n » For help run: functional-javascript help\r\n\r\n\r\n$ fjs run 7.js\r\ninput:      [ 'laboris', 'deserunt', 'id', 'culpa', 'id', 'eiusmod', 'aliquip', 'do', 'cillum', 'qui', 'proident', 'velit', 'duis', 'dolore', 'deserunt', 'pariatur', 'lorem', 'enim', 'exercitation', 'enim', 'reprehenderit', 'non', 'consectetur', 'commodo', 'cillum', 'duis', 'magna', 'velit', 'officia', 'do', 'eiusmod', 'quis', 'dolor', 'fugiat', 'deserunt', 'aliqua', 'dolor', 'ea', 'irure', 'occaecat', 'deserunt', 'dolore', 'veniam', 'in' ]\r\nsubmission: { laboris: 1, deserunt: 4, id: 2, culpa: 1, eiusmod: 2, aliquip: 1, do: 2, cillum: 2, qui: 1, proident: 1, velit: 2, duis: 2, dolore: 2, pariatur: 1, lorem: 1, enim: 2, exercitation: 1, reprehenderit: 1, non: 1, consectetur: 1, commodo: 1, magna: 1, officia: 1, quis: 1, dolor: 2, fugiat: 1, aliqua: 1, ea: 1, irure: 1, occaecat: 1, veniam: 1, in: 1 }\r\n```\r\n\r\nSomething's most definitely broken w/ this package...."}}
{"actor":{"display_login":"RavenHursT"}}