These are chat archives for FreeCodeCamp/Help

2nd
Sep 2018
Karma Drukpa
@coderkarma
Sep 02 2018 01:39
let myString = "freeCodeCamp";
let fccRegex = /freeCodeCamp/i; 
let result = fccRegex.test(myString);
why this is not working
Aditya
@ezioda004
Sep 02 2018 01:42
@coderkarma You're matching "myStringg" to "freeCodeCamp"
Bjorn van de Peut
@bjorno43
Sep 02 2018 01:43
@ezioda004 It's not yours, it's mine!
Kyle Holm
@thekholm80
Sep 02 2018 01:43
that's a lot of 'g's
Karma Drukpa
@coderkarma
Sep 02 2018 01:44
thanks
Kyle Holm
@thekholm80
Sep 02 2018 01:44
i never did figure out how to use variables in regex, so i always use the method RegExp(variable, flag) lol
Bjorn van de Peut
@bjorno43
Sep 02 2018 01:44
@thekholm80 Congratulate me
Kyle Holm
@thekholm80
Sep 02 2018 01:44
@bjorno43 congrats
Bjorn van de Peut
@bjorno43
Sep 02 2018 01:44
I got bobsbotty gitter banned..
Kyle Holm
@thekholm80
Sep 02 2018 01:44
the world hates PHP bots, bob
Aditya
@ezioda004
Sep 02 2018 01:44
Tbf he had it coming
Bjorn van de Peut
@bjorno43
Sep 02 2018 01:44
:joy:
Kyle Holm
@thekholm80
Sep 02 2018 01:45
i figure 3 or 4 more and you'll realize it
Bjorn van de Peut
@bjorno43
Sep 02 2018 01:45
There was an error with the Gitter API implementation I'm using. So while debugging, I forgot to change its messages. That triggered the spam ban xD
If you repeat the same message enough times, even with plenty of time between them, it'll trigger a spam ban xD
Kyle Holm
@thekholm80
Sep 02 2018 01:48
well, back to the drawing board
brb signing up for @bobsbot2, @bobsbot3, @bobsbotty2, etc
Bjorn van de Peut
@bjorno43
Sep 02 2018 01:49
Whaha nah. Gitter will probably unban it soon
Kyle Holm
@thekholm80
Sep 02 2018 01:50
Dear Bob,
We will unban this account if you re-write your bot in a real language.
  • Gitter Dev Team
Aditya
@ezioda004
Sep 02 2018 01:52
@thekholm80 harry your a wizard
Kyle Holm
@thekholm80
Sep 02 2018 01:53
@ezioda004 rofl that's awesome
Karma Drukpa
@coderkarma
Sep 02 2018 01:58
let extractStr = "Extract the word 'coding' from this string.";
let codingRegex = extractStr.match(/coding/);
let result = codingRegex;
what is wrong her? I should get str "coding" as matching output?
Kyle Holm
@thekholm80
Sep 02 2018 02:01
match() returns an array, is that what you want? should you be pulling an element from that array?
Aditya
@ezioda004
Sep 02 2018 02:03
codingRegex should be just be the regex.
result should be extractStr.match()
Karma Drukpa
@coderkarma
Sep 02 2018 02:04
oh!! thanks
Manish Giri
@Manish-Giri
Sep 02 2018 02:24
@thekholm80 i'm getting the feeling this is about to blow up...spectacularly.
:boom:
Kyle Holm
@thekholm80
Sep 02 2018 02:35
@Manish-Giri there will be pieces of mac book shrapnel all over your apartment
Kyle Holm
@thekholm80
Sep 02 2018 03:07
yo dog, i heard you like for() loops. so i put some for() loops in your for() loops so you can loop while you loop
Manish Giri
@Manish-Giri
Sep 02 2018 03:14
yea
pretty much
John
@taloloy18
Sep 02 2018 03:53
Hi
Whose online
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:06
I am
let exampleStr = "Let's have fun with regular expressions!";
let unRegex = /.un/; // Change this line
let result = exampleStr.test(unRegex);
not getting it to work.
Aditya
@ezioda004
Sep 02 2018 04:19
let result = unRegex.test(exampleStr);
Manish Giri
@Manish-Giri
Sep 02 2018 04:20
@coderkarma you needed to change only that line marked with the comment
and your regex is fine
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:20
^ test() is a regex function. It's not a method of String
Karma Drukpa
@coderkarma
Sep 02 2018 04:22
oh my god, I just getting confused regular expression. but thanks aditya
let exampleStr = "Let's have fun with regular expressions!";
let unRegex = /.un/; // Change this line
let result = exampleStr.match(unRegex);
what if i do match?
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:26
That works, because match() is a String method. So basicly you're turning it around
Karma Drukpa
@coderkarma
Sep 02 2018 04:27
@bjorno43 cool
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:32
I just had an interesting issue to solve
Given an HTML string, remove all elements matching certain tagnames, but preserve their contents
Karma Drukpa
@coderkarma
Sep 02 2018 04:34
how would you do that?
psyperl
@psyperl
Sep 02 2018 04:34
textedit?
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:35
First you need to parse the HTML as a DOM document. Then you need to starting looping through it. Copy contents of elements to remove to their parents, then remove the element
psyperl
@psyperl
Sep 02 2018 04:35
why not just regex it
Aditya
@ezioda004
Sep 02 2018 04:36
Or why not use textContent or innerText?
psyperl
@psyperl
Sep 02 2018 04:36
^
Aditya
@ezioda004
Sep 02 2018 04:37
You'll get lot of whitespace but that can be removed with regex
psyperl
@psyperl
Sep 02 2018 04:37
or tell the web dev to remove it before they publish it
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:37
Regex: Much more prone to errors. You don't know what kind of values users might have in their attributes.
textContent: Won't work. It must preserve inner elements as well
psyperl
@psyperl
Sep 02 2018 04:37
childcontent
or child .. can't remember the function name
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:38
This is what I ended up doing:
function parseHTML(html, elements){
    // Parse the HTML
    let parser = new DOMParser();
    let htmlDoc = parser.parseFromString(html, "text/html");

    // Loop through each element that should be removed
    for(let i = 0; i < elements.length; i++){
        // Get all elements that need to be removed
        let element = htmlDoc.getElementsByTagName(elements[i]), index;

        // Loop through each element
        for (index = element.length - 1; index >= 0; index--) {
            let parent = element[index].parentNode;
            // Copy the contents of the element to be removed to its parent so it doesn't get lost
            while( element[index].firstChild ) {
                parent.insertBefore( element[index].firstChild, element[index] );
            }
            // Remove the element
            element[index].parentNode.removeChild(element[index]);
        }
    }

    // Save the result
    let result = htmlDoc.documentElement.outerHTML;

    // Show the result in the console
    console.log(result);
}

// Array of elements to remove
const arr = ['table','tr','td'];

// HTML string to parse
const str = "<body><div><table><tr><td><p>test</p></td></tr></table></div></body>";

