From 01d71ca1d92feb6bda6860f9f643effc94ae555d Mon Sep 17 00:00:00 2001 From: Roger Turnau Date: Fri, 14 Aug 2015 16:29:16 -0400 Subject: [PATCH 1/5] Added improved instructions to Least Common Multiple Bonfire. --- seed/challenges/intermediate-bonfires.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index 954d402ce9..c47d55b9ef 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -547,7 +547,7 @@ "title": "Smallest Common Multiple", "difficulty": "2.11", "description": [ - "Find the smallest number that is evenly divisible by all numbers in the provided range.", + "Find the smallest number that is evenly divisible by all numbers in the provided range. In other words, given the range [3,7], you will need to find the least common multiple of 3, 4, 5, 6, and 7.", "The range will be an array of two numbers that will not necessarily be in numerical order.", "Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code." ], From fa454cfdd4c8cf69b44e5a609e5b7f2bfc9c1967 Mon Sep 17 00:00:00 2001 From: Isabell Long Date: Sat, 15 Aug 2015 19:53:04 +0100 Subject: [PATCH 2/5] Close a tag so that only actual code is marked - Fixes #1767, hopefully. --- seed/challenges/html5-and-css.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index d3a44025d5..36744e2f9c 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -538,7 +538,7 @@ "title": "Change the Font Size of an Element", "difficulty": 1.13, "description": [ - "Create a second p element with the following kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.", + "Create a second p element with the following kitty ipsum text: Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.", "Then, inside your <style> element, set the font-size of all p elements to 16 pixels.", "Font size is controlled by the font-size CSS attribute, like this: h1 { font-size: 30px; }.", "See if you can figure out how to give both of your p elements the font-size of 16 pixels (16px). You can do this inside the same <style> tag that we created for your red-text class." From 13b38aefb56e51c1af9bb4883aa0dd3bc87dff33 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 15 Aug 2015 12:19:36 -0700 Subject: [PATCH 3/5] add random attribute to user props Allows easier random sampling --- common/models/user.js | 7 ++++++- common/models/user.json | 4 ++++ seed/loopbackMigration.js | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common/models/user.js b/common/models/user.js index 8f79fe6b75..7bcef4ae38 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -7,7 +7,7 @@ import { saveUser, observeMethod } from '../../server/utils/rx'; import { blacklistedUsernames } from '../../server/utils/constants'; const debug = debugFactory('freecc:user:remote'); -const BROWNIEPOINTS_TIMEOUT = [30, 'seconds']; +const BROWNIEPOINTS_TIMEOUT = [1, 'hour']; function getAboutProfile({ username, @@ -35,6 +35,11 @@ module.exports = function(User) { delete User.validations.email; // set salt factor for passwords User.settings.saltWorkFactor = 5; + // set user.rand to random number + User.definition.rawProperties.updated.default = + User.definition.properties.updated.default = function() { + return Math.random(); + }; // username should not be in blacklist User.validatesExclusionOf('username', { diff --git a/common/models/user.json b/common/models/user.json index aaaf610d07..62883cf976 100644 --- a/common/models/user.json +++ b/common/models/user.json @@ -152,6 +152,10 @@ } ], "default": [] + }, + "rand": { + "type": "number", + "index": true } }, "validations": [], diff --git a/seed/loopbackMigration.js b/seed/loopbackMigration.js index ab86785b34..a06eea83c1 100644 --- a/seed/loopbackMigration.js +++ b/seed/loopbackMigration.js @@ -124,6 +124,7 @@ var users = dbObservable user[provider + 'id'] = user[provider]; user[provider] = null; }); + user.rand = Math.random(); return user; }) From 129eebcc418886d7034a0f5845e676ef436f639f Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 15 Aug 2015 12:28:19 -0700 Subject: [PATCH 4/5] fix type should be rand not updated --- common/models/user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/models/user.js b/common/models/user.js index 7bcef4ae38..c51709a406 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -36,8 +36,8 @@ module.exports = function(User) { // set salt factor for passwords User.settings.saltWorkFactor = 5; // set user.rand to random number - User.definition.rawProperties.updated.default = - User.definition.properties.updated.default = function() { + User.definition.rawProperties.rand.default = + User.definition.properties.rand.default = function() { return Math.random(); }; From 38ceeee635006f29a21d80d382f3605373445df6 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 15 Aug 2015 14:04:01 -0700 Subject: [PATCH 5/5] Update intermediate-bonfires.json --- seed/challenges/intermediate-bonfires.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index c47d55b9ef..10c1c35bcf 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -547,7 +547,8 @@ "title": "Smallest Common Multiple", "difficulty": "2.11", "description": [ - "Find the smallest number that is evenly divisible by all numbers in the provided range. In other words, given the range [3,7], you will need to find the least common multiple of 3, 4, 5, 6, and 7.", + "Find the smallest number that is evenly divisible by all numbers in the provided range.", + "In other words, given the range [3,7], you will need to find the least common multiple of 3, 4, 5, 6, and 7.", "The range will be an array of two numbers that will not necessarily be in numerical order.", "Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code." ],