These are chat archives for FreeCodeCamp/Help

17th
Oct 2018
Aditya
@ezioda004
Oct 17 2018 00:19
@Ly-Kyli You have position: fixed on the navbar, the element stays in the same position relative to the viewport , what behavior do you want?
Christopher McCormack
@cmccormack
Oct 17 2018 01:20
@Ly-Kyli may need to add this to your <head> as well - <meta name="viewport" content="width=device-width, initial-scale=1">
In Codepen you can go to Settings > HTML and there is a button to add it automatically, near the bottom
ICEBRRR
@Ly-Kyli
Oct 17 2018 01:34
@ezioda004
Sorry on mobile and couldn’t see your user name. The requirements said to fix the navbar to the left which is why I did that. i figured there might be a way to have it on the left nav and also not have the text scroll over?
@cmccormack
I’ll look into your suggestion thanks!
Momozor
@momozor
Oct 17 2018 02:20
:eyes:
Niraj Nandish
@Nirajn2311
Oct 17 2018 03:22
@diomed how do i connect a vue file with a html file , i just cant seem to understand
Anand Potukuchi
@anandpotukchi
Oct 17 2018 03:47
morning folks
YaoChen
@YaoChen1118
Oct 17 2018 04:29
morning~
Claudio Restifo
@Marmiz
Oct 17 2018 05:01
anyone here that knows JQuery?
Shabab Karim
@shabab477
Oct 17 2018 05:04
@Marmiz I think I can take a shot at the problem
Claudio Restifo
@Marmiz
Oct 17 2018 05:08

@shabab477 I have an IIFE that does what Bootstrap suggest is correct for Tooltip.js / Popper

  $(function () {
    $('[data-toggle="tooltip"]').tooltip();
  });

Then some async function that fetch data and all that stuff.
in one then
I create some markup.
then proceed to append

append(`<div class='col-sm-2 text-right'><a href="#" data-toggle="tooltip" title="Some tooltip text!">${some var for text}</a></div>`)

But the tooltip is totally ignored.
Popper is in page before bootstrap.js

either this or I do the tooltip myself :anger:
Shabab Karim
@shabab477
Oct 17 2018 05:14
I think you should be using $('[data-toggle="tooltip"]').tooltip(); AFTER you have used the append function to add the tooltip div to the DOM
@Marmiz
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Oct 17 2018 05:21
Hi, in expresssj. How are you going to test if the end point exist or not? Like if in the app route /api/:last?, are you going to check it using if (req.params.last === undefined) or if (req.params.last === null) ?
Claudio Restifo
@Marmiz
Oct 17 2018 05:26
@shabab477 think I've tried it, but will give it a shot :)
well, it worked. thanks @shabab477
Shabab Karim
@shabab477
Oct 17 2018 05:31
Sure. The reason I am telling you to use tooltip() function after you have appended to the dom is because IIFE gets invoked immediately, before even your async function has been finished. So you are trying Popperify a div that does not exist. You would want to Popperify only after it has been appended to the DOM
Claudio Restifo
@Marmiz
Oct 17 2018 05:32
Make sense
Shabab Karim
@shabab477
Oct 17 2018 05:32
The Bootstrap suggestion example works only if the div is existent in the DOM.
Claudio Restifo
@Marmiz
Oct 17 2018 05:33
Ok, this will make things... interesting :)
Thanks for the heads up :+1:
Shabab Karim
@shabab477
Oct 17 2018 05:40
@isemaj_gitlab I would use if (req.params.last) which uses Javascript's definition of falsy values to define a condition is true or false. This is actually a shorthand for if (req.params.last === undefined)
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Oct 17 2018 05:41
thank you
Shabab Karim
@shabab477
Oct 17 2018 05:41
Welcome
Claudio Restifo
@Marmiz
Oct 17 2018 05:45
only edge case if last is actually 0 :int, in that case will be seen as false.
I doubt it is a concern but it's worth to know
Shabab Karim
@shabab477
Oct 17 2018 05:48

I have a question here. I am new to contributing to FCC. Here is my work flow:

  1. Make changes to code
  2. Run npm run bootstrap
  3. Run npm run start-develop
  4. Inspect code change.
  5. Ooops made a mistake.
  6. CTRL + C stop server
  7. GOTO step 1

As you can see this is pretty cumbersome. Doing Steps 1 and 2 takes some time and I have this habit of seeing changes hot reloaded every time I make a change. Am I missing something? Or contributors are a little bit more patient than me?

@Marmiz thanks for mentioning that. Express JS most probably parses name params to type string so even if its 0 it will be of type string. So it shouldn't be a problem, at least in this case.
Bjorn van de Peut
@bjorno43
Oct 17 2018 06:43
Morning all :wave:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 07:06
@bjorno43 :wave:
Rasmus Ørum Bruus
@Plimsol
Oct 17 2018 07:15
Hi all
Claudio Restifo
@Marmiz
Oct 17 2018 07:36
@shabab477 I think the command should be develop. Or at least used to be
have a look @ package.json just to be sure
Bjorn van de Peut
@bjorno43
Oct 17 2018 07:52
My chatsystem is coming along nicely
Everything I've got working so far:
  • Multiple rooms
  • Private chat
  • Mute / Ignore users
  • Several Admin functions: Kick / Ban / Broadcast message / Cloaking (makes them invisble in userlist)
  • Profiles including profile pictures. Those are shown in chat like Gitter
  • Fully responsive obviously
  • Message logging
