These are chat archives for FreeCodeCamp/Help

11th
Nov 2017
Darren
@DarrenfJ
Nov 11 2017 00:55
evening fCC
@MWBauer ah man good luck. I avoid regex ;)
Henry
@GitHub-Henry
Nov 11 2017 01:16
image.png
@MWBauer
shows an error when i cut and paste your
regex
Henry
@GitHub-Henry
Nov 11 2017 01:35
probably should use regexr to get the results you want then use that expression in your code
@MWBauer
var lcStr = str.toLowerCase().replace(/[^A-Z0-9]/i,"");
the code suggested by @randelldawson above might help
Jill Lee
@jill-lee
Nov 11 2017 02:14
@korzo Thanks
CamperBot
@camperbot
Nov 11 2017 02:14
:cookie: 761 | @korzo |http://www.freecodecamp.com/korzo
phoenix-burn sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
Jill Lee
@jill-lee
Nov 11 2017 02:17
Question, is it possible to build an e-commerce website that works like ebay with a functionality of wix where in the supplier can just add photos and details on the website without our help?
And also automatically transfer 10% of the payment/cut to the admin and the rest to the supplier when someone placed an order?
Long Nguyen
@longnt80
Nov 11 2017 03:08
@phoenix-burn it is possible, of course
metmouse
@metmouse
Nov 11 2017 04:57
How do you make a navigation bar go over the background picture? There is always a space for me.
Fabien SHAN
@X140hu4
Nov 11 2017 04:59
Do you have a codepen?
metmouse
@metmouse
Nov 11 2017 05:01
I have a codepen
Ken Haduch
@khaduch
Nov 11 2017 05:13
@metmouse - not sure if you mean that you have the navbar overlapping the picture and you want to not have that? If you add some padding to the top of the body, that will move the background below the navbar as much padding as you specify.
metmouse
@metmouse
Nov 11 2017 05:17
Oh okay. Thanks!
lbgcode
@lbgcode
Nov 11 2017 06:43
Nest an Anchor Element within a Paragraph
Darren
@DarrenfJ
Nov 11 2017 07:27
evening fCC
@phoenix-burn it sounds like it could be
@phoenix-burn specially if it's done now.. many of P1xt's projects are cloning other sites. Actually be a good challenge to do tobh, and probably a good intro to websites for many small businesses...
Darren
@DarrenfJ
Nov 11 2017 07:38
@phoenix-burn what I mean by 'specially if it's done now.' is that anything that exists in code can be coned, and with something like react or other frameworks that are module driven, you can figure out how to integrate the components and make it all work...
Darren
@DarrenfJ
Nov 11 2017 07:43
@khaduch thanks for helping @metmouse
thanks @khaduch
CamperBot
@camperbot
Nov 11 2017 07:43
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3494 | @khaduch |http://www.freecodecamp.com/khaduch
Darren
@DarrenfJ
Nov 11 2017 07:44
I'm off to bed, code on roomies
Bhoomi Khanderia
@bhoomikhanderia
Nov 11 2017 07:54
Hi guys!
How can I connect to an api using javascript?
Jake
@JakeDVirus
Nov 11 2017 08:35

one simple confusion.
it is advisable to go for mobile first approach. i agree with this. But there is one aspect which is confusing me and that is the background image context.
if i do something like this shown in the code below and the user is using the large screen device, would not the images for small screen and medium screen also get called/requested (wastage of data which impact the loading time) as because those rules will be parsed first (and in those rules the call/request to those images will be made) though the background-image for large screen will override the precedings in the final execution of code.

.banner {
  background-image: url("rough.jpg");
}



@media only screen and (min-width: 320px) {
  background-image: url("rough-sm.jpg");
}


@media only screen and (min-width: 700px) {
  background-image: url("rough-md.jpg");

}

@media only screen and (min-width: 1300px) {
  background-image: url("rough-lg.jpg");

}

pardon me if i am confusing anything silly in the mist of so much mess created by this specific context inside my head

