These are chat archives for FreeCodeCamp/Help

3rd
Jan 2018
Kyle Holm
@thekholm80
Jan 03 2018 00:00
image.png
see?
Olapri
@Olapri
Jan 03 2018 00:00
yes)) I have it ))
Thank you!
I was editing this file today.. and that is why I have forgotten about jQuery))
@thekholm80 thanks!
CamperBot
@camperbot
Jan 03 2018 00:01
olapri sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1646 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Olapri
@Olapri
Jan 03 2018 00:01
@Gersho thanks!
Kyle Holm
@thekholm80
Jan 03 2018 00:01
np
I need a UI/UX enthusiast. I want to make a Reddit client but I don't want to build the front end lol
Gersho
@Gersho
Jan 03 2018 00:05
haven't seen Eric, isn't he around anymore ?
Kyle Holm
@thekholm80
Jan 03 2018 00:05
Eric?
my memory is not good
Gersho
@Gersho
Jan 03 2018 00:05
hmm, can't remember the full nickname, but the guy was good at design
Kyle Holm
@thekholm80
Jan 03 2018 00:06
my favorite UI guy was @LordFifth , haven't seen him in ages
Gersho
@Gersho
Jan 03 2018 00:07
i don't know him
Kyle Holm
@thekholm80
Jan 03 2018 00:07
check out his Game of Life project
Gersho
@Gersho
Jan 03 2018 00:08
ascii in the js file :D
Kyle Holm
@thekholm80
Jan 03 2018 00:09
yeah lol
Gersho
@Gersho
Jan 03 2018 00:09
i have a refresh issue on the page (vivaldi) epilepsy inducing but the TV looks damn cool
Kyle Holm
@thekholm80
Jan 03 2018 00:09
he made some cool stuff
mostly using Vue
Gersho
@Gersho
Jan 03 2018 00:11
when doing your design don't forget some people still use 4/3 resolution ;)
Kyle Holm
@thekholm80
Jan 03 2018 00:12
any UI I build will be specifically for me lol
I never plan on anyone else wanting to use anything I make
Gersho
@Gersho
Jan 03 2018 00:13
lol
nubian16
@nubian16
Jan 03 2018 00:40
function nonRandom() {

  var searchValue = document.getElementById("searchValue");

var wikiSearch = "https//en.wikipedia.org/w/api.php?action=query&format=json&prop=&list=search&utf8=1&srsearch=costa%20rica";
console.log(searchValue)

  $.get(wikiSearch, function returnSearch(data) {

    searchValue.innerHTML= data.title;
   console.log(data)
  });
};
Kyle Holm
@thekholm80
Jan 03 2018 00:40
```
Your code
```
yay!
nubian16
@nubian16
Jan 03 2018 00:42
@thekholm80 lol thanks , seems it was the space!
CamperBot
@camperbot
Jan 03 2018 00:42
nubian16 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1647 | @thekholm80 |http://www.freecodecamp.org/thekholm80
nubian16
@nubian16
Jan 03 2018 00:43
sooo it seems I cant get the button to show the results when using nonRandom
its like if the $.get was not functioning
Kyle Holm
@thekholm80
Jan 03 2018 00:45
you've got CORS problems
Failed to load https://codepen.io/boomerang/iFrameKey-3d5307dd-0d8b-1585-78b9-f5ad102965ff/https/en.wikipedia.org/w/api.php?action=query&format=json&prop=&list=search&utf8=1&srsearch=costa%20rica: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://s.codepen.io' is therefore not allowed access. The response had HTTP status code 404.
nubian16
@nubian16
Jan 03 2018 00:47
ouch , how did you test that ?
Kyle Holm
@thekholm80
Jan 03 2018 00:47
i just opened up the dev console
and clicked your button
nubian16
@nubian16
Jan 03 2018 00:50
@thekholm80
@thekholm80 appreciate it!
@thekholm80 Thank you !
CamperBot
@camperbot
Jan 03 2018 00:51
nubian16 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
api offline
Kyle Holm
@thekholm80
Jan 03 2018 00:51
I'd offer suggestions on how to get around it, but I don't remember the options in jQuery
i think there's a proxy you can use
a little googling will get you sorted out
nubian16
@nubian16
Jan 03 2018 00:53
lol yep thats where im headed right now
Manish Giri
@Manish-Giri
Jan 03 2018 00:53
I got 99 problems but CORS ain't one
nubian16
@nubian16
Jan 03 2018 00:54
jajajajajaj
Kyle Holm
@thekholm80
Jan 03 2018 00:54
rofl
Manish Giri
@Manish-Giri
Jan 03 2018 00:54
freakish cold is one, though
Kyle Holm
@thekholm80
Jan 03 2018 00:55
I'm telling you, @Manish-Giri , move to CA
graduate already, geez
Manish Giri
@Manish-Giri
Jan 03 2018 00:55
:running:
Mark Brathwaite
@markbrathwaite
Jan 03 2018 00:58
@khaduch appreciate you checking. I actually had my code reinstated today, really strange - I was never on the beta site and did not request any resets, but it's working fine now.
Ken Haduch
@khaduch
Jan 03 2018 00:59
@markbrathwaite - oh, that's good! Sometimes people think that things are missing or work that they completed got lost, just because they enter the site a different way. I thought that if I could see your account on one of the two sites then it would be helpful, but it didn't seem to be on either one. Glad that you got things restored - good luck!
Mark Brathwaite
@markbrathwaite
Jan 03 2018 01:00
Yeah it's strange my profile isn't showing on your end. I signed up through the main site. I'll look into that -- @khaduch thank you!
CamperBot
@camperbot
Jan 03 2018 01:00
markbrathwaite sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3641 | @khaduch |http://www.freecodecamp.org/khaduch
Ken Haduch
@khaduch
Jan 03 2018 01:03
@markbrathwaite - yeah, strange? I can usually go to freecodecamp.org/<username> and see the info. Unless I've spelled your username incorrectly but I don't think that I did? What's the URL for your freeCodeCamp homepage? I'm just curious... thanks
CamperBot
@camperbot
Jan 03 2018 01:03
khaduch sends brownie points to @markbrathwaite :sparkles: :thumbsup: :sparkles:
api offline
Mark Brathwaite
@markbrathwaite
Jan 03 2018 01:09
@khaduch I figured it out! I wasn't linked to freecodecamp through my github account but now that I am - woks fine - I didn't have a username before (very Jason Bourne of me). But now it's: markbrathwaite
Kyle Holm
@thekholm80
Jan 03 2018 01:10
and now you exist!
Mark Brathwaite
@markbrathwaite
Jan 03 2018 01:11
Hahah. Sure is nice to be recognized
Kyle Holm
@thekholm80
Jan 03 2018 01:12
is Toronto in a French-speaking province? Or is that pretty much just Quebec?
Gersho
@Gersho
Jan 03 2018 01:12
do you not like french ?
Mark Brathwaite
@markbrathwaite
Jan 03 2018 01:13
It's mostly Quebec and New Brunswick, but there is a Francophone community in Toronto as well
Kyle Holm
@thekholm80
Jan 03 2018 01:13
I like French just fine, i'm just not very knowledgeable about Canada
Gersho
@Gersho
Jan 03 2018 01:13
i don't know about Canada either, i'm French
Kyle Holm
@thekholm80
Jan 03 2018 01:13
@GitHub-Henry that looks really awesome
Mark Brathwaite
@markbrathwaite
Jan 03 2018 01:14
@Gersho bonjour mon ami!
Henry
@GitHub-Henry
Jan 03 2018 01:14
@thekholm80 yes indeed
Ken Haduch
@khaduch
Jan 03 2018 01:14
@markbrathwaite - ah - a little trick that I guess isn't too obvious... great!
Gersho
@Gersho
Jan 03 2018 01:14
@markbrathwaite bonjour ;)
Henry
@GitHub-Henry
Jan 03 2018 01:14
@thekholm80 go through the intro video, amazing
Daniel
@dkapexhiu
Jan 03 2018 01:15
hi! how can i convert this function into a string?
const getTotal = () => { let total = getSubTotal(npizza) + getTax(npizza); return total; }
Gersho
@Gersho
Jan 03 2018 01:15
don't you get the string by calling getTotal instead of getTotal() ?
i'm off for today, happy coding to all
Kyle Holm
@thekholm80
Jan 03 2018 01:17
@Gersho have a good night
@GitHub-Henry that is seriously cool. I don't have node on this PC and sometimes I'm too lazy to boot up my laptop to try something out
Daniel
@dkapexhiu
Jan 03 2018 01:20
i dont know it @Gersho .. if i call getTotal i get a string?
Henry
@GitHub-Henry
Jan 03 2018 01:24
@dkapexhiu here's a way to get a string https://codepen.io/anon/pen/opwRyZ?editors=1111
Daniel
@dkapexhiu
Jan 03 2018 01:30
thank you.. @GitHub-Henry for example i want it to show .. getsubtotal + gettax + " $".. can i do it?
CamperBot
@camperbot
Jan 03 2018 01:30
dkapexhiu sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 521 | @github-henry |http://www.freecodecamp.org/github-henry
Manish Giri
@Manish-Giri
Jan 03 2018 01:38
@dkapexhiu
return `${getSubTotal(npizza) + getTax(npizza)} $`;
Kyle Holm
@thekholm80
Jan 03 2018 01:41
@Manish-Giri why doesn't my kata rank ever go up?
Manish Giri
@Manish-Giri
Jan 03 2018 01:41
:thought_balloon:
Kyle Holm
@thekholm80
Jan 03 2018 01:41
i've been the same rank forever
i rocked out some awesome recursion today, though
felt good
Manish Giri
@Manish-Giri
Jan 03 2018 01:42
  1. if you're doing the 6-7 kyu ones, you gotta do many of those
  2. easier is to solve the tougher ones, like 3-4 kyu