parseHTML(str, arr);
psyperl
@psyperl
Sep 02 2018 04:39
with regex.. one don't need to know the value users might have in their attributes :p
Aditya
@ezioda004
Sep 02 2018 04:39
. ftw
Interesting, didnt know there as a DOMParser function constructor
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:42
There is. And I think it's a better approach than using regex
psyperl
@psyperl
Sep 02 2018 04:43
elements.map ( e => htmlDoc.getElementsByTageName(e) ).....
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:45
@psyperl I believe for performs better than map :P
psyperl
@psyperl
Sep 02 2018 04:45
i don't know .. i prefer regex for that one i think
John
@taloloy18
Sep 02 2018 04:45
https://codepen.io/taloloy18/pen/EeWvdW I'm trying to hide my nav-bar using JS but it's not working.
Aditya
@ezioda004
Sep 02 2018 04:46
@bjorno43 Your result also returns html and head tags, is that intended?
John
@taloloy18
Sep 02 2018 04:46
@bjorno43
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:46
@ezioda004 No that's just the browser I think. It tends to correctly format incomplete HTML when parsing it with the DOMParser.
@taloloy18 getElementById("navbar ul") -> <nav id="nav-bar">
Aditya
@ezioda004
Sep 02 2018 04:49
@taloloy18 document.querySelector("#nav-bar ul")
John
@taloloy18
Sep 02 2018 04:51
same
@bjorno43 +
@ezioda004
tried both but it's the same
Aditya
@ezioda004
Sep 02 2018 04:53
You mean its not working?
John
@taloloy18
Sep 02 2018 04:53
yep
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:53
@taloloy18 That's because you need to change .top to .marginTop
John
@taloloy18
Sep 02 2018 04:56
same
Bjorn van de Peut
@bjorno43
Sep 02 2018 04:57
@taloloy18
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
  var currentScrollPos = window.pageYOffset;
  if (prevScrollpos > currentScrollPos) {
    document.getElementById("nav-bar").style.marginTop = "0";
  } else {
    document.getElementById("nav-bar").style.marginTop = "-50px";
  }
  prevScrollpos = currentScrollPos;
}
Works fine for me. Well, not fine because prevScrollpos > currentScrollPos gets triggered on scroll up and not just when at scroll top. But that's for you to solve
John
@taloloy18
Sep 02 2018 05:01
@bjorno43 Actually I didn't study yet the JS. I only made this to make my portfolio page presentable before I disimbark to JS curriculum of FCC> I'm still on basic CSS and HTML. Thanks!! XD
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:04
@taloloy18 Ah ok. Well just change if (prevScrollpos > currentScrollPos) { to if (currentScrollPos <= 0) { and you have a basic solution.
John
@taloloy18
Sep 02 2018 05:06
The header still appears when scrolled.
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:12
@taloloy18 You mean the menu, right? And that's because you're doing -50px instead of the actual height of the menu
John
@taloloy18
Sep 02 2018 05:16
yes
I didn't get it.
The transition also didn't apply.
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:20
@taloloy18 Try this:
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
  var currentScrollPos = window.pageYOffset;
  if (currentScrollPos < 5) {
    document.getElementById("nav-bar").style.marginTop = "0";
  } else {
    let eleHeight = document.querySelector("#nav-bar ul").scrollHeight;
    document.getElementById("nav-bar").style.marginTop = "-"+eleHeight+"px";
  }
  prevScrollpos = currentScrollPos;
}
And the transition doesn't work because your CSS is completely different than the one given in the example
John
@taloloy18
Sep 02 2018 05:23
@bjorno43 Thank you! I think I need to study JS now. ;-)
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:39
So I've reached the point where I'm disgusted by seeing the use of var now.. :joy:
Aditya
@ezioda004
Sep 02 2018 05:43
Why?
I rarely use it but it still has its uses
John
@taloloy18
Sep 02 2018 05:44
@bjorno43 funny when you have gotten that far in your coding journey.
@bjorno43 the problem was not really solved yet earlier
when you scroll it downward the menu disappears however it wont go back when you stop to scroll it again so you need to go back to the top for you to click the main bar
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:46
@ezioda004 It kinda feels like deprecated code to me I guess, lol
@taloloy18 What's the point of making it disappear if you want it to appear again when ppl stop scrolling?
John
@taloloy18
Sep 02 2018 05:49
like when you're already at the botttom of the page and you want to go back directly to the top. The main bar should be a big help.
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:50
If you want to appear on scrolling up, no matter where on the page, you should use the code given in the example and replace if (currentScrollPos < 5) { with if (prevScrollpos > currentScrollPos) { again
John
@taloloy18
Sep 02 2018 05:52
error?
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:53

@taloloy18

var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
  var currentScrollPos = window.pageYOffset;
  if (prevScrollpos > currentScrollPos) {
    document.getElementById("nav-bar").style.marginTop = "0";
  } else {
    let eleHeight = document.querySelector("#nav-bar ul").scrollHeight;
    document.getElementById("nav-bar").style.marginTop = "-"+eleHeight+"px";
  }
  prevScrollpos = currentScrollPos;
}

Works fine for me

John
@taloloy18
Sep 02 2018 05:55
image.png
image.png
Bjorn van de Peut
@bjorno43
Sep 02 2018 05:56
What's the problem?
John
@taloloy18
Sep 02 2018 05:57
It's seems that the main bar is blinking and the color was reddish
This happens when I scroll up
Bjorn van de Peut
@bjorno43
Sep 02 2018 06:00
I don't see any red or blinking. Keep in mind that it's extremely sensitive though. The slightest pixel up or down scrolling causes the menu to appear or disappear. With a badly calibrated mouse this could cause such "blinking"
John
@taloloy18
Sep 02 2018 06:01
do I need to change the settings in my code pen since this was the first time that I use JS?
Bjorn van de Peut
@bjorno43
Sep 02 2018 06:02
Not unless you're including some kind of library for JS
John
@taloloy18
Sep 02 2018 06:05
Ok. I think the problem was with my mouse since when I use scroll that's the time it has an error so I just use the left click to navigate.
@bjorno43 Thanks!! XD
Aditya
@ezioda004
Sep 02 2018 06:47
@coderkarma What have you tried?
Karma Drukpa
@coderkarma
Sep 02 2018 06:48
Honestly nothing for this.
Trying to understand
Kranti Nebhwani
@darkphotonKN
Sep 02 2018 07:57

guys in this part of my code where i'm learning on animating a form to make it shake when user enters wrong input i don't quite get how it works. It successfully makes my form shake left and right 3 times (total of 6 animations because of the for loop):

// Reject user when they enter wrong field input
const shakeTime = 100;
function inputFail() {
    formBox.className = 'error';
    for(let i=0; i<6; i++) {
        setTimeout(transform, shakeTime*i, ((i%2) * 2 - 1) * 20, 0);
    }
}
// shake animation
function transform(x, y) {
    formBox.style.transform = `translate(${x}px, ${y}px`;
}

So my questions are:

  1. How is setTimeout() being used there to make the delay, I'm used to: setTimeout(functionToRun, timeDelay) but in that code that I use above I see 1 extra argument and the last argument is a bunch of calculations and commas it doesn't match what I find the arguments to be from js mdn.
  2. Inside the setTimeout() the function that is called is to shake the form of course, so the tutorial teaches to make a seperate function called transform which takes two arguments. But inside the setTimeout() when we call this function we don't give it an x or y for it to know what to translate, how does this work?
Henry
@GitHub-Henry
Sep 02 2018 08:27
@darkphotonKN try running your code through this. http://pythontutor.com/javascript.html#mode=edit
Kranti Nebhwani
@darkphotonKN
Sep 02 2018 08:34
@GitHub-Henry it didnt really explain anything.. it showed me some things I already knew
Aditya
@ezioda004
Sep 02 2018 08:46
@darkphotonKN Additional parameters to the setTimeout are passed to the callback function as arguments (when its invoked).
setTimeout((x) => console.log(x), 1000, "Hello world"); // Hello world
Kranti Nebhwani
@darkphotonKN
Sep 02 2018 08:50
@ezioda004 ah thank you man that's so much more clear than what i find online xD
Bjorn van de Peut
@bjorno43
Sep 02 2018 08:52
Alright, Bobsbot now includes ranks :)
@bobsbot help challenges
Note to self: Change the username the bot reacts to if you change the user the bot uses..
@bobsbot help challenges
@bobsbot help challenges
bobsbot
@bobsbot
Sep 02 2018 08:56

@bjorno43 Similar to Codewars, I can provide Javascript challenges which you need to solve.
To see the current challenge (command: challenge)
To input your solution (command: solve) followed by your code between 3 backticks
To see the ranks (command: ranks)
To see how many points you've earned (command: points)

If you wish to contribute your own challenge, please go to https://www.icecub.nl/gitter/bobsbotty and follow the instructions

Bjorn van de Peut
@bjorno43
Sep 02 2018 08:57
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 08:57

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Aditya
@ezioda004
Sep 02 2018 09:00

@bjorno43

Note to self: Change the username the bot reacts to if you change the user the bot uses..

:thought_balloon:

alpox
@alpox
Sep 02 2018 09:06
@bobsbot
function camelCase(str) {
  return str.replace(/(\w)\s+(\w)/g, (_, m1, m2) => m1 + m2.toUpperCase());
}
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:07
@alpox Rebooting the server right now, sorry :P
alpox
@alpox
Sep 02 2018 09:07
@bjorno43 xD np
Thought I want to be sneaky and see if he reacts ^^
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:08
It wouldn't because 1) you didnt user the commend solve, and 2) you wrote a new function instead of adding a prototype to String
psyperl
@psyperl
Sep 02 2018 09:09
did it got banned again?
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:10
Ye I got bobsbotty banned xD
psyperl
@psyperl
Sep 02 2018 09:10
aww
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:10
@alpox It's back up
Ye my own stupid mistake again. Was testing an issue and the bot kept sending the same response. Eventually auto spam ban kicked in xD
@alpox Are you trying to solve it? Otherwise I'm gonna give it a solution to test the ranks
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:22
I guess that's a no then..
Yago Estévez
@yagoestevez
Sep 02 2018 09:22
@bobsbot
function camelCase( ) {
  return this
    .split( ' ' )
    .map( ( x ) => x
      .split( '' )
      .map( ( char, i ) => i === 0 ? char.toUpperCase() : char  )
      .join( '' )
    )
    .join( ' ' )
}

String.prototype.camelCase = camelCase;
bobsbot
@bobsbot
Sep 02 2018 09:22
@yagoestevez The result of your Javascript code is:

Yago Estévez
@yagoestevez
Sep 02 2018 09:22
@bobsbot
function camelCase( ) {
  return this
    .split( ' ' )
    .map( ( x ) => x
      .split( '' )
      .map( ( char, i ) => i === 0 ? char.toUpperCase() : char  )
      .join( '' )
    )
    .join( ' ' )
}

String.prototype.camelCase = camelCase;
Now
Too long solution lol
Hey, it didn't reply the second answer
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:23
Nah the bot crashed. Gonna check the issue
Yago Estévez
@yagoestevez
Sep 02 2018 09:24
Maybe it's because I sent an empty block and then edited, sorry :S
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:26
@yagoestevez Nah it's fine. I'll have to check it later. You simply forgot to give the command solve
@bobsbot help challenges
bobsbot
@bobsbot
Sep 02 2018 09:26

@bjorno43 Similar to Codewars, I can provide Javascript challenges which you need to solve.
To see the current challenge (command: challenge)
To input your solution (command: solve) followed by your code between 3 backticks
To see the ranks (command: ranks)
To see how many points you've earned (command: points)

If you wish to contribute your own challenge, please go to https://www.icecub.nl/gitter/bobsbotty and follow the instructions

Yago Estévez
@yagoestevez
Sep 02 2018 09:27
@bobsbot challenge
@bobsbot command: solve
alpox
@alpox
Sep 02 2018 09:27
@bjorno43 Sry, was gone for breakfast :D
Yago Estévez
@yagoestevez
Sep 02 2018 09:27
lol
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:28
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 09:28

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Yago Estévez
@yagoestevez
Sep 02 2018 09:28
I am too think
alpox
@alpox
Sep 02 2018 09:28
@bobsbot
function camelCase(str) {
  return str.replace(/(\w)\s+(\w)/g, (_, m1, m2) => m1 + m2.toUpperCase());
}
bobsbot
@bobsbot
Sep 02 2018 09:28
@alpox There was an error with your Javascript code:
V8Js::compileString():1: ReferenceError: js is not defined
alpox
@alpox
Sep 02 2018 09:28
Interesting...
There is no javascript mate :D
Yago Estévez
@yagoestevez
Sep 02 2018 09:28
@bobsbot solve
function camelCase( ) {
  return this
    .split( ' ' )
    .map( ( x ) => x
      .split( '' )
      .map( ( char, i ) => i === 0 ? char.toUpperCase() : char  )
      .join( '' )
    )
    .join( ' ' )
}

String.prototype.camelCase = camelCase;
Nop. it's not working
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:29
Ye that code makes the bot crash.. I just don't understand why
alpox
@alpox
Sep 02 2018 09:29
@yagoestevez I guess I crashed it :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:29
@alpox No you didn't. You just keep forgetting the command solve so it just doesn't care
Yago Estévez
@yagoestevez
Sep 02 2018 09:29
Maybe it doesn't support prototypes?
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:30
Nah I'm getting Object of class V8Function could not be converted to string on your code
Trouble is, there's only a V8 class. It seems to mess up with function in your code
I mean, I know this solution works perfectly fine. I've tested it:
String.prototype.camelCase=function(){
  let arr = this.toString().split(' ');

  return arr.map(x => x.charAt(0).toUpperCase() + x.slice(1)).join('');
}
alpox
@alpox
Sep 02 2018 09:32
@bjorno43 Aha I did not know that this command is needed :D
@bjorno43 But I guess that the js is not defined comes from that I added js to the backticks which forces gitter to use javascript highlighting
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:36
@alpox True. The bot selects everything between 3 backticks
For some reason the bot doesn't recognise commands from @yagoestevez
@alpox Can you try using the command challenges on the bot?
Yago Estévez
@yagoestevez
Sep 02 2018 09:43
@bobsbot challenges
Ignoring me, huh?
lol
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:45
Ye I'm trying to figure out if it's just you or everyone except me @yagoestevez
That's why I asked if @alpox (or anyone else) could please try typing challenges to the bot
@bobsbot challenges
@bobsbot challenges
Aditya
@ezioda004
Sep 02 2018 09:46
@bobsbot challenges
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:47
@bobsbot helpo
@bobsbot help
bobsbot
@bobsbot
Sep 02 2018 09:47
@bjorno43 Available functions:
  • Parse Javascript code and output result (command: help javascript)
  • Do Javascript challenges (command: help challenges)
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:47
@bobsbot help javascript
bobsbot
@bobsbot
Sep 02 2018 09:47

@bjorno43 Put your Javascript code between 3 backticks and I will return you its result.
Do NOT use console.log(). Instead, call the result directly, like:

let example = 'Hello World!';
example;

Use JSON.stringify() or array.toString() to output arrays.

