These are chat archives for MontCode/GeneralChat

5th
Jun 2016
Jeff Fritz
@csharpfritz_twitter
Jun 05 2016 00:14
In depth JavaScript is a long strange trip.
Don't get too wrapped up in the framework du jour
Robert Maylie
@rmaylie9560
Jun 05 2016 00:29
Hey can someone take a look at my code on lesson 221. I'm stuck.
Lily Romano
@Lilyheart
Jun 05 2016 00:30
as soon as i can move again and get to the PC. dinner was too amazing
Robert Maylie
@rmaylie9560
Jun 05 2016 00:30
lol
thank you.
Robert Maylie
@rmaylie9560
Jun 05 2016 00:36
i just checked out your solution. it seems that i wasnt using the object directly. instead i was just using the params given with dot notation.
Robert Maylie
@rmaylie9560
Jun 05 2016 00:51
@csharpfritz_twitter hahaha :laughing:
can you elaborate on the magically voyage of in depth javascript? what do you find most challenging?
out of curiousity...
Jeff Fritz
@csharpfritz_twitter
Jun 05 2016 01:20
Javascript is a dynamic language, which drives me a little bitty trying to track the types of the objects I'm working with. Everything is a function, and anything can dynamically have properties and methods added to it.
It becomes very tricky to manage in larger projects, and thus the need for folks to invent CoffeeScript and TypeScript
As a fan of C# and statically types languages, I've been drawn to TypeScript
Robert Maylie
@rmaylie9560
Jun 05 2016 01:45
so just the looseness of the language ?
Robert Maylie
@rmaylie9560
Jun 05 2016 03:50
function updateRecords(id, prop, value) {
 if(value!=="" && prop!=="tracks"){
   collection[id][prop]=value;
 }
 else if(prop==="tracks" && value!==""){

     collection[id][prop]=[];
    collection[id][prop].push(value);
  }
  else if (value===""){
    delete collection[id][prop];
  }

  return collection;
}

lil I got it finally!!!!
Lily Romano
@Lilyheart
Jun 05 2016 03:51
Yay! Want a suggestion?
Robert Maylie
@rmaylie9560
Jun 05 2016 03:51
absolutely
Lily Romano
@Lilyheart
Jun 05 2016 03:52
Notice how you have to do a similar test in every if?
value ===||!== “” <- not valid code ofc, just short handing.
What would happen if you put the last logic statement first?
Robert Maylie
@rmaylie9560
Jun 05 2016 03:54
it would save some load on the program.
thats actually really smart. i see what youre saying.
Lily Romano
@Lilyheart
Jun 05 2016 03:54
if value === “”
else if prop === tracks
else
Robert Maylie
@rmaylie9560
Jun 05 2016 03:57
is there a possible logical error that could possibly happen down the like when using else if instead of else?
run-time error i mean
i really have to get in the habit of keeping the Big-O in mind. its not included in my thought process.
is that what youre saying or did i miss the point completely?
Lily Romano
@Lilyheart
Jun 05 2016 04:01
you just have to make sure that you really want EVERYTHING else. In that case else is EVERYTHING not value not tracks, which is what we want.
honestly if you look at my code even i did two else ifs. but it’s not necessary. pretty much any code can be constantly cleaned up.
But yes, optimize. On FCC it is not important. Writing that same code for a website on a server that might run many times in a very short period of time, if it needs to go to the bottom logic status, that is 6 logic checks. The above code? 2
Robert Maylie
@rmaylie9560
Jun 05 2016 04:06
awesome advice lil, definitely a great lesson you've taught me.
Lily Romano
@Lilyheart
Jun 05 2016 04:07
some people are more visual, that might be you. draw yours out the way you originally had it on a flow chart, might make it easy to say hey! wait a minute! if I put this there… then.. that.. hmm. BINGO
Robert Maylie
@rmaylie9560
Jun 05 2016 04:18
ill give it a shot. it might help with efficiently laying out logic.
Robert Maylie
@rmaylie9560
Jun 05 2016 04:47
@davidjcastner this was that platform I was talking about http://techcrunch.com/2016/05/09/beam-wants-to-turn-gaming-streams-wildly-dynamic/
Lily Romano
@Lilyheart
Jun 05 2016 13:49
This message was deleted
Robert Maylie
@rmaylie9560
Jun 05 2016 14:18
you deleted!!!
:shipit:
Lily Romano
@Lilyheart
Jun 05 2016 14:19
Cats. :smiley_cat:
Robert Maylie
@rmaylie9560
Jun 05 2016 14:19
:laughing:
what if it was just an encrypted message that explains all the secrets of life!
Lily Romano
@Lilyheart
Jun 05 2016 14:22
That’s easy. 00101010
Well, that’s the unencrypted version anyway
Robert Maylie
@rmaylie9560
Jun 05 2016 14:22
the cats need a medium to convey the message to us people!
42?
42 :worried:
Lily Romano
@Lilyheart
Jun 05 2016 14:23
Encrypted would be more like GfNTQThcL6HiaEKVZpNGfh7wDCaSpZeNKxTXTSRC3UhwoT4cpO2xAw==
Robert Maylie
@rmaylie9560
Jun 05 2016 14:24
hahahaha :laughing:
Lily Romano
@Lilyheart
Jun 05 2016 14:24
https://www.tools4noobs.com/online_tools/decrypt/ encrypted using blowfish with binary 42 as the key
Robert Maylie
@rmaylie9560
Jun 05 2016 23:44
function randomRange(myMin, myMax) {

  return Math.floor(Math.random() * (myMax - myMin + 1) +myMin); // Change this line 

}
var myRandom = randomRange(5, 15);
// so esstentially you have   1%- 100% of 16 that will get sent back but 100% of 16 is over max. hows this correct?
Lily Romano
@Lilyheart
Jun 05 2016 23:46
:sunglasses: :sparkles: :star: :star2: :dizzy: :muscle:
Robert Maylie
@rmaylie9560
Jun 05 2016 23:47
There's a nuance that I'm overlooking
Lily Romano
@Lilyheart
Jun 05 2016 23:47
What’s that?
Robert Maylie
@rmaylie9560
Jun 05 2016 23:47
read the comment at the bottom
Lily Romano
@Lilyheart
Jun 05 2016 23:50
This message was deleted
This message was deleted
Robert Maylie
@rmaylie9560
Jun 05 2016 23:51
It passed
buuuut it has the possibility of going over max(15) If random shoots out a 1
I found it curious.
Lily Romano
@Lilyheart
Jun 05 2016 23:54
Hmm.. my first thing actually doesn’t matter. lemme look.
Oh, I see your question.
It’ll never shoot out a 1. It’s a 0% to 99.99999999blah% of 16
that’s why you have to add the one.
So I repeat.. :sunglasses: :sparkles: :star: :star2: :dizzy: :muscle: