These are chat archives for MontCode/GeneralChat

29th
Jun 2016
David Castner
@davidjcastner
Jun 29 2016 00:00
@SimplyPhy I check gitter at least twice a day except for when I'm traveling
@dcpking If you need help with python let me know, that was the first language I learned properly
Eric Phy
@SimplyPhy
Jun 29 2016 00:01
Aside from perhaps when you're jumping into a project that hasn't used strict mode and would be difficult to change to accommodate it, can you think of any time when it wouldn't be possible/reasonable to use?
Mike
@dcpking
Jun 29 2016 00:02
@davidjcastner I may end up taking you over for a week, David!
David Castner
@davidjcastner
Jun 29 2016 00:02
two reason you wouldn't use it, first being the one you mentioned, second if someone pointed a gun at you and told you not to use it or else, in which case it's debatable
Jonathan Herman
@lantech19446
Jun 29 2016 00:04
@davidjcastner would you just be to shaken up to use strict code after shooting them?
Eric Phy
@SimplyPhy
Jun 29 2016 00:04
So if someone's pointing a gun at me, threatening to fire if I use strict mode, and they're referencing me using it on his/her project which is large and doesn't use strict mode...probably a no go?
David Castner
@davidjcastner
Jun 29 2016 00:05
yea probably but it's your dignity at stake
I think i'm caught up on chat now
@dcpking yea feel free to fire python questions at me, I love that language and would like to use it more
Eric Phy
@SimplyPhy
Jun 29 2016 00:07
what's better: 2.7 or 3.x :P
Mike
@dcpking
Jun 29 2016 00:07
It's one of the things on my "almost right now" list to learn - thanks
3.n is surely the future
David Castner
@davidjcastner
Jun 29 2016 00:08
I have gone through most of project euler with python
Lily Romano
@Lilyheart
Jun 29 2016 00:08
well @davidjcastner , I finally finished Map the Debris. Only one left now. No repeats please
David Castner
@davidjcastner
Jun 29 2016 00:08
@Lilyheart congrats!!!
Lily Romano
@Lilyheart
Jun 29 2016 00:08
Laughing out loud at the :worried: :gun:
David Castner
@davidjcastner
Jun 29 2016 00:09
I don't know enough about the latest changes of python to give you a good answer between the two. when I was using it (about 2 years ago) it was always use python 2.7
Nowadays my guess would be that 2.7 will be maintain for quite a few more years, but if you're starting a new project or beginning to learn python use 3
Jonathan Herman
@lantech19446
Jun 29 2016 00:11
a year or so ago a lot of things weren't supporting 3 I believe android was one of those things. Not sure if this has changed but there were concerns about its security.
Lily Romano
@Lilyheart
Jun 29 2016 00:12
What is the best way to approach No repeat please? Determine all the permutations and use regex to look for repeated chars?
David Castner
@davidjcastner
Jun 29 2016 00:13
honestly the biggest issue for me between the two was having to use parentheses on print statments
# python 2.7
print "hello world!"
# love it!
# python 3
print("hello world!")
# omg WTF! my life is over, this is so unpythonic!
@Lilyheart knowing me, you will know that regex is a last resort
Lily Romano
@Lilyheart
Jun 29 2016 00:14
Yeah... but... best approach....
David Castner
@davidjcastner
Jun 29 2016 00:14
let me check
Lily Romano
@Lilyheart
Jun 29 2016 00:14
heh
David Castner
@davidjcastner
Jun 29 2016 00:14
best approach implies not using regex :wink2:
Lily Romano
@Lilyheart
Jun 29 2016 00:14
Really, I just really don't wanna write this function. Something about it makes me icky.
LIES!
David Castner
@davidjcastner
Jun 29 2016 00:16
after you have a function that creates permutations, it's not too bad
Mike
@dcpking
Jun 29 2016 00:17
Do I <em>have</em> to use JavaScript to do it with?
Like usual it's past 8 and I didn't even realize it! Good Code and Good Chat @davidjcastner @lantech19446 @dcpking @SimplyPhy @ReentryUSA2_twitter @CodingNerd32 ! (I hope I got everyone).
David Castner
@davidjcastner
Jun 29 2016 00:19
@dcpking I think some python libraries will convert your python to javascript for the frontend. No matter what you need javascript for the client side because browser don't run python. I never used django, so I'm not sure if it does
Jonathan Herman
@lantech19446
Jun 29 2016 00:19
lol I didn't realize it either, I'm here so much
David Castner
@davidjcastner
Jun 29 2016 00:19
Good night!
Jonathan Herman
@lantech19446
Jun 29 2016 00:19
night dave!
Mike
@dcpking
Jun 29 2016 00:19
Good night David!
Lily Romano
@Lilyheart
Jun 29 2016 00:20
I'm not goin' to be yet xD
Mike
@dcpking
Jun 29 2016 00:20
ACM has some fun stuff, doesn't it Lily!
David Castner
@davidjcastner
Jun 29 2016 00:20
oh whoops i'm still here sorry thought @dcpking was saying goodnight misread that lol
thanks though!
Lily Romano
@Lilyheart
Jun 29 2016 00:20
Yes, but... I'm actually debating not renewing...
David Castner
@davidjcastner
Jun 29 2016 00:20
@dcpking good chat to you two!
Mike
@dcpking
Jun 29 2016 00:21
@Lilyheart You're on a student sub - no?
@davidjcastner You too!
Lily Romano
@Lilyheart
Jun 29 2016 00:21
I am. But I have zero income. So... And MontCode eats money :p that seems like a better investment.
Eric Phy
@SimplyPhy
Jun 29 2016 00:21
night all :)
David Castner
@davidjcastner
Jun 29 2016 00:22
@SimplyPhy Good night!
To everyone: remember that you can always ask questions here during the week. I use it as a break from work, do I need a life...?
Mike
@dcpking
Jun 29 2016 00:26
Well, now DCPKing really is saying goodnight, but only because he has to go back to the BootCamp. Oh what fun it is to be a slave to your own brain!
Lily Romano
@Lilyheart
Jun 29 2016 00:27
heh
Jonathan Herman
@lantech19446
Jun 29 2016 00:30
night Mike
Lily Romano
@Lilyheart
Jun 29 2016 00:30
nini
David Castner
@davidjcastner
Jun 29 2016 00:30
Good night!
ReentryUSA
@ReentryUSA2_twitter
Jun 29 2016 00:35
You folks are awesome to follow! Take care and good night. Rich Jacobs
Jonathan Herman
@lantech19446
Jun 29 2016 00:41
night Rich
Lily Romano
@Lilyheart
Jun 29 2016 01:07
Converting this healps algorithm code to JS without looking to see what other people did is a pain in the :sparkles:
ReentryUSA
@ReentryUSA2_twitter
Jun 29 2016 01:24
:)
Lily Romano
@Lilyheart
Jun 29 2016 02:30
FCC Advanced Algorithm Scripting is done. Only projects left for Front-End! wheee
Time for zzzzz
Lily Romano
@Lilyheart
Jun 29 2016 12:36
To answer my question about regEx yesterday, after determining the permutations, it's a single line to count the number of "no repeats". if (!array.join("").match(/(.)\1/)) answer++;
Eric Phy
@SimplyPhy
Jun 29 2016 15:10
Feeling dumb again :grimacing:
Lily Romano
@Lilyheart
Jun 29 2016 15:11
why?
Eric Phy
@SimplyPhy
Jun 29 2016 15:11
Ha, I figured that green dot meant you were here :D
Lily Romano
@Lilyheart
Jun 29 2016 15:12
See! Smart!
Eric Phy
@SimplyPhy
Jun 29 2016 15:12
haha xDD
I'm just putting together instances of a constructor, trying to do so programmatically through OOP as much as possible, and just bumping into so many "but what about that"s
"can a string value be programmatically defined and then used to concatenate a variable in a function call?"
stuff like that
when does a method return a value, and therefore can be chained, and when doesn't it
etc etc
Lily Romano
@Lilyheart
Jun 29 2016 15:15
But think of how smart you will feel when it all clicks! (I don't think it clicks for anyone the first time around tbh)
Eric Phy
@SimplyPhy
Jun 29 2016 15:21
yup, yeah i don't actually think i'm dumb, i just feel dumb for now :D. Just as ones capacity to get angry doesn't predicate them as being violent, so too shouldn't ones feeling of being dumb make them believe themselves idiots. :snowman:
Your dot turned orange :sad:
really, sad isn't one? haha xD
Lily Romano
@Lilyheart
Jun 29 2016 15:21
I have three monitors xD Gitter is only one of them :laughing:
Eric Phy
@SimplyPhy
Jun 29 2016 15:22
"time for a fourth monitor" :stuck_out_tongue:
aww :(
Lily Romano
@Lilyheart
Jun 29 2016 15:25
silly boy
blob
Eric Phy
@SimplyPhy
Jun 29 2016 15:27
ha not fair!
Lily Romano
@Lilyheart
Jun 29 2016 15:27
heh
I guess technically there are 4 screens if you count the pi in the lower left.
Eric Phy
@SimplyPhy
Jun 29 2016 15:30
almost there...
Lily Romano
@Lilyheart
Jun 29 2016 15:30
I've seen some pretty impressive single person setups on massive frames. I won't be able to go much higher as this is a sitstand desk so I have the weight to think about on the motor.
Eric Phy
@SimplyPhy
Jun 29 2016 15:32
How do I get the URL to disappear?
Lily Romano
@Lilyheart
Jun 29 2016 15:32
Image is ![alt](http://) I believe
Eric Phy
@SimplyPhy
Jun 29 2016 15:32
Yup, it just also shows the code when I do that on gitter :(
Lily Romano
@Lilyheart
Jun 29 2016 15:33
I hate coming up with alt text
I typed in ![I hate coming up with alt text](http://static1.businessinsider.com/image/4b06c73900000000002ff0fa/how-to-get-your-boss-to-buy-you-more-computer-monitors.jpg)
Eric Phy
@SimplyPhy
Jun 29 2016 15:33
weird...can you see my code in my post?
ooooo
Lily Romano
@Lilyheart
Jun 29 2016 15:34
you fllipped the [] and the ()
Eric Phy
@SimplyPhy
Jun 29 2016 15:34
ha, I can't edit anymore
I deserve it
xDD
Lily Romano
@Lilyheart
Jun 29 2016 15:34
And that is how we learn! I still flip the []()
Eric Phy
@SimplyPhy
Jun 29 2016 15:35
I am a champion
muhahaha
Lily Romano
@Lilyheart
Jun 29 2016 15:35
lulzy
David Castner
@davidjcastner
Jun 29 2016 16:06

Learning new things everyday about my favorite management tool :octocat:

If you include a task list in the first comment of an Issue, you will get a handy progress indicator in your issue list. It also works in Pull Requests!

how to make a task list

- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item

Source: https://guides.github.com/features/mastering-markdown/

David Castner
@davidjcastner
Jun 29 2016 16:14
@Lilyheart what are you using for hosting mongodb?
Lily Romano
@Lilyheart
Jun 29 2016 16:14
It's in cloud9
Next lesson is heroku tho however it's spelled. On lunch at the moment
David Castner
@davidjcastner
Jun 29 2016 16:16
got it, if you or anyone else is interested, I would recommend mLab, they have free sandbox environments
Lily Romano
@Lilyheart
Jun 29 2016 16:16
I'll read that GitHub link soon. Looks interesting at a glance
Lily Romano
@Lilyheart
Jun 29 2016 18:18
Looking at the titles of the videos for the next section @davidjcastner , it looks like we will be deploying the yelp-camp app on heroku using mongoLab. Small world :D
Eric Phy
@SimplyPhy
Jun 29 2016 21:38
var happy = 5;

var happyFun = function() {
    var happy = 7;

  function happier(){
    var happy = 9;
    return happy;
  };
  happier();
  console.log(happy);
  console.log(happier());
};
happyFun();
console.log(happy);
Playing with scope. Ugh. But getting there :sunrise_over_mountains:
Lily Romano
@Lilyheart
Jun 29 2016 21:38
Dat's a lot of nested happiness
Eric Phy
@SimplyPhy
Jun 29 2016 21:38
I manipulated that code like 40 times
dit dis, dit dis.
Lily Romano
@Lilyheart
Jun 29 2016 21:39
I offically have 7 minutes of video left in my 40+ hour course. https://lit-lake-99427.herokuapp.com/campgrounds
Eric Phy
@SimplyPhy
Jun 29 2016 21:39
w00t w00t
Lily Romano
@Lilyheart
Jun 29 2016 21:40
1.5 speed here I come!
Eric Phy
@SimplyPhy
Jun 29 2016 21:43
2.0!
10.0!
Lily Romano
@Lilyheart
Jun 29 2016 21:43
Dude already talks quickly @ _@
Eric Phy
@SimplyPhy
Jun 29 2016 22:11
Finished? [yay?]
Lily Romano
@Lilyheart
Jun 29 2016 22:12
Yar
Eric Phy
@SimplyPhy
Jun 29 2016 22:12
yay!
medium level celebration, i imagine?
Lily Romano
@Lilyheart
Jun 29 2016 22:13
I get to watch a TV episode on Netflix. Whooooooo
Eric Phy
@SimplyPhy
Jun 29 2016 22:13
:D
not bad not bad
so question:
can you declare a variable in js and set a data type but no variable?
like var number = some_number; // console.log(number) = undefined ...but you can still do number++ and have it return a number?
Lily Romano
@Lilyheart
Jun 29 2016 22:16
Num++ on an undefined gives undefined
Eric Phy
@SimplyPhy
Jun 29 2016 22:16
yeah that's my problem :(
David Castner
@davidjcastner
Jun 29 2016 22:16

@SimplyPhy no, there are falsy (yes that is the technical term, they are empty values like '' or 0) values for most data types though

undefined is a data type though

https://www.sitepoint.com/javascript-truthy-falsy/

@SimplyPhy what are you trying to work around?
Eric Phy
@SimplyPhy
Jun 29 2016 22:17
and David swoops in :D
var Cat = function(name, pic){

        this.name = name;
        this.pic = pic;

        this.catCount = number;
        (function() {
            Cat.catCount++;
        })();

        // Cat.catCount = 0;
    };
David Castner
@davidjcastner
Jun 29 2016 22:18
@Lilyheart is knowledgeable too, so she's good to listen to too
Lily Romano
@Lilyheart
Jun 29 2016 22:18
cept when typing on a phone that is about to die. heh
Eric Phy
@SimplyPhy
Jun 29 2016 22:18
I'm trying to automatically increment catCount without defining the variable in the global scope
and without resetting it everything i make a new Cat :(
David Castner
@davidjcastner
Jun 29 2016 22:18
@SimplyPhy is there a value that you would catcount to start at?
Eric Phy
@SimplyPhy
Jun 29 2016 22:19
yeah 0, but it seems whenever i define it anywhere besides globally, it just resets to 0 everytime i make a new Cat
the worst part is i'm not sure there's any difference to defining a constructor's property within it or outside of it
aside from it only running once when you define it outside
David Castner
@davidjcastner
Jun 29 2016 22:26
one sec I am looking something up to verify that I'm giving you correct information
Eric Phy
@SimplyPhy
Jun 29 2016 22:37

So I imagine this one will be quick (I think the answer is no):

Is it possible to call a variable through concatenation...e.g.:

var happy1 = 5;
var happy2 = 10;

var happyArray = [];

function happyPush(){
  for(var i = 0; i < 2; i++) {
    var newHappy1 = "happy" + [i].toString;
    var newHappy1 === 5 // true
  }
};

Or something that logically functions in that way, but actually works?

To be clear: I know what I wrote doesn't work; I'm just curious if such a methodology exists, so that you call loop through variables based on their numeric suffix.
David Castner
@davidjcastner
Jun 29 2016 22:43
yea I am almost done writing an explanation, but I have to go to dinner, I shouldn't be long. I'll tag with the answers to your questions
Eric Phy
@SimplyPhy
Jun 29 2016 22:46
<3
Lily Romano
@Lilyheart
Jun 29 2016 22:51
@SimplyPhy not a medium level celebration, a whopper one. I'm at Burger King.
Eric Phy
@SimplyPhy
Jun 29 2016 22:55
My Gosh. Watching netflix while driving and eating a whopper? Champion status.
Lily Romano
@Lilyheart
Jun 29 2016 23:11
Heh. I finished my ep allotment
David Castner
@davidjcastner
Jun 29 2016 23:17
@SimplyPhy okay so for having class properties here's how you can do it. I am having trouble finding a good source for it though, I've people use iife's for this too
// two ways to create a class property for class-like objects in javascript
// (technically it's not a class)
//
// Cat (the variable) is a defined as a function that will return a Cat object
// when new Cat() is called
//
// Cat is still an object at heart (functions are technically objects) with a
// special property to call the function
// so properties can still be added to Cat for the entire class

////////////////////////////////////////////////////////////////////////////////
// OPTION ONE: Using a property value
////////////////////////////////////////////////////////////////////////////////

var Cat = function(name, pic) {
    this.name = name;
    this.pic = pic;
    // here the counter is set to the property value
    // the function is being called yet, so not worried about
    // Cat.catCount being undefined
    this.nthCat = Cat.catCount;
    // increase the cat counter
    Cat.catCount++;
};
// now Cat is an object we can add properties to

// using Cat.variableName defined a property specific to Cat
// note this could also be defined as a global variable
Cat.catCount = 0;

////////////////////////////////////////////////////////////////////////////////
// OPTION TWO: using a global variable
////////////////////////////////////////////////////////////////////////////////

// variables defined using var are limited in scope by two things
// function and file
// so using a global like this is okay if each class has a seperate file
var catCount = 0;

// prototypes are like class methods
var Cat = function(name, pic) {
    this.name = name;
    this.pic = pic;
    this.nthCat = catCount;
    // increase the cat counter
    catCount++;
};
@SimplyPhy regarding you concatenation question, I'm afraid I don't know what you are trying to achieve with your code, could you explain it a little bit more
Eric Phy
@SimplyPhy
Jun 29 2016 23:27
Thanks @davidjcastner :thumbsup: . Very descriptive :D.
I wanted basically to just make a bunch of new Cats, and was hoping to use a for loop to create as many Cats as I wanted, but incrementing each new Cat's variable value. E.g. cat1, cat2, cat3, etc.

so instead of doing:

    var cat1 = new Cat("Cute Cat", "images/cat1.jpg");
    var cat2 = new Cat("Shy Cat", "images/cat2.jpg");
    var cat3 = new Cat("Vicious Cat", "images/cat3.jpg");
    var cat4 = new Cat("Shocked Cat", "images/cat4.jpg");
    var cat5 = new Cat("Heroic Cat", "images/cat5.jpg");

I wanted to programmatically designate each new Cat. I know the parameters can be programmatically assigned, but I can't figure out how to programmatically assign the names of an array of variables. I'm thinking it can't be done.

This message was deleted
Eric Phy
@SimplyPhy
Jun 29 2016 23:34
Basically I wanted a Cat making machine :D
Lily Romano
@Lilyheart
Jun 29 2016 23:36
Better is an octocat machine. David made one once.
Eric Phy
@SimplyPhy
Jun 29 2016 23:37
P.s. number of times you guys have helped me today: several.
Number of times Udacity's entire forum team helped me today: zero.
(to be fair they tried twice, but neither time were helpful, and haven't responded since I clarified my inquiry)
which was like 10:00am
So thank you <3
one day I've have the technical mojo to help back :D
Lily Romano
@Lilyheart
Jun 29 2016 23:38
That's what I created the group for!
Eric Phy
@SimplyPhy
Jun 29 2016 23:39
I'd bet they'd say they created a forum to help, too. And then they hired probably dozens of denizens, and have [tens of] thousands of students.
I pay them to give me a piece of paper that affirms that others helped me sufficiently to get me through their program xD
David Castner
@davidjcastner
Jun 29 2016 23:41
I think you are looking for something along the lines of this, you can use i.toString() to get the a string version of the index
var allCats = [];
var limit = 9001;
for (var i = 0; i < limit; i++) {
    var name = 'cat' + i.toString();
    allCats.push(new Cat(name));
}
Eric Phy
@SimplyPhy
Jun 29 2016 23:41
hmmmm...
David Castner
@davidjcastner
Jun 29 2016 23:42
that's what the resources that I was provided for what I am working on at the moment
their example is a cat party... :cat: :balloon:
Eric Phy
@SimplyPhy
Jun 29 2016 23:43
Ha! it works! :surfer: :clap: :saxophone:
a sensible solution :D w00t!
That's awesome, thanks @davidjcastner :D
David Castner
@davidjcastner
Jun 29 2016 23:45
no problem
all that I ask is that you follow me on github (trying to grow my portfolio) https://github.com/davidjcastner
Eric Phy
@SimplyPhy
Jun 29 2016 23:46
I made it happen :D
not without angst and great personal sacrifice, but alas
David Castner
@davidjcastner
Jun 29 2016 23:47
ahahaha thanks
Eric Phy
@SimplyPhy
Jun 29 2016 23:47
@davidjcastner @Lilyheart what are you guys currently working towards, more specifically
David Castner
@davidjcastner
Jun 29 2016 23:48
in life? or what scope (get it?)
Eric Phy
@SimplyPhy
Jun 29 2016 23:49
life could be a curiosity, though I meant more regarding what each of your studying and code-related activities are pursuant of
For me, the life question would be mostly covered if I were to provide a complete response to study/code question
Lilyheart @Lilyheart runs screaming the room something about scopes.
Lily Romano
@Lilyheart
Jun 29 2016 23:53
I'm working towards a computer science degree in the fall and spring and absorb as much information as I can about other tech during the summer and winter. It will hopefully be the best of both worlds (degree and self taught)
David Castner
@davidjcastner
Jun 29 2016 23:53
For education, I am currently studying computer science, but I am not learning anything new at school at the moment; therefore, I am considering switching to business or math just so I'm not repeating material. For career, I am currently doing full stack development, but casually looking for other positions in back-end development and higher pay. I would also love to do something with artificial intelligence at some point.
@SimplyPhy what about yourself?
Lily Romano
@Lilyheart
Jun 29 2016 23:54
Then there is MontCode. MontCode original was just me and a few students from a spring class that were going to work together to go through FCC over the summer. Somehow MontCode has rocket-shipped into something else that I don't quite have a handle on yet but I'm working towards figuring that out too.
Eric Phy
@SimplyPhy
Jun 29 2016 23:57
Nice, I'll comment more in the near future about both of your responses. First: who posted the lily screaming through room thing>
Lilyheart @Lilyheart did.
Eric Phy
@SimplyPhy
Jun 29 2016 23:58
how do you do that? :(
@simplyphy does stuff too
:(
Lilyheart @Lilyheart is what is commonly known as a smartass when she has had to much sugar.
Lilyheart @Lilyheart wonders if you knew Burger King has ICEEs
Lily Romano
@Lilyheart
Jun 29 2016 23:58
/me Commonly used in MMOs
SimplyPhy @SimplyPhy muhaha
Eric Phy
@SimplyPhy
Jun 29 2016 23:58
w00t
i should have known that from my broodwar days
any who, my response:
Lily Romano
@Lilyheart
Jun 29 2016 23:59
Exactly! It's so second nature to me that one day I just typed /me did something and was like WHOA PURPLE
Eric Phy
@SimplyPhy
Jun 29 2016 23:59
/w lily stuff
nope
xD