Current limitations:

  • I can only output 1 result at a time. (Don't output results in a loop as it will only return the last loop)
  • My time limit is set to 10 seconds. Scripts taking more time will be killed
  • My memory limit is set to 10 MegaBytes. Scripts taking more memory will be killed
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:47
@bobsbot help challenges
bobsbot
@bobsbot
Sep 02 2018 09:47

@bjorno43 Similar to Codewars, I can provide Javascript challenges which you need to solve.
To see the current challenge (command: challenge)
To input your solution (command: solve) followed by your code between 3 backticks
To see the ranks (command: ranks)
To see how many points you've earned (command: points)

If you wish to contribute your own challenge, please go to https://www.icecub.nl/gitter/bobsbotty and follow the instructions

Bjorn van de Peut
@bjorno43
Sep 02 2018 09:48
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 09:48

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Bjorn van de Peut
@bjorno43
Sep 02 2018 09:48
Crap
@yagoestevez Can you try the command 'challenge' :joy:
Yago Estévez
@yagoestevez
Sep 02 2018 09:50
@bobsbot challenge
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:50
Alright, now lets see
Yago Estévez
@yagoestevez
Sep 02 2018 09:50
@bobsbot whatswrongwithyou?
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:50
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 09:50

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Bjorn van de Peut
@bjorno43
Sep 02 2018 09:50
Ok so it's not the character encoding
@bobsbot help
bobsbot
@bobsbot
Sep 02 2018 09:51
@bjorno43 Available functions:
  • Parse Javascript code and output result (command: help javascript)
  • Do Javascript challenges (command: help challenges)
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:51
@ezioda004 Could you please try the command 'challenge'?
Aditya
@ezioda004
Sep 02 2018 09:51
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 09:51

@ezioda004 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Bjorn van de Peut
@bjorno43
Sep 02 2018 09:52
Ye now I think I know what's causing the issue
@yagoestevez I think the bot doesn't like the é in your Name
Aditya
@ezioda004
Sep 02 2018 09:54
@bjorno43 Thats a racist bot you have there
Bjorn van de Peut
@bjorno43
Sep 02 2018 09:55
@yagoestevez Could you try the command challenge one more time? I've enabled debugging so I can see what the bot actually receives from you
@ezioda004 lol
Yago Estévez
@yagoestevez
Sep 02 2018 10:11
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:11

@yagoestevez The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Yago Estévez
@yagoestevez
Sep 02 2018 10:12
Hurray
@bobsbot solve
String.prototype.camelCase = function () {
  return this.split(' ').map(w => w[0].toUpperCase() + w.slice(1)).join('');
}
bobsbot
@bobsbot
Sep 02 2018 10:13
@yagoestevez There was an error with your Javascript code:
V8Js::compileString():3: TypeError: Cannot read property 'toUpperCase' of undefined
Yago Estévez
@yagoestevez
Sep 02 2018 10:13
Whaat?
@bobsbot solve
String.prototype.camelCase = function () {
  return this.split(' ').map(w => w[0].toUpperCase() + w.slice(1)).join(' ');
}
That works perfectly fine on node v10.4.1
alpox
@alpox
Sep 02 2018 10:17
@bobsbot challenge
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:18
He crashed it again. But thanks to the debugging I think I know why
He used 2 spaces between the mention and the command instead of one
Yago Estévez
@yagoestevez
Sep 02 2018 10:19
Can we try?
@bobsbot solve
Fuck
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:20
@yagoestevez Ye, just try the command challenge with 2 spaces
alpox
@alpox
Sep 02 2018 10:20
@bobsbot challenge
Yago Estévez
@yagoestevez
Sep 02 2018 10:20
Ah alright
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:21
Finally! So that's where the damn bugger is killing it!
I just didn't notice it here because Gitter removes double spaces when showing the message. It just doesn't remove them when actually sending it through the API
Yago Estévez
@yagoestevez
Sep 02 2018 10:23
@bobsbot solve
String.prototype.camelCase = function () {
  return this.split(' ').map(w => w[0].toUpperCase() + w.slice(1)).join('');
}
@bobsbot challenge
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:24
@yagoestevez I've shut it down to fix the issue. Give me a few mins
Yago Estévez
@yagoestevez
Sep 02 2018 10:24
Aright! :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:26
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:26

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Bjorn van de Peut
@bjorno43
Sep 02 2018 10:26
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:26

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

alpox
@alpox
Sep 02 2018 10:26
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(\w)\s+(\w)/g, (_, m1, m2) => m1+m2.toUpperCase());
}
bobsbot
@bobsbot
Sep 02 2018 10:26
@alpox Test "test case".camelCase(); should return TestCase. Instead got: testCase. Please try again!
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:26
Yes!
alpox
@alpox
Sep 02 2018 10:26
TestCase? Thats not camelcase
Thats pascalcase
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:27
@alpox Blame wiki. According wiki, there are 2 variants on camelCase. One called "upper CamelCase"
alpox
@alpox
Sep 02 2018 10:27
That sounds just wrong to me :D
Kelechi Chinaka
@ke1echi
Sep 02 2018 10:28
TestCase not camelCase @bjorno43
Niraj Nandish
@Nirajn2311
Sep 02 2018 10:28
@alpox you ain’t the only one who felt like that
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:29
@ke1echi I know. As I said, blame wiki: "Some systems prefer camel case with the first letter capitalised, others not.[1][2][3] For clarity, this article calls the two alternatives upper camel case"
Niraj Nandish
@Nirajn2311
Sep 02 2018 10:29
I think even fcc thought camelCase as the first word being lowercase and then second word onwards first letter to be capital
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:30
But I'll fix the issue in that challenge later on :)
Now I'm more interested to see if the bot crashes on this code again
@bobsbot solve
function camelCase( ) {
  return this
    .split( ' ' )
    .map( ( x ) => x
      .split( '' )
      .map( ( char, i ) => i === 0 ? char.toUpperCase() : char  )
      .join( '' )
    )
    .join( ' ' )
}

String.prototype.camelCase = camelCase;
bobsbot
@bobsbot
Sep 02 2018 10:31
@bjorno43 Test "test case".camelCase(); should return TestCase. Instead got: Test Case. Please try again!
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:31
And it does not! Whoohoo!
alpox
@alpox
Sep 02 2018 10:31
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:31

@alpox The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

alpox
@alpox
Sep 02 2018 10:31
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(^|\s)(\w)/g, (_,__,m) => m.toUpperCase());
}
bobsbot
@bobsbot
Sep 02 2018 10:31
@alpox Test "say hello ".camelCase(); should return SayHello. Instead got: SayHello. Please try again!
Ene Catalin
@EneCatalin
Sep 02 2018 10:31
you really need to add an o to that thing
alpox
@alpox
Sep 02 2018 10:31
Ehm
should return SayHello. Instead got: SayHello
clap clap
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:32
Erm.. that's odd :joy:
Aditya
@ezioda004
Sep 02 2018 10:32
@bobsbot solve
String.prototype.camelCase = function(){
    let i =  this.indexOf(" ");
     let up = this[0].toUpperCase();
      if (i == -1) return up + this.slice(1);
      return up + this.slice(1, i) + camelCase(this.slice(i+1));
}
bobsbot
@bobsbot
Sep 02 2018 10:32
@ezioda004 There was an error with your Javascript code:
V8Js::compileString():6: ReferenceError: camelCase is not defined
Ene Catalin
@EneCatalin
Sep 02 2018 10:32
you forgot .
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:33
Alright, let me try the solution I know that should work..
@bobsbot solve
String.prototype.camelCase=function(){
  let arr = this.toString().split(' ');

  return arr.map(x => x.charAt(0).toUpperCase() + x.slice(1)).join('');
}
bobsbot
@bobsbot
Sep 02 2018 10:33
@bjorno43 Congratulations! Your solution is correct!
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
alpox
@alpox
Sep 02 2018 10:34
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:34

@alpox The current challenge is:
Write a function that takes 3 arguments, each representing a RBG decimal value. The function should return the hexadecimal representation of the RGB value.

Rules:

  • The name of the function should be: rgb.
  • The valid decimal values for RGB are 0 - 255.
  • Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value.
  • The hexadecimal representation must be upper case.

Example:
rgb(255, 255, 255); should return: FFFFFF.

alpox
@alpox
Sep 02 2018 10:34
Damn another one :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:34
Ye I'll manually set it back
Done. It's the same challenge now
@bobsbot ranks
bobsbot
@bobsbot
Sep 02 2018 10:35
@bjorno43
  1. bjorno43 with 1 points!
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:36
solve..
And you crashed it
Aditya
@ezioda004
Sep 02 2018 10:36
Too many instructions
Niraj Nandish
@Nirajn2311
Sep 02 2018 10:36
@bobsbot help
alpox
@alpox
Sep 02 2018 10:36
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase());
}
Well I just had the solution for the second one too :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:37
Try again
solve!!!
Aditya
@ezioda004
Sep 02 2018 10:37
@bobsbot solve
String.prototype.camelCase = function(){
    let i =  this.indexOf(" ");
    let up = this[0].toUpperCase();
    if (i == -1) return up + this.slice(1);
    return up + this.slice(1, i) + this.slice(i+1).camelCase();
}
bobsbot
@bobsbot
Sep 02 2018 10:37
@ezioda004 Test " camel case word".camelCase(); should return CamelCaseWord. Instead got: CamelCaseWord. Please try again!
alpox
@alpox
Sep 02 2018 10:37
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase());
}
bobsbot
@bobsbot
Sep 02 2018 10:37
@alpox Test "say hello ".camelCase(); should return SayHello. Instead got: SayHello. Please try again!
alpox
@alpox
Sep 02 2018 10:37
That thing is broken
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:38
What I don't understand is that my solution works, but those do not. It's not even strict checking..
Wait, I'll stop the bot and enable some debugging..
alpox
@alpox
Sep 02 2018 10:39
wait
a seg
sec*
I test for whitespace
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase()).trim();
}
Guess I'm too late :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:39
Nah go ahead now
alpox
@alpox
Sep 02 2018 10:39
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase());
}
bobsbot
@bobsbot
Sep 02 2018 10:39
@alpox Test "say hello ".camelCase(); should return SayHello. Instead got: SayHello. Please try again!
alpox
@alpox
Sep 02 2018 10:39
ok again right
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase()).trim();
}
Huh
I thought I can go twice
Niraj Nandish
@Nirajn2311
Sep 02 2018 10:40
Y’all the games rigged so only @bjorno43 wins it 😂😂😂😂
Aditya
@ezioda004
Sep 02 2018 10:40
Insert PHP meme
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:40
Ye sry, enabled it again. Let me know when done
alpox
@alpox
Sep 02 2018 10:40
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase()).trim();
}
bobsbot
@bobsbot
Sep 02 2018 10:40
@alpox Congratulations! Your solution is correct!
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
alpox
@alpox
Sep 02 2018 10:41
@bjorno43 Yup, the problem were white-space on the sides which were not showing in gitter
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:41
Ah. Ye I suspected as much.. Because gitter removes those, you can't see it
alpox
@alpox
Sep 02 2018 10:41
Yes I see
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:42