Anand Potukuchi
@anandpotukchi
Oct 17 2018 08:02
cool
Bjorn van de Peut
@bjorno43
Oct 17 2018 08:04
Thnx :)
May Kittens Devour Your Soul
@diomed
Oct 17 2018 08:17
@Nirajn2311 via #app
that's like vue101. better take a look at examples or better yet, look here: https://jsfiddle.net/boilerplate/vue
https://codesandbox.io/s/vue is another example, most likely the one u need
BuntyBru
@BuntyBru
Oct 17 2018 09:08
@bjorno43 congrats
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:20
@bjorno43 I think the only thing you're missing is a hovercard
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:29
@anandpotukchi A what? :joy:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:29
@bjorno43 hovercard
hover on someone's profile pic
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:29
Oh that, lol
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:30
yeah
and also download chat
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:30
Perhaps at some point. It's not rly nessesary for those that I'm building this for
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:30
@bjorno43 whom are you building it for?
We could just launch a messaging app
they're getting a lot of traction these days'
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:31
Well pretty much every chatsite here in the Netherlands went offline. There's only 1 major chatsite out there and they recently decided to completely mess it up. Even making it paid only. So some users contacted me for a solution
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:32
even mark cuban has his owns messenger
@bjorno43 are there enough develoeprs there?
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:33
Nah. I'm doing it all alone at the moment
I don't really mind. Those users have some very specific demands. If you don't fully understand those, you'll have a hard time working on this. The system is rly quite complicated
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:35
was a general question
just curious
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:35
Ah ok
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:36
?
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:36
Nothing. Just that you ment it as a general question
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:37
yeah. are there enough developers
is it a good place to move to
where in netherlands are you btw?
the only place i know is hague
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:37
Eindhoven
What did you mean with neoigh?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:39
aah ..spelling error
im bad at typing fast
meant enough
are there enough developers there
is what i meant
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:41
In the Netherlands?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:41
yeah
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:42
Well, there are quite a few open jobs for developers. However, they're all very specific. As in, there aren't many entry-level jobs available
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:43
what about freelancing
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:44
If you can find the clients, then sure. But with Dutch ppl you gotta be very carefull as a freelancer. Dutch always want everything for nothing. They'll try to underpay you as much as they can
May Kittens Devour Your Soul
@diomed
Oct 17 2018 09:44
my shadow looks like a :cat:
@bjorno43 why do you narrow your scope to Dutch. pretty sure that should be global
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:45
pretty much like indians
:laughing:
May Kittens Devour Your Soul
@diomed
Oct 17 2018 09:49
last week I saw an error on a pro webpage where fonts werent displaying properly.
and as a busybody I decided to send mail to a jew web developer.
error was fixed, but never got a thank you note reply.
what a Jew.
Bjorn van de Peut
@bjorno43
Oct 17 2018 09:55
@diomed True. But Dutch are especially good at making you feel guilty if you ask more than they're willing to pay. If you're not carefull, they even talk you into working without paying anything. Saying they'll pay after the job is done. And then suddenly can't afford it etc etc
Anand Potukuchi
@anandpotukchi
Oct 17 2018 09:57
@bjorno43 indians are masters at this
Daniel
@dkapexhiu
Oct 17 2018 10:23
hello! i want that the bootstrap 3.2 carousel shows one slide contemporary when width is less than 720px and three slides contemporary when width is greater than 720px
here's the code: https://gist.github.com/dkapexhiu/513c06f1fcae2342974c63b8d5b62729
Anand Potukuchi
@anandpotukchi
Oct 17 2018 10:30
@dkapexhiu write a media query
Daniel
@dkapexhiu
Oct 17 2018 10:38
in javascript or in css? show me an example related to gist
@anandpotukchi
Anand Potukuchi
@anandpotukchi
Oct 17 2018 10:39
css
do you have an example
of what you wanna achieve
Daniel
@dkapexhiu
Oct 17 2018 10:45
i want to change the behaviour of carousel in bootstrap3 with jquery..
i guess i can't do it in css file
only with js
Anand Potukuchi
@anandpotukchi
Oct 17 2018 10:46
ah.. i get it
Daniel
@dkapexhiu
Oct 17 2018 10:47
in gist i have two different jquery conditions, one to load when screen is wider than 767px and the other to load when screen smaller than 767
how can i do it?
Claudio Restifo
@Marmiz
Oct 17 2018 10:52

just a random idea, but if I'm correct BS carousel gives active to each item you nest right?
Maybe with JQuery you can group multiple images under the same item.
Some css for proper margin - display and stuff like that.

Can be an idea. Never tried it tho

Bjorn van de Peut
@bjorno43
Oct 17 2018 10:53
Ok I've got a very weird situation here..
userage = 32 / maxage = 100
this.userage < this.roomList[key]['maxage'] //false
this.userage > this.roomList[key]['maxage'] //true
Daniel
@dkapexhiu
Oct 17 2018 10:55
@Marmiz can you explain me with code how to do it?
Claudio Restifo
@Marmiz
Oct 17 2018 10:55
@bjorno43 types? both strings? int ...
@dkapexhiu that's your part to do it
I was throwing possible ideas
Bjorn van de Peut
@bjorno43
Oct 17 2018 10:55
@Marmiz You might be onto something there. Lemme check
Claudio Restifo
@Marmiz
Oct 17 2018 10:56
you can fiddle a hard coded version with multiple img into the same item and see how behave @dkapexhiu
Aditya
@ezioda004
Oct 17 2018 10:56
@bjorno43 Does this work userage = 32 / maxage = 100 seems like invalid assignment
Daniel
@dkapexhiu
Oct 17 2018 10:56
you are saying display none the prev and next when on mobile
Bjorn van de Peut
@bjorno43
Oct 17 2018 10:58
@Marmiz Yup, that was the issue. Thanks!
@ezioda004 That was just an example to tell what the values were, ghehe
Aditya
@ezioda004
Oct 17 2018 10:58
Oh gotcha
Claudio Restifo
@Marmiz
Oct 17 2018 11:00
@bjorno43 Typescript @bjorno43 or Flow. Or Elm. Or ReasonML
sorry for the double mention
:sheep:
Bjorn van de Peut
@bjorno43
Oct 17 2018 11:01
No idea what you mean with those, lol
Claudio Restifo
@Marmiz
Oct 17 2018 11:01
strictly typed languages for front end stuff
Bjorn van de Peut
@bjorno43
Oct 17 2018 11:01
Ah yes of course
Claudio Restifo
@Marmiz
Oct 17 2018 11:01
TS and Flow are superset of JS. The other two are actually two different languages
Elm is based on Scala, Reason on OCaml
so you have different syntax than JS
so next time the compiler yells if you are summing two strings :smiley:
Aditya
@ezioda004
Oct 17 2018 11:02
@Marmiz How different are TS and Flow? I've barely heard of flow, even with React people seem to use TS more
Bjorn van de Peut
@bjorno43
Oct 17 2018 11:02
Ye I know. Though I'm just using normal JS here. Or at least, in this case :P
Anyway, parseInt to the rescue, issue solved xD
Claudio Restifo
@Marmiz
Oct 17 2018 11:04
@ezioda004 slightly different syntax. TS is around since a while. Flow is babel based while TS has binaries and require compilation while flow i think reads your code.
I only use TS so I can't tell much about real differences. Try them and see which one you feel the most
Aditya
@ezioda004
Oct 17 2018 11:05
Interesting, I've started with TS and been liking so far
May try Flow in some project
May Kittens Devour Your Soul
@diomed
Oct 17 2018 11:47
superset is a great word.
gotta name a package like that. or maybe password
Victor Popescu
@VicPopescu
Oct 17 2018 11:49
potato
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:12
@VicPopescu classic penguin
Victor Popescu
@VicPopescu
Oct 17 2018 12:14
I have nothing to say
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:15
@VicPopescu here you are again
Victor Popescu
@VicPopescu
Oct 17 2018 12:18
@diomed muahaha
I don't drink coffee
Just enemy's blood
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:19
I see... that would make a lot darker comic, tho
Victor Popescu
@VicPopescu
Oct 17 2018 12:20
Carots. Carots are my enemies muahaha
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:22
ok. but why tho :interrobang:
Victor Popescu
@VicPopescu
Oct 17 2018 12:25
they killed bugs bunny!!! :(
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:32
there aren't bugs anymore like bugs bunny
Victor Popescu
@VicPopescu
Oct 17 2018 12:34
true...
Kirk Clemons
@kcclemo
Oct 17 2018 12:35
Good morning everyone!
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:38
g_morning, Kirk
Victor Popescu
@VicPopescu
Oct 17 2018 12:41
Good morning
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:41
anyone know where could find agood artile on keyPress
in react
Aditya
@ezioda004
Oct 17 2018 12:45
@anandpotukchi keyPress works the same way in React as it does normally in JS
Well, any event listeners works the same way, React has synthetic events, that just adds cross browser compatibility.
Niraj Nandish
@Nirajn2311
Oct 17 2018 12:48
@diomed are you free for my vue queries 50 mins from now
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:50
@Nirajn2311 lol, just ask here
Michael Bomholt
@bomholtm
Oct 17 2018 12:51
@anandpotukchi ?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:51
what @bomholtm
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:51
@bomholtm did u report that guy in the end?
Michael Bomholt
@bomholtm
Oct 17 2018 12:52
@anandpotukchi didn’t understood what you were saying
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:52
about?
@bomholtm
Michael Bomholt
@bomholtm
Oct 17 2018 12:52
@diomed thinking back and forth i wrote an email
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:53
to whom?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:53
to?
Michael Bomholt
@bomholtm
Oct 17 2018 12:53
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:53
@bomholtm about?
I was scared that you were telling them about me
seriosuly
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:54
about you, of course :smiling_imp:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:54
shit scared
Michael Bomholt
@bomholtm
Oct 17 2018 12:54
Haha i suppose thats a good thing
isn’t it?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:54
@bomholtm what is and why
I copied parts of the tehnical documentation to save time
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:54
it's funny how you're incriminating yourself on FCC chat.
Michael Bomholt
@bomholtm
Oct 17 2018 12:55
that you are scared if you actually copied work to claim a certificat
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:55
@diomed I'd even tell tthe team the msame thing
but does that coem under copying
Michael Bomholt
@bomholtm
Oct 17 2018 12:55
yea right @diomed :D
Anand Potukuchi
@anandpotukchi
Oct 17 2018 12:56
@bomholtm anyway who was it
????????????
@bomholtm
Michael Bomholt
@bomholtm
Oct 17 2018 12:58
I don’t see a point in naming. The guys of freecodecamp can decide if its worth investigating or doing something about it.
Aditya
@ezioda004
Oct 17 2018 12:59
:corn: :fire:
May Kittens Devour Your Soul
@diomed
Oct 17 2018 12:59
popcorn
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:00
@bomholtm check PM
Michael Bomholt
@bomholtm
Oct 17 2018 13:00
Wasn’t even sure what to do about it. That’s why I asked here yesterday. Don’t wanted to destroy someones reputation just because I think he may cheat…
Moving on... How is everybody?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:03
not moving on
plese giv e username
in PM
Michael Bomholt
@bomholtm
Oct 17 2018 13:05
I won't
Doesn’t change anything
If I was right I’m sure the freecodecamp team will handle the situation perfectly
Aditya
@ezioda004
Oct 17 2018 13:07
Plagiarism is bad, mmmmmkay kids?
Daniel
@dkapexhiu
Oct 17 2018 13:08
Hello! How to display on smaller screens (width less than 767px) only one image in carousel in bootstrap3.2: https://codepen.io/dkapexhiu/pen/dgJpGo
Michael Bomholt
@bomholtm
Oct 17 2018 13:09
@ezioda004 I’m not even sure what to think about that but practically forking the example projects and just removing the “coded by” is for sure … i guess ?!?!?
;)
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:10
did that guy even read the academic honesty policy?
Aditya
@ezioda004
Oct 17 2018 13:11
@bomholtm Lol, I feel like those people who do that miss the point...its not about certificates, its about experience/knowledge you gain from making projects. Oh well their loss.
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:11
exactly
I've been stuck with this damned drum amchine for two days
Michael Bomholt
@bomholtm
Oct 17 2018 13:12
@ezioda004 except that it devalues the certification
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:12
I could have got my cert in that time
Kyle Holm
@thekholm80
Oct 17 2018 13:12
glad i sold my certs while the market was high
Michael Bomholt
@bomholtm
Oct 17 2018 13:12
Haha I shouldn’t come to this place anymore
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:13
@bomholtm I have no idea what people do with such sort of certs
@thekholm80 lol
Aditya
@ezioda004
Oct 17 2018 13:13
@thekholm80 Thanks, now I just need to change my name to "Kyle Holm"
Kyle Holm
@thekholm80
Oct 17 2018 13:14
i've got some photoshop certs i can sell you so you can change the name
Aditya
@ezioda004
Oct 17 2018 13:14
Does that cost extra?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:15
$45 a cert, anyone?
Michael Bomholt
@bomholtm
Oct 17 2018 13:15
I don’t understand the problem with caring about honesty
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:16
@bomholtm well it might be the thing about showing off
or people looking upto you
Michael Bomholt
@bomholtm
Oct 17 2018 13:16
Now I’m completly lost
Aditya
@ezioda004
Oct 17 2018 13:17
??
Kyle Holm
@thekholm80
Oct 17 2018 13:17
i joke, but i care. i've found a number of people who broke the academic honesty pledge while i've been here. some were pretty flagrant
oh aditya
you got me
Aditya
@ezioda004
Oct 17 2018 13:18
60% of the time, it works every time
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:18
Kyle Holm
@thekholm80
Oct 17 2018 13:18
so close
Michael Bomholt
@bomholtm
Oct 17 2018 13:20
funny plot twist … it was you @anandpotukchi
I’m kidding :D :D
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:20
oh my GODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
Michael Bomholt
@bomholtm
Oct 17 2018 13:20
hahahahahah
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:21
im logging out
Im never seeing you again
bye
You ruined my lfe
Michael Bomholt
@bomholtm
Oct 17 2018 13:21
hahahaha :D
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:21
*gets a milkshake
opens po**hub
Michael Bomholt
@bomholtm
Oct 17 2018 13:21
:D
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:24
@bomholtm u from US?
@thekholm80
u?
Kyle Holm
@thekholm80
Oct 17 2018 13:24
yep
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:25
you went to college?
Michael Bomholt
@bomholtm
Oct 17 2018 13:25
But seriously i suppose everyone does copy code…and i'm absolutly fine with that. it’s just that copying examples and then tweeting about their achievements was a little to much to not to report :P
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:25
how much does a bs in cs cost
Michael Bomholt
@bomholtm
Oct 17 2018 13:26
@anandpotukchi GER
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:26
private university
top
without student loans
@anandpotukchi GER I have no idea what that is
Michael Bomholt
@bomholtm
Oct 17 2018 13:27
Germany? :D
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:27
@bomholtm why cant you just share the name
privately
or the username
Aditya
@ezioda004
Oct 17 2018 13:27
@bomholtm This is my keyboard
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:28
@ezioda004 pretty much any SE's
acco to quora threads
people admit there
Michael Bomholt
@bomholtm
Oct 17 2018 13:29
@ezioda004 but backspace is missing … to remove the credits :D
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:29
It's faster
Aditya
@ezioda004
Oct 17 2018 13:30
@bomholtm Thats simple, you just dont copy credits :trollface:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:30
@thekholm80 ?
Kyle Holm
@thekholm80
Oct 17 2018 13:31
private university here is usually around $40k per year, i hear
Aditya
@ezioda004
Oct 17 2018 13:31
@anandpotukchi It probably costs a lot in private unis and that too without loan
Kyle Holm
@thekholm80
Oct 17 2018 13:31
if you can do your BS in 4 years it's $120k-ish, most take 5 years
Aditya
@ezioda004
Oct 17 2018 13:32
:money_with_wings: :wave:
@thekholm80 x
Kyle Holm
@thekholm80
Oct 17 2018 13:36
i'm embarrassed by how much time i've spent trying to pick variable names
Eric Weiss
@eweiss17
Oct 17 2018 13:36
x, y, z
Kyle Holm
@thekholm80
Oct 17 2018 13:36
and then changing them later
Eric Weiss
@eweiss17
Oct 17 2018 13:36
xx, yy, zz
there
Aditya
@ezioda004
Oct 17 2018 13:37
Kyle Holm
@thekholm80
Oct 17 2018 13:38
is it just me or is there an xkcd for pretty much everything?
Eric Weiss
@eweiss17
Oct 17 2018 13:38
just make variable names short and descriptive
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:40
@ezioda004 it sure does
im thinking of studying there
restarting my education
how does $300k sound
Aditya
@ezioda004
Oct 17 2018 13:41
I'll take it
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:41
I'm looking at making that much
by june
Aditya
@ezioda004
Oct 17 2018 13:42
My thoughts and prayers are with you
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:44
can i make it
any one here who is trilingual
or higher
May Kittens Devour Your Soul
@diomed
Oct 17 2018 13:51
I'm bilingual or lower
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:51
@ezioda004 need help
this is my drum till now
there's no click events no keypresses
do i create a functionfor each
because it sounds stupid
Tom
@moT01
Oct 17 2018 13:57
@anandpotukchi yes, you will need a click event for each button, but they should be able to be grouped into a single block of code if you make it efficient.. and you will need something for the keypress as well that might look something like this...
onKeyPress => check if key pressed === q || w || e.....
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:58
@moT01 grouped?
Eric Weiss
@eweiss17
Oct 17 2018 13:58
you don't really need a college degree if you are just really good at programming
could easily find a start up / newer company that would hire you
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:59
like an array?
@eweiss17 where do you live
Eric Weiss
@eweiss17
Oct 17 2018 13:59
usa
Anand Potukuchi
@anandpotukchi
Oct 17 2018 13:59
jave you been to asia
or met asian people
@eweiss17
Eric Weiss
@eweiss17
Oct 17 2018 14:00
i haven't been to asia but i know american asian people?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:00
then you msut know that asians place a very high value on education
to the point you're useless without a abacheolor's degree
(minimum}
@eweiss17
@moT01
Tom
@moT01
Oct 17 2018 14:01
@anandpotukchi yea, maybe something like this... button.click => get letter
Eric Weiss
@eweiss17
Oct 17 2018 14:01
well if you do not like it you could move location
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:02
@eweiss17 to
amercians and asians are different
Tom
@moT01
Oct 17 2018 14:02
instead of q.addClickListener, w.addClickListener, e.addClickListener....
does that make any sense? i know im not very specific
Aditya
@ezioda004
Oct 17 2018 14:05
@anandpotukchi Its not necessary to create events on each button, you could very well use event delegation and have the click event on the parent
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:06
@moT01 yep. too specific.
@ezioda004 event delegation
Aditya
@ezioda004
Oct 17 2018 14:06
But it'd probably be more easier to have event on each of them
More or less a preference except delegation saves more memory (if you care about that)
Eric Weiss
@eweiss17
Oct 17 2018 14:08
@anandpotukchi are there start up companies at your location?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:08
yes. some
Eric Weiss
@eweiss17
Oct 17 2018 14:08
do those also require college degree?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:08
80% do
Aditya
@ezioda004
Oct 17 2018 14:10
@anandpotukchi Where have you been looking? I have barely seen any startup requiring a bachelors degree
Atleast in Bangalore.
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:10
hyderabad
plus what about skill?
that's why im on fcc
i went to college for three years..and then in hospital for two
FYI
Aditya
@ezioda004
Oct 17 2018 14:12
Try on angel.co, I'm sure you'll find good startups there with no degree requirement.
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:12
and I have some restrictions
@ezioda004 SKILL
wher ewill i get tht
Aditya
@ezioda004
Oct 17 2018 14:13
Uh, practice? Theres no secret recipe
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:14
yeah
well i dont fit in the job category then @eweiss17
proved
May Kittens Devour Your Soul
@diomed
Oct 17 2018 14:15
my friend got a job at startup - drives cars for Uber
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:15
@diomed nice.
I can't do that
Eric Weiss
@eweiss17
Oct 17 2018 14:16
Check out some potential companies
and see their requirments
and then learn to fit those
Also the willingness to learn, goes a long way
If you do not fit all the requirements, you can just say that you are willing to learn it on the job
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:18
I'm trying fo an internship
at amazon
cans omeone help me with a resume
Im currently lloking for freeelance projects
May Kittens Devour Your Soul
@diomed
Oct 17 2018 14:19
my name is Lance. can you do free projects for me?
@ezioda004 get me this background
Eric Weiss
@eweiss17
Oct 17 2018 14:20
internship at amazon..... that is not going to be easy
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:21
@eweiss17 can you help me
Aditya
@ezioda004
Oct 17 2018 14:21
@diomed Its redirecting me to some other page
:white_medium_square:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:23
@eweiss17 internship as an SDE
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:29
@eweiss17 Sorry, there are no jobs that meet your criteria
that's exactly why im working on fcc
Eric Weiss
@eweiss17
Oct 17 2018 14:30
There are no jobs that you do not need a degree for?
May Kittens Devour Your Soul
@diomed
Oct 17 2018 14:31
ever since McDonalds fired me I'm not the same man
there was some policy about no :cat:s near food. strange
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:38
\ @eweiss17 not in hyderabad, india
(in amazon)
Eric Weiss
@eweiss17
Oct 17 2018 14:39
I cannot help with amazon. I am not knowledgeable about how to get a job there
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:40
wait
even this requires a bachelor's degree
tehre's a four part tutorial on hwo to mak a drum machine on youtube
Eric Weiss
@eweiss17
Oct 17 2018 14:43
It is amazon.... they are very large company
they want the best of the best
You make more money as an intern at amazon than you do at a full time position elsewhere
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:46
@eweiss17 are you a college grad
Eric Weiss
@eweiss17
Oct 17 2018 14:48
yes
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:48
do you know of any online degree programs
and whether they're a scam
@eweiss17
Eric Weiss
@eweiss17
Oct 17 2018 14:49
I do not know. I went to college in person
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:50
well
Eric Weiss
@eweiss17
Oct 17 2018 14:50
see what programmers in your area did.... sometimes on company websites it says where their employees went to college
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:51
let's put college aside
and focus on me getting a good grip in CS fundamentals
and programming
Eric Weiss
@eweiss17
Oct 17 2018 14:52
do you know OOP?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 14:53
some..w e had a beginner class inc college
AFAIk these are the things I know i'm not good at
  • solving real world problems
