These are chat archives for FreeCodeCamp/Help

7th
Mar 2015
Christopher Hutchinson
@cshutchinson
Mar 07 2015 01:39
hi all :)
Yosi
@jparkton
Mar 07 2015 01:51
Hello
Jorge
@jdesotoi
Mar 07 2015 02:00
hi
i need guidance with a bonfire :fire: diff two array where i can reed how to or something :worried:
Cristián Berríos
@crisberrios
Mar 07 2015 02:04
hmm you can try reading some general sets theory
write it on paper, then to comments, then start to code
Jorge
@jdesotoi
Mar 07 2015 02:05
mmhh ok, im on it
thks
Cristián Berríos
@crisberrios
Mar 07 2015 02:06
read everything about arrays and all it's methods
you'll use them in most bonfires
Jorge
@jdesotoi
Mar 07 2015 02:07
yea i figure that one out :smile:
if any more tips let me know
Cristián Berríos
@crisberrios
Mar 07 2015 02:10
any more tips would be giving you the answer :P
Jorge
@jdesotoi
Mar 07 2015 02:22
no, no answer
Yosi
@jparkton
Mar 07 2015 02:22
@jdesotoi what is the goal?
Jorge
@jdesotoi
Mar 07 2015 02:24
Compare two arrays and return a new array with any items not found in both of the original arrays.
Yosi
@jparkton
Mar 07 2015 02:25
ok do you know how to compare the two?
Jorge
@jdesotoi
Mar 07 2015 02:58
yes
but cant get the answer right
Yosi
@jparkton
Mar 07 2015 02:59
put what you have on http://www.codeshare.io/
Jorge
@jdesotoi
Mar 07 2015 03:01
i delete like 15 min :(
Yosi
@jparkton
Mar 07 2015 03:03
oy gevalt
:P
next time
Chris Dziewa
@chrisdziewa
Mar 07 2015 03:43
@jonslucas did you finish no repeats please yet?
I don't know why it is tripping me up so much.
Cristián Berríos
@crisberrios
Mar 07 2015 03:50
what is your approach Chris?
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:06
That's the thing I don't know where to start
I've seen a way to do it using for loops but I wanted to try recursion
I don't know how to make the combos or what to use as a base case
Cristián Berríos
@crisberrios
Mar 07 2015 04:10
for base case you can use the array sum coderbyte
don't remember the name exactly
but relies heavily on recursion
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:11
I know I want to make the string into an array and loop through setting each letter to be the first letter then going through each next position using all the left over letters
until I get to the end
Cristián Berríos
@crisberrios
Mar 07 2015 04:11
well, you already have the logic
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:11
Yeah I just can't convert it to code for some reason
and I wasn't able to finish the array addtion coderbyte
Danny Fritz
@dannyfritz
Mar 07 2015 04:12
can you write it out in psuedo code for us?
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:13
ha that might end badly but I can try
Danny Fritz
@dannyfritz
Mar 07 2015 04:13
seems like you conceptually get it, just having trouble converting it to code.
Tyler Haas
@tylerthehaas
Mar 07 2015 04:15
having trouble with the symmetric difference bonfire can someone tell me where I'm going wrong with this code
blob
Danny Fritz
@dannyfritz
Mar 07 2015 04:16
@haasDev you are solving for unique instead of symmetric difference.
Tyler Haas
@tylerthehaas
Mar 07 2015 04:19
it just keeps telling me undefined is not a function here is my latest code...I had to correct something
blob
im just using that as a variable to tell me whether that is the only existence of the value in any of the arrays passed to the function
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:22
@dannyfritz These are basically just instructions and not true pseudocode
//set string to be an array
//loop through array
//each iteration choose current index as string to build off of
//for each remaining letter in array add letter to first letter
//when original loop is finished, 
//take result and filter out pairs with repeats
Danny Fritz
@dannyfritz
Mar 07 2015 04:22
yeah, that looks like it would work
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:22
I think I should be storing the pieces in an array or something though
Cristián Berríos
@crisberrios
Mar 07 2015 04:23
chris
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:23
yeah?
Cristián Berríos
@crisberrios
Mar 07 2015 04:23
how do you separate an arbitrary character from an array?
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:24
well I can splice it out
Cristián Berríos
@crisberrios
Mar 07 2015 04:24
:thumbsup:
and if going the recursive way, you want to pass the remaining letters right?
Danny Fritz
@dannyfritz
Mar 07 2015 04:25
@chrisdziewa given these 2 arguments 'a', ['a','b','c'] could you create 'aa', 'ab', 'ac' ?
Tyler Haas
@tylerthehaas
Mar 07 2015 04:25
blob
@chrisdziewa how do you get to post your code so it shows up nice and big like that?
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:27
@dannyfritz I could map the array and return the item as the first argument plus the current item
do three backticks
start a new line
Oliver
@Dadsaster
Mar 07 2015 04:27
@haasDev can you post your code so it is copyable
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:27
and finish with three more on a new line
use shift + enter to go to the next line
Tyler Haas
@tylerthehaas
Mar 07 2015 04:28
I'm not sure how @Dadsaster
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:28
Also if you click the little list on the right of the text box there are markdown instructions
Does that make sense @haasDev ?
backtick being "`"
Tyler Haas
@tylerthehaas
Mar 07 2015 04:30
ok thanks
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:31
you bet
makes your life easier haha
at least markdown is very popular so you can use the same formatting on many sites
Tyler Haas
@tylerthehaas
Mar 07 2015 04:32
sorry im having a bit of trouble do i do this on the fcc site?
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:33
just for the chat
so do it right where you send messages
whoops can't do that
it won't let me type it out
pretend the single quotes are backticks
'''
Your code here
'''
Tyler Haas
@tylerthehaas
Mar 07 2015 04:36
function sym(arr) {
  var arrDiff = [];
  var unique = true;
  //loop through first arr
  arguments[0].forEach(function(currVal){
    //determine if value exists in any array passed
    for (var i = 1; i < arguments.length; i++){
      if (arguments[i].indexOf(currVal) > -1){
        unique = false;
        break;
      }
    }
    //push the value to arrDiff if does not exist
    if (unique){
      arrDiff.push(currVal);
    }
  });
  console.log(arrDiff);
}

sym([1, 2, 3], [5, 2, 1, 4])
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:36
bam
ha
nice
Tyler Haas
@tylerthehaas
Mar 07 2015 04:36
sweet thanks!
Chris Dziewa
@chrisdziewa
Mar 07 2015 04:37
anytime :smile:
Tyler Haas
@tylerthehaas
Mar 07 2015 04:38
@Dadsaster does that help?
Oliver
@Dadsaster
Mar 07 2015 04:41
I'm trying to follow your logic.
I think the problem is that you are trying to dig one level too deep
arguments[0] is [1,2,3] so when you foreach it currVal is going to be 1 then 2 then 3
so when you use argments.length it will return 3 which is the length of arguments[0] not arguments
Tyler Haas
@tylerthehaas
Mar 07 2015 04:47
so what im trying to do in the forEach is compare each of the values in the first array against all falues in any other arrays
Oliver
@Dadsaster
Mar 07 2015 04:47
basically I think arguments[i] will always return 0 since you aren't calling it on an array
The logic I used to solve this one was:
1 - make each input array unique - (i.e. turn [1,1,2,4] -> [1,2,4]
2 - compare array 1 to array 2 - if and item is unique do nothing else remove element from both arrays
Oliver
@Dadsaster
Mar 07 2015 04:50
3 - push what remains in array 2 onto array 1 and compare the new array to the array 3 etc.
Tyler Haas
@tylerthehaas
Mar 07 2015 04:50
did you do all that with the arguments object like i did here or can that not be done?
Oliver
@Dadsaster
Mar 07 2015 04:53
@haasDev I think you have to use the arguments object in some capacity or you can't get at the other arrays
Tyler Haas
@tylerthehaas
Mar 07 2015 04:53
ok...thanks. I think I can use that logic to complete it
Oliver
@Dadsaster
Mar 07 2015 04:54
no worries - definitely make the arrays unique as this was the hardest bug to chase done for me.
Suzanne Atkinson
@AdventureBear
Mar 07 2015 06:39
I'm working on "where do I belong" bonfire now. I'm thinking array.findIndex is probabaly a good method to use, and then in the callback, I just check to see if the element from the array I'm stepping through is > the num. then the proper index place would be that value (as it would bump the others up). Does that sound reasonable? I've tried to implement it, but having some odd trouble with sytnax, so just wanted to run the pseudo code by someone
Suzanne Atkinson
@AdventureBear
Mar 07 2015 06:59
@chrisdziewa thoughts? http://repl.it/cwr/4
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:08
@crisberrios you up?
Cristián Berríos
@crisberrios
Mar 07 2015 07:09
still here
This is an experimental technology, part of the ECMAScript 6 (Harmony) proposal.
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future version of browsers as the spec changes.
"findIndex"
it might work, but it might not
now, let me check the code
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:11
lol, when I substitute some other array method like "filter" i can at least get output, but with findIndex I'm getting undefined is not a function
so mabye it's the ECMA 6 thing.
Cristián Berríos
@crisberrios
Mar 07 2015 07:11
yeah, most probably
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:12
hmm.
Cristián Berríos
@crisberrios
Mar 07 2015 07:12
in any case, index won't return anything
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:12
so I need some other algorithm or method.
Cristián Berríos
@crisberrios
Mar 07 2015 07:12
since the item isn't in the 1st array
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:12
Cristián Berríos
@crisberrios
Mar 07 2015 07:13
I came with a simple way
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:13
that way? if it did work?
aha, I just noticed the little beakers to the left of the methods...experimental APIs.
Cristián Berríos
@crisberrios
Mar 07 2015 07:14
I think your algorithm might work with filter
but
you need to add something
on iterators like map and filter
the function not only takes 1 argument, but 3
1st one is the item
2nd one is the index
and 3rd one is the whole array (for convenience)
you could use the 2nd parameter (index) as it's what you are looking for
and hmmm since you aren't really filtering but searching
I think a better option could be using forEach instead
or reduce
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:17
yeah, OK, so with foreach I'd have to set a counter
or soemthing to track
Cristián Berríos
@crisberrios
Mar 07 2015 07:19
with reduce, you could use the accumulator to store the index
(2nd parameter on the function)
but any of the 2 will do
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:20
i havn't tried reduce yet
Cristián Berríos
@crisberrios
Mar 07 2015 07:20
 arr.push(num);
  return arr.sort().indexOf(num);
well, that's my solution :P
but try to solve it using iterators
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:21
lol.
that IS simple. why didn't I think of it?
ha
Cristián Berríos
@crisberrios
Mar 07 2015 07:22
KISS DRY DOT
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:22
what's DOT?
Cristián Berríos
@crisberrios
Mar 07 2015 07:23
do one thing
3 maxims of programming
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:23
if I use reduce, can I use a conditional fuction, to return 1 for each time the value is < the num to insert, and 0 if >? then at the end I'd have the proper index location. (I think).
Never heard DOT before, I like it
Cristián Berríos
@crisberrios
Mar 07 2015 07:24
Vince
@Vince33
Mar 07 2015 07:24
No repeats is suppose to return a value right?
Cristián Berríos
@crisberrios
Mar 07 2015 07:24
let me check if it gets the 3 parameters
yes @Vince33
Vince
@Vince33
Mar 07 2015 07:25
I have some really hideous code, but it returns the proper values and dosen't pass any of the test for some reason
Cristián Berríos
@crisberrios
Mar 07 2015 07:25
reduce function accepts 4 parameters callback
Function to execute on each value in the array, taking four arguments:
previousValue
The value previously returned in the last invocation of the callback, or initialValue, if supplied. (See below.)
currentValue
The current element being processed in the array.
index
The index of the current element being processed in the array.
array
The array reduce was called upon.
so it should be function ( a, b, index, array) { ... }
you can omit the 4th parameter
check that the returned values are not in a string or array
@Vince33
Vince
@Vince33
Mar 07 2015 07:26
I see no quotes or brackets
Cristián Berríos
@crisberrios
Mar 07 2015 07:27
message me the code
Vince
@Vince33
Mar 07 2015 07:27
I see a type error message but nothing in the linter and works in replit
Cristián Berríos
@crisberrios
Mar 07 2015 07:27
to check it against bonfire
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:28
I can eliminate the 4th param because it's redundant, right?
Cristián Berríos
@crisberrios
Mar 07 2015 07:28
not redundant but not useful for this problem
Suzanne Atkinson
@AdventureBear
Mar 07 2015 07:32
This looks like it should work, but doesn't return a value
and the logic doesn't look right, but it "should" still give me an index location I think? or at least some number (either 40 or 60) if not the index.
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:12
does anyone know the shortcut to switch context from the chrome javascript console back to the main window in chrome where you are editing code… i repeatedly have to command K to clear the console surely there must be a way to go back to the code without clicking
Cristián Berríos
@crisberrios
Mar 07 2015 16:13
F12?
Cristián Berríos
@crisberrios
Mar 07 2015 16:17
^
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:18
i just viewed that link previously; will look again, thanks :)
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:30
command option J is the best option I can find but it is ugly; but works basically toggling it off and then back on to get focus in right place
Cristián Berríos
@crisberrios
Mar 07 2015 16:30
what about ctrl+shift+c?
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:31
will try
Cristián Berríos
@crisberrios
Mar 07 2015 16:31
hmm it doesn't work well
F12 is what I use
Yosi
@jparkton
Mar 07 2015 16:32
really is it that tedious to just click a mouse
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:33
@crisberrios yeah funny how cmd/ctrl shift C will get you there but not back :)
@jparkton when I do it several hundred times a day yes
Yosi
@jparkton
Mar 07 2015 16:33
idk man I click a mouse several thousand times a day, open emails, follow links
it is part of my computing
Danny Fritz
@dannyfritz
Mar 07 2015 16:41
@cshutchinson what are you trying to do? just switch between console and sources?
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:42
Screen Shot 2015-03-07 at 11.41.38 AM.png
trying to switch between console on right and code editing on left
Danny Fritz
@dannyfritz
Mar 07 2015 16:42
oh
detach the dev tools into a separate window and alt+tab
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:42
good idea :)
ty
Christopher Hutchinson
@cshutchinson
Mar 07 2015 16:48
works beautifully ty @dannyfritz
Suzanne Atkinson
@AdventureBear
Mar 07 2015 17:41
good morining
er, afternoon
Cristián Berríos
@crisberrios
Mar 07 2015 17:45
good morning for me still
Suzanne Atkinson
@AdventureBear
Mar 07 2015 17:49
:)
hey, can I bug you to look at my reduce function? Can't seem to get it workiing
Cristián Berríos
@crisberrios
Mar 07 2015 17:53
you still have to use a somewhere
Suzanne Atkinson
@AdventureBear
Mar 07 2015 17:53
I don't like a. lol
Cristián Berríos
@crisberrios
Mar 07 2015 17:53
also, you always have to return something when reducing
since that goes to a
as it acts as an accumulator
Suzanne Atkinson
@AdventureBear
Mar 07 2015 17:54
doesn't return b push it to a ?
Cristián Berríos
@crisberrios
Mar 07 2015 17:56
yes, but you are only pushing in the "if" case
on the "else case" you return undefined
and that goes to a
with reduce, the start value is either the 1st value of the array (passed as a), or a value you define as a second parameter (initial value) also passed as a on the first iteration
Danny Fritz
@dannyfritz
Mar 07 2015 17:58
b doesn't push to a. it returns b as the new accumulator
the return of the last iteration will be the accumulator of the next iteration. most times you will return the accumulator
Cristián Berríos
@crisberrios
Mar 07 2015 17:59
^
Suzanne Atkinson
@AdventureBear
Mar 07 2015 17:59
OH...
Ok, I'm closer
so a is only the previous value if you set it to something? Is a the accumulator or an array value? I'm confused there.
In any case, now by adding return a with the else, I do have it returning a value to me, which is the value of hte location where the new element would be placed.
did that make any sense? lol. Again, not sure my logic (b<num) is sound, but it was hard to test when the function wasn't working
Danny Fritz
@dannyfritz
Mar 07 2015 18:05
@AdventureBear there is a paramater to supply the beginning value of the accumulator.
Cristián Berríos
@crisberrios
Mar 07 2015 18:07
wrapping it up, you have 4 parameters to work with
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:07
I've read that 20 times already...clearly something's not clicking in my brain
Cristián Berríos
@crisberrios
Mar 07 2015 18:07
initial value, a, b and index
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:08
right, because array is "optional" as I'm already using it to invoke the iterator, right?
Cristián Berríos
@crisberrios
Mar 07 2015 18:08
right
Danny Fritz
@dannyfritz
Mar 07 2015 18:08
@AdventureBear some simple reduce examples: http://repl.it/cwr/7
Cristián Berríos
@crisberrios
Mar 07 2015 18:09
a is the initial value (if you define it) or the 1st item of the array
but also, is where you want to store your result
which, in theory, has to be an index
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:09
Oh, geez, just saw where the initial value goes for the first time..way down there after the end of the callback function!
Danny Fritz
@dannyfritz
Mar 07 2015 18:10
i added one more for posterity: http://repl.it/cwr/8
Cristián Berríos
@crisberrios
Mar 07 2015 18:10
b are the array values (if you set an initial value) so you might want to compare against them
and index is the index of the current item (b) within the array
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:10
if it weren't for you guys this owuld be really, really hard to figure out!!
so I want to compare array values (compare num, with the current value).
Cristián Berríos
@crisberrios
Mar 07 2015 18:11
not necessarily
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:11
when I fidn the first value that is greater than the num, I want to insert at that index location.
Cristián Berríos
@crisberrios
Mar 07 2015 18:11
those are just the tools you have to work with
you can compare against anything
and put anything in the accumulator
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:16
@dannyfritz thanks for those eamples!
examples
Danny Fritz
@dannyfritz
Mar 07 2015 18:16
:thumbsup:
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:18
In this case, I'm not sure how accumulating values helps because while I want to end up with ONE number from the algorithm, it's not really the result of a mathematical expression is it? Returning the index of a number I've compared to another number?
Maybe if I did this "long hand" with a for loop I'd see the pattern I'm looking for. ..
sigh.
Cristián Berríos
@crisberrios
Mar 07 2015 18:18
maybe
Danny Fritz
@dannyfritz
Mar 07 2015 18:18
someone suggested to me yeseterday to try writing something long-hand first. and by golly it worked
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:19
haha.
well in my mind it's clear... :)
Cristián Berríos
@crisberrios
Mar 07 2015 18:19
it's easy to turn up a loop into something else
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:20
when I took programming classes in college (which was like 20 years ago), I used to go sit on my porch witha blank sheet of 8 1/2 x 11" paper and a 0.5mm lead pencil and hand write my algorithms. I usually finished my projects before everyone else that way!
Danny Fritz
@dannyfritz
Mar 07 2015 18:21
i have a whiteboard on my desk i use http://www.esquoia.com/
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:25
whoa that is cool!!
OK, I'll work on this and let you guys know if I survive.
I mean, when I have it figured out
Danny Fritz
@dannyfritz
Mar 07 2015 18:26
:laughing:
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:36
OK, this took about 2 minutes and passes
how to convert that to reduce (for the sake of my education...)
Danny Fritz
@dannyfritz
Mar 07 2015 18:38
i don't think i would convert it to a reduce. :P
Yosi
@jparkton
Mar 07 2015 18:49
how does writing out the code with a pencil differ from typing the same characters in a text file?
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:49
Then when am I trying to do it???
it feels different
Yosi
@jparkton
Mar 07 2015 18:49
Or does it maybe have something to do with the Brain->Hand thing
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:49
it's more spacial
Yosi
@jparkton
Mar 07 2015 18:49
spacial?
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:49
I can write in the margins, draw arrows, insert ideas
no spacial
Yosi
@jparkton
Mar 07 2015 18:49
//comment like a baws
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:49
there is space you can work with on a sheet of paper, rather than lines of code
it's different parts of the brain working to solve a puzzle
you can write on paper anywhere
Yosi
@jparkton
Mar 07 2015 18:50
I can type anywhere
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:50
see it in the sun. Doesn't need to be charged
Yosi
@jparkton
Mar 07 2015 18:50
wut??
Danny Fritz
@dannyfritz
Mar 07 2015 18:50
@jparkton changing your environment sparks creativity
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:50
you asked how it was different
but you seem to be looking for a debate
Yosi
@jparkton
Mar 07 2015 18:51
True that @dannyfritz
Danny Fritz
@dannyfritz
Mar 07 2015 18:51
and yeah, handwriting if often more expressive than typing.
Yosi
@jparkton
Mar 07 2015 18:51
true
Danny Fritz
@dannyfritz
Mar 07 2015 18:51
but yeah, doing your thinking on a text editor isn't wrong either though
you choose what works
Yosi
@jparkton
Mar 07 2015 18:52
yeah
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:52
right...sharing what worked for me!
Yosi
@jparkton
Mar 07 2015 18:52
I wonder if it triggers something in the brain when you write it more than when typing
Danny Fritz
@dannyfritz
Mar 07 2015 18:53
maybe, but i would guess in terms of brain activity typing and handwriting would be similar
if you are a touch typist
Yosi
@jparkton
Mar 07 2015 18:53
hm
oh hah lol
I wasn't looking for a debate, only to hear why people think it helps.
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:54
Well if it doesn't help you then it doesnt. ;)
Yosi
@jparkton
Mar 07 2015 18:54
I just dont see the difference
I also think it helps to see the errors
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:54
Keep in mind I graduated from college in 1990. use of computers meant being in a college lab with no windows
Yosi
@jparkton
Mar 07 2015 18:54
paper doesnt compile well
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:54
do what works for you
sounds like you've convinced yourself then. :)
Yosi
@jparkton
Mar 07 2015 18:55
I dont think so
I am looking to understand how it helps, I think fritz nailed it with changing environments, sometimes it helps me to go take a walk and approach it later
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:57
OK, well when I sit with paper I'm not in a debugging mode, I'm in a thinking mode.
Yosi
@jparkton
Mar 07 2015 18:59
OK!
Suzanne Atkinson
@AdventureBear
Mar 07 2015 18:59
When I have the pencil in my hand, I become more of an artist. I reach a more meditative state with a lead tip that slides over just the right textured paper where I feel my ideas flow onto the paper without my brain worrying about targets on a keyboard and typos. I can close my eyes or refocus on the horizon (instead of the cute/annoying/loud/well-dressed person in teh coffee shop) and let the thought mingle there. I can just close my eyes and feel the warmth of the sun and take a short nap...
does that help you understand why I like that method?
Yosi
@jparkton
Mar 07 2015 19:00
Not really, but maybe that is why it is your method
lol
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:00
ha, OK,
interesting how we all think differently.
Yosi
@jparkton
Mar 07 2015 19:03
yeah
We all learn our own way
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:04
@crisberrios I think I'm going to achieve my 1000 hours of Free Code Camp just from working on no repeats please
Yosi
@jparkton
Mar 07 2015 19:04
lol
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:06
haahah
I'm no my first 2 fire bonfire!
on my
yikes!!
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:07
first or last?
Cristián Berríos
@crisberrios
Mar 07 2015 19:14
@chrisdziewa lol
how may I help you?
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:19
suggest a different career path
just kidding haha
@crisberrios It's funny. I understand simple recursion and have no problem building regular programs and websites but the second that I need to do something more complex (useful?) with recursion my eyes glaze over and everything just goes over my head.
Yosi
@jparkton
Mar 07 2015 19:21
I can identify
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:24
ugh. why doesn't this work the way it LOOKs like it should??
I'd have had this sum bonfire done 20 minutes ago if it did! lol
what's red highlighting mean here in gitter?
Yosi
@jparkton
Mar 07 2015 19:27
someone said your name
Danny Fritz
@dannyfritz
Mar 07 2015 19:27
@AdventureBear because Array.prototype.sort is dumb and sorts as if it is a word
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:29
I just "sorted" it out by adding a fuction (compare(a,b){a<b}); or something along those lines. it's in the examples.
just took me a long time ot sort it out
Cristián Berríos
@crisberrios
Mar 07 2015 19:29
@chrisdziewa it's not too diferent than doing a recursive fibonacci, but in this case you are branching the solution, so what goes in the recursion call for each branch is different.
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:29
@jparkton thanks
@chrisdziewa another "way back" story from me dealing with recursion...
Cristián Berríos
@crisberrios
Mar 07 2015 19:30
@chrisdziewa in fib, you call fib(n-1) and fib(n-2), in this case you maybe do a return func(arr1).concat(func(arr2))
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:30
i used to work as an Outward Bound instructor, taking kids on wilderness trips for 3 weeks at a time.
I was dating a programmer who challenged me to write some C code to solve the Towers ofHanoi problem
Cristián Berríos
@crisberrios
Mar 07 2015 19:30
or return func(arr1) + "," + func(arr2)
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:31
I could solve the puzzle but couldn't program it. Would you believe that that long summer of dealing with 15 year old misfit kids much of what I thought about was that recursive problem ? lol.
Cristián Berríos
@crisberrios
Mar 07 2015 19:31
or arr.map(function(i) {
return function(i) });
it all depends on how you structure the recursive function
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:31
and @jparkton when it hit me, I wrote it down in my (paper) note book/ journal, and when I got home that summer plugged it in and it worked. That was before the days of digital notebooks.
Yosi
@jparkton
Mar 07 2015 19:32
I was one of those misfits
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:32
@crisberrios the closest I've come to doing something on there with a test case of "aab" is a result of ["aa", "ab"]
so I guess I don't know how to make the call continue on until each value in the result is the correct length
Cristián Berríos
@crisberrios
Mar 07 2015 19:33
let's go through permutating aab with a simple pseudo function
function string:
if string length is 1, return string
else
call the function once per each possible string without one of the characters and return the aggregated result
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:36
@jparkton I thought so. ;)
maybe you helped me solve it!
Yosi
@jparkton
Mar 07 2015 19:37
I doubt it
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:37
lol
lotbs
@LookOnTheBrightSide
Mar 07 2015 19:38
how long should the 1 flame bonfires be taking me? I'm afraid i'm too slow. just finished one in about an hour 🙀
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:39
@LookOnTheBrightSide you'll get faster
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:39
@LookOnTheBrightSide some of them take me an entire day of troubleshooting. Pairing helps
Yosi
@jparkton
Mar 07 2015 19:39
should take about 10 minutes
maybe less
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:39
What adventurebear said
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:40
Depends on your programming experience and exposure to JS too.
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:41
You will get into the flow and cruise through some and get stuck for a while on others until you grasp the concepts you need to use or a function that works best.
lotbs
@LookOnTheBrightSide
Mar 07 2015 19:41
zero experience
started a few months back on/off
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:41
in that case I think they can be tricky since you have little experience to go on.
lotbs
@LookOnTheBrightSide
Mar 07 2015 19:41
@jparkton lol
Yosi
@jparkton
Mar 07 2015 19:41
anywhere from 1hr > 1week
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:41
@LookOnTheBrightSide and it isn't a race.
Yosi
@jparkton
Mar 07 2015 19:41
^
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:41
@jparkton that's where I am the over a week thing haha
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:41
haha
Yosi
@jparkton
Mar 07 2015 19:42
Once you grasp js, the bonfires ill take about 5 minutes, see the rquirement, write the code, run, pass
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:42
this is by far the slowest component of FCC for me so far.
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:42
Everything else was pretty straight-forward
lotbs
@LookOnTheBrightSide
Mar 07 2015 19:42
I'm glad I'm doing them without having to google
just mdn ...
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:42
I'm plannign to redo the bonfires for reinforcement. it's clear to me that the methods used are useful and will apply to real world problems.
Yosi
@jparkton
Mar 07 2015 19:43
these are also pretty good http://www.codewars.com/
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:43
yeah mdn is good and stackoverflow is sometimes better (when you want to see it in action)
Yosi
@jparkton
Mar 07 2015 19:43
problem solving are fun
Chris Dziewa
@chrisdziewa
Mar 07 2015 19:44
@jparkton A lot of those are challenging but I love that they show all the other solutions when you are finished
Yosi
@jparkton
Mar 07 2015 19:44
I do too!
Also the learnyounode ones
Suzanne Atkinson
@AdventureBear
Mar 07 2015 19:44
diff two arrays...seems like a series of forEach would work ?
learnyounode is fun, i'm on #8 I think but will need a referesher after my vaca last week.
Jorge
@jdesotoi
Mar 07 2015 20:13
glad to know im not the only one on that one
Cristián Berríos
@crisberrios
Mar 07 2015 20:24
forEach will work
also, mind to share the code that worked for you in the previous bonfire?
I'm curious on what was the final result of your quest :P
Suzanne Atkinson
@AdventureBear
Mar 07 2015 20:31
for the sums between 2 numbers?
or the one prior to that? (geez I'm forgetting already)
Cristián Berríos
@crisberrios
Mar 07 2015 20:34
where in the array
Suzanne Atkinson
@AdventureBear
Mar 07 2015 20:39
Oh, hang on
@crisberrios http://repl.it/dGJ
Cristián Berríos
@crisberrios
Mar 07 2015 20:41
so you didn't use an iterator :P
well, the answer is simple enough, but you have to get a grip on iterators
Suzanne Atkinson
@AdventureBear
Mar 07 2015 20:46
They are slippery
:point_up: March 7 2015 1:38 PM @crisberrios --> I decided to move on
Danny Fritz
@dannyfritz
Mar 07 2015 21:17
Suzanne Atkinson
@AdventureBear
Mar 07 2015 21:50
whoa, brilliant!
Returning the location of false. I love it.