@alpox The current challenge is:
Write a function that returns the longest word in a string.

Rules:

  • The name of the function should be longestWord.
  • If multiple words are the longest, the last one should be returned.

Example:
longestWord('Welcome to FCC!'); should return: Welcome.

alpox
@alpox
Sep 02 2018 10:42
How many challenges do exist? :D
alpox
@alpox
Sep 02 2018 10:43
ah ok
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:43
So at the moment there are 5 challenges
Also, don't try to solve a challenge you've already solved. The bot won't allow that to give others a chance. Not a perfect solution, but I'll fix that later
alpox
@alpox
Sep 02 2018 10:45
@bobsbot solve
function longestWord(str) {
  return str.split` `.reduce((longest, word) => 
    word.length > longest.length ? word : longest);
}
bobsbot
@bobsbot
Sep 02 2018 10:45
@alpox Test longestWord('eehyd easfdn eefn sefnds'); should return sefnds. Instead got: easfdn. Please try again!
alpox
@alpox
Sep 02 2018 10:45
ups :D
I should read right ^^
@bobsbot solve
function longestWord(str) {
  return str.split` `.reduceRight((longest, word) => 
    word.length > longest.length ? word : longest);
}
bobsbot
@bobsbot
Sep 02 2018 10:46
@alpox Congratulations! Your solution is correct!
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
alpox
@alpox
Sep 02 2018 10:47
@bobsbot challenge
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:47
@bobsbot ranks
alpox
@alpox
Sep 02 2018 10:47
guess he has enough of me :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:47
No. Something weird is going on now..
It's still running. No errors
alpox
@alpox
Sep 02 2018 10:47
:/
bobsbot
@bobsbot
Sep 02 2018 10:48
Just a test
phao5814
@phao5814
Sep 02 2018 10:48
Hi everyone. I’m having some issues getting sign in with phone number to work properly in Firebase and would appreciate if someone with Firebase experience could give me a hand here: https://stackoverflow.com/questions/52136075/uncaught-typeerror-when-authenticating-phone-number-with-firebase-and-vuejs
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:48
Ok so it's not banned, phew
@bobsbot help
@bobsbot help
bobsbot
@bobsbot
Sep 02 2018 10:49
@bjorno43 Available functions:
  • Parse Javascript code and output result (command: help javascript)
  • Do Javascript challenges (command: help challenges)
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:50
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:50

@bjorno43 The current challenge is:
Create a function that takes an array as argument. Return the amount of smileys in the array.

Rules:

  • The name of the function should be: countSmileys.
  • Each smiley face must contain a valid pair of eyes. Eyes can be marked as : or ;.
  • A smiley face can have a nose but it does not have to. Valid characters for a nose are - or ~.
  • Every smiling face must have a smiling mouth that should be marked with either ) or D.
  • No additional characters are allowed except for those mentioned.
  • In case of an empty array return 0.

Example:
countSmileys([':)', ';(', ';}', ':-D']); should return: 2.

alpox
@alpox
Sep 02 2018 10:50
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:50

@alpox The current challenge is:
Create a function that takes an array as argument. Return the amount of smileys in the array.

Rules:

  • The name of the function should be: countSmileys.
  • Each smiley face must contain a valid pair of eyes. Eyes can be marked as : or ;.
  • A smiley face can have a nose but it does not have to. Valid characters for a nose are - or ~.
  • Every smiling face must have a smiling mouth that should be marked with either ) or D.
  • No additional characters are allowed except for those mentioned.
  • In case of an empty array return 0.

Example:
countSmileys([':)', ';(', ';}', ':-D']); should return: 2.

alpox
@alpox
Sep 02 2018 10:50
Hmm something is weird. I send once and I write twice
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:50
Nah we both did xD
@bobsbot ranks
bobsbot
@bobsbot
Sep 02 2018 10:51
@bjorno43
  1. alpox with 2 points!
  2. bjorno43 with 1 points!
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:52
@bobsbot points
bobsbot
@bobsbot
Sep 02 2018 10:52
@bjorno43 You currently have: 1 points!
alpox
@alpox
Sep 02 2018 10:55
@bobsbot solve
function countSmileys(arr) {
  return arr.filter(s => /^[;:][-~]?[)D]$/.test(s)).length;
}
bobsbot
@bobsbot
Sep 02 2018 10:55
@alpox Congratulations! Your solution is correct!
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
alpox
@alpox
Sep 02 2018 10:55
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:55

@alpox The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

alpox
@alpox
Sep 02 2018 10:55
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase()).trim();
}
bobsbot
@bobsbot
Sep 02 2018 10:55
@alpox You've already solved this challenge before. I cannot accept your solution as to give others a chance at solving this challenge.
alpox
@alpox
Sep 02 2018 10:56
Then he shouldn't give me that challenge :D
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 10:56

@alpox The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Bjorn van de Peut
@bjorno43
Sep 02 2018 10:56
Ye as I said, it's not perfect at the moment
alpox
@alpox
Sep 02 2018 10:56
I see :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 10:57
I'll fix that soon. Instead of not allowing it, I should simply not add points for it
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:03
@alpox Alright, applied some fixes and changed that issue. It'll now allow you to solve challenges you solved before. It just wont give you any points for it
alpox
@alpox
Sep 02 2018 11:03
@bjorno43 Ah okay :D nice!
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:03

@alpox The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

alpox
@alpox
Sep 02 2018 11:03
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase()).trim();
}
bobsbot
@bobsbot
Sep 02 2018 11:03
@alpox Congratulations! Your solution is correct!
@alpox You were not granted any points for this solution because you've already solved this challenge before.
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
alpox
@alpox
Sep 02 2018 11:04
@bjorno43 seems to work :D
@bobsbot challenge
Except...
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:04
Ye I really need to figure that one out.. I'm not getting any errors. The bot keeps running. It just doesn't respond anymore
alpox
@alpox
Sep 02 2018 11:05
Hmm sounds like it is in a weird state
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:06
Well there's only one way to find out.. But I'll have to do a bit of coding for it
alpox
@alpox
Sep 02 2018 11:06
Okay :D
Yago Estévez
@yagoestevez
Sep 02 2018 11:07
@bobsbot solve
String.prototype.camelCase = function () {
  return this.split(' ').map(w => w[0].toUpperCase() + w.slice(1)).join('');
}
Always late
hehe
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:09
lol
@alpox Alright, keep on solving now and hopefully it'll crash again
@yagoestevez Make sure you always use the command challenge first so you know you're providing the solution for the correct challenge
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:10

@bjorno43 The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

Bjorn van de Peut
@bjorno43
Sep 02 2018 11:12
@bobsbot solve
String.prototype.camelCase = function() {
  return this.replace(/(?:^|\s)(\w)/g, (_,m) => m.toUpperCase()).trim();
}
bobsbot
@bobsbot
Sep 02 2018 11:12
@bjorno43 Congratulations! Your solution is correct!
@bjorno43 You were not granted any points for this solution because you've already solved this challenge before.
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:13
@bobsbot challenge
@bobsbot help
alpox
@alpox
Sep 02 2018 11:14
@bobsbot challenge
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:14
@alpox Already managed to crash it. Debugging now
Alright, I think I've solved it..
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:18

@bjorno43 The current challenge is:
Given a strictly positive integer, output "fizzbuzz" if the number is a multiple of 15, "fizz" if the number is a multiple of 3 (but not 15), and "buzz" if the number is a multiple of 5 (but not 15). If the number is not a multiple of 3, 5, or 15, return the number as passed.

Rules:

  • The function must be named fizzBuzz, accepting a single numeric argument that will be a strictly positive integer
  • All return values must be in lowercase if they are strings
  • If the return value is the number as passed, it must not be coerced to a string (i.e. it must remain of the type Number)