solving real world problems
I'm moving onto calculator
May Kittens Devour Your Soul
@diomed
Oct 17 2018 14:59
too bad, son. that's why people hire programmers.
to solve real world problems
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:03
@ezioda004 did you use mathjs
for calc
Aditya
@ezioda004
Oct 17 2018 15:04
Huh, its not hard to do arithmetic
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:05
ok
justo wanted to know
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:05
@anandpotukchi I have fantastic vue calc for you, if you just wanna copy paste and change some styling
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:05
@diomed sure
and i'll report you
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:06
for what exactly
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:06
for giving me a soln
to something i dont a soln to
Aditya
@ezioda004
Oct 17 2018 15:07
@diomed You can copy my calculator
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:08
can i
copy the color scheme
Aditya
@ezioda004
Oct 17 2018 15:10
No :anger:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:10
too bad
already have
Eric Weiss
@eweiss17
Oct 17 2018 15:11
nice we are allowed to sell our fcc projects?
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:11
anything under MIT can be selled
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:11
@diomed *sold
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:12
I knew that something was off, but wasn't sure exactly :stuck_out_tongue:
Aditya
@ezioda004
Oct 17 2018 15:13
My projects are under getty images license
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:14
oh, so we can embed them. how nice of you
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:19
@ezioda004 It isn;t against the rules to use mathjs tho is it
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:19
@ezioda004 why u not put links above in github repo
Aditya
@ezioda004
Oct 17 2018 15:21
@anandpotukchi Probably not, but Im not sure what you want to use math.js for, making a calculator isnt that hard
@diomed I'm not sure what you're referring to
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:21
@ezioda004 howndi compute
and how do i display error
anything by 0 should be undefinded
how did do that
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:23
@ezioda004 like this guy has it
Aditya
@ezioda004
Oct 17 2018 15:23
Just check if the denominator is 0? Sounds like you need if statement
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:23
would be nice if your projects are reachable from repos
Aditya
@ezioda004
Oct 17 2018 15:24
@diomed Oh cause I'm dumb, I usually have a live preview link in the readame file (not for old projects), will update to something like that. Thanks
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:25
ya, it's a lot more visible if up
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:25
12+5%4-2%0
@ezioda004
solve this
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:27
@anandpotukchi butterflies are my friends. are butterflies your friends, too
you SHALL NOT divide with 0, damnit, that creates black holes! :angry:
Aditya
@ezioda004
Oct 17 2018 15:30
@anandpotukchi I'm not solving the problems for you, try to figure out yourself how you'd solve it
Think of it as a "real world problem"
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:30
give me some tips
Aditya
@ezioda004
Oct 17 2018 15:30
Think how calculators work
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:31
by typing on them
Kelechi Chinaka
@ke1echi
Oct 17 2018 15:31
that would return NaN @anandpotukchi
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:31
some are powered by small battery, and some by solar light
Aditya
@ezioda004
Oct 17 2018 15:32
:cat: :heavy_check_mark:
Kelechi Chinaka
@ke1echi
Oct 17 2018 15:33
12+5%4-2%0==>12+(5%4)-2%0
psyperl
@psyperl
Oct 17 2018 15:33
none powered by hamster?
Aditya
@ezioda004
Oct 17 2018 15:33
But thats not how calculators compute
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:33
@ezioda004 bodmas
Aditya
@ezioda004
Oct 17 2018 15:34
They dont follow BODMAS or whatever rule you call it.
Kelechi Chinaka
@ke1echi
Oct 17 2018 15:34
12+1-(2%0) ==>(2%0) returns NaN
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:34
NaNu NaNu
Kelechi Chinaka
@ke1echi
Oct 17 2018 15:34
thats not bodmas its operator precedence
Aditya
@ezioda004
Oct 17 2018 15:35
Operator precedence is BODMAS :)
psyperl
@psyperl
Oct 17 2018 15:35
@diomed mork and mindy?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:36
@ezioda004 wasn't that I said
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:36
probably. I'm too young to know
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:36
*what
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:36
and too European
Kelechi Chinaka
@ke1echi
Oct 17 2018 15:36
so hows the computer suppose to evaluate that equation @ezioda004 because it returns NaN
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:37
like this
Computer says NO
hensn5250
@hensn5250
Oct 17 2018 15:37
use order of operations*
Aditya
@ezioda004
Oct 17 2018 15:37
@ke1echi Fire up a calculator and try it out, they simply follow the left to right rule
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:38
is it true that some calculators calculate differently than other calculators and get different results?
Aditya
@ezioda004
Oct 17 2018 15:38
:thought_balloon:
hensn5250
@hensn5250
Oct 17 2018 15:38
RPN calcs use different ordering, i think
May Kittens Devour Your Soul
@diomed
Oct 17 2018 15:39
sup?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:44
@ezioda004 now I remember something about stacks and operators
Guess I solved it
It's called something like infix, prefix or postfix
Correct?
Core
hensn5250
@hensn5250
Oct 17 2018 15:45
@anandpotukchi what is the problem you want to solve?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:46
Create a calculator @hensn5250
Aditya
@ezioda004
Oct 17 2018 15:47
@anandpotukchi I guess you can use a stack, depending on how you're handling operators and operands.
hensn5250
@hensn5250
Oct 17 2018 15:48
@anandpotukchi are you using only basic arithmetic functions or inculding parenthesis and other stuff
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:48
@hensn5250 No idea
preferably one with braces and stuff
hensn5250
@hensn5250
Oct 17 2018 15:49
well then decide what you want it to do first
Anand Potukuchi
@anandpotukchi
Oct 17 2018 15:51
want to solve anything
Eric Weiss
@eweiss17
Oct 17 2018 15:56
the problem i had with the calc was the C and CE buttons...
you have to think ahead to get those to work correctly
Kelechi Chinaka
@ke1echi
Oct 17 2018 16:06
returns NaN on the console, whats the result on a calculator? @ezioda004
Aditya
@ezioda004
Oct 17 2018 16:10
JS != calculator, regardless of the result the point was. Say you have 8+7*2, you'll get 22 in console but 30 in calculator cause no operator precedence in calculators
hensn5250
@hensn5250
Oct 17 2018 16:11
you mean no operator precedence in the console right?
Kelechi Chinaka
@ke1echi
Oct 17 2018 16:12
console uses operator precedence and calculator uses left-to-right
i get what you mean @ezioda004
Aditya
@ezioda004
Oct 17 2018 16:13
Calculator uses operator associativity left to right, programming languages uses both
hensn5250
@hensn5250
Oct 17 2018 16:14
right, i see
modern calcs use both as well
Anand Potukuchi
@anandpotukchi
Oct 17 2018 16:23
Within each .drum-pad, there should be an HTML5 audio element which has a src attribute pointing to an audio clip, a class name of clip, and an id corresponding to the inner text of its parent .drum-pad
@ezioda004 dooes this mean isnde the div
<div className='col-xs-4'>
                <button type="button" className="btn drum-pad" onClick={this.handleClickQ}>q
                  <audio src=""></audio>
                </button>
              </div>
