These are chat archives for FreeCodeCamp/Help

12th
Sep 2018
Karma Drukpa
@coderkarma
Sep 12 2018 00:01
@psyperl lets keep grinding JS
dpinney39
@dpinney39
Sep 12 2018 02:32

<!DOCTYPE html>

<html>
<head>

<style>

h1 {text-align: center;}
p {text-align: justify;}
a {text-align: center;}
title {background-color: blueviolet;}
</style>     
 <title>World Peace Church Of Christ</title>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<link rel="stylesheet" href="styles.css">

<body>
<div>

</div>
<header>
    <h1>World Peace Church of Christ</h1>
        <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">Sermon</a></li>
    <li><a href="#">Events</a></li>
    <li><a href="#">Contact</a></li>        

</ul>

</header>
<img src="backlit-cemetery-christianity-415571.jpg" width="581" height="327" alt="cross" class="center">

<p> World Peace Church of Christ is an International Ministry,<br> we are here for the lost souls. WPCC ais very in tuned in the Great Commission.<br> WPCC are affiliated with UMOYO Widows an Orphanage charity Organization in Zambia, Africa. WPCC has shipped clothing and Bibles to the woman and children Orphanage. </p>

    <p>
    </p>
<a href= "https://www.facebook.com/WorldPeaceChurchOfChrist/?ref=bookmarks">FaceBook</a>

</body>
</html>
I WANT TO MAKE TO PUT TEXT IN HOME, SERMON, EVENTS, AND CONTACT. AT THE TOP RIGHT OF THE PAGE

Claudio Restifo
@Marmiz
Sep 12 2018 02:43

@dpinney39 it all boils down to how you want your page to look like for different screen sizes.
I think that the easiest option is setting a position property on header. and work on that.

Also, it's better if you format your code in here so it's easier to read. To so so wrap it in 3 ` (backticks)

``` (shift+enter for line break)
var code = "formatted";
```

psyperl
@psyperl
Sep 12 2018 03:49
(shift-enter for line break) const test = 1
FaisalFarooqui
@FaisalFarooqui
Sep 12 2018 09:51
Hi,
Any one there?
Aditya Dehal
@aditya2000
Sep 12 2018 09:51
Hi @FaisalFarooqui
FaisalFarooqui
@FaisalFarooqui
Sep 12 2018 09:52
Hello Aditya Thanks for Reply
Actually i am facing a problem
problem is that Font IDAutomationHC39M not reflecting on Server but running successfully on local host
Can you please help me with this?
Aditya Dehal
@aditya2000
Sep 12 2018 09:55
So are you doing some barcode kindof stuff?
FaisalFarooqui
@FaisalFarooqui
Sep 12 2018 09:55
yes
Online.png
LocalHost.png
This is the diffrence
Aditya Dehal
@aditya2000
Sep 12 2018 09:56
Well I have not worked on it but still let me check if I can help you
FaisalFarooqui
@FaisalFarooqui
Sep 12 2018 09:57
I will be really thankful to you
Aditya Dehal
@aditya2000
Sep 12 2018 09:58
which framework are you using for backend?
FaisalFarooqui
@FaisalFarooqui
Sep 12 2018 09:58
Asp.net MVC C#
Aditya Dehal
@aditya2000
Sep 12 2018 10:03
Are you trying to print the barcode in some pdf format?
check this link
this is almost similar to your problem
maybe this is what you are looking for
FaisalFarooqui
@FaisalFarooqui
Sep 12 2018 10:06
yeah, i am reading the solution thanks a lot i will let you know if this gets resolved
Aditya Dehal
@aditya2000
Sep 12 2018 10:09
yeah sure! :)
according to this purchasing is only the sollution?
Aditya Dehal
@aditya2000
Sep 12 2018 10:28
If that's the case then I think check out for some other alternatives
Maybe QR code or something
John
@taloloy18
Sep 12 2018 12:07

// Example
function minusSeven(num) {
return num - 7;
}

// Only change code below this line
function productFive(num){
return num * 5;
}

console.log(productFive(5,2,0));

what wrong?
Aditya
@ezioda004
Sep 12 2018 12:08
Create a function timesFive
John
@taloloy18
Sep 12 2018 12:09
done thanks
creeps
@winnypie_twitter
Sep 12 2018 12:23
Is there any good free socks api provider ? pls let me know i need it urgently.
May Kittens Devour Your Soul
@diomed
Sep 12 2018 12:25
they're all smelly
creeps
@winnypie_twitter
Sep 12 2018 12:27
idc i need it... there should be no limit on request
May Kittens Devour Your Soul
@diomed
Sep 12 2018 13:31
computer.md
psyperl
@psyperl
Sep 12 2018 14:17
¿
psyperl
@psyperl
Sep 12 2018 14:22
solved a problem in a day... phew
where i am expected to solve 3 or 4 in a day :stuck_out_tongue_winking_eye:
It does not matter how slowly you go as long as you do not stop. -- Confucius
creeps
@winnypie_twitter
Sep 12 2018 15:28
@psyperl WHERE ARE U FROM?
psyperl
@psyperl
Sep 12 2018 15:40
!
May Kittens Devour Your Soul
@diomed
Sep 12 2018 15:41
he's from Chocolate Pastures
Aditya Dehal
@aditya2000
Sep 12 2018 15:45
Sounds Chocolaty ... isn't it? ;D
Kyle Holm
@thekholm80
Sep 12 2018 17:25
it's quiet today
Christopher McCormack
@cmccormack
Sep 12 2018 17:26
We were napping until you woke us all up!
Aditya Dehal
@aditya2000
Sep 12 2018 17:26
Yea @thekholm80
Kyle Holm
@thekholm80
Sep 12 2018 17:26
a nap would be nice
psyperl
@psyperl
Sep 12 2018 17:33
BuntyBru
@BuntyBru
Sep 12 2018 17:36
whats up guys ?
a nap would be nice
everyone went away for a nap again or what?
Christopher McCormack
@cmccormack
Sep 12 2018 17:37
@psyperl those look so fake!
Aditya Dehal
@aditya2000
Sep 12 2018 17:38
Hey @BuntyBru
BuntyBru
@BuntyBru
Sep 12 2018 17:38
Hey
Kyle Holm
@thekholm80
Sep 12 2018 17:40
@BuntyBru :wave:
BuntyBru
@BuntyBru
Sep 12 2018 17:40
Hey Holm,
whats going on
Christopher McCormack
@cmccormack
Sep 12 2018 17:43
what's everyone working on today
besides finding the best possible GIF for any given comment
Aditya Dehal
@aditya2000
Sep 12 2018 17:44
Diving deeper into data structures @cmccormack
😅
Christopher McCormack
@cmccormack
Sep 12 2018 17:46
@aditya2000 what are you currently looking at?
Aditya Dehal
@aditya2000
Sep 12 2018 17:46
Binary search tree
psyperl
@psyperl
Sep 12 2018 17:47
ever heard of spaghetti linked list?
Kyle Holm
@thekholm80
Sep 12 2018 17:47
i'm trying to get my work done so i can play a new super buggy wow emu i found lol
Christopher McCormack
@cmccormack
Sep 12 2018 17:48
@thekholm80 not sure if that's a mount or an emulator
Kyle Holm
@thekholm80
Sep 12 2018 17:48
por que no los dos?
Christopher McCormack
@cmccormack
Sep 12 2018 17:48
@aditya2000 fun :) Are you coding them as well?
Aditya Dehal
@aditya2000
Sep 12 2018 17:48
I know about linked list ...but never heard about spaghetti one 😂
psyperl
@psyperl
Sep 12 2018 17:48
well if you look up google about "spaghetti linked list" you might end up in this chat lol
i've never heard of it before either, but i could imagine that i wouldn't want to work on it
Christopher McCormack
@cmccormack
Sep 12 2018 17:49
@thekholm80 I think emu or ostrich would be the ideal mount, both stupid looking yet aggressive
Kyle Holm
@thekholm80
Sep 12 2018 17:49
i have a hawkstrider, it's close
Christopher McCormack
@cmccormack
Sep 12 2018 17:50
@psyperl I like this idea, maybe like a linked list where each node is randomly linked to like 3 other nodes and when traversing it can randomly take any of the three paths
psyperl
@psyperl
Sep 12 2018 17:50
@cmccormack something like that possibly yeah
Christopher McCormack
@cmccormack
Sep 12 2018 17:50
provided it has a way to prevent loops, it could be faster than normal linked list traversal!
Aditya Dehal
@aditya2000
Sep 12 2018 17:51
Well there is something called spaghetti stack too
Christopher McCormack
@cmccormack
Sep 12 2018 17:53
Making me hungry
May Kittens Devour Your Soul
@diomed
Sep 12 2018 17:53
spaghetti code is delicious
Aditya Dehal
@aditya2000
Sep 12 2018 17:54
Lol 😂
Kyle Holm
@thekholm80
Sep 12 2018 17:55
my github is full of spaghetti code
i'm kind of a master
Aditya Dehal
@aditya2000
Sep 12 2018 17:55
Master Kyle 😂
Teach me how to write spaghetti code
😂😂
Kyle Holm
@thekholm80
Sep 12 2018 17:57
start with a good idea, then go off on a ton of unnecessary tangents. bonus points if you don't add comments
Christopher McCormack
@cmccormack
Sep 12 2018 17:58
need as few lines as possible to ensure your rank amongst the masters! Comments are just kale in your spaghetti
Aditya Dehal
@aditya2000
Sep 12 2018 17:59
Lol 😂
Kyle Holm
@thekholm80
Sep 12 2018 18:20
there is one caveat, though. you can use comments if they are painfully obvious
// adds x and y
function badFunctionName(x, y) {
  return x + y;
}
Kaylee
@kaymonlee
Sep 12 2018 18:21
How can I make radio buttons clickable through the text?
psyperl
@psyperl
Sep 12 2018 18:22
label for.. i think
Kaylee
@kaymonlee
Sep 12 2018 18:23
yep! just figured it out haha
psyperl
@psyperl
Sep 12 2018 18:24
awesome
@thekholm80 that's not as bad as this
const addXandY = (x, y) => 
  x !== 0 
    ? x > 0
      ? addXandY(x-1, y+1)
      : addXandY(x+1, y-1)
    : y
Kyle Holm
@thekholm80
Sep 12 2018 18:29
yikes
Christopher McCormack
@cmccormack
Sep 12 2018 18:30
@psyperl that looks fine to me
psyperl
@psyperl
Sep 12 2018 18:30
lol
Christopher McCormack
@cmccormack
Sep 12 2018 18:30
would it ever hit the inner else?
oh I guess if x begins less than 0
psyperl
@psyperl
Sep 12 2018 18:31
if x is minus yeah
Christopher McCormack
@cmccormack
Sep 12 2018 18:31
may be because I use a lot more ternaries lately but it looks nice and clean haha
psyperl
@psyperl
Sep 12 2018 18:32
gotta love ternaries :D
Christopher McCormack
@cmccormack
Sep 12 2018 18:35
or you can use
const addXandY = (x, y) =>  x !== 0 && x > 0 && addXandY(x-1, y+1) || addXandY(x+1, y-1) || y
psyperl
@psyperl
Sep 12 2018 18:37
lol
i am not very good with operator precedence
Christopher McCormack
@cmccormack
Sep 12 2018 18:38
I discovered that ternary ? and : symbols can be replaced with && and || basically
unless I'm mistaken :)
psyperl
@psyperl
Sep 12 2018 18:39
ahh
Kyle Holm
@thekholm80
Sep 12 2018 18:39
i thought i was mistaken once, but it was wrong
psyperl
@psyperl
Sep 12 2018 18:40
i have to play around with that to understand it
wut that's difficult logic haha
yeah it doesn't work @cmccormack
Christopher McCormack
@cmccormack
Sep 12 2018 18:44
haha may need parens
psyperl
@psyperl
Sep 12 2018 19:00
almost
const addXandY = (x, y) => 
  x !== 0 && ( x > 0 && addXandY(x-1, y+1) || addXandY(x+1, y-1) ) || y
failed on addXandY(-10,10)
Christopher McCormack
@cmccormack
Sep 12 2018 19:07
Maybe
const addXandY = (x, y) =>  x !== 0 && (x > 0 && addXandY(x-1, y+1) || addXandY(x+1, y-1)) || y
hmm that's the same isn't it
psyperl
@psyperl
Sep 12 2018 19:08
lol
Christopher McCormack
@cmccormack
Sep 12 2018 19:08
const addXandY = (x, y) =>  x !== 0 && (x > 0 && (addXandY(x-1, y+1) || addXandY(x+1, y-1))) || y
maybe?
Kyle Holm
@thekholm80
Sep 12 2018 19:09
spaghetti-ness intensifies
Christopher McCormack
@cmccormack
Sep 12 2018 19:09
I Could try testing myself, but what would that teach me?
Kyle Holm
@thekholm80
Sep 12 2018 19:10
i think you just passed the first management test
psyperl
@psyperl
Sep 12 2018 19:10
no no no i need to understand this
lol
May Kittens Devour Your Soul
@diomed
Sep 12 2018 19:10
All hail flying spaghetti monster!
and write code in it's honor
Kyle Holm
@thekholm80
Sep 12 2018 19:11
may he cradle us in his noodly appendages
May Kittens Devour Your Soul
@diomed
Sep 12 2018 19:11
may he cradle us in his noodly appendages
Amen
Kyle Holm
@thekholm80
Sep 12 2018 19:11

Amen

ramen

May Kittens Devour Your Soul
@diomed
Sep 12 2018 19:12
ah, you're right. forgot that r is silent only when we speak it
psyperl
@psyperl
Sep 12 2018 19:18
yeah the problem is that when the result y is 0 .. it treates it like it was false and it continues to loop
Eric Weiss
@eweiss17
Sep 12 2018 19:21
while (true) ?
psyperl
@psyperl
Sep 12 2018 19:24
got it
const addXandY = (x, y) => 
    x === 0 
    && y 
    || x > 0 
    && addXandY(x-1, y+1) 
    || x < 0 
    && addXandY(x+1, y-1) 
    || 0
but double checking the condition
now that's a real spaghetti lol
it looks weird
i learn something new today yay .. thanks @cmccormack !
psyperl
@psyperl
Sep 12 2018 19:35
i think the first one is easier to read
const addXandY = (x, y) => 
    x === 0 && y 
    || x > 0 && addXandY(x-1, y+1) 
    || x < 0 && addXandY(x+1, y-1) 
    || 0
Christopher McCormack
@cmccormack
Sep 12 2018 19:39
@psyperl nice!
Xarri Jorge
@xarrijorge
Sep 12 2018 19:49
That right there is some convoluted piece of code
Eric Weiss
@eweiss17
Sep 12 2018 19:52
If it works but looks awful just make a comment about what it does
Eric Weiss
@eweiss17
Sep 12 2018 19:59
doing some sql, anyone check my logic?
trying to put user id into admins table , which can be found within users table with users that are admins
UPDATE admins
SET admins.id = users.id
INNER JOIN users ON admins.username= users.username OR admins.username = users.alt_username
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 20:18
In the Challenge of D3:heat Map. My axis are not moving down as expect by using transform. Also my y-axis has height more than I provide in the range option. Here is the live github link : https://prashant-rajoriya.github.io/FCC-HEAT-MAP/
Eric Weiss
@eweiss17
Sep 12 2018 20:19
figured out the sql...
Christopher McCormack
@cmccormack
Sep 12 2018 20:34
@prashant-rajoriya your axis look fine to me, what you would expect with your code. You may want to derive the cell width and height from the width and height of your canvas proportional to the number of elements in your dataset so it's accurate
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 20:45
@cmccormack my axis looks fine but problem is that actual height of my month axis is over 650px and actually I have given it only 600px.
Also that axis are not moving down as I expect when I increase the value of margin-top
Christopher McCormack
@cmccormack
Sep 12 2018 20:46
@prashant-rajoriya I put it in this codepen to play with easier - you should play with it and see what results you get
@prashant-rajoriya are you trying to add margin in CSS?
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 20:48
@cmccormack yes
Christopher McCormack
@cmccormack
Sep 12 2018 20:48
I would recommend against that, you already have a transform you should consider using that instead
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 20:51
@cmccormack I am using all those margins is in transform only
Christopher McCormack
@cmccormack
Sep 12 2018 20:52
you stated you were trying to add in CSS, which is it?
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 20:58
@cmccormack sorry I thought you were asking in general
@cmccormack I am not using in CSS
Just using margins in transform attribute
Christopher McCormack
@cmccormack
Sep 12 2018 21:00
set the transform to 0 for both x and y for the y-axis and it sits at the very top left of the page, which I believe is accurate behavior
I see the height as 611 pixels, which makes sense as it needs to allow room for the top and bottom of the axis text
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 21:02
@cmccormack But then axis labels will be cutoff
Christopher McCormack
@cmccormack
Sep 12 2018 21:02
what specifically are you changing? I can't read your mind :)
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 21:08
@cmccormack What I want as my layout is:
  1. Title at top with height - 50px.
  2. then followed by the description which has height 30px.
    then after seperation of height 10px
  3. my Y-axis start with all rect elements for the heat map.
  4. My X-axis at bottom of last layer of rect elements.
    with seperation of height 10 px
  5. My legend conatiner will come. Which right now i have not added.
@cmccormack sorry if I am not clear about my problem with you
Christopher McCormack
@cmccormack
Sep 12 2018 21:10
@prashant-rajoriya did you read my suggestion about the cell width/height? It looks like you may be sizing your canvas based on your cells rather than the other way around, which if not done properly may cause issues
I could be wrong, I only skimmed your code
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 21:12
@cmccormack let width = 1518, height = 600, cellWidth = Math.ceil(width/Math.ceil(monthlyVariance.length/12)), cellHeight = height/12, margin = { top: 120, right: 10, bottom: 60, left: 100 };
Christopher McCormack
@cmccormack
Sep 12 2018 21:13
@prashant-rajoriya I see, different than what was on your github
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 21:13
@cmccormack I changed as you said as cell formation
Christopher McCormack
@cmccormack
Sep 12 2018 21:14
ok
side note I highly recommend against using comma separated variable declaration, makes it a pain to move stuff around and it really adds no value
@cmccormack quite didn't understand output correctly.
Christopher McCormack
@cmccormack
Sep 12 2018 21:24
@prashant-rajoriya I think you're getting weird gaps in between the months because of the scale you are using, looks like days shorter than 31 introduce gaps
if it helps, I used scaleBand
@coderkarma heya not sure what your question is
Christopher McCormack
@cmccormack
Sep 12 2018 21:31
@coderkarma sure I saw the link but what are you stuck on?
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 21:32
@cmccormack I am learning D3 and most of the Scales I know is scaleLinear, scaletime, scaleOrdinal.
So whats the best scale for showing months?
Cause I choose the scaleTime as by searching in the api refrence of D3. I saw range and domain methods of month in timeFormat reference.
Christopher McCormack
@cmccormack
Sep 12 2018 21:33
@prashant-rajoriya you only need the 12 months, scaleBand should work
I dunno I don't remember how I ended up choosing that :)
Prashant Rajoriya
@prashant-rajoriya
Sep 12 2018 21:37
@cmccormack Thank you for your help. It works now as I wanted.
Christopher McCormack
@cmccormack
Sep 12 2018 21:37
@prashant-rajoriya great!
Carlos Alfaro
@Mixedbysalas_twitter
Sep 12 2018 22:06
I'm trying to change state in react app, how can I do the example below without mutating state
this.setState(prevState => {
      return {
        ...(this.state.expenses[id - 1].percentage = getUserPercentage(
          prevState.income,
          value
        ))
      };
    });
Christopher McCormack
@cmccormack
Sep 12 2018 22:10
@Mixedbysalas_twitter don't assign values in your return
deconstruct expenses into new variable first then assign the new values before updating state
Carlos Alfaro
@Mixedbysalas_twitter
Sep 12 2018 22:13
@cmccormack thank you so much!
Christopher McCormack
@cmccormack
Sep 12 2018 22:14
@Mixedbysalas_twitter np
Karma Drukpa
@coderkarma
Sep 12 2018 22:14
@cmccormack I didn't understand earlier question but i will try it out. In the mean time could you help me out on this .
let me share you my code
I am trying to filter out the non alabetical ele .
Kyle Holm
@thekholm80
Sep 12 2018 22:18
have you tried String.replace()?
i think it's easier than filter
Karma Drukpa
@coderkarma
Sep 12 2018 22:18
function reverseLetter(str) {
   // convert the str in to arr
   // filter out non alphebet 
  let newArr = str.split('');
   console.log(newArr);
    return  newArr.filter(ele => typeof +ele === "String").reverse().join('');
 }
 reverseLetter("ultr53o?n");
 //str = "ultr53o?n", the output should be "nortlu".
my logic filtering out.ele which is non albatical is not quite right
I haven't tried with string .replace
let me try it out
Kyle Holm
@thekholm80
Sep 12 2018 22:23
for example
str = 'h3l10'
"h3l10"
str.replace(/[^A-Za-z]/g, '')
"hl"
Karma Drukpa
@coderkarma
Sep 12 2018 22:34
@thekholm80 what are you replacing there.
Kyle Holm
@thekholm80
Sep 12 2018 22:54
@coderkarma str.replace(/[^A-Za-z]/g, '') says "remove everything that's not a letter ^ here means not, then A-Za-z is letters, and replace it with '' an empty string"
could be a bit cleaner with /[^a-z]/gi
Karma Drukpa
@coderkarma
Sep 12 2018 23:21
let newStr = str.replace(/[^a-z]/g, '');
   return ouput = newStr.split('').reverse().join('');
need to learn more about regex