this is from 2012 tho
@Bhoomi-Github you mean get data from api? Using fetch/ jQuery getJSON etc.
Jake
@JakeDVirus
Nov 11 2017 10:12
@GarrusNapp Oh thanks a lot man. This made sense and cleared out most of the cloud :D
CamperBot
@camperbot
Nov 11 2017 10:12
neeldvirus sends brownie points to @garrusnapp :sparkles: :thumbsup: :sparkles:
:cookie: 854 | @garrusnapp |http://www.freecodecamp.com/garrusnapp
Jake
@JakeDVirus
Nov 11 2017 11:31
is the chrome's developer tool's network panel good for checking out the request made by the page? i want to cross check that whether any redundant file got requested implicitly. i hope i am making sense
Bhoomi Khanderia
@bhoomikhanderia
Nov 11 2017 11:41
@GarrusNapp I am getting cors error
Aita Kane
@aita-kane
Nov 11 2017 12:49
Hello guys I'm building my first website and I'm facing my first problem . I'm using display flex for all my containers . So my container with the class "right" i want it to be full so i won't see the background of section1 with the color brown . Well I try everything I started by using flex-basis and width + height but for both whenever I apply for one of them both of my containers grow at the same time so please help me fix this issue . My pen : https://codepen.io/akane96/pen/JOWVJB So at the same time I can have a review of everything I've done so far
lion18
@lion18
Nov 11 2017 13:59
Can anyone take a minute out and tell me what mistake I have made in my code?
I am not getting the data from api
Sorin Ruse
@sorinr
Nov 11 2017 14:26
@lion18 your lat and lon are not available yet in here: var api = "https://fcc-weather-api.glitch.me/api/current?lat="+lat+"&lon="+lon ;
lion18
@lion18
Nov 11 2017 14:30
How can I fix it?
@sorinr
Sorin Ruse
@sorinr
Nov 11 2017 14:32
@lion18 you may set the var api = https://fcc-weather-api.glitch.me/api/current? and in the getWeather function complete it with the lat and lon you are passing to before calling the getJSON function
lion18
@lion18
Nov 11 2017 14:35
Thanks @sorinr
CamperBot
@camperbot
Nov 11 2017 14:35
lion18 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
api offline
Sorin Ruse
@sorinr
Nov 11 2017 14:40
@lion18 welcome
Sorin Ruse
@sorinr
Nov 11 2017 14:57
@lion18 it was ok your first version with calling the getWeather function. you had only to truncate the global api var to var api = https://fcc-weather-api.glitch.me/api/current? and add right after function getWeather(lat,lon){ api += "lat="+lat+"&lon="+lon ; and you were done
Darren
@DarrenfJ
Nov 11 2017 16:29
morning fCC.. popping in to say hi
Sorin Ruse
@sorinr
Nov 11 2017 16:32
morning Darren
Darren
@DarrenfJ
Nov 11 2017 16:40
how goes thee code brutha!
about to grab a :coffee: and do the reply all podcast...
Liam Docherty
@ldocherty1
Nov 11 2017 16:44

What is wrong with this line of code, I keep getting an error in my JAVA program.

System.out.println("Please insert the relevant grade for each of the units" + (PASS)+"," +(MER)+"," +(DIST)+".");

Darren
@DarrenfJ
Nov 11 2017 16:45
@ldocherty1 not a lot of java coders in this room tbh.. might find more people in the main chat room
Liam Docherty
@ldocherty1
Nov 11 2017 16:45
@DarrenfJ Cheers mate
Darren
@DarrenfJ
Nov 11 2017 16:57
I see yah getting help over in front end help :D good luck
Ene Catalin
@EneCatalin
Nov 11 2017 17:52
hey you're still here
Jake
@JakeDVirus
Nov 11 2017 18:08
which media condition will win in the given code below. there arises two possiblities.
Suppose the screen is greater than 800px and also has device-pixel-ratio equals to 2, then both the media queries resolves to true. which image will be retrieved? and if there any change that both will get retrieved at the runtime?
.img {
  background-image: url(small.jpg);
}
@media
  (-webkit-min-device-pixel-ratio: 2), 
  (min-resolution: 192dpi) {
  .img {
    background-image: url(medium.jpg);
  }
}
@media
  (min-width: 800px) {
  .img {
    background-image: url(large.jpg);
  }
}
Darren
@DarrenfJ
Nov 11 2017 18:26
@EneCatalin i pop in now and then :D
@NeelDVirus well, going by the rules of cascading should be the last one.. but I'm not sure if media queries have any kind of hierarchy like how an ID trumps a class
for me I'd probably put it in a repl.it or codePen and play around with it to experiment with what it does..
Jake
@JakeDVirus
Nov 11 2017 18:31
@DarrenfJ Thanks for suggestion man. i have just created my own mess
CamperBot
@camperbot
Nov 11 2017 18:31
neeldvirus sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2267 | @darrenfj |http://www.freecodecamp.com/darrenfj
Liam Docherty
@ldocherty1
Nov 11 2017 18:46
This message was deleted
How can I add a space between these three characters the variables?
System.out.println("Please insert the relevant grade for each of the units"+(PASS)+ (MER)+ (DIST)+".");
Darren
@DarrenfJ
Nov 11 2017 18:50