Kyle Holm
@thekholm80
Jan 03 2018 01:43
i only do the 1 kyu ones because the rest are super easy
kidding, kidding
that's probably it
Manish Giri
@Manish-Giri
Jan 03 2018 01:43
lol
:joy:
Kyle Holm
@thekholm80
Jan 03 2018 01:44
grats on 3 kyu btw, you're a pro
Manish Giri
@Manish-Giri
Jan 03 2018 01:44
lol
I don't think I can ever get to 2
wonder how scout did it
Kyle Holm
@thekholm80
Jan 03 2018 01:44
ctrl + c && ctrl + v
Manish Giri
@Manish-Giri
Jan 03 2018 01:44
lol
I remember I was at 4 kyu (20%) and I solved a 2 kyu problem, and it immediately jumped up to 3 kyu
Kyle Holm
@thekholm80
Jan 03 2018 01:45
dang
i should do some 2s and 3s
Manish Giri
@Manish-Giri
Jan 03 2018 01:45
it was a regex problem
Kyle Holm
@thekholm80
Jan 03 2018 01:45
I'm just too lazy to spend hours on a kata
Manish Giri
@Manish-Giri
Jan 03 2018 01:45
me too
Daniel
@dkapexhiu
Jan 03 2018 01:46
it doesnt work .. @Manish-Giri do you know another way?
it doesnt show the $ symbol on the total
Daniel
@dkapexhiu
Jan 03 2018 01:50
yes now it shows it .. excuse me @Manish-Giri
Manish Giri
@Manish-Giri
Jan 03 2018 01:50
:+1:
@thekholm80 you're now the recursion sensei..teach me
@GitHub-Henry not yet, lemme see
Kyle Holm
@thekholm80
Jan 03 2018 01:51
@Manish-Giri lol
Manish Giri
@Manish-Giri
Jan 03 2018 01:59
@GitHub-Henry looks neat!
Daniel
@dkapexhiu
Jan 03 2018 02:01
thank you @Manish-Giri
CamperBot
@camperbot
Jan 03 2018 02:01
dkapexhiu sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6798 | @manish-giri |http://www.freecodecamp.org/manish-giri
Manish Giri
@Manish-Giri
Jan 03 2018 02:04
@dkapexhiu :+1:
Albert Cardona II
@daddycardona
Jan 03 2018 04:15
this next challenge looks defeating especially why I have a slight headache and a cold boo challenge, map the debris wth
Kyle Holm
@thekholm80
Jan 03 2018 04:16
it's just math
Albert Cardona II
@daddycardona
Jan 03 2018 04:19

