These are chat archives for FreeCodeCamp/Help

16th
Sep 2018
Smootimus
@Smootimus
Sep 16 2018 00:02
@ezioda004 Jetbrains offers their stuff COMPLETELY free if you're a student
I do use Visual Studio myself
Enterprise edition that I got completely free when I ordered Visio 2016 Pro through my school's Microsoft thing :D
I just saw the mention about this, I been out the loop :'(
But here's the Question
C or C++?
I mean it doesn't REALLY matter, but then it kinda does lol
Netbeans and Eclipse you can get to do C
Visual Studio doesn't like C so much as C++ and C#
Code::Blocks can do C
But when doing C
Traditionally I've used Dev C lol
Bloodshed's
Well, it's Dev C++ but it does C
In College when I very first learned C
We used
Miracle C
:'(
I would advocate tho, if you're on Linux or something, just use Vim and make xD
glitz20
@glitz20
Sep 16 2018 00:05
Anyone who knows how to restrict users to go through a certain page using url or link in node.js?
Smootimus
@Smootimus
Sep 16 2018 00:06
Sorry for spam :eyes: Just wanted to catch up LOL
What do you mean exactly
Restrict users
Through url or link
glitz20
@glitz20
Sep 16 2018 00:08
@Smootimus so I have page for admin, and I have its url as example.com/admin
so if the user logs in using admin credential, he/she is redirected to the /admin page
but as of now users can directly enter /admin in address bar and go to the admin page, even without admin credentials
so I want to avoid that
Kyle Holm
@thekholm80
Sep 16 2018 00:11
now i know everything there is to know about IDEs for C
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Sep 16 2018 00:18
Hi, since lookbehind is not supported to all browser and I have /(?<!\()[+\-\/*]/g which looks for any of the basic math operators which is not preceded by opening parenthesis what is the best alternative for it without using the lookbehind?
Aditya
@ezioda004
Sep 16 2018 03:39
@Smootimus Ah I see, this sem is all C so I'm looking for C only, you think I should try jetbrains?
Apparently VSC can also compile C/C++ code with code runner plugin, pretty neat
Vadim
@vnikifirov
Sep 16 2018 04:43
My site - nikifovadim.com
My Twitter- @nikifovadim
psyperl
@psyperl
Sep 16 2018 06:36
:eyes:
what's with the world's weather today
Ene Catalin
@EneCatalin
Sep 16 2018 06:39
generally shitty
thankfully global warming will solve that and make it all "saharan"
psyperl
@psyperl
Sep 16 2018 06:40
how would all be saharan, we are trapped in the middle of big water
i worry more about being drowned
unless of course if the sea water escaped into the moon
Ene Catalin
@EneCatalin
Sep 16 2018 06:44
heard drowning is a relaxing experience
so no worries
(it was a myth though, hurts like a bitch)
psyperl
@psyperl
Sep 16 2018 06:45
lolwut
Ene Catalin
@EneCatalin
Sep 16 2018 06:45
yeah apparently once you begin to "shut down" it feels very calming
I probably had it confused with death by cold
psyperl
@psyperl
Sep 16 2018 06:45
maybe you meant 'after' being shut down :D
Ene Catalin
@EneCatalin
Sep 16 2018 06:45
(though that too hurts like a bitch before you get ready to sleep)
kinda hard to feel anything after
what with being dead and all that
psyperl
@psyperl
Sep 16 2018 06:49
i read a comic when i was a kid about a man who can live underwater
i can't swim though, i am scared of the ocean
but i managed to breathe underwater in some occasional dream
psyperl
@psyperl
Sep 16 2018 06:55
but yeah.. never thought of frozen to death before.. death by cold is another thing... maybe one can take aspirin or some such
Smootimus
@Smootimus
Sep 16 2018 08:52
@ezioda004 VSC with code runner works just fine on Linux for me lol
Like a charm, actually
On windows, it's not so hot
Do you have an active Student email at a university?
I signed up for my Jetbrains pack and downloaded Pycharm and IDEA
But I haven't tried the C Lion one yet, was meaning to peek at it
Smootimus
@Smootimus
Sep 16 2018 08:59
@sabin20 So that I just now got a chance to see this, I was distracted pretty bad. But is this hosted?
@ezioda004 And what's OS? Windows, Mac, Linux?
psyperl
@psyperl
Sep 16 2018 09:07
why am i keep feeling code looks so bad

example code

const someFunction = _callback => {
  let _params = {}
  _params.SomeProp = _SOME_VALUE_
  _params.Key = _SOME_KEY_
  const someObj = new SomeInit()
  return somObj.doSomething(_params, _callback)
}

wonder what's better way of writing that

i could try..

const someFunction = _callback => {
  let _params      = {}
  _params.SomeProp = _SOME_VALUE_
  _params.Key      = _SOME_KEY_
  const someObj    = new SomeInit()
  return somObj.doSomething(_params, _callback)
}

but...

wew that's worst
but yeah gonna have trouble with repeated spaces
psyperl
@psyperl
Sep 16 2018 09:13

or i could also do

const someFunction = _callback =>
  (new SomeInit())
    .doSomething(
      {SomeProp: _SOME_VALUE_, Key: _SOME_KEY_},
      _callback
    )

or

const someFunction = _callback =>
  (new SomeInit())
    .doSomething({SomeProp: _SOME_VALUE_, Key: _SOME_KEY_},_callback)

not sure which is best and good for maintainance and readability

oh well i'll take the one with green...
psyperl
@psyperl
Sep 16 2018 09:20
i've been contemplating a lot about how the code should be written lately, compare to what's needed to be written.. i feel so unproductive ( or is that normal )
Smootimus
@Smootimus
Sep 16 2018 09:22
Hmm
I dunno which one feels better to me
Lemme look for a sec
psyperl
@psyperl
Sep 16 2018 09:25
yeah that's what i've spent most of my time with code .. "maybe i should write it that way,.. oh maybe this way.. oo this way could be better.. oo noo".. etc
Smootimus
@Smootimus
Sep 16 2018 09:27
This is what I would say
Don't go off other people's
Go off how you like to do it
Your own style
I mean nothing is really right or wrong about it, as long as it works!
I mean I would go off other people's as far as standardized ways of doing things
But when it comes to your style, that's your own personality
psyperl
@psyperl
Sep 16 2018 09:29
yeah
but i still don't know which one i like the most lol
possibly the one with green, i'll stick to that for now
BuntyBru
@BuntyBru
Sep 16 2018 09:33
@Smootimus
too early to get up
Smootimus
@Smootimus
Sep 16 2018 09:42
Too early to not have slept xD
Nah I feel pretty good actually
For not having closed my eyes
I may in a couple hrs, just for an hr or so
@psyperl The one before that one feels more JS like
To me anyways lol
psyperl
@psyperl
Sep 16 2018 09:44
@Smootimus ok thanks
Smootimus
@Smootimus
Sep 16 2018 10:12
@BuntyBru might close my eyes for an hr then I'll be right back at it heh
Aditya
@ezioda004
Sep 16 2018 11:59
@Smootimus Yeah I have an active uni email, and I'm on windows
@psyperl I like the last one, but thats subjective
Smootimus
@Smootimus
Sep 16 2018 12:06
No harm in trying the Jet rains stuff, I'm pretty sure it's all their top of the line ides you get access to completely free for a year
Aditya
@ezioda004
Sep 16 2018 12:08
Hmm, true
psyperl
@psyperl
Sep 16 2018 12:25
@ezioda004 thanks, yeah i was expecting subjective opinions
Luc Martin
@fmartin5
Sep 16 2018 13:26
@psyperl I prefer your very first version of someFunction- it's uglier and more verbose than the one with green, it looks imperative and almost like old ES 5, but having a distinct variable name for each intermediate result makes things easier to remember and debug (e.g. you can insert/remove console.log or debugger statement without refactoring any expression)
psyperl
@psyperl
Sep 16 2018 13:28
@fmartin5 thanks. and yeah, the first one is more formal i think.
Luc Martin
@fmartin5
Sep 16 2018 13:31
Yea more imperative :/
psyperl
@psyperl
Sep 16 2018 13:35

what if i refactored the last code to be somthing like this

const _makeProp = _ => ({SomeProp: _SOME_VALUE_, Key: _SOME_KEY_})
const _doInit = x => new SomeInit()
const someFunction = _callback =>
  _doInit()
    .doSomething(_makeProp(),_callback)

will it make any difference? @fmartin5 ?

not sure how i can put debugger in
Luc Martin
@fmartin5
Sep 16 2018 13:38
But, _makeProp is not a function
psyperl
@psyperl
Sep 16 2018 13:39
yeah i just turned it to function haha
Luc Martin
@fmartin5
Sep 16 2018 13:39
xD
psyperl
@psyperl
Sep 16 2018 13:39
i try to put debugger && but can't do
so yeah your reason still applies about debugging difficulty
Luc Martin
@fmartin5
Sep 16 2018 13:40
Yea and doInitand _makeProp are now in the outer scope
psyperl
@psyperl
Sep 16 2018 13:40
they are safe out there i think
possibly during debugging i can see them entering the function?
Luc Martin
@fmartin5
Sep 16 2018 13:41
Yes
I think It also look like promise-style, so maybe use promises so you have a reject handler available
psyperl
@psyperl
Sep 16 2018 13:43
ugh i need to learn about promise first before i can do that :p
Luc Martin
@fmartin5
Sep 16 2018 13:43
:D
LydaTech
@lydatech
Sep 16 2018 13:44
anyone have experience running apache on linux?
psyperl
@psyperl
Sep 16 2018 13:45
you are
:smiley:
i usually ask anything related to that to anthonygallina1 @lydatech
LydaTech
@lydatech
Sep 16 2018 13:49
@psyperl thx
psyperl
@psyperl
Sep 16 2018 13:50
last time i ran apachectl on a mac was 10 years ago.. not sure what's new anymore :D
wei2333
@wei2333
Sep 16 2018 13:56
how to use font-size
@fmartin5 but yeah, i am not so choosy atm about imperative or functional.. just trying to still be able (possibly easier) to manage codebase when it starts growing larger whichever way is possible
and i think shorter lines is better because one can see more on the editor.. or one would need to utilize the code folding feature on IDE
May Kittens Devour Your Soul
@diomed
Sep 16 2018 14:01
font-size: tiny
#that's what she said
psyperl
@psyperl
Sep 16 2018 14:03
:root { --diomed : tiny }
diomed @diomed grrrr
psyperl
@psyperl
Sep 16 2018 14:04
:smiley:
i just discovered that in debugging console we can expose the type information.. wonder if this is new
psyperl
@psyperl
Sep 16 2018 14:10
Screen Shot 2018-09-16 at 21.07.50.png
Kyle Holm
@thekholm80
Sep 16 2018 14:11
that's pretty neat
psyperl
@psyperl
Sep 16 2018 14:12
does chrome have it too? that's in Safari web console btw
psyperl
@psyperl
Sep 16 2018 14:20
and i think it needs to be active before the page is loading
Kyle Holm
@thekholm80
Sep 16 2018 14:24
oh i don't know. i've not seen anything like that in chrome, but that doesn't mean much
psyperl
@psyperl
Sep 16 2018 14:28
well at least you know that i don't have chrome on my system lol
psyperl @psyperl is a terrible web dev
May Kittens Devour Your Soul
@diomed
Sep 16 2018 14:30
don't flatter yourself
Kyle Holm
@thekholm80
Sep 16 2018 14:32
i think with lots of hard work you could become terrible
psyperl
@psyperl
Sep 16 2018 14:32
psyperl.flatter()
/// TypeError: psyperl.flatter is not a function.
Kyle Holm
@thekholm80
Sep 16 2018 14:32
it's good to have goals
psyperl
@psyperl
Sep 16 2018 14:35
i wonder why new student being taught web dev though.. web is the most difficult thing to build
Kyle Holm
@thekholm80
Sep 16 2018 14:35
you think so?
psyperl
@psyperl
Sep 16 2018 14:35
i still think so yeah
Kyle Holm
@thekholm80
Sep 16 2018 14:36
web dev clicked for me so it never felt difficult.
psyperl
@psyperl
Sep 16 2018 14:36
have you built native app before @thekholm80 ? it's much easier.. you don't have to guess around the environment etc
Kyle Holm
@thekholm80
Sep 16 2018 14:37
umm ... i've done a bit of vb. it wasn't terribly difficult either
psyperl
@psyperl
Sep 16 2018 14:37
i think that should be much easier than developing full stack for example
Kyle Holm
@thekholm80
Sep 16 2018 14:38
i think authentication was the hardest concept for me
psyperl
@psyperl
Sep 16 2018 14:38
security being taken care of, API being provided, environment is fixed ( maybe some OS version diff ) but not as bad as browser compatibility
auth is terrible yeah
i think that can be on it's own speciality
Kyle Holm
@thekholm80
Sep 16 2018 14:42
parts of it are
i don't imagine the folks who write stuff like SHA256 spend a lot of time writing, say, css or anything like that
psyperl
@psyperl
Sep 16 2018 14:44
the folks who implement or who created it?
Kyle Holm
@thekholm80
Sep 16 2018 14:44
created
psyperl
@psyperl
Sep 16 2018 14:45
we can always mail them and ask?
'dude .. nice work on SHA256, btw .. have you played around CSS transition lately? you should check it out.. it's so cool'
Kyle Holm
@thekholm80
Sep 16 2018 14:47
i wonder if they're even computer scientists, or if it was created by math geniuses then translated into code
psyperl
@psyperl
Sep 16 2018 14:47
ah yeah.. from Math background is possible too
psyperl
@psyperl
Sep 16 2018 15:55
lets study Math then!
oh nvm.. i still want my hair attached :trollface:
Kyle Holm
@thekholm80
Sep 16 2018 15:56
oh sure ... bald jokes. real original
ehutchllew
@ehutchllew
Sep 16 2018 15:57
@thekholm80 I actually used nested destructuring in production code the other day due to our conversation a while back. It was super convenient tbh.
Kyle Holm
@thekholm80
Sep 16 2018 15:58
once you try it you can never go back
so many . you'll never have to type again
ehutchllew
@ehutchllew
Sep 16 2018 16:01
Yeah, it was actually beautiful. Always a good feeling when you can apply new things you learned to real life situations.
Kyle Holm
@thekholm80
Sep 16 2018 16:01
i agree
psyperl
@psyperl
Sep 16 2018 19:07
hehehe i am still awake
yeah i also need to practice more on putting destructuring pattern in my code base.. except the part that i rarely have that idea pops up when writing code
Karma Drukpa
@coderkarma
Sep 16 2018 19:08
Hi Kyle how you doing ?
Kyle Holm
@thekholm80
Sep 16 2018 19:10
good you?
psyperl
@psyperl
Sep 16 2018 19:10
and all i remember about destructuring right now is that someone been trying so hard to split a dad from a family group here :smiling_imp:
psyperl @psyperl thinks @coderkarma only wants to say hi to @thekholm80 :smiley:
Kyle Holm
@thekholm80
Sep 16 2018 19:11
what can i say? everyone loves me
i'm freaking adorable
psyperl
@psyperl
Sep 16 2018 19:12
it's all about you here @thekholm80 :p
i literally just typing and he is just saying hi to you lol ... -- that really hurts :smile:
Kyle Holm
@thekholm80
Sep 16 2018 19:13
well i still love you
even if @coderkarma doesn't like you
psyperl
@psyperl
Sep 16 2018 19:13
\o/
and soon comes the coding question ... wait ....
Karma Drukpa
@coderkarma
Sep 16 2018 19:15
No no hi to all of my fellow senior coders.
Hahahaha
psyperl
@psyperl
Sep 16 2018 19:15
hehehe
Kyle Holm
@thekholm80
Sep 16 2018 19:15
oh now i'm "senior"? just because i'm older than everyone?
that hurts
Karma Drukpa
@coderkarma
Sep 16 2018 19:16
No no no .. it’s all about experience and skills that you folks have.
Kyle Holm
@thekholm80
Sep 16 2018 19:16
mhmm
Karma Drukpa
@coderkarma
Sep 16 2018 19:18
No question @psyperl, I haven’t done much coding problems lately, even I try to do 1-3 questions a day. Mainly focusing try to learn more front end stuff and actually trying to implement in static webpage.
Kyle Holm
@thekholm80
Sep 16 2018 19:18
i have a coding question
Karma Drukpa
@coderkarma
Sep 16 2018 19:19
I am scared to ask question these days, I am pretty sure whenever I call anyones names, they thinks I am have a questions.
Kyle Holm
@thekholm80
Sep 16 2018 19:19
why is the default action of <button> submit? the default of <input type='submit' is submit, too. so i have to say <button rel='button'>
Karma Drukpa
@coderkarma
Sep 16 2018 19:19
Which is true most of the time.
Aditya
@ezioda004
Sep 16 2018 19:20
@thekholm80 Is the button inside the form?
Kyle Holm
@thekholm80
Sep 16 2018 19:20
yeah
outside a form it doesn't matter
Aditya
@ezioda004
Sep 16 2018 19:21
Yeah inside form its default is submit
Kyle Holm
@thekholm80
Sep 16 2018 19:21
but inside a form you have to either catch the event and event.preventDefault() or put rel='button'
it's stupid
Karma Drukpa
@coderkarma
Sep 16 2018 19:22
@kyle I have no idea.
Kyle Holm
@thekholm80
Sep 16 2018 19:22
it's mostly rhetorical lol
Aditya
@ezioda004
Sep 16 2018 19:23
Welp thats how the semantics are defined
Kyle Holm
@thekholm80
Sep 16 2018 19:23
still stupid
<button rel='button'> smdh
Aditya
@ezioda004
Sep 16 2018 19:25
<button type = "button">should also stop the default behavior
Kyle Holm
@thekholm80
Sep 16 2018 19:26
still stupid
i'm convinced html was created for / by drunk people
Aditya
@ezioda004
Sep 16 2018 19:27
Inside form it kinda makes sense but yeah implicitly changing behavior creates confusion
Karma Drukpa
@coderkarma
Sep 16 2018 19:36
Semantic html5
I have never used this aside tags
Article tags
psyperl
@psyperl
Sep 16 2018 19:48
i remember seeing someone made a 'submit' button typoed value that says 'sumbit', i didn't know it was typoed, i thought the html changed the submit term to 'sumbit'. i was wondering.. hey maybe they change it because it is sending the sum of a bit .. or some such.
psyperl
@psyperl
Sep 16 2018 19:59
i am not sure if <button> default is submit though
<form method="GET" action="https://www.google.com">
  <button type="button">some button.. will it submit</button>
</form>
it does nothing here
Kyle Holm
@thekholm80
Sep 16 2018 20:00
if you take the type off?
psyperl
@psyperl
Sep 16 2018 20:01
lol wow
yeah i just realize i never have button inside form before
Kyle Holm
@thekholm80
Sep 16 2018 20:04
buttons are cool because you can style them
if you're into css and all that crap
Aditya
@ezioda004
Sep 16 2018 20:09
Speaking of forms
You know how you submit forms and the page starts reloading kinda thing? Is there a way to do it with AJAX?
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:10
If you want a submit button like that, it's simply <button type="submit">
Kyle Holm
@thekholm80
Sep 16 2018 20:10
@ezioda004 you can catch the event then preventDefault() and call your ajax instead
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:10
@ezioda004 You mean reset the form, reload the page or prevent reload?
psyperl
@psyperl
Sep 16 2018 20:11
maybe he meant the loading sign from the browser
Aditya
@ezioda004
Sep 16 2018 20:11
Yess ^^
I havent found a way to do it with AJAX
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:12
What kind of ajax are you using? Vanilla js or something else?
psyperl
@psyperl
Sep 16 2018 20:12
you might want to use custom progress bar instead i think
Kyle Holm
@thekholm80
Sep 16 2018 20:12
prolly jquery
@ezioda004 loves jquery
Aditya
@ezioda004
Sep 16 2018 20:14
Its the best library
Is AJAX method relevant? I mean even fetch uses XMLHttpRequest object..so does jQuery
Kyle Holm
@thekholm80
Sep 16 2018 20:14
i'm still not clear on what you want to do
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:15
If you want to invoke some kind of loading icon, you use beforeSend to initiate it and done to stop it @ezioda004
Aditya
@ezioda004
Sep 16 2018 20:21
I'm using something similar and no jQuery lol
For example https://purple-paladin.glitch.me/ in this one, if you upload a file, the page refreshes
I did it with AJAX here https://warm-silk.glitch.me/
They've used form
oh that is sent to custom progress possibly
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:23
But what's the point in using Ajax if you want the page to refresh? The whole purpose of Ajax is to not have the page refresh :laughing:
psyperl
@psyperl
Sep 16 2018 20:23
he want's the browser's progress indicator
Aditya
@ezioda004
Sep 16 2018 20:24
^
Kyle Holm
@thekholm80
Sep 16 2018 20:25
curious
Aditya
@ezioda004
Sep 16 2018 20:25
AJAX is just making requests via JS, can be used to redirect to pages aswell (not the issue what I'm referring to)
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:27
Yes, but the only use case for that is having a redirect based on data returned from the server
Which is still kind of silly if you ask me, cuz any server side language can redirect as well. Might as well just use a normal form
Aditya
@ezioda004
Sep 16 2018 20:29
What if I want to sanitize/modify the form before sending to backend?
psyperl
@psyperl
Sep 16 2018 20:30
what if i only want to change a letter from the backend but not the 2000MB data that are already in the browser page
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:30
Then you're pretty much wasting your time. Sanatizing user input should always be done server side
@psyperl We're talking about a re-direct here :P Not just changing some value
Aditya
@ezioda004
Sep 16 2018 20:32
Form modification is a proper use case, atleast for me
psyperl
@psyperl
Sep 16 2018 20:33
AJAX is just making requests via JS, can be used to redirect to pages aswell (not the issue what I'm referring to)
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:35
@ezioda004 Well yes and no. Sure it has its uses. I'm just saying that you can't rely on it. There are plenty of ways to modify request headers before they're sent to the server. Browser addons / Perl scripts etc. Your JS might modify it, but a user with such addons or scripts can just mess it up anyway
Kyle Holm
@thekholm80
Sep 16 2018 20:49
lol
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:49
That's not accurate. Pretty much any question that starts with "How do I.." on SO gets a lot more downvotes than that
On SO the only "good" questions are "I tried this, it didn't work, what did I do wrong?"
Kyle Holm
@thekholm80
Sep 16 2018 20:50
SO is cancer
probably runs on PHP
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:50
lol
Kyle Holm
@thekholm80
Sep 16 2018 20:50
or worse, .net
maybe it's both
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:51
They're trying to improve it. There's now a reminder to be friendly and new users get a special flag stating "user is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. "
Kyle Holm
@thekholm80
Sep 16 2018 20:52
how long has it been around?
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:52
I think it's been there for about 3 weeks
Kyle Holm
@thekholm80
Sep 16 2018 20:53
i meant SO lol ... wiki says they started in 2008, so that's 10 years of toxicity they're trying to clean up
gonna take more than a flag, i think
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:54
Oh lol. Ye true. It isn't rly working either. They're still quite toxic. And the so called "reason" for it, is to prevent users from running to SO at the first sign of trouble
Kyle Holm
@thekholm80
Sep 16 2018 20:54
my general workflow is
  1. read the docs
  2. check git hub
  3. see if someone else has asked my question on SO
  4. go desperately back to the docs
  5. find some other way to do it
@diomed x
May Kittens Devour Your Soul
@diomed
Sep 16 2018 20:56
why is there no Nobel prize for programming?
 public static void main(){
            main();
    }
psyperl
@psyperl
Sep 16 2018 20:57
how do you even know he is going to type @thekholm80 ?
Kyle Holm
@thekholm80
Sep 16 2018 20:57
i'm tapped into his webcam
May Kittens Devour Your Soul
@diomed
Sep 16 2018 20:57
he senses my presence
his beard is allergic to :cat:s
Kyle Holm
@thekholm80
Sep 16 2018 20:58
nonsense, i feed it a cat once a week
Bjorn van de Peut
@bjorno43
Sep 16 2018 20:58
Mine is slightly different:
  1. Check some IDE for syntax errors
  2. Add debugging code where ever I can
  3. Check the docs
  4. Use Google / SO search
  5. Ask here if someone is around that I know might have the answer
  6. If it's a small question, go SO chat
  7. Create SO question
  8. Find a workaround
Kyle Holm
@thekholm80
Sep 16 2018 20:58
makes it softer
May Kittens Devour Your Soul
@diomed
Sep 16 2018 20:59
my degenerate workflow is:
  1. read what is needed
  2. bother people on gitter
  3. send private messages
  4. receive private messages
  5. publish repo
  6. profit
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:00
But I guess having almost 5k rep on SO also helps me in getting more serious answers to my questions there, lol
nice humblebrag, bob
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:05
lol
I actually ment that as that SO is quite elitist. Like they're more willing to help those with high rep than those with low. As they're perceived as noobs
Kyle Holm
@thekholm80
Sep 16 2018 21:09
it's funny that the only measure of someone's ability is magic internet points
Aditya
@ezioda004
Sep 16 2018 21:10
Thats why I miss c-bot. he used to give me approval via brownies
Kyle Holm
@thekholm80
Sep 16 2018 21:10
it was pretty much the only validation i received in my life
"I might be bald, but i'm close to 2k brownies so it's not all bad"
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:11
lol. I can have Bobsbotty give out brownies. It just wont be added to your FCC points :P
Kyle Holm
@thekholm80
Sep 16 2018 21:11
i think we should start a crypto-currency and then the bot can give us money
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:12
lol
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:25
@thekholm80 It's 25%. Because the correct answer to the question is 50%. And there's only 1 answer for that
Kyle Holm
@thekholm80
Sep 16 2018 21:26
which 25% is correct though? there can be only one
newmoon
@newmoon
Sep 16 2018 21:27
To calculate chance it's 1 - ( ( 1 - x) ^ y ) where x is the choice you make divided by all possible choices (1/4) and y is the number of attempts.
:)
I think that image is a good explanation of why I hate multiple choice
(and chalkboards!)
Kyle Holm
@thekholm80
Sep 16 2018 21:28
maybe math teachers are evil
imageek-me
@imageek-me
Sep 16 2018 21:29
Hi, I have a code editor question...
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:29
@bobsbotty
1 - ((1 - 1) ^ 4
bobsbotty
@bobsbotty
Sep 16 2018 21:29
@bjorno43 There was an error with your Javascript code:
V8Js::compileString():2: SyntaxError: Unexpected end of input
Kyle Holm
@thekholm80
Sep 16 2018 21:29
)
you can borrow mine
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:29
@bobsbotty
1 - ((1 - 1) ^ 4)
bobsbotty
@bobsbotty
Sep 16 2018 21:29
@bjorno43 The result of your Javascript code is:
-3
newmoon
@newmoon
Sep 16 2018 21:30
@imageek-me What's your question?
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:30
Ah wait
imageek-me
@imageek-me
Sep 16 2018 21:30
I know I can get class intellisense from .css to .html files, but what about backwards? What if I create my classes in my html and then want to define them in the css file? I can't find intellisense plugin that will do that, I've searched VSCode and Atom. Does what I seek exist?
Bjorn van de Peut
@bjorno43
Sep 16 2018 21:30
@bobsbotty
1 - ((1 - 0.25) ^ 4)
bobsbotty
@bobsbotty
Sep 16 2018 21:30
@bjorno43 The result of your Javascript code is:
-3
newmoon
@newmoon
Sep 16 2018 21:31
@imageek-me I'm sorry, I don't know of any extensions that would help you out.
imageek-me
@imageek-me
Sep 16 2018 21:32
it looks like it was working on the 30 Days of CSS3 video...
but can't figure out how
newmoon
@newmoon
Sep 16 2018 21:34
I wonder if Brad lists out all the details of his coding environment like Wes Bos
imageek-me
@imageek-me
Sep 16 2018 21:35
I googled but didn't find anything
I already asked a question on the day1 video, guess I'll just wait and see if he responds
I'm new at coding, so what is the norm? to create all of your classes in CSS then write your HTML? Or make your classes when writing HTML then define them in the CSS file?
Kyle Holm
@thekholm80
Sep 16 2018 21:37
whichever works best for you
newmoon
@newmoon
Sep 16 2018 21:37
@imageek-me Yeah, I was thinking maybe try finding him on twitter, but youtube should work too.
I usually do a mix - my CSS will have some standard classes for adding padding, margins, buttons that I want styled a specific way, etc... Then as my page gets developed, I might add a class to the HTML and then define it in my CSS file later.
Bjorn van de Peut
@bjorno43
Sep 16 2018 22:11
Updated bobsbotty. Should no longer stop running on its own. If it does, it'll autorestart
psyperl
@psyperl
Sep 16 2018 22:13

whichever works best for you

simple answer, works most of the time

Kyle Holm
@thekholm80
Sep 16 2018 22:17
60% of the time, it works every time
psyperl
@psyperl
Sep 16 2018 22:17
:smile:
Bjorn van de Peut
@bjorno43
Sep 16 2018 22:18
I never lie, except now
psyperl
@psyperl
Sep 16 2018 22:48
i would put timeout/delay before the bot restarts.. because if there is a flaw on the start up and makes it shutdown again immediately.. that can cause it to 'busy restarting' and just looping in there... with delay will make it less severe
Bjorn van de Peut
@bjorno43
Sep 16 2018 22:58
@psyperl Nah I'm using Supervisor for it. It automaticly starts the script when stopped, but also monitors errors. In such cases it won't restart the bot and just write a log for me to check whats going on later
psyperl
@psyperl
Sep 16 2018 23:00

in that case

Should no longer stop running on its own. If it does, it'll possibly autorestart

i added the word in italic

Bjorn van de Peut
@bjorno43
Sep 16 2018 23:16
lol
@bjorno43 @thekholm80 is this good question to use map to make first element of str to upperCase
Manish Giri
@Manish-Giri
Sep 16 2018 23:22
@coderkarma normally i use .map() when I want to transform all elements of a collection in some way
Bjorn van de Peut
@bjorno43
Sep 16 2018 23:22
@coderkarma Ye. You want to split on space, then use map to lowercase each array element and uppercase the first letter afterwards
Karma Drukpa
@coderkarma
Sep 16 2018 23:25
@bjorno43 that's true , i did got the answer but i was trying to use map or arrow function to make it short
@Manish-Giri ok sir
function titleCase(str) {
    // //convert str 
    // let words = str.split(' ');
    // console.log(words);
    //  let arrStr = [];
    // // loop through an str
     for (let i = 0; i <words.length; i++){
         let word = words[i];

          let firstChar = word.slice(0,1).toUpperCase();
          let rest = word.slice(1).toLowerCase();
      let newStr = firstChar + rest;

          arrStr.push(newStr);
     }
    return arrStr.join(' ');

    //const arrStr = str.split(' ').map(function(ele, idx) {
   //   let first= ele.slice(0,1).toUpperCase();
   //   let rest = ele.slice(1).toLowerCase();
    //  return first + rest;
    //});

}

  titleCase("my name is karma");
@Manish-Giri was trying with map also
Bjorn van de Peut
@bjorno43
Sep 16 2018 23:32
@coderkarma This would be a solution with map:
function titleCase(str) {
  return str.split(' ').map(x => x.charAt(0).toUpperCase() + x.slice(1).toLowerCase()).join(' ');
}
Karma Drukpa
@coderkarma
Sep 16 2018 23:32
damnn
Damn this map, reduce is powerful
Bjorn van de Peut
@bjorno43
Sep 16 2018 23:38
Well it's really quite easy to understand.
str.split(' ') = Create array with each word
map = Perform function on each array element x
x.charAt(0).toUpperCase() = Get the first character from the string (word in x) and make it uppercase
x.slice(1).toLowerCase() = Get the entire word (x) and remove the first letter. Make the remaining string lower case
join(' ') = Put the array back together seperated by a space
Xarri Jorge
@xarrijorge
Sep 16 2018 23:41
Great breakdown @bjorno43
Kyle Holm
@thekholm80
Sep 16 2018 23:41
i think we're missing something essential here. map() performs a function on every element, and returns a new array with the outcome otherwise we'd just use forEach()
Bjorn van de Peut
@bjorno43
Sep 16 2018 23:41
@thekholm80 True
Kyle Holm
@thekholm80
Sep 16 2018 23:42
i know it seems like semantics, but i think it's key
Bjorn van de Peut
@bjorno43
Sep 16 2018 23:43
Ye you're right. It's easy to forget when you're used to it. But definitely important for those learning the function
Karma Drukpa
@coderkarma
Sep 16 2018 23:54
@bjorno43 that is true, I know how things work but I always get confuse while using it .
But i like map, filter and reduce these days.
powerful
stuff
Bjorn van de Peut
@bjorno43
Sep 16 2018 23:56
@coderkarma Keep practicing them. And learn about Callback Functions. That's the only way to get used to it
Karma Drukpa
@coderkarma
Sep 16 2018 23:57
@bjorno43 thank you, i am doing it. Mastering Js is my slogan lol
these days