These are chat archives for FreeCodeCamp/Help

18th
Feb 2019
kinopotato
@kinopotato
Feb 18 08:57
happy coding!
kinopotato
@kinopotato
Feb 18 09:06
Hello, is there a better place to edit/try code online for html/css/js than codepen?
codepen is fine but it has trouble when I use console and I can't ts properly :|
Manish Giri
@Manish-Giri
Feb 18 09:09
there are many options - jsbin, jsfiddle, repl.it, etc
kinopotato
@kinopotato
Feb 18 09:09
repl.it can do html with js??
Manish Giri
@Manish-Giri
Feb 18 09:09
not sure, maybe?
kinopotato
@kinopotato
Feb 18 09:10
I'll try that then and jsfiddle, I've always used repl.it just for js. haha
thanks man :)
Manish Giri
@Manish-Giri
Feb 18 09:10
:thumbsup:
god of lotus
@1371289694
Feb 18 09:27
eh
myfriends
abraham anak agung
@padunk
Feb 18 09:29
codesandbox.io is also great. @kinopotato
god of lotus
@1371289694
Feb 18 09:29
I want to know how to add a comment
abraham anak agung
@padunk
Feb 18 09:29
@1371289694 in where?
god of lotus
@1371289694
Feb 18 09:29
China
abraham anak agung
@padunk
Feb 18 09:30
no, i mean you want to add a comment where? HTML, JS, CSS ?
god of lotus
@1371289694
Feb 18 09:30
HtML
<!--
abraham anak agung
@padunk
Feb 18 09:31
<!-- your comment here -->
god of lotus
@1371289694
Feb 18 09:31
emmm
I 'll have a try
emmm
where should I put my comment
abraham anak agung
@padunk
Feb 18 09:34
anywhere you think you need to.
<-- section about my products -->
<section>
  <h2>My Products</h2>
</section>
god of lotus
@1371289694
Feb 18 09:34
Such as I want to add comments to the main heading
abraham anak agung
@padunk
Feb 18 09:35
@1371289694
<!-- comment about heading -->
<h1>Main Heading</h1>
god of lotus
@1371289694
Feb 18 09:36
oh I see
Must there be a blank line between the main heading and the subheading?
abraham anak agung
@padunk
Feb 18 09:38
no, why?
god of lotus
@1371289694
Feb 18 09:39
eh,I see there is an empty line
abraham anak agung
@padunk
Feb 18 09:41
i'm not following, can you share you code here and what is the problem?
god of lotus
@1371289694
Feb 18 09:42

<h1>Hello World</h1>

<h2>我家的猫咪</h2>

<p>Hello Paragraph</p>
-->

abraham anak agung
@padunk
Feb 18 09:45

@1371289694 and what you going to do? if you want to make all visible:

<h1>Hello World</h1>

<h2>我家的猫咪</h2>

<p>Hello Paragraph</p>

if you want to make hide all, you can comment it all like so

<!--
<h1>Hello World</h1>

<h2>我家的猫咪</h2>

<p>Hello Paragraph</p>
-->
god of lotus
@1371289694
Feb 18 09:46
He let me comment out the main headings and paragraphs, but leave the subheadings
abraham anak agung
@padunk
Feb 18 09:48
@1371289694 so you can just comment the heading and the paragraphs
<!-- <h1>Hello World</h1> -->

<h2>我家的猫咪</h2>

<!-- <p>Hello Paragraph</p> -->
god of lotus
@1371289694
Feb 18 09:50
Oh,I see. Thank you very much
god of lotus
@1371289694
Feb 18 10:27
You have to have two p elements.
Make sure all paragraphs contain closing tags.
Your p element should contain text for raising animals.
Do not add a class attribute to the second paragraph or remove the class attribute from the first paragraph.
Set the font-size of the paragraph to 16px.

<style>
.red-text {
color: red;
}
</style>

<style>
p1{
font-size:16px;
}
p2{
font-size:16px
}
</style>

<h2 class="red-text">我家的猫咪</h2>

<p1 class="red-text">在大家心目中,猫是慵懒的可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。</p1>

<p2>养动物有的时候,就是介于爱与恨之间,当你钦羡别人萌宠这么可爱的时候,你一定没有想过,狗狗和猫猫会到处拉屎,甚至会屯老鼠,啃鞋子,用爪子爬门,你不理它,它就挠你,你要对它发脾气,它会比你更来劲。所以,狗猫慎入,没有一定的准备,切勿随便去侍养动物。它们一旦认定你了,你就是它们的主人,如果你抛弃它们,它们必定心中重创。</p2>