@dkapexhiu

return `${getSubTotal(npizza) + getTax(npizza)} $`;

you could do this too

return  `$${getSubTotal(npizza) + getTax(npizza)} `; /// so you can get the dollar sign in the front
Albert Cardona II
@daddycardona
Jan 03 2018 04:32
Yeah I see the math @thekholm80 I just don't get it like it just said to me that t=2pie, where did it get the 2 and is it always 2?
Kyle Holm
@thekholm80
Jan 03 2018 04:33
lemme take a look at it to refresh my memory
Albert Cardona II
@daddycardona
Jan 03 2018 04:35
then it goes on to tell me that I have to do is that square root of a to the 3rd power and divide that sucker by mass or general mass m to the 3rd pow to / s to the 2nd pow wth LOL
Kyle Holm
@thekholm80
Jan 03 2018 04:36
lol it uses a lot of the Math object, for sure
Math.round(), Math.PI, Math.sqrt() and Math.pow()
Albert Cardona II
@daddycardona
Jan 03 2018 04:36
yeah i see like Math.pie(2) lol
I have to hang out with sheldon cooper or lenard to understand this stuff lol
Kyle Holm
@thekholm80
Jan 03 2018 04:37
mostly it's just plugging data into an equation though
you'll get it
Manish Giri
@Manish-Giri
Jan 03 2018 04:38
i'd rather hang with Penny
Kyle Holm
@thekholm80
Jan 03 2018 04:38
eh
My favorite girl was on one episode for like 10 seconds lol
Albert Cardona II
@daddycardona
Jan 03 2018 04:39
yeah I just don't understand the equation like what goes where is avgAlt suppose to go? that is what confuses me lol and yeah me too she is the sexiest on the show but bernadet is the prettiest
maybe rahj sister lol
Kyle Holm
@thekholm80
Jan 03 2018 04:39
omg i forgot about her
Albert Cardona II
@daddycardona
Jan 03 2018 04:39
yeah I love that show
I watched every episode but forget most of them lol
Kyle Holm
@thekholm80
Jan 03 2018 04:40
the average altitude plus the radius of the earth will give you the diameter of the orbit, right?
Albert Cardona II
@daddycardona
Jan 03 2018 04:41
damm if I know I am still trying to understand the wiki so much stuff t learn I did not want to be astro physis learner lol
I can't even spell it correctly lol
Kyle Holm
@thekholm80
Jan 03 2018 04:41
today you make websites, tomorrow you put a man on the moon
it's pretty normal progression for devs
Albert Cardona II
@daddycardona
Jan 03 2018 04:43
lmao
Wow I am inspired not to learn now lol
Kyle Holm
@thekholm80
Jan 03 2018 04:43
@Manish-Giri has been to the moon 2 times
he's kind of famous
Albert Cardona II
@daddycardona
Jan 03 2018 04:43
I sucked at math in school that is why I like Ron from the treehouse commercials lol
wow he is my new hero @Manish-Giri for President :)
this is the formula I used, iirc
Albert Cardona II
@daddycardona
Jan 03 2018 04:45
yeah I don't get it lol
Kyle Holm
@thekholm80
Jan 03 2018 04:45
i'm a highschool drop out, if I can figure it out anyone can
Albert Cardona II
@daddycardona
Jan 03 2018 04:45
t = time got that part
you were too smart for highschool thats why you dropped out lol
Kyle Holm
@thekholm80
Jan 03 2018 04:46
2 * Pi, you should know that part
Albert Cardona II
@daddycardona
Jan 03 2018 04:46
where did they get 2pie from
Kyle Holm
@thekholm80
Jan 03 2018 04:46
then it's the square root of a cubed over GM
Albert Cardona II
@daddycardona
Jan 03 2018 04:47
is 2pie a constant that makes it automatically 2?
Kyle Holm
@thekholm80
Jan 03 2018 04:47
2 pi is 2 x 3.14159
Albert Cardona II
@daddycardona
Jan 03 2018 04:47
no I know but where did the 2 come from
Kyle Holm
@thekholm80
Jan 03 2018 04:47
it's part of the equation
Albert Cardona II
@daddycardona
Jan 03 2018 04:48
I understand pie is not just something I eat hence therefore I am fat lol
so 2pi is constant in the equation
Kyle Holm
@thekholm80
Jan 03 2018 04:48
right
you won't change that
this shows that a is the earth's radius plus the average altitude of the satellite
Albert Cardona II
@daddycardona
Jan 03 2018 04:51
okay so if I put t=Math.Round((2*Math.PI) SquareRoot(of the rest of algorythm )
Kyle Holm
@thekholm80
Jan 03 2018 04:52
Math.sqrt()
is square root
Albert Cardona II
@daddycardona
Jan 03 2018 04:52
yeah I got that lol
I don't know why I put iti like that lol
Kyle Holm
@thekholm80
Jan 03 2018 04:53
but yeah, just make sure you multiply the 2 pi with the square root
Albert Cardona II
@daddycardona
Jan 03 2018 04:54
Math.sqrt(Math.Pow(base,exponent)/ GM)
Kyle Holm
@thekholm80
Jan 03 2018 04:54
yessir
the base will be a and the exponent will be 3
Albert Cardona II
@daddycardona
Jan 03 2018 04:55
now is a == avgAlt
Albert Cardona II
@daddycardona
Jan 03 2018 04:56
or is that what you was trying to show me on this page
that just gives me a picture lol
Kyle Holm
@thekholm80
Jan 03 2018 04:57
if you look at the picture, it shows that a is measured from the center of the central body (the earth, in this case) to the orbiting body
which would be the average altitude
Albert Cardona II
@daddycardona
Jan 03 2018 05:00
so a = earth'sRadius/2
Kyle Holm
@thekholm80
Jan 03 2018 05:00
close
Albert Cardona II
@daddycardona
Jan 03 2018 05:00
a is the orbit's semi-major axis in meters is what I read
Kyle Holm
@thekholm80
Jan 03 2018 05:01
The semi-major axis of a hyperbola is, depending on the convention, plus or minus one half of the distance between the two branches. Thus it is the distance from the center to either vertex (turning point) of the hyperbola.
Albert Cardona II
@daddycardona
Jan 03 2018 05:01
so now I am confused again let me keep reading because you speaking nerdy gibrish I am trying to as nerdy as you I can't lol you too smart for me a college grad LOL
Kyle Holm
@thekholm80
Jan 03 2018 05:01
rofl
Albert Cardona II
@daddycardona
Jan 03 2018 05:02
what you just quoted makes no sense to me at all lol
Kyle Holm
@thekholm80
Jan 03 2018 05:02
that's what you're looking for
a is the earth's radius plus the average altitude of the satellite
Albert Cardona II
@daddycardona
Jan 03 2018 05:03
I don't know
I am lost lol
Kyle Holm
@thekholm80
Jan 03 2018 05:03
rofl i just told you the answer
the orbit's semi-major axis is the earth's radius, plus the altitude of the orbiting object
lemme draw a pic of it
Albert Cardona II
@daddycardona
Jan 03 2018 05:06
so you are saying a = earthsRadius + avgAlt
Kyle Holm
@thekholm80
Jan 03 2018 05:07
yes!
so in your Math.sqrt(Math.Pow(base,exponent)/ GM) that is the base
Albert Cardona II
@daddycardona
Jan 03 2018 05:07
oh okay where did you find that out
base = a
Kyle Holm
@thekholm80
Jan 03 2018 05:07
lol in the pic i linked
Albert Cardona II
@daddycardona
Jan 03 2018 05:08
I don't see that lol
I meant the deffinition I am having a hard time reading today I have a slight headache, a fever induce headache, and my eyes are watering lol

this says

The semi-major axis is one half of the major axis, and thus runs from the centre, through a focus, and to the perimeter.

Albert Cardona II
@daddycardona
Jan 03 2018 05:11
I see that but your definition is adding the alt I don't see that I am trying to read I read all that :)
Kyle Holm
@thekholm80
Jan 03 2018 05:13
the altitude is the distance from earth's sea level, right? and the earth's radius is 1/2 it's diameter. so if we add them together we get the orbit's distance from the center of the earth, which we're calling the center of the orbit
the full diameter of the orbit would be the the major axis, for our formula we need the semi major axis, or 1/2 the major axis
which happens to be the earth's radius + the average altitude
man i wish I could explain things better
Albert Cardona II
@daddycardona
Jan 03 2018 05:16
I get it now :) you did good young padawan :)
I got that to actually work :)
Kyle Holm
@thekholm80
Jan 03 2018 05:17
awesome!
Albert Cardona II
@daddycardona
Jan 03 2018 05:20
Now I have to figure out how to do it for the second one and make it say name: sputnick but I think I can figure that out once again thanks @thekholm80
CamperBot
@camperbot
Jan 03 2018 05:20
:star2: 1648 | @thekholm80 |http://www.freecodecamp.org/thekholm80
daddycardona sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
Albert Cardona II
@daddycardona
Jan 03 2018 05:20
you getting better at teaching too :)
Kyle Holm
@thekholm80
Jan 03 2018 05:21
keep in mind they're passing you an array so you may have more than one object you need to work your magic on
Albert Cardona II
@daddycardona
Jan 03 2018 05:22
yeah I am thinking of creating a second function or loop for each function thingy too finish that one ;)
Kyle Holm
@thekholm80
Jan 03 2018 05:22
good thinking
Albert Cardona II
@daddycardona
Jan 03 2018 05:22
but tonight I got the gist of it thanks to you
foreach() sounds like it will work ;)
Kyle Holm
@thekholm80
Jan 03 2018 05:23
it's pretty handy
Albert Cardona II
@daddycardona
Jan 03 2018 05:23
well good night I am exhausted freaking cold :)
not that its cold outside but the cold that bastard lol
:sleepy: :zzz: @thekholm80 and FCC
Kyle Holm
@thekholm80
Jan 03 2018 05:32
@daddycardona g'night
slience.c
@hellc3c
Jan 03 2018 08:28
image.png
image.png
I have a problem
where is the mistake ?
I have solved it ,nothing
hehongkun
@hehongkun
Jan 03 2018 09:28
I think I am here to study English.....
Not web...
Sorin Ruse
@sorinr
Jan 03 2018 10:16
@hellc3c you are missing a , comma at the end of line 11. it should be like },
Darren
@DarrenfJ
Jan 03 2018 16:19
morning fCC, can't stay.. it's back to the usual grind of stand-up meetings that seem to go on forever...
but wanted to say hi
Kyle Holm
@thekholm80
Jan 03 2018 16:19
@DarrenfJ :wave:
VaseJS
@VaseJS
Jan 03 2018 16:20
@DarrenfJ they stand up the whole time? to keep people awake?
lol
Stephen James
@sjames1958gm
Jan 03 2018 17:09
@DarrenfJ stand-ups are supposed to keep you agile (and be short)
Henry
@GitHub-Henry
Jan 03 2018 18:38
Morning fcc, here is something, perhaps of interest, in case you didn't see it.
Olapri
@Olapri
Jan 03 2018 18:45
Hu. Pls help to understand why my tweet-function does not work. I get "undefined" on tweet-page. https://codepen.io/ololpri/pen/JMjZJM?editors=1011
Gersho
@Gersho
Jan 03 2018 18:49
hello fCC/Help
Chris
@bestintown23
Jan 03 2018 18:49
why are my social media icons showing on a slant? https://codepen.io/bestintown23/pen/gogmVB
Gersho
@Gersho
Jan 03 2018 18:51
@Olapri
var quateDisplay = quate[random];
is inside function generate () {
so it is not accessible when you call
console.log(quateDisplay);
window.open("https://twitter.com/intent/tweet?text=" + quateDisplay);
i see you have already declared it with var earlier in your code (line 3/4) so you should be able to make it work by removing the var on lines 12/13
quateDisplay = quate[random];
authorDisplay = author[random];
Kyle Holm
@thekholm80
Jan 03 2018 18:55
@Gersho :wave:
Gersho
@Gersho
Jan 03 2018 18:55
:wave: @thekholm80
Albert Cardona II
@daddycardona
Jan 03 2018 18:58
@bestintown23 take out the fig captions <figcaption> and it will all line up properly sorry I am late
hey you guys :)
Kyle Holm
@thekholm80
Jan 03 2018 18:59
@daddycardona :wave:
Albert Cardona II
@daddycardona
Jan 03 2018 18:59
@thekholm80 and @Gersho I completed that task last night now I have to try to figure out this last algorythm :)
Kyle Holm
@thekholm80
Jan 03 2018 18:59
now that you're a rocket scientist the rest will be easy
Albert Cardona II
@daddycardona
Jan 03 2018 19:00
LOL that one was easy except the math and the fact I think I was trying to learn the whole page lol
Kyle Holm
@thekholm80
Jan 03 2018 19:00
yeah, you do like to make things even more challenging
Gersho
@Gersho
Jan 03 2018 19:01
and i still don't have frontEnd D:
Kyle Holm
@thekholm80
Jan 03 2018 19:01
My goal for the next few months is to finish the last few projects I've got left
Gersho
@Gersho
Jan 03 2018 19:02
i got portfolio and a few advanced algo (but i'm not sure i'll bother with those)
Albert Cardona II
@daddycardona
Jan 03 2018 19:02
I will be doing this one today I hope I think I understand it
Gersho
@Gersho
Jan 03 2018 19:02
which one ?
Albert Cardona II
@daddycardona
Jan 03 2018 19:03
Pairwise
I swore I understood it last night but I had a headache and was like go to sleep
Kyle Holm
@thekholm80
Jan 03 2018 19:04
lol
Gersho
@Gersho
Jan 03 2018 19:04
didn't do that one, guess i'll try it a bit, my JS is getting rusty
Kyle Holm
@thekholm80
Jan 03 2018 19:04
my solution to that one is pretty ugly
I think by this point I was just happy to get it done, i didn't care how it looked
Gersho
@Gersho
Jan 03 2018 19:05
i never rewrite challenge i've done, some are pretty nasty
Kyle Holm
@thekholm80
Jan 03 2018 19:07
I sometimes refactor mine
especially when I see some really crappy code I've written
Gersho
@Gersho
Jan 03 2018 19:08
i kinda like seeing the progression between my older stuff and more recent ones
Albert Cardona II
@daddycardona
Jan 03 2018 19:08
I am like you kyle I don't care if its 10 or 100 lines as long as I understand it and get it done ;)
I have refactor mines too especially when I am helping others out I am like yuck what am I thinking :)
Gersho
@Gersho
Jan 03 2018 19:09
understanding it is the most important part
Kyle Holm
@thekholm80
Jan 03 2018 19:09
lol yeah
Gersho
@Gersho
Jan 03 2018 19:09
i always think "what if you're in a interview and the guys asks you how it works"
i wanted to check an old one but i get 414 Request-URI Too Large xD
Kyle Holm
@thekholm80
Jan 03 2018 19:10
:sparkles: Magic! :sparkles:
Kyle Holm
@thekholm80
Jan 03 2018 19:10
exactly
Albert Cardona II
@daddycardona
Jan 03 2018 19:11
LOL
I am going to go over the permutation one a lot because a lot of people on youtube say it is a question that they ask a lot :)
so I will memorize it and be like its done abc aab what ever lol
Kyle Holm
@thekholm80
Jan 03 2018 19:12
I would have trouble with any interview question that expects me to have everything memorized. I cannot write a line of code without MDN
Albert Cardona II
@daddycardona
Jan 03 2018 19:13
no just taht one lol
Albert Cardona II
@daddycardona
Jan 03 2018 19:13
lol
Gersho
@Gersho
Jan 03 2018 19:13
@thekholm80 use zeal instead of mdn, less loading time ;)
Kyle Holm
@thekholm80
Jan 03 2018 19:14
man Eric Elliot is all about functional programming
Gersho
@Gersho
Jan 03 2018 19:14
for me it's star trek level technobable
invert the functionality of the prototype inheritence !
Kyle Holm
@thekholm80
Jan 03 2018 19:15
I used to read all of his stuff
he's definitely a smart dude
Gersho
@Gersho
Jan 03 2018 19:19
i'm reading pairwise, it sounds like those math exercice that will never have any real life use xD but whatever let's get to work
Kyle Holm
@thekholm80
Jan 03 2018 19:20
that's how I feel about every kata on codewars
"I'll never need to do this in real life"
Gersho
@Gersho
Jan 03 2018 19:21
well codewars is more about bragging rights and fancy one liners
but it's good to be able to compare with others results
haven't been there in 2+ months
Albert Cardona II
@daddycardona
Jan 03 2018 19:22
I been there like once or twice or ninjacode or whatever the sites are lol
Gersho
@Gersho
Jan 03 2018 19:22
Overall:5 kyu / 16%
JavaScript:6 kyu / 48%
Python:6 kyu / 46%
so pretty much small fry, i don't go there often
Albert Cardona II
@daddycardona
Jan 03 2018 19:24
well I am going to try it and be back to cry how hard it is for me and @thekholm80 is going to say you don't need all that all you need is to do this LOL
Kyle Holm
@thekholm80
Jan 03 2018 19:25
Keep It Simple, Stupid
KISS
Albert Cardona II
@daddycardona
Jan 03 2018 19:26
that was my Marine Corps Motto lOL
LOL
Gersho
@Gersho
Jan 03 2018 20:02
Done ! well it wasn't that hard after all
Albert Cardona II
@daddycardona
Jan 03 2018 20:20
Wow I am over here confused as heck @Gersho probably something I am overthinking like always
did you use the reduce() method ?
Gersho
@Gersho
Jan 03 2018 20:21
i used a reduce at the end but most of the work is done with for loops
here's the backbone of my method
function pairwise(arr, arg) {
  var usedIndex = [];
  for(i=0;i<arr.length-1;i++){
    for(j=i+1;j<arr.length;j++){
      if(arr[i]+arr[j] === arg){
        //magic
      }
    }
  }
//more magic
}
i use reduce in the "more magic" part
Albert Cardona II
@daddycardona
Jan 03 2018 20:25
I just did that lol I was doing it wrong inittially lol
but I did reduce still working on the magic part lol
I am doing reduce and a for loop :)
Gersho
@Gersho
Jan 03 2018 20:26
you need some checks inside the for i and for j to avoid using the same values twice
i actually got the idea when i was doing one of exemples pen&paper because i had trouble wrapping my head around it
Albert Cardona II
@daddycardona
Jan 03 2018 20:28
yes I am doing that just trying to figure out the code :)
Kyle Holm
@thekholm80
Jan 03 2018 20:28
↑↑↓↓←→←→BA
only code you ever need
Gersho
@Gersho
Jan 03 2018 20:30
haha
funny how many sites have konami code easter eggs
Kyle Holm
@thekholm80
Jan 03 2018 20:30
i should start putting it in stuff I build
Gersho
@Gersho
Jan 03 2018 20:31
haha
Kyle Holm
@thekholm80
Jan 03 2018 20:31
i can make a library for it, so I don't have to push the code to github
Albert Cardona II
@daddycardona
Jan 03 2018 20:32
contra
down R up left y b is the code I need lol
Gersho
@Gersho
Jan 03 2018 20:34
street fighter xD
Albert Cardona II
@daddycardona
Jan 03 2018 20:34
:) one of my favorite games of all times :)
Kyle Holm
@thekholm80
Jan 03 2018 20:35
abacabb?
Albert Cardona II
@daddycardona
Jan 03 2018 20:35
be back in a few :)
mortal combat blood code sega
Gersho
@Gersho
Jan 03 2018 20:35
in french we call it out loud "barolyb" (bas/down R o(haut)/up L Y B)
Albert Cardona II
@daddycardona
Jan 03 2018 20:35
I can't believe i remember that lol
Kyle Holm
@thekholm80
Jan 03 2018 20:35
lol gotta have that gore
Albert Cardona II
@daddycardona
Jan 03 2018 20:35
lol
artbohr
@artbohr
Jan 03 2018 20:46