Example:
fizzBuzz(6) should return "fizz"
fizzBuzz(10) should return "buzz"
fizzBuzz(30) should return "fizzbuzz"
fizzBuzz(5) should return "buzz"
fizzBuzz(91) should return 91

Bjorn van de Peut
@bjorno43
Sep 02 2018 11:20
I'm just gonna throw a few solutions to see if it crashes
bobsbot
@bobsbot
Sep 02 2018 11:20
@bjorno43 Congratulations! Your solution is correct!A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:20
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:20

@bjorno43 The current challenge is:
Write a function that takes 3 arguments, each representing a RBG decimal value. The function should return the hexadecimal representation of the RGB value.

Rules:

  • The name of the function should be: rgb.
  • The valid decimal values for RGB are 0 - 255.
  • Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value.
  • The hexadecimal representation must be upper case.

Example:
rgb(255, 255, 255); should return: FFFFFF.

@bjorno43 Congratulations! Your solution is correct!A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:21
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:21

@bjorno43 The current challenge is:
Write a function that takes 3 arguments, each representing a RBG decimal value. The function should return the hexadecimal representation of the RGB value.

Rules:

  • The name of the function should be: rgb.
  • The valid decimal values for RGB are 0 - 255.
  • Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value.
  • The hexadecimal representation must be upper case.

Example:
rgb(255, 255, 255); should return: FFFFFF.

@bjorno43 Congratulations! Your solution is correct!You were not granted any points for this solution because you've already solved this challenge before.
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:22
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:22

@bjorno43 The current challenge is:
Write a function that returns the longest word in a string.

Rules:

  • The name of the function should be longestWord.
  • If multiple words are the longest, the last one should be returned.

Example:
longestWord('Welcome to FCC!'); should return: Welcome.

Bjorn van de Peut
@bjorno43
Sep 02 2018 11:22
Alright, issue seems fixed :D
Removed my solutions from the room to prevent cheating
Aditya
@ezioda004
Sep 02 2018 11:23
@bobsbot solve
function longestWord(word){
  return word.split(" ").sort((a, b) => a.length - b.length).pop();
}
bobsbot
@bobsbot
Sep 02 2018 11:23
@ezioda004 Congratulations! Your solution is correct!A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
Aditya
@ezioda004
Sep 02 2018 11:24
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:24

@ezioda004 The current challenge is:
Given a strictly positive integer, output "fizzbuzz" if the number is a multiple of 15, "fizz" if the number is a multiple of 3 (but not 15), and "buzz" if the number is a multiple of 5 (but not 15). If the number is not a multiple of 3, 5, or 15, return the number as passed.

Rules:

  • The function must be named fizzBuzz, accepting a single numeric argument that will be a strictly positive integer
  • All return values must be in lowercase if they are strings
  • If the return value is the number as passed, it must not be coerced to a string (i.e. it must remain of the type Number)

Example:
fizzBuzz(6) should return "fizz"
fizzBuzz(10) should return "buzz"
fizzBuzz(30) should return "fizzbuzz"
fizzBuzz(5) should return "buzz"
fizzBuzz(91) should return 91

Bjorn van de Peut
@bjorno43
Sep 02 2018 11:24
Ye I still need to add the new lines in those messages, ghehe
Done, added those new lines. Challenge is still the same
@bobsbot ranks
bobsbot
@bobsbot
Sep 02 2018 11:26
@bjorno43
  1. bjorno43 with 3 points!
  2. alpox with 3 points!
  3. ezioda004 with 1 points!
alpox
@alpox
Sep 02 2018 11:27
@bobsbot solve
function fizzBuzz(n) {
  if(n % 15) return "fizzbuzz";
  if(n % 3) return "fizz";
  if(n % 5) return "buzz";
  return n;
}
bobsbot
@bobsbot
Sep 02 2018 11:27
@alpox Test fizzBuzz(1); should return 1. Instead got: fizzbuzz. Please try again!
alpox
@alpox
Sep 02 2018 11:27
ups :D
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:28
Btw I've also applied a fix for the bot crashing when you forget the command solve :)
alpox
@alpox
Sep 02 2018 11:28
@bobsbot solve
function fizzBuzz(n) {
  if(!(n % 15)) return "fizzbuzz";
  if(!(n % 3)) return "fizz";
  if(!(n % 5)) return "buzz";
  return n;
}
bobsbot
@bobsbot
Sep 02 2018 11:28
@alpox Congratulations! Your solution is correct!
A new random challenge has been selected. Keep in mind that this could be the same challenge as before. The chance of this happening will decrease as more challenges are added to the database.
Message "challenge" to me to see the new challenge!
alpox
@alpox
Sep 02 2018 11:28
@bjorno43 nice :D
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:28

@alpox The current challenge is:
Create a function that takes an array as argument. Return the amount of smileys in the array.

Rules:

  • The name of the function should be: countSmileys.
  • Each smiley face must contain a valid pair of eyes. Eyes can be marked as : or ;.
  • A smiley face can have a nose but it does not have to. Valid characters for a nose are - or ~.
  • Every smiling face must have a smiling mouth that should be marked with either ) or D.
  • No additional characters are allowed except for those mentioned.
  • In case of an empty array return 0.

Example:
countSmileys([':)', ';(', ';}', ':-D']); should return: 2.

alpox
@alpox
Sep 02 2018 11:29
@bobsbot solve
function countSmileys(arr) {
  return arr.filter(s => /^[;:][-~]?[)D]$/.test(s)).length;
}
bobsbot
@bobsbot
Sep 02 2018 11:29
@alpox Congratulations! Your solution is correct!
You were not granted any points for this solution because you've already solved this challenge before.
alpox
@alpox
Sep 02 2018 11:29
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:29

@alpox The current challenge is:
Write a function that returns the longest word in a string.

Rules:

  • The name of the function should be longestWord.
  • If multiple words are the longest, the last one should be returned.

Example:
longestWord('Welcome to FCC!'); should return: Welcome.

alpox
@alpox
Sep 02 2018 11:30
@bobsbot solve
function longestWord(sentence) {
  return sentence.split` `.reduceRight((l, w) =>
    w.length > l.length ? w : l)
}
bobsbot
@bobsbot
Sep 02 2018 11:30
@alpox Congratulations! Your solution is correct!
You were not granted any points for this solution because you've already solved this challenge before.
alpox
@alpox
Sep 02 2018 11:31
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:31

@alpox The current challenge is:
Add a new method to the String object in Javascript. This method should turn the string into a valid upper CamelCase string.

Rules:

  • The name of the method should be camelCase
  • All words in the string must have their first letter capitalized
  • There can be no spaces in the result

Example:
"hello case".camelCase(); should return: HelloCase

alpox
@alpox
Sep 02 2018 11:31
@bobsbot solve
String.prototype.camelCase = function () {
  return this.replace(/(?:^|\s)(\w)/g, (_, m) => m.toUpperCase()).trim();
}
bobsbot
@bobsbot
Sep 02 2018 11:31
@alpox Congratulations! Your solution is correct!
You were not granted any points for this solution because you've already solved this challenge before.
alpox
@alpox
Sep 02 2018 11:31
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:31

@alpox The current challenge is:
Given a strictly positive integer, output "fizzbuzz" if the number is a multiple of 15, "fizz" if the number is a multiple of 3 (but not 15), and "buzz" if the number is a multiple of 5 (but not 15). If the number is not a multiple of 3, 5, or 15, return the number as passed.

Rules:

  • The function must be named fizzBuzz, accepting a single numeric argument that will be a strictly positive integer
  • All return values must be in lowercase if they are strings
  • If the return value is the number as passed, it must not be coerced to a string (i.e. it must remain of the type Number)

Example:
fizzBuzz(6) should return "fizz"
fizzBuzz(10) should return "buzz"
fizzBuzz(30) should return "fizzbuzz"
fizzBuzz(5) should return "buzz"
fizzBuzz(91) should return 91

alpox
@alpox
Sep 02 2018 11:31
@bobsbot solve
function fizzBuzz(n) {
  if(!(n % 15)) return "fizzbuzz";
  if(!(n % 3)) return "fizz";
  if(!(n % 5)) return "buzz";
  return n;
}
bobsbot
@bobsbot
Sep 02 2018 11:31
@alpox Congratulations! Your solution is correct!
You were not granted any points for this solution because you've already solved this challenge before.
alpox
@alpox
Sep 02 2018 11:31
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:31