correct?
Aditya
@ezioda004
Oct 17 2018 16:25
@anandpotukchi Yes, also add clip class to audio tag and give it id q and likewise
Anand Potukuchi
@anandpotukchi
Oct 17 2018 16:26
thanks
@ezioda004 there's no dynamic way of doing this
?
Aditya
@ezioda004
Oct 17 2018 16:28
Sure is, .map() comes to mind
Anand Potukuchi
@anandpotukchi
Oct 17 2018 16:28
objects with map
Aditya
@ezioda004
Oct 17 2018 16:29
Objects inside array*
Anand Potukuchi
@anandpotukchi
Oct 17 2018 16:29
hmm
why the array
Aditya
@ezioda004
Oct 17 2018 16:30
Because I want to loop through and do stuff dynamically?
Anand Potukuchi
@anandpotukchi
Oct 17 2018 16:30
yeah ok
got it
good night
Aditya
@ezioda004
Oct 17 2018 16:31
:wave:
Anand Potukuchi
@anandpotukchi
Oct 17 2018 16:49
In retrospect, I would've completed this today, but I'm just a lazy, f up
Ass
May Kittens Devour Your Soul
@diomed
Oct 17 2018 18:10
@ezioda004 do you know how to compile sass?
Aditya
@ezioda004
Oct 17 2018 18:12
@diomed Yes
Niraj Nandish
@Nirajn2311
Oct 17 2018 18:15
Is there anyway to get uncommited changes which were reset hard
May Kittens Devour Your Soul
@diomed
Oct 17 2018 18:16
@ezioda004 with what wizardry?
Aditya
@ezioda004
Oct 17 2018 18:17
@diomed You have sass installed?
@Nirajn2311 Nope
Niraj Nandish
@Nirajn2311
Oct 17 2018 18:19
BANGS HEAD FOR DOING WITHOUT THINKING AND WASTING 2 HOURS OF HARD WORK :tired_face:
Aditya
@ezioda004
Oct 17 2018 18:19
I had to delete a fork for that same reason yesterday
May Kittens Devour Your Soul
@diomed
Oct 17 2018 18:25
@ezioda004 I don't :-|
@Nirajn2311 what did you do?!?
Aditya
@ezioda004
Oct 17 2018 18:29
@diomed Do you have VSC? Theres a extension called SASS watcher which will automatically compile SASS/SCSS to CSS as soon as you save the file.
Niraj Nandish
@Nirajn2311
Oct 17 2018 18:29
I was building a vue counter app
I had staged them
But then i remembered about a previous mistake and mistakely did hard reset
May Kittens Devour Your Soul
@diomed
Oct 17 2018 18:33
@Nirajn2311 don't learn vue. let vue teach you
Niraj Nandish
@Nirajn2311
Oct 17 2018 18:33
We are humans, we learn things
@diomed you are a :cat: , things teach you
May Kittens Devour Your Soul
@diomed
Oct 17 2018 18:35
indeed
Kyle Holm
@thekholm80
Oct 17 2018 18:42
@diomed x
Aditya
@ezioda004
Oct 17 2018 18:45
🥒
hensn5250
@hensn5250
Oct 17 2018 18:47
What are the benefits of SASS over CSS w/ new feature(e.g. variables )
outside of industry uses it
Kyle Holm
@thekholm80
Oct 17 2018 18:50
i always liked that i could nest stuff, like
.foo {
  & .bar {
    all_the: things;
  }
}
not sure if my syntax is :100: i haven't done it in a while
hensn5250
@hensn5250
Oct 17 2018 18:52
i just googled it... is a CSS pre-processor that lets you use variables, mathematical operations, mixins, loops, functions, imports, and other interesting functionalities
i guess the use use of the nested syntax and the mixins
Kyle Holm
@thekholm80
Oct 17 2018 18:53
mixins are cool
they made media queries super simple
hensn5250
@hensn5250
Oct 17 2018 18:55
I've always wanted to learn/add SASS into my projects but with the way vanilla CSS and JS are going it seems they'll make a lot of libraries/preprocessors useless soon.
Kyle Holm
@thekholm80
Oct 17 2018 18:56
i stopped using it because it added a level of complexity that was unnecessary for my projects
hensn5250
@hensn5250
Oct 17 2018 18:56
due to the syntax? size?
Aditya
@ezioda004
Oct 17 2018 18:59
I like SCSS, mainly because of nesting and you don't have to worry about specificity and it makes code more readable
Kyle Holm
@thekholm80
Oct 17 2018 18:59
i didn't get any benefits from it that made it worth the trouble of adding it in
especially with CRA
but that's a personal decision, not something really quantifiable
Aditya
@ezioda004
Oct 17 2018 19:01
How is troubling with CRA? I just create a css and scss file, and that's it. Have sass watcher on and it automatically compiles to css, pretty straightforward
Christopher McCormack
@cmccormack
Oct 17 2018 19:03
yeah sass is pretty great, I don't like touching a larger project without it
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:03
@thekholm80 that's not even a pickle Rick
Christopher McCormack
@cmccormack
Oct 17 2018 19:04
mixins can be really powerful too
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:04
teach me sass you guys
Kyle Holm
@thekholm80
Oct 17 2018 19:04
@ezioda004 it used to be that you had to eject to add sass
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:04
what should I do to compile my own version of bulma?
Kyle Holm
@thekholm80
Oct 17 2018 19:04
they may have changed it
@diomed i thought cats were scared of cucumbers?
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:05
it was too small to frighten me
Aditya
@ezioda004
Oct 17 2018 19:06
@thekholm80 Ah I don't mess with webpack, I can see your point
@cmccormack Same, I did a big project with few other people and CSS with react was such a mess and headache
Christopher McCormack
@cmccormack
Oct 17 2018 19:07
I believe parcel will compile your sass right out the gate
latest webpack might as well, not sure
Kyle Holm
@thekholm80
Oct 17 2018 19:07
lol making that :moneybag:
Christopher McCormack
@cmccormack
Oct 17 2018 19:08
@ezioda004 have you played with CSS-in-JS for React projects?
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:08
how? @cmccormack
Christopher McCormack
@cmccormack
Oct 17 2018 19:08
I believe I use node-sass
@diomed I've always done sass as a dependency of an html doc though, never directly with parcel if that's what you're doing
Aditya
@ezioda004
Oct 17 2018 19:10
@cmccormack I tried, didn't like it.. It looks like a mess to me, so I keep JS separated from CSS
Same with inline styling, like height and width is fine but anything more than that should be seperated
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:12
sepa
Christopher McCormack
@cmccormack
Oct 17 2018 19:12
@ezioda004 it can be really powerful when you can start using your state/props to guide the styling
I like Styled-components OK but when I used material-ui recently I really liked the power of the themeing
Aditya
@ezioda004
Oct 17 2018 19:16
Can't type on mobile dang it
Christopher McCormack
@cmccormack
Oct 17 2018 19:17
@ezioda004 that's basically what CSS-in-JS does, wraps the component in an HoC that converts a style object to a css class
but because it's an object it can be dynamic
Aditya
@ezioda004
Oct 17 2018 19:19
@cmccormack className = {`${this.state.someStuff ? "this-class": "that-class"}`}
First try :D
@cmccormack Oh yeah, but I prefer this style, remind me of good ol' jQuery days
Bjorn van de Peut
@bjorno43
Oct 17 2018 19:22