https://codepen.io/artbohr/pen/RxpPpY

guys, can someone take a look why it's laggy as hell? What is the primary source of the lags, what should I strike to optimeze in the first place?

optimize*
in faster PC's u can play but in slower PC's the player is just teleporting all around xD
Gersho
@Gersho
Jan 03 2018 20:47
we can't move with arrows :(
artbohr
@artbohr
Jan 03 2018 20:47
ye, use WASD ^^
Gersho
@Gersho
Jan 03 2018 20:48
super conveniant on an azerty keyboard
artbohr
@artbohr
Jan 03 2018 20:48
I was about to starting with optimizing but then I thought that maybe someone can tell me what is the primary source of the lags, so I begin in the right place, before making useless cuts
Gersho
@Gersho
Jan 03 2018 20:50
hmm, lag seem to occur when key is held down
arrows version for you
Gersho
@Gersho
Jan 03 2018 20:52
so maybe try putting a delay (0.1 sec ?) that would prevent input while you're doing your current move ? also i didn't really check the react part but check to make sure you're not refreshing more things than necessary
haha thanks
artbohr
@artbohr
Jan 03 2018 20:54
well, in slower PCs it's just retarded as laggy, I'm not sure what is the right place to cut the unnecessary calculatios
Gersho
@Gersho
Jan 03 2018 20:55
i dunno sorry
Kyle Holm
@thekholm80
Jan 03 2018 21:10
this was a big reason why I used canvas instead of react. canvas draws everything as a single image instead of having to render a ton of different things
well, i guess i should say canvas inside of react
Gersho
@Gersho
Jan 03 2018 21:13
do you change stuff outside the canvas during gameplay ? i can't seem to see the point of mixing canvas and react
Kyle Holm
@thekholm80
Jan 03 2018 21:14
my entire game lived in a canvas element, I just used react for the landing page, page navigation and to actually render the canvas element
Gersho
@Gersho
Jan 03 2018 21:15
so it didn't react did it ?
Kyle Holm
@thekholm80
Jan 03 2018 21:15
huh?
alpox
@alpox
Jan 03 2018 21:15
Guess that was a joke :D
Kyle Holm
@thekholm80
Jan 03 2018 21:15
oh lol I'm not very bright
Gersho
@Gersho
Jan 03 2018 21:15
i mean isn't the whole point of react to be able to alter the page without refreshing the whole DOM object ?
so if it's a page where the only thing changing is the canvas, does using react have any impact over classic html ?
Kyle Holm
@thekholm80
Jan 03 2018 21:16
using react is my preferred method of putting anything onto the dom
alpox
@alpox
Jan 03 2018 21:16
@Gersho Yes but it still has to do checks for where it has to update and where not - its called DOM diffing. That also takes some time. Also, if you have many often updating elements, react cannot perform well. In that case maybe even worse than without virtual DOM
Gersho
@Gersho
Jan 03 2018 21:17
ok thanks for clearing that up @thekholm80 @alpox
CamperBot
@camperbot
Jan 03 2018 21:17
gersho sends brownie points to @thekholm80 and @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1649 | @thekholm80 |http://www.freecodecamp.org/thekholm80
:star2: 1516 | @alpox |http://www.freecodecamp.org/alpox
Kyle Holm
@thekholm80
Jan 03 2018 21:18
i did my game of life entirely in React and I saw some pretty noticeable lag if I tried to update the game state too often
Gersho
@Gersho
Jan 03 2018 21:19
only did markdown and leaderboard in react
artbohr
@artbohr
Jan 03 2018 21:21
@alpox is it even possible to make something from my project in it's current state if react is as bad in this case? In terms of optimization to be playable
alpox
@alpox
Jan 03 2018 21:22
@artbohr react has no problems with the dungeon crawler mostly because you 1. usually don't draw all the elements at once (Only the visible subset) and 2. you update only a small part of the DOM at once
The game of life is a different story
artbohr
@artbohr
Jan 03 2018 21:22
@alpox I'm talking about
Gersho
@Gersho
Jan 03 2018 21:22
his game is a roguelike
the last dataviz project
alpox
@alpox
Jan 03 2018 21:23
@Gersho Yea sry i wrote it wrong. I meant that one :-)
artbohr
@artbohr
Jan 03 2018 21:23
so my problem is updating the whole grid?
Gersho
@Gersho
Jan 03 2018 21:24
btw i was planning to use https://github.com/ondras/rot.js when i start the roguelike project, do you think it's ok or there's too much stuff premade ?
Kyle Holm
@thekholm80
Jan 03 2018 21:24
that's what I used to make my maps @Gersho
Gersho
@Gersho
Jan 03 2018 21:24
ok cool :)
alpox
@alpox
Jan 03 2018 21:24
@artbohr Well the grid is big and much is visible at once so react takes some time do diff the DOM. The update itself does not take long. In the example you see that they show only little of the board - not so much. That makes it more performant
Kyle Holm
@thekholm80
Jan 03 2018 21:24
I'm pretty sure the instructions say to use whatever libraries you want
Gersho
@Gersho
Jan 03 2018 21:25
i know but still, didn't know where to draw the line, the point being to learn :P
alpox
@alpox
Jan 03 2018 21:26
@Gersho Creating a good grid is hard actually. But its maybe worth the try
artbohr
@artbohr
Jan 03 2018 21:26
@alpox well still not sure what to do with my project to fix my projects issues, ty
CamperBot
@camperbot
Jan 03 2018 21:26
artbohr sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1517 | @alpox |http://www.freecodecamp.org/alpox
Gersho
@Gersho
Jan 03 2018 21:26
oh sorry to play it political, but i'm watching the news and...did trump just play "uh uh i've got a bigger one" ? xD
alpox
@alpox
Jan 03 2018 21:26
I guess i would go for it myself if i'd be about to create a roguelike. Didn't do it though :D
@artbohr Sry, i didn't see you had an issue. I gotta scroll up :D
Gersho
@Gersho
Jan 03 2018 21:26
it gets laggy when holding down btn for mouvement
artbohr
@artbohr
Jan 03 2018 21:27
@gersho yeap, ty
CamperBot
@camperbot
Jan 03 2018 21:27
artbohr sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 554 | @gersho |http://www.freecodecamp.org/gersho
alpox
@alpox
Jan 03 2018 21:27
Ah the holding down problem. Well, thats clear whats the problem. @artbohr
holding down the mouse creates a ton of click callbacks. Setting the state and diffing the DOM each time it happens (all some ms) is a major overload
Gersho
@Gersho
Jan 03 2018 21:28