@alpox The current challenge is:
Write a function that takes 3 arguments, each representing a RBG decimal value. The function should return the hexadecimal representation of the RGB value.

Rules:

  • The name of the function should be: rgb.
  • The valid decimal values for RGB are 0 - 255.
  • Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value.
  • The hexadecimal representation must be upper case.

Example:
rgb(255, 255, 255); should return: FFFFFF.

alpox
@alpox
Sep 02 2018 11:32
@bobsbot solve
function rgb(...rgb) {
  return rgb.map(c => c.toString(16)).join('').toUpperCase();
}
bobsbot
@bobsbot
Sep 02 2018 11:32
@alpox Test rgb(255, 255, 300); should return FFFFFF. Instead got: FFFF12C. Please try again!
alpox
@alpox
Sep 02 2018 11:32
oha
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:34
@alpox Yup: "Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value."
alpox
@alpox
Sep 02 2018 11:34
yea
@bobsbot solve
function rgb(...rgb) {
  return rgb.map(c => (
    c > 255
    ? 255
    : (c < 0
      ? 0
      : c)
  ).toString(16)).join('').toUpperCase();
}
bobsbot
@bobsbot
Sep 02 2018 11:34
@alpox Test rgb(148, 0, 211); should return 9400D3. Instead got: 940D3. Please try again!
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:34
Ghehe you're falling for all the classic traps
alpox
@alpox
Sep 02 2018 11:35
I see :D
@bobsbot solve
function rgb(...rgb) {
  return rgb.map(c => (
    c > 255
    ? 255
    : (c < 0
      ? 0
      : c)
  ).toString(16).padStart(2, 0)).join('').toUpperCase();
}
bobsbot
@bobsbot
Sep 02 2018 11:35
@alpox There was an error with your Javascript code:
V8Js::compileString():9: TypeError: (intermediate value)(intermediate value)(intermediate value).toString(...).padStart is not a function
alpox
@alpox
Sep 02 2018 11:35
Thats... curious
Bjorn van de Peut
@bjorno43
Sep 02 2018 11:37
Ye Google's V8 JS Engine is pretty strict and weird. It doesn't like undeclared variables for example. That's why it sometimes returns errors on code that works perfectly fine in Node
alpox
@alpox
Sep 02 2018 11:37
Hmm maybe it didn't like the string coercion
@bobsbot solve
function rgb(...rgb) {
  return rgb.map(c => (
    c > 255
    ? 255
    : (c < 0
      ? 0
      : c)
  ).toString(16).padStart(2, '0')).join('').toUpperCase();
}
bobsbot
@bobsbot
Sep 02 2018 11:37
@alpox There was an error with your Javascript code:
V8Js::compileString():9: TypeError: (intermediate value)(intermediate value)(intermediate value).toString(...).padStart is not a function
alpox
@alpox
Sep 02 2018 11:37
Nope
Niraj Nandish
@Nirajn2311
Sep 02 2018 11:38
@bobsbot challenge
bobsbot
@bobsbot
Sep 02 2018 11:38

@Nirajn2311 The current challenge is:
Write a function that takes 3 arguments, each representing a RBG decimal value. The function should return the hexadecimal representation of the RGB value.

Rules:

  • The name of the function should be: rgb.
  • The valid decimal values for RGB are 0 - 255.
  • Any (r,g,b) argument values that fall out of that range should be rounded to the closest valid value.
  • The hexadecimal representation must be upper case.

Example:
rgb(255, 255, 255); should return: FFFFFF.

Bjorn van de Peut
@bjorno43
Sep 02 2018 11:38
Anyway, I gotta go to an appointment so I'll have to shut the bot down for now. It's already accepted for FCC, but not for this room yet. I'll turn it back on when I get back
@bobsbot help
Yup, it's down. Alright, cya guys :wave:
alpox
@alpox
Sep 02 2018 11:41
@bjorno43 :wave:
Niraj Nandish
@Nirajn2311
Sep 02 2018 11:44
@alpox hey I need your help with react
alpox
@alpox
Sep 02 2018 11:52
@Nirajn2311 Whats up with react?
Niraj Nandish
@Nirajn2311
Sep 02 2018 11:53
const Description = props => {
    return (
        <div>
            <p>
                Hi {props.name}, this is a TODO app built with React.
                <br />
                Today Date: {Date()}
            </p>
        </div>
    );
};

Description.propTypes = {
    name: PropTypes.number.isRequired
};
@alpox so in the above code I'm saying that name should be a number but if I pass a string it is still shown on the screen
How do I prevent this
May Kittens Devour Your Soul
@diomed
Sep 02 2018 11:56
@Nirajn2311 I know a simple way to prevent this
alpox
@alpox
Sep 02 2018 11:56
@Nirajn2311 The proptypes, afaik, only give a warning
Niraj Nandish
@Nirajn2311
Sep 02 2018 11:57
@diomed may your soul go to hell
@alpox So is there any way to prevent this
May Kittens Devour Your Soul
@diomed
Sep 02 2018 11:57
:smiling_imp:
alpox
@alpox
Sep 02 2018 11:57
@Nirajn2311 Do you want to not show any text then?
Or just to not show the name
Niraj Nandish
@Nirajn2311
Sep 02 2018 12:05
@alpox No text
May Kittens Devour Your Soul
@diomed
Sep 02 2018 12:06
does anyone here, god forbid, have Brackets installed
Niraj Nandish
@Nirajn2311
Sep 02 2018 12:08
No, I've been using vscode since beginning
alpox
@alpox
Sep 02 2018 12:10
@Nirajn2311
const Description = props => {
    return typeof props.name === "number" && (
        <div>
            <p>
                Hi {props.name}, this is a TODO app built with React.
                <br />
                Today Date: {Date()}
            </p>
        </div>
    );
};
Niraj Nandish
@Nirajn2311
Sep 02 2018 12:11
@alpox It's still there
alpox
@alpox
Sep 02 2018 12:12
@Nirajn2311 fixed
Niraj Nandish
@Nirajn2311
Sep 02 2018 12:12
You know what, just chuck it I'm thinking of asking a user to input a name and then output it in the description
But thx for your help
@Nirajn2311 fixed
No it's not fixed
May Kittens Devour Your Soul
@diomed
Sep 02 2018 14:06
@thekholm80 dogs pfffft
Kyle Holm
@thekholm80
Sep 02 2018 14:08
that's not annoying at all
Lee Arnold
@nsanity1
Sep 02 2018 15:21
hey all :wave:
question for the mac users out there
I'm trying to push to github from the terminal and it runs smooth until i need to put in my user id and password....i can type in my username just fine, but it wont let me enter my password. It shows a key and i can't click it or type in it....what does that mean (new to mac btw)?
Lee Arnold
@nsanity1
Sep 02 2018 15:31
nvm, figured it out
Aditya Dehal
@aditya2000
Sep 02 2018 16:04
Hello everyone!!
May Kittens Devour Your Soul
@diomed
Sep 02 2018 16:34
:penguin: smile and wave, boys.
Just smile and wave.
Aditya
@ezioda004
Sep 02 2018 16:35
:smile: :wave:
psyperl
@psyperl
Sep 02 2018 16:48
lolwut
i wonder how difficult is graphQL... i've never tried it
Aditya
@ezioda004
Sep 02 2018 16:53
@thekholm80 loves it
psyperl
@psyperl
Sep 02 2018 16:54
where are they being used commonly i wonder
Aditya Dehal
@aditya2000
Sep 02 2018 16:54
LOL ;D @diomed
@psyperl You use it when you want to make your life a little bit better ;)
psyperl
@psyperl
Sep 02 2018 16:55
ugh that's very descriptive
i was thinking about AppSync
i guess those graphQL folks are those the one who didn't make move to REST and trying to get the crowd back to XML lol?
because maybe back then wsdl is not so fool proof
May Kittens Devour Your Soul
@diomed
Sep 02 2018 17:12
Aditya
@ezioda004
Sep 02 2018 17:16
Thats genius
:bicyclist:
Niraj Nandish
@Nirajn2311
Sep 02 2018 17:34
holy shit those people on the roof are peddling at a speed of 42km/hr
🤣🤣🤣
May Kittens Devour Your Soul
@diomed
Sep 02 2018 17:43
that woman is pedalling with her hands
Aditya
@ezioda004
Sep 02 2018 17:45
Pretty sure shes trying to hit other people, like in Roadrash.
Aditya Dehal
@aditya2000
Sep 02 2018 17:46
The red one is a savage ha ha
Hussnain Fareed
@husnainfareed
Sep 02 2018 18:30
.
Kyle Holm
@thekholm80
Sep 02 2018 19:06
@ezioda004 i do love graphql