@NeelDVirus

i have just created my own mess

that's the fun and games of coding :D
Albert Cardona II
@daddycardona
Nov 11 2017 18:57
switch from atom to vscode
@thekholm80 I am trying to use atom for coding right now for the first time but this is one of the reasons I switched to vscode and :wave: @DarrenfJ
@ldocherty1 can't you just do what you did but put do (pass)+" "+ etc..
Jake
@JakeDVirus
Nov 11 2017 19:01

@DarrenfJ

that's the fun and games of coding :D

often associated with hangovers without alcohol :D

Albert Cardona II
@daddycardona
Nov 11 2017 19:03
LOL @NeelDVirus
happy veterans for all the veterans here :)
Jake
@JakeDVirus
Nov 11 2017 19:04
:D
Brianna
@brisourceful
Nov 11 2017 19:07
Is anyone here familiar with Ruby on Rails?
Ken Haduch
@khaduch
Nov 11 2017 19:56
@daddycardona - hey there- happy Veterans Day to you!
@brisourceful - there might be someone on here but since freecodecamp doesn’t do any Ruby on Rails there won’t be too many people around.
Popokeface
@Popokeface
Nov 11 2017 19:59
hello
i have a problem with php
Ken Haduch
@khaduch
Nov 11 2017 19:59
You could try stackoverflow.com, @brisourceful
Popokeface
@Popokeface
Nov 11 2017 19:59
im trying to get login from database but i got a blank site in return
here is the code

<?php

require_once "connect.php";

$polaczenie/*stands for connection*/ = @new mysqli($host, $db_user, $db_password, $db_name);

if($polaczenie-> connect_errno!=0)
{
    echo "Error: ".$polaczenie-> connect_errno;

}
else
{
    $login= $_POST['login'];
    $haslo/*stands for password*/= $_POST['haslo'];


$sql="SELECT*FROM users WHERE login='$login' AND password='$haslo'";
if ($rezultat/*stands for result*/=@$polaczenie->query($sql))
{

    $ilu/*stands for how much*/_userow= $rezultat-> num_rows;
    if($ilu_userow>0)
    {
        $wiersz/*stands for line*/ = $rezultat->fetch_assoc();
        $user= $wiersz['login'];


        $rezultat->close();

            echo $user;

    }
else{

    }

}

$polaczenie->close();
}

?>

anyone?
Ken Haduch
@khaduch
Nov 11 2017 20:04
@Popokeface - you might have some more people in the https://gitter.im/FreeCodeCamp/HelpBackEnd room, although freeCodeCamp doesn't focus on PHP...
Stephane
@overmelo
Nov 11 2017 20:04
hello all, anyone here has implemented p2p web services with gnutella?
Ken Haduch
@khaduch
Nov 11 2017 20:07
@Popokeface - offhand, though, I would say your SQL syntax might be a little messed up - does SELECT*FROM users work? It looks like it should be SELECT * FROM users - some spaces in there? Try putting some echo output in the else clause for your if ($rezultat/*stands for result*/=@$polaczenie->query($sql)) condition. I would try to fix the SQL syntax first, and also put some output in the else clause.
@DarrenfJ - thanks for coming back to check on the room - not too many questions here but it's good to have a check now and then!
CamperBot
@camperbot
Nov 11 2017 20:09
khaduch sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2268 | @darrenfj |http://www.freecodecamp.com/darrenfj
Henry
@GitHub-Henry
Nov 11 2017 20:17
to @daddycardona and other vets, your service is appreciated, thanks :star2: :sparkles:
CamperBot
@camperbot
Nov 11 2017 20:17
:cookie: 485 | @daddycardona |http://www.freecodecamp.com/daddycardona
github-henry sends brownie points to @daddycardona :sparkles: :thumbsup: :sparkles:
heroiczero
@heroiczero
Nov 11 2017 23:32
@GitHub-Henry thx for the help :point_up: November 10, 2017 8:35 PM
CamperBot
@camperbot
Nov 11 2017 23:32
heroiczero sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 482 | @github-henry |http://www.freecodecamp.com/github-henry