i suggested

so maybe try putting a delay (0.1 sec ?) that would prevent input while you're doing your current move ? also i didn't really check the react part but check to make sure you're not refreshing more things than necessary

but there's probably a better approach

Kyle Holm
@thekholm80
Jan 03 2018 21:28
mine has some visual bugs, but i'm mostly happy with how it plays
Gersho
@Gersho
Jan 03 2018 21:29

Show them they're clucking with the wrong chicken.

you should have put clicken instead of chicken ^^

the character doesn't display until i've made the first movement
Kyle Holm
@thekholm80
Jan 03 2018 21:30
yeah, there's some weird bugs
but i'm not all that worried
alpox
@alpox
Jan 03 2018 21:30
Yea a delay would probably be a good solution here :-)
Gersho
@Gersho
Jan 03 2018 21:31
for real ? cool, maybe i'm not that dumb after all
alpox
@alpox
Jan 03 2018 21:32
@artbohr You can go with @Gersho solution and put a timeout for the input. You'd just set a boolean to the component state which tells that you just pressed. Reset it to false after maybe 0.1 sec (With a setTimeout) and in the eventlistener, check that boolean. If its set to true, ignore the event.
artbohr
@artbohr
Jan 03 2018 21:32
@Gersho @alpox can you guys suggest a good spot for the delay? I tried a bunch but it didn't work as expected, you meant setInterval, right?
Gersho
@Gersho
Jan 03 2018 21:32
around where you listen for input
alpox
@alpox
Jan 03 2018 21:32