I'm not sure what that has to do with XML though

i guess those graphQL folks are those the one who didn't make move to REST and trying to get the crowd back to XML lol?

May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:07
or on the pin
psyperl
@psyperl
Sep 02 2018 19:07
aren't graphql uses xml backend?
Kyle Holm
@thekholm80
Sep 02 2018 19:08
xml is a data format
everything i've done in graphql transmits json
psyperl
@psyperl
Sep 02 2018 19:08
oo
Kyle Holm
@thekholm80
Sep 02 2018 19:09
@diomed who comes up with that stuff?
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:09
creative Japanese people, I guess
they're like - hmm.. what can we sell for money?
hm... we could get some velcro clothes and mount a wall... hmmm. yeah. that'll do
they'll knock themselves out
@thekholm80 what would u pay for?
Kyle Holm
@thekholm80
Sep 02 2018 19:11
they came up with cat cafes, so i'll let it slide
what would i pay for? what do you mean?
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:13
for off pc fun activity
Kyle Holm
@thekholm80
Sep 02 2018 19:13
oh. umm ... not sure really. i'm pretty cheap
i go to movies sometimes, i guess that counts
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:16
I meant activity
Kyle Holm
@thekholm80
Sep 02 2018 19:16
i play disc golf every day, but it's free
i guess i pay for the discs, so there's that
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:17
oh yeah, that's interesting
psyperl
@psyperl
Sep 02 2018 19:18
hmm yeah i wonder how graphql being interpreted on the server side
i've seen the query being passed in parameter
or body not sure yet
i thought the graphQL itself is the data format that is returned lol.. my bad
Kyle Holm
@thekholm80
Sep 02 2018 19:25
nah, it allows the front end to talk to the back end without a REST api
psyperl
@psyperl
Sep 02 2018 19:26
is not just formating but also an engine required right? like sql server or no?
yeah i need to learn more about this.. i still can't see the whole picture
Kyle Holm
@thekholm80
Sep 02 2018 19:33
it's used in place of REST. you build a single endpoint for your graphql server, then it listens for queries/mutations and processes them accordingly. much like a database would handle connections & transactions
Aditya
@ezioda004
Sep 02 2018 19:39
@thekholm80 So query string and prams are send to graphql server as JSON?
psyperl
@psyperl
Sep 02 2018 19:39

then it listens for queries/mutations

new terms in there hmmm .. i am reading the mutation section now i wonder if 'mutations' is a name/term similar to update/insert in SQL.. i could be wrong

Kyle Holm
@thekholm80
Sep 02 2018 19:41
@ezioda004 i believe it's sent as a string, and parsed that way but i'm not 100% sure
Aditya
@ezioda004
Sep 02 2018 19:44
@thekholm80 Ah I see, after that it does its thingy and let's the express know what the client wants, express does its thingy (db query and stuff) and send stuff back to client? Or is it something else?
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:46
stringy
Kyle Holm
@thekholm80
Sep 02 2018 19:46
express just provides an endpoint for graphql to use. the query comes in, body parser parses it into req.body, graphql passes that to the appropriate handler, which figures out what information is needed or action to take, then executes and returns the appropriate data (if any)
psyperl
@psyperl
Sep 02 2018 19:47
{
  user(id: 3500401) {
    id,
    profilePicture(size: 50)  {
      uri,
      width,
    }
  }
}
example query so i guess that's not a valid json.. some do look like json however
Kyle Holm
@thekholm80
Sep 02 2018 19:47
it feels a lot like redux, with actions and reducers
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:47
sajens
psyperl
@psyperl
Sep 02 2018 19:47
the response look like json as @thekholm80 mentioned earlier
Aditya
@ezioda004
Sep 02 2018 19:49
@thekholm80 graphql act as action and express acts as reducer?
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:50
@thekholm80 Did u see Deadpool2 yet?
Aditya
@ezioda004
Sep 02 2018 19:51
Just trying to get the whole graph picture in my head 😅
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:51
How to make hornet looking t-shirts?
psyperl
@psyperl
Sep 02 2018 19:52
what's expres @ezioda004 you meant the web framework express? or another term from grapql?
Kyle Holm
@thekholm80
Sep 02 2018 19:53
@ezioda004 it's more express acts like a gateway and graphql does all the heavy lifting
Aditya
@ezioda004
Sep 02 2018 19:53
Yeah node.js framework
Kyle Holm
@thekholm80
Sep 02 2018 19:53
i'm cooking right now or i'd try to knock together a little example code
but chicken wings > graphql
psyperl
@psyperl
Sep 02 2018 19:54
why not just put it in microwave then done.. that's what i do with wings
Aditya
@ezioda004
Sep 02 2018 19:54
Sure I'll prob fall asleep reading this book
🐔+ 🔥= 🥩
@diomed That's some emoji math for you
psyperl
@psyperl
Sep 02 2018 19:56
:chicken: + :wink: = :meat_on_bone:
Aditya
@ezioda004
Sep 02 2018 19:58
You wink at a chicken and it cooks itself?
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:58
@ezioda004 lies, all lies :cow: + :fire: = :steam_locomotive:
psyperl
@psyperl
Sep 02 2018 19:58
that's chicken wink
Aditya
@ezioda004
Sep 02 2018 19:58
Oh I feel dumb for not getting that
May Kittens Devour Your Soul
@diomed
Sep 02 2018 19:59
@psyperl unsure how ;) gives us :meat_on_bone: but ok
since we're all a bit surrealists here, I'll give you that
watch & learn, people watch and learn
that boy is pure master
psyperl
@psyperl
Sep 02 2018 20:02
you have to learn graphql @diomed so you can teach me :D
May Kittens Devour Your Soul
@diomed
Sep 02 2018 20:03
@psyperl NO! you learn vue.js so u teach me :cat:
Aditya
@ezioda004
Sep 02 2018 20:03
@diomed kwel kids use React
May Kittens Devour Your Soul
@diomed
Sep 02 2018 20:06
am not kwel kid
May Kittens Devour Your Soul
@diomed
Sep 02 2018 20:12
May Kittens Devour Your Soul
@diomed
Sep 02 2018 20:17
heathens
they dont even have vue
Kyle Holm
@thekholm80
Sep 02 2018 20:52
@diomed x
May Kittens Devour Your Soul
@diomed
Sep 02 2018 20:57
@thekholm80 mine is similar. just says vue
Bjorn van de Peut
@bjorno43
Sep 02 2018 21:09
@thekholm80 Many updates done on Bobsbotty
  • Fixed crash when users used more than one space before sending a command
  • Fixed JS errors when users added a language after the 3 backticks for color formatting
  • Fixed crash when the bot sends more than 1 message to the room on a single event
  • Added user points and ranks. Users can't be granted more than 1 point for a challenge
Bjorn van de Peut
@bjorno43
Sep 02 2018 21:16
Oh and I've also fixed the camelCase challenge to a PascalCase challenge
Thami Memel
@ThamiMemel
Sep 02 2018 21:30
anyone have an idea for using react with phonegap ?
@thekholm80
var twoSum = function(nums, target) {
    //declare the variable empty arr 
    // loop through  array
    // do inner loop 
    // sum the outer and inner ele of loops == targest 
    // push that indices to arr and return it


    for (let i = 0; i <nums.length; i ++){
        let num1 = nums[i];
        for (let j = i + 1; j <nums.length; j ++){
            let num2 = nums[j];
            if(num1 + num2 === target){
                let indices = [i, j];
                 return indices;
                }
            }
        }
};
Karma Drukpa
@coderkarma
Sep 02 2018 23:57
think I got it