Ok for once I need a little JS help guys :P Lets say I have an array like this:

[
    ['icecub','moderator'],
    ['bjorno43','admin']
]

So an array containing arrays with info. How would I alphabetically .sort() this array based on the usernames there? If I just sort the array, it doesn't work. It sorts on the index of each array.

Aditya
@ezioda004
Oct 17 2018 19:22
@thekholm80 Should we be scared
Kyle Holm
@thekholm80
Oct 17 2018 19:25
@ezioda004 i welcome our future robot overlords
Christopher McCormack
@cmccormack
Oct 17 2018 19:27
@bjorno43 can you use an array of objects instead?
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:27
comments are precious
Christopher McCormack
@cmccormack
Oct 17 2018 19:27
@bjorno43 arr.sort((a, b) => a[0] - b[0]) should work
although I didn't and probably won't test it
Aditya
@ezioda004
Oct 17 2018 19:29
@cmccormack I was thinking similarly arr.sort((a, b) => a[0] > b[0]) but both doesnt work
May Kittens Devour Your Soul
@diomed
Oct 17 2018 19:29
that robot already can dance better than me
Christopher McCormack
@cmccormack
Oct 17 2018 19:29
I tested it anyway it didn't work
Aditya
@ezioda004
Oct 17 2018 19:30
Curious
Bjorn van de Peut
@bjorno43
Oct 17 2018 19:30
Nah. Appearently this should work:
function sortFunction(a, b) {
    if (a[0] === b[0]) {
        return 0;
    }
    else {
        return (a[0] < b[0]) ? -1 : 1;
    }
}
Christopher McCormack
@cmccormack
Oct 17 2018 19:30
@bjorno43 that's the same thing as above
Bjorn van de Peut
@bjorno43
Oct 17 2018 19:32
@cmccormack I don't think so. Cause that does work
Aditya
@ezioda004
Oct 17 2018 19:32
@cmccormack arr.sort((a, b) => a[0] > b[0] ? 1 : -1); this works as well
I'm dumb, forgot false coerces to 0
Christopher McCormack
@cmccormack
Oct 17 2018 19:36
oh duh because it's usually numbers you have to build the callback for, strings are default for sort
Aditya
@ezioda004
Oct 17 2018 19:37
Yeah default is lexicographical sort
J. Guidry
@J-Guidry
Oct 17 2018 20:56
If you are practicing html/css, it is a good idea to take psds from dribbble/psd365/other sites with webpage designs and code them? They likely won't be responsive and you may have to take liberties to make them responsive.
Henry
@GitHub-Henry
Oct 17 2018 20:58
perhaps do the html/css responsive design challenges
J. Guidry
@J-Guidry
Oct 17 2018 21:00
Those I have already done. They were good but I am looking for more complex layouts to do
May Kittens Devour Your Soul
@diomed
Oct 17 2018 21:01
@GitHub-Henry what library you use?
Henry
@GitHub-Henry
Oct 17 2018 21:01
i know how to make a web site responsive
May Kittens Devour Your Soul
@diomed
Oct 17 2018 21:01
FML. @J-Guidry that was for you
J. Guidry
@J-Guidry
Oct 17 2018 21:01
I did not use libraries
May Kittens Devour Your Soul
@diomed
Oct 17 2018 21:02
damn humans :cat:
Aditya
@ezioda004
Oct 17 2018 22:38
@thekholm80 @cmccormack [2, 1].sort((a,b) => a > b); what does this return in your browser?
My chrome returns [2, 1] but firefox returns [1, 2]
Christopher McCormack
@cmccormack
Oct 17 2018 22:39
[1, 2]
Aditya
@ezioda004
Oct 17 2018 22:39
You using chrome?
Christopher McCormack
@cmccormack
Oct 17 2018 22:39
Chrome Version 69.0.3497.100 (Official Build) (64-bit)
Aditya
@ezioda004
Oct 17 2018 22:40
Can you update to 70?
Christopher McCormack
@cmccormack
Oct 17 2018 22:41
nah it's a work pc, we have version restrictions :)
Aditya
@ezioda004
Oct 17 2018 22:42
Ah, ok
Anyone got chrome 70?
Kyle Holm
@thekholm80
Oct 17 2018 23:26
[1, 2] in my chrome
Aditya
@ezioda004
Oct 17 2018 23:29
70?
Henry
@GitHub-Henry
Oct 17 2018 23:29
[2, 1], chrome 70
Aditya
@ezioda004
Oct 17 2018 23:30
So its a bug?
Christopher McCormack
@cmccormack
Oct 17 2018 23:34
It's using TimSort now I think, maybe?
:shrug:
looks interesting but long
Aditya
@ezioda004
Oct 17 2018 23:38
Yeah timsort
But isnt this a breaking bug?
Henry
@GitHub-Henry
Oct 17 2018 23:39
[2, 1].sort((a,b) => a > b);
result [2,1] chrome 70


[2, 1].sort((a,b) => a > b);
result [1,2] chrome 68
result [1,2] firefox 63
Aditya
@ezioda004
Oct 17 2018 23:40
What if my webapp with 2 concurrent user relies on that specific behavior? I gotta find my pitchfork