@artbohr Additional hint:

// make a deep copy of the grid
  deepCopy = arr => {
    return JSON.parse(JSON.stringify(arr));
  };

Dude this is the slowest thing you can do to anything

Gersho
@Gersho
Jan 03 2018 21:33

(listen){
if(token){
return;
}
token=true;
}

and put token=false when you're done

artbohr
@artbohr
Jan 03 2018 21:33
@alpox @gersho thanks, will try that
CamperBot
@camperbot
Jan 03 2018 21:33
artbohr sends brownie points to @alpox and @gersho :sparkles: :thumbsup: :sparkles:
api offline
api offline
artbohr
@artbohr
Jan 03 2018 21:33
what is the alternative? just looks so clean and nice ^^
alpox
@alpox
Jan 03 2018 21:33
Better:
// make a deep copy of the grid
  deepCopy = arr => {
    return [].concat(arr);
  };
This is likely the fastest method in terms of performance
Kyle Holm
@thekholm80
Jan 03 2018 21:34
or just deepCopy = [...arr];?
alpox
@alpox
Jan 03 2018 21:34
@thekholm80 Thats slower sadly
Looks cleaner tho
Gersho
@Gersho
Jan 03 2018 21:34
of those [...] always forget about those
looks fancy
Kyle Holm
@thekholm80
Jan 03 2018 21:34
i generally use slice() iirc
alpox
@alpox
Jan 03 2018 21:34
Hmm slice could be as fast i guess
Not sure
return arr.slice(); would do
Not sure how it performs against the concat
Albert Cardona II
@daddycardona
Jan 03 2018 21:35
man I am confused with what I am trying to do I hate being sick lol
Gersho
@Gersho
Jan 03 2018 21:35
@thekholm80 i'm on floor 2 and level 3 but i haven't seen any items yet, only potions
alpox
@alpox
Jan 03 2018 21:36
But anything is better than the JSON method :D
Kyle Holm
@thekholm80
Jan 03 2018 21:36
@Gersho everything in the first 4 levels is completely random lol. sometimes you'll spawn completely surrounded by mobs, sometimes you have to wander for a while
Gersho
@Gersho
Jan 03 2018 21:36
oh nvm just found one
oh i had a bug where there was 4-5 mobs in a row but all disaperead after killing the 1st
Kyle Holm
@thekholm80
Jan 03 2018 21:37
@daddycardona nyquil & bedrest, the code will be here when you're better
Gersho
@Gersho
Jan 03 2018 21:37
oh you see the equiped item on the char, cool
alpox
@alpox
Jan 03 2018 21:37
@artbohr Another hint: document.getElementById("gameLog").textContent = "Player advances to next level"; may work for you now, but try to come around document.xyz things in react. This can confuse react to its deepest. DOM diffing becomes a problem when doing this because the virtual DOM will not be in sync with the real DOM anymore if you change the DOM yourself!
Kyle Holm
@thekholm80
Jan 03 2018 21:37
yeah, i had to draw a ton of crap lol
Gersho
@Gersho
Jan 03 2018 21:38
@alpox thanks but it's not my project :p
CamperBot
@camperbot
Jan 03 2018 21:38
gersho sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
api offline
alpox
@alpox
Jan 03 2018 21:38
@Gersho Sry, yes. Already changed
Albert Cardona II
@daddycardona
Jan 03 2018 21:41
yeah
Gersho
@Gersho
Jan 03 2018 21:42
@thekholm80 i'm a dual wielding chicken fighting clowns <3
Kyle Holm
@thekholm80
Jan 03 2018 21:42
rofl
i love the clowns
Gersho
@Gersho
Jan 03 2018 21:45
the game crashed, upon entenring lvl 5, i want a refund
Kyle Holm
@thekholm80
Jan 03 2018 21:46
sure, just send me the credit card numbers so I can put your money back
Gersho
@Gersho
Jan 03 2018 21:46
lol
with the digits on the back too ?
Kyle Holm
@thekholm80
Jan 03 2018 21:46
better just mail me the card
to be safe
Gersho
@Gersho
Jan 03 2018 21:46
tough luck for you i don't have a,y
was fun game
btw
Kyle Holm
@thekholm80
Jan 03 2018 21:47
@Gersho thanks
CamperBot
@camperbot
Jan 03 2018 21:47
thekholm80 sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 555 | @gersho |http://www.freecodecamp.org/gersho
Kyle Holm
@thekholm80
Jan 03 2018 21:47
it was fun to make
Gersho
@Gersho
Jan 03 2018 21:47
i especialy loved the weapons on the character xD
Manish Giri
@Manish-Giri
Jan 03 2018 21:48
ooh are we getting money back
I want some too
Kyle Holm
@thekholm80
Jan 03 2018 21:48
same as I told @Gersho , send me your credit card info
and I'll get you some money
Manish Giri
@Manish-Giri
Jan 03 2018 21:48
sure
Kyle Holm
@thekholm80
Jan 03 2018 21:49
after I get done killing all the ninjas
Gersho
@Gersho
Jan 03 2018 21:50
don't forget the clowns
Kyle Holm
@thekholm80
Jan 03 2018 21:51
if i don't find some health pots soon i won't make it to the clowns
I miss the dev version of the game, i could have infinite health and 1 shot everything
Gersho
@Gersho
Jan 03 2018 21:51
you should have left some function and trigger them via console
Kyle Holm
@thekholm80
Jan 03 2018 21:52
guess I still could
Gersho
@Gersho
Jan 03 2018 21:52
if you remember the function for when you get a potion you could trigger it via console
Kyle Holm
@thekholm80
Jan 03 2018 21:52
but i'd have to roll back my node version just to change anything
Gersho
@Gersho
Jan 03 2018 21:52
or just set your life up
Kyle Holm
@thekholm80
Jan 03 2018 21:53
not sure if I could, webpack minified all my code
it's not really readable
artbohr
@artbohr
Jan 03 2018 21:53
@alpox thanks
CamperBot
@camperbot
Jan 03 2018 21:53
artbohr sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
api offline
Gersho
@Gersho
Jan 03 2018 21:53
if it's minified variables and function names will have changed
Kyle Holm
@thekholm80
Jan 03 2018 21:53
right
artbohr
@artbohr
Jan 03 2018 21:54
@alpox api not ready yet :D btw, about setting text, totally makes sense, forgot about that, do u know any workaround about that? not sure how to place the text there then
@alpox also the event key listener is attached to the dom the same way, isn't it?
alpox
@alpox
Jan 03 2018 22:10
@artbohr The workaround is to keep a state indicator for the textmessage in the component state and decide in the render method what text to set to the DOM.
About the event listener attatchment, you gotta set it directly in the render method to the respective elements too (onKeyDown)
Darren
@DarrenfJ
Jan 03 2018 22:16
@GitHub-Henry thanks for the link brutha will check it out
CamperBot
@camperbot
Jan 03 2018 22:16
darrenfj sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 523 | @github-henry |http://www.freecodecamp.org/github-henry
Darren
@DarrenfJ
Jan 03 2018 22:17
@Manish-Giri made some notes on a few thangs I'll tackle re: scryNet o'er the next little bit.. rawk on with the thesis in the mean time
@sjames1958gm oh I know that. But they/we're in transition and people cannot give up the old ways...
@VaseJS to keep me awake anyway ;)
DarrenfJ @DarrenfJ sneaks off back to testing
artbohr
@artbohr
Jan 03 2018 22:27
@alpox thanks
CamperBot
@camperbot
Jan 03 2018 22:27
artbohr sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1518 | @alpox |http://www.freecodecamp.org/alpox
artbohr
@artbohr
Jan 03 2018 22:27
@DarrenfJ :wave:
Gersho
@Gersho
Jan 03 2018 22:34
@DarrenfJ :wave:
@GitHub-Henry thanks
CamperBot
@camperbot
Jan 03 2018 22:34
gersho sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 524 | @github-henry |http://www.freecodecamp.org/github-henry