I tried to do it, but it seemed wrong
Would anyone like to give me a hand
?
Well, no, I've got it. Thank you
kinopotato
@kinopotato
Feb 18 11:52
hello, was hoping to get some help with this weird thing (lots of weird things for people who have no idea what they are doing, haha)
<select class='fullWidth blue' id='dayPay'>
              <option value='8' selected=''>Full Day</option>
              <option value='4'>Half Day</option>
              <option value='1'>1</option>
              <option value='2'>2</option>
              <option value='3'>3</option>
              <option value='5'>5</option>
              <option value='6'>6</option>
              <option value='7'>7</option>
              <option value='0'>No Work</option>
              <option value='absent'>Absent</option>
            </select>
you can see the class .blue, what it does it it makes the background color teal (seemed entertaining at the time)
so this element was reproduced using JS, as you can see in this console.log, the class was applied, yet in the DOM, it doesn't render. any ideas why??
god of lotus
@1371289694
Feb 18 12:50
emmm
anyone can tell me what is "anchor text"?
kinopotato
@kinopotato
Feb 18 13:26
@1371289694
<a href="#">This is probably what you mean, maybe? The text part of an anchor tag</a>
kinopotato
@kinopotato
Feb 18 14:29
good day,
if (totalDate <= totalDays && j == 0) {
            let newCell = document.createElement("td");
            newCell.innerHTML = calendarCell;
            newRow.appendChild(newCell);

            let newDailyDiv = document.createElement("div");
            newDailyDiv.setAttribute("class", "fullWidth center");

            let newDailyText = document.createTextNode(totalDate);
            newDailyDiv.appendChild(newDailyText);
            newCell.appendChild(newDailyDiv);
            //document.querySelector("#dayPay")[totalDate - 1].children[1].selected = "selected";
            console.log(document.querySelector("#dayPay")[totalDate].children[1]);
            totalDate++;
          }
here you can see a number of the variable totalDate
everything there works EXCEPT when I put [totalDate] to the console.log. even if I use querySelector or querySelectorAll.
Why isn't it working on that specific place when it works as a variable with a numerical value everywhere else, you can even see the totalDate++ which works just fine
kinopotato
@kinopotato
Feb 18 15:12
I managed to get it working . . . but I have no idea how 8D
Ghost
@ghost~5873bc92d73408ce4f424efa
Feb 18 18:14
I have created a basic tool for abacus.
I would like you guys to review it and share your feedback.
Also the UI is shitty so any comments on how to improve UI is very much welcomed.
Here is the link to the repository: https://github.com/RAJKUMAR18/Abacus-Tool
Any input is welcomed.
P.S. I am very new to UI/UX and front end part so please guide me.
Thank you.
mikilao
@mikilao
Feb 18 19:27
ok im trying to understand a solution to Functional Programming: Use the map Method to Extract Data from an Array. Their solution is not very well explained
rating = watchList.map( (item) => ({"title":item["Title"], "rating":item["imdbRating"]}) );
mikilao
@mikilao
Feb 18 19:33
thats all it says but no explanation
Jason Luboff
@JLuboff
Feb 18 19:38
Which part don't you understand?
mikilao
@mikilao
Feb 18 19:54
where the hell does 'item' come from it was not mentioned at all it is just part of the solution. to understand how to come up with this solution i need to understand how they jump from a for loop to this
and as i was typing that out i realized they didnt declare rating as a variable and thats why it wasnt working too
Christopher McCormack
@cmccormack
Feb 18 20:06
@mikilao item is the argument to a callback function. The argument to map is a callback function that runs for each item in the array - this type of function is called an arrow function, and the arrow function you pasted above is only using one of the arguments (item) that map will call on each item. An object is returned for each map iteration.
item could be called any other name - it is just a variable storing a reference to the current watchList array entry
mikilao
@mikilao
Feb 18 20:12
yea started re-reading SO it think i got it now t @cmccormack
*ty
Christopher McCormack
@cmccormack
Feb 18 20:33
np
Oburusule Dunstan
@alsong
Feb 18 20:55

So i have managed to try to upload a file to azure blob storage.
I used HTTP/Request2 and Net/URL2 projects.
So when i try to test it out. i get this error

Fatal error: Uncaught <table style="border: 1px" cellspacing="0"> <tr><td colspan="3" style="background: #ff9999"> <b>HTTP_Request2_ConnectionException</b>: Unable to connect to tls://thefaith.blob.core.windows.net:443. Error: stream_socket_client(): unable to connect to tls://thefaith.blob.core.windows.net:443 (Unknown error) stream_socket_client(): Failed to enable crypto stream_socket_client(): SSL: Handshake timed out in <b>C:\xampp4\htdocs\test\HTTP\Request2\Adapter\Socket.php</b> on line <b>331</b></td></tr> <tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr> <tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td><td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr> <tr><td style="text-align: center;">0</td><td>HTTP_Request2_SocketWrapper->__construct('tls://thefaith.b…', 10, Array)</ in C:\xampp4\htdocs\test\HTTP\Request2\SocketWrapper.php on line 134