These are chat archives for FreeCodeCamp/HelpFrontEnd

26th
Oct 2017
Gos-Jr
@Gos-Jr
Oct 26 2017 00:00
Using the float, min-width and margin to accomplish the current visual
korzo
@korzo
Oct 26 2017 00:01
@Gos-Jr Not wrong, but structure is very fragile as you rely on width + margin
Add box-sizing: border-box to li and it will break
Gos-Jr
@Gos-Jr
Oct 26 2017 00:03
I figured that would make it more responsive
korzo
@korzo
Oct 26 2017 00:04
@Gos-Jr also adding clearfix to li should solve your problems
Gos-Jr
@Gos-Jr
Oct 26 2017 00:05
@korzo okay, I'll give that a shot, thanks very much for your help, much appreciated.
CamperBot
@camperbot
Oct 26 2017 00:05
gos-jr sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 667 | @korzo |http://www.freecodecamp.com/korzo
korzo
@korzo
Oct 26 2017 00:09
@Gos-Jr add at the end of css
li:after {
  content: "";
  display: table;
  clear: both;
}

li {
  clear: both;
}
It will solve your problem with floats
It will no longer rely on width
@Gos-Jr
restrepomich
@restrepomich
Oct 26 2017 00:54
Hey guys, I need some help with my code
I have to boards that need to switch out automatically at 10:30 am
The breakfast one is up until 10:30, and at that time the lunch one kicks in
this is what i have so far
time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 11

if(hours >= starthour) {
    location.replace('1-lunch.html');
}
time = new Date();
hours = time.getHours();
minutes = time.getMinutes();
starthour = 11

if(hours < starthour) {
    location.replace('breakfast-1.html');
}
I can't seem to get the minutes to work
Long Nguyen
@longnt80
Oct 26 2017 01:16
@restrepomich it's working in my console
Ken Haduch
@khaduch
Oct 26 2017 01:26
@restrepomich - what are you trying to do with minutes? Just extract and perhaps display them?
@restrepomich - oh, you might want to do something like if ( (hours >= starthour - 1 && minutes >= 30) || hours >= starthour ) ? Could that be where you're running into trouble? You have to check for two different cases, at least that's my quick thought on this...
restrepomich
@restrepomich
Oct 26 2017 01:32
@khaduch thanks so much for the response! I ended up figuring it out. This was the correct code: if(hours && minutes < starthour && startminute) {
location.replace('breakfast-2.html');
}
CamperBot
@camperbot
Oct 26 2017 01:32
restrepomich sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3409 | @khaduch |http://www.freecodecamp.com/khaduch
restrepomich
@restrepomich
Oct 26 2017 01:32
thanks for the input!
Ken Haduch
@khaduch
Oct 26 2017 01:41

@restrepomich - maybe I'm not thinking straight, but your code doesn't make sense to me? hours will evaluate to true if the time is later than 1 a.m. minutes < starthour will evaluate to true when the minutes are 0, 1, 2, etc. until 11, but then it will be false? startminute is just going to be a value, I guess you might be using 30 for the value, so it will always be true. So you are selecting your page based on the hours being 1 or greater than 1, and the minutes value being less than the starthour value.

You might possibly be wanting to check if hours < starthour and minutes < startminute - you would have to write that as if ( hours < starthour && minutes < startminute) - but I'm not sure that that is correct, either...

time calculations are often confusing and tricky...
Kaz Baig
@kbaig
Oct 26 2017 01:45
Has anyone here used sass with create-react-app?
Long Nguyen
@longnt80
Oct 26 2017 01:45
@kbaig yes
Kaz Baig
@kbaig
Oct 26 2017 01:48
@longnt80 I followed the instructions found at https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-a-css-preprocessor-sass-less-etc. I have an index.sass that imports other files. When I update the imported files and save, I see a message in the terminal saying https://gyazo.com/4d24e243421376f4151c5171448719b8 but the server does not recompile/reload. When I then save the index.css file, the server reloads
How can I make it so that saving the importing sass files reloads the server?
Long Nguyen
@longnt80
Oct 26 2017 01:52

When I then save the index.css

you mean the index.sass?

Kaz Baig
@kbaig
Oct 26 2017 01:52
yes
sorry
Would this maybe have to do with the fact that I've only imported index.css into my index.js?
Long Nguyen
@longnt80
Oct 26 2017 01:53
I think that set up only generate the sass file being saved
so in order to generate the new index.css, the only way is to hit Save on the index.sass
maybe there's a npm script to trigger compiling the index.sass whenever a sass is compiled?
I have no clue about npm script though
Ken Haduch
@khaduch
Oct 26 2017 01:57
@restrepomich - it might be more logical to deal with your time and page selection based on a number of elapsed minutes in the day? hours * 60 + minutes would be your total minutes elapsed, and then you calculate where you are in the day based on that?
Kaz Baig
@kbaig
Oct 26 2017 01:58
@longnt80 hmm you're right. index.css doesn't change when I save an imported sass file
@longnt80 ill look into it. thanks
CamperBot
@camperbot
Oct 26 2017 01:58
kbaig sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 613 | @longnt80 |http://www.freecodecamp.com/longnt80
Long Nguyen
@longnt80
Oct 26 2017 01:59
@kbaig np, let me know if you have a solution
Kaz Baig
@kbaig
Oct 26 2017 03:11
@longnt80 still haven't found a solution :/ dang
Michael Stewart
@mpstewart
Oct 26 2017 03:31
using jquery, I’m trying to have it so when I click a span, a form slides into view. For some reason, when I click a link that takes me to a page in a different controller, and then navigate back to the index, the script doesn’t seem to fire. What gives?
Long Nguyen
@longnt80
Oct 26 2017 03:45
@kbaig I just ran a test and the import.sass actually got updated when I tried to save an imported sass

here's the structure:
File: import.sass:

@import "components/styles/test.sass"

File test.sass:

/* Write anything */
the import.css got updated whenever I made change to test.sass
Long Nguyen
@longnt80
Oct 26 2017 03:51
@kbaig not sure what's wrong with your setup
I didn't do anything than the default setup from the guide
@mpstewart do you have any a tag inside the span?
Michael Stewart
@mpstewart
Oct 26 2017 03:55
@longnt80 I do not. Also, I am using rails.
Long Nguyen
@longnt80
Oct 26 2017 03:57
@mpstewart not familiar with Rails, but I guess there must be some action invoked before the script is fired

when I click a link

what does this mean?

is that an a tag?
Michael Stewart
@mpstewart
Oct 26 2017 04:07
I actually thought this was a different channel. Never mind.
Kaz Baig
@kbaig
Oct 26 2017 04:14
@longnt80 wait I just figured out what the problem specifically is

@longnt80 this works:
root.sass

@import include

_include.sass

/* stuff */
but this does not:

root.sass

selector
    attr: val

    @import include

_include.sass

/* stuff */
I wanted to indent whatever I was importing, and that was working when I saved root.sass, but it wouldn't refresh
I'm so annoyed
Long Nguyen
@longnt80
Oct 26 2017 04:18
I see
Kaz Baig
@kbaig
Oct 26 2017 04:18
I've been working on fixing this for 3+ hrs
@longnt80 hello annoyed atm. Thanks for making the effort tho
CamperBot
@camperbot
Oct 26 2017 04:23
kbaig sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 615 | @longnt80 |http://www.freecodecamp.com/longnt80
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 07:34
gm
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 07:48
@alpo when you get around was trying to follow what you said yesterday
passport.use(new FacebookStrategy({
    clientID: process.env.FB_ID,
    clientSecret:process.env.FB_SECRET,
    callbackURL:"http://localhost:3000/auth/facebook/callback",
    profileFields : ["id","displayName","photos"]
},(accessToken,refreshToken,profile,done)=>{
     User.findOne({oauthID:profile.id}).then((user)=>{
        if(user){
            return(null,user);
        }else{
            return new User({
                oauthID:profile.id,
                name:profile.displayName,
                photo:profile.photos[0].value,
                createdAt:moment().format("Do MMMM YYYY")
            }).save()
            .then((data)=> {return (null,user)})
            .catch(e=>console.log(e));
        }
    }).catch((e)=>{
        console.log(e);
    });
    return done(null,profile); 
}
));
was there any way to make this even more correct based on using promises
alpox
@alpox
Oct 26 2017 07:50
@tiagocorreiaalmeida put the done into a .then. It has to be called when you did all your work. Also, you dont have to return two values (null, user) - that doesnt work anyway. The null gets ignored like this and only user is returned. Else it looks fine on forst sight :)
In case of that you enter an error (catch) you have to send an error through done with the error as only and first argument to done
So you can do done(e);
Or just .catch(done);
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 07:55
im not sure how this works in the other side but doesnt it expect an error as first argument?that's why we are sending a null when everythign goes right?
alpox
@alpox
Oct 26 2017 07:57
@tiagocorreiaalmeida yes, in case of done that is true because its a node-style callback ans not a promise.
In case of promises you dont do that. There you would reject the promise
Like: return Promise.reject(error) in case of an error
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 07:59
styill looking into the code and thinking what im gonna return to chain a then call for the done :D
passport.use(new FacebookStrategy({
    clientID: process.env.FB_ID,
    clientSecret:process.env.FB_SECRET,
    callbackURL:"http://localhost:3000/auth/facebook/callback",
    profileFields : ["id","displayName","photos"]
},(accessToken,refreshToken,profile,done)=>{
     User.findOne({oauthID:profile.id}).then((user)=>{
        if(user) return (null,user);
            return new User({
                oauthID:profile.id,
                name:profile.displayName,
                photo:profile.photos[0].value,
                createdAt:moment().format("Do MMMM YYYY")
            }).save()
            .then((data)=>(null,user))
            .catch((e)=>done(e));
    }).catch((e)=>done(e));
    return done(null,profile); 
}
));
so far this
alpox
@alpox
Oct 26 2017 08:00
return (null,user); this is exactly the same as return user;. Dont bother with the null :)
@tiagocorreiaalmeida you can just add a .then between the User.findOne and the .catch
Also, you dont need the inner catch phrase
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 08:02
still gotta learn a bit more I guess could yuou show me the final of this plus recommend something to give a read today to get a bit more used to this?:D
alpox
@alpox
Oct 26 2017 08:03
Okay, ler me grasp my laptop :D im not doing that on my phone
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 08:04
ahahaha that requires quite some skill xd
alpox
@alpox
Oct 26 2017 08:06
@tiagocorreiaalmeida I didn't check the logic too much - did you really want to return the profile?
I'd say it should look about like this:
User.findOne({ oauthID: profile.id })
    .then(user => {
        if (user) return user;
        return new User({
            oauthID: profile.id,
            name: profile.displayName,
            photo: profile.photos[0].value,
            createdAt: moment().format("Do MMMM YYYY"),
        }).save();
    })
    .then(user => done(null, user))
    .catch(done);
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 08:09
in this cause return the user yeah was about to do that still big thanks
alpox
@alpox
Oct 26 2017 08:10
I'm not sure about resources i could give you :D i never keep resources around
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 08:12
I woke up thinking about promises we can say things are getting serious :D
alpox
@alpox
Oct 26 2017 08:13
@tiagocorreiaalmeida Hahaha i know that feeling :D that gives quite abstract dreams too
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 08:13
cause I knew there was alot of code I could change to make it more readable and simpler and give real use to promises just save 20 lines of code with this solution since I have two passport strategys
yup ahaha
falling asleep thinking about express
its problematic
alpox
@alpox
Oct 26 2017 08:13
Kinda :D try to think about other stuff, some nature etc. when going to sleep :D
linkin-park
@linkin-park
Oct 26 2017 09:21
you are also passing children to App but never using them @ashwins93
why promise are really great thing @alpox
alpox
@alpox
Oct 26 2017 09:25
@linkin-park Because they help you escape the callback hell :-)
linkin-park
@linkin-park
Oct 26 2017 09:25
they handle it internally
it is abstract
am i wrong? @alpox
alpox
@alpox
Oct 26 2017 09:27
@linkin-park depends what you want to call abstract. And what exactly do you mean with they handle "it" internally?
ronald
@ronstarcool
Oct 26 2017 09:27
anyone knows how versioning works with css?
alpox
@alpox
Oct 26 2017 09:27
Its just a way to help to handle errors, waiting for values and flattening the code structure
ronald
@ronstarcool
Oct 26 2017 09:27
i need to set version=1 in html header?
thanks folks
that was real helpful
alpox
@alpox
Oct 26 2017 09:31
@ronstarcool what do you mean with versioning in css? Your own versions? CSS spec version?
ronald
@ronstarcool
Oct 26 2017 09:31
yes
i have a file, index.html
and index.css
if i change something, the user doesnt get new version css
i need to set a version on the link tak in the header
but im not sure how
alpox
@alpox
Oct 26 2017 09:33
Well the user could just reload with cache clear (ctrl-f5). Else you use cache busting: <link rel="stylesheet" src="index.css?v=1" />
ronald
@ronstarcool
Oct 26 2017 09:34
ok
thanks alpox!
aaaah, nice!
alpox
@alpox
Oct 26 2017 09:34
@ronstarcool You can just count up the v=1 v=2 etc.
ronald
@ronstarcool
Oct 26 2017 09:34
oki
got it
linkin-park
@linkin-park
Oct 26 2017 09:35
promise are pattern . not sure which pattern.
alpox
@alpox
Oct 26 2017 09:36
@linkin-park Not just a pattern. Its a library (Natively integrated but there are libraries to replace them and make them more performant and extend their possibilities)
@linkin-park The best known and most widely used: http://bluebirdjs.com/docs/getting-started.html
Its used in most bigger applications
ronald
@ronstarcool
Oct 26 2017 09:37
maybe you have some more tips for me!
alpox
how bout this one
i have some elements inside a flexboxbox
they nicely stack in the browser, smaller window
but, when on phone, those bastards become smaller
like, really small
why dont they stack on the phone
alpox
@alpox
Oct 26 2017 09:38
@ronstarcool I believe you used percentage size of the elements?
ronald
@ronstarcool
Oct 26 2017 09:38
no, width: 200px
alpox
@alpox
Oct 26 2017 09:38
@ronstarcool And they scale down?
ronald
@ronstarcool
Oct 26 2017 09:38
yes
alpox
@alpox
Oct 26 2017 09:39
@ronstarcool Try to put this in your head if its not already there: <meta name="viewport" content="width=device-width, initial-scale=1">
ronald
@ronstarcool
Oct 26 2017 09:39
oh
alpox
@alpox
Oct 26 2017 09:39
Not sure if it helps though, there could be something else wrong too
ronald
@ronstarcool
Oct 26 2017 09:39
you rock
wanna marry me?
i have time tomorrow..
alpox
@alpox
Oct 26 2017 09:40
Thanks but i have a girlfriend xD
ronald
@ronstarcool
Oct 26 2017 09:40
srs, it works
ok
maybe some other time then
alpox
@alpox
Oct 26 2017 09:40
You're welcome
linkin-park
@linkin-park
Oct 26 2017 09:40
just curious @alpox have you worked any real time apps?
ronald
@ronstarcool
Oct 26 2017 09:40
ur css hero?
alpox
@alpox
Oct 26 2017 09:40
@ronstarcool Nah, just some experience
linkin-park
@linkin-park
Oct 26 2017 09:40
yes @ronstarcool
ronald
@ronstarcool
Oct 26 2017 09:40
cool
alpox
@alpox
Oct 26 2017 09:40
@linkin-park Real-time? Made some tests and such but not much more
I know how it works
ronald
@ronstarcool
Oct 26 2017 09:41
@alpox you must have finished most of fcc right?
alpox
@alpox
Oct 26 2017 09:41
@ronstarcool No i didn't really finish anything much
ronald
@ronstarcool
Oct 26 2017 09:41
you already knew all this stuff?
alpox
@alpox
Oct 26 2017 09:41
@ronstarcool I mostly stick around here to help - i don't have the need for a certificate
ronald
@ronstarcool
Oct 26 2017 09:42
well, i really respect that
linkin-park
@linkin-park
Oct 26 2017 09:42
certificate sucks
ronald
@ronstarcool
Oct 26 2017 09:42
you work as a dev then
linkin-park
@linkin-park
Oct 26 2017 09:42
FCC certificate su! too
alpox
@alpox
Oct 26 2017 09:42
@ronstarcool Not yet work. I'm at university atm
ronald
@ronstarcool
Oct 26 2017 09:42
ah ok
im busy with node
but css still gets me freaked out at times
alpox
@alpox
Oct 26 2017 09:43
I used to work as dev a little before and have a previous education for it but decided to go further with university now :-)
linkin-park
@linkin-park
Oct 26 2017 09:43
i have built ERP but i never wrote a promise as explicit as possible.
alpox
@alpox
Oct 26 2017 09:43
@ronstarcool CSS takes time to learn properly
ronald
@ronstarcool
Oct 26 2017 09:43
yeah really. so many loopholes
alpox
@alpox
Oct 26 2017 09:43
@linkin-park You missed something there :-) you'll love it once you know it right
linkin-park
@linkin-park
Oct 26 2017 09:45
did i :/
bam!
ronald
@ronstarcool
Oct 26 2017 09:46
well, i hope you stick around alpox
im already married, but....things happen!
alpox
@alpox
Oct 26 2017 09:47
@ronstarcool lol :D i often stick around. Have fun mate
linkin-park
@linkin-park
Oct 26 2017 09:47
i have a question in reactjs
alpox
@alpox
Oct 26 2017 09:48
@linkin-park Ye?
linkin-park
@linkin-park
Oct 26 2017 09:48
i need to display a popup
for a field
should i need to have that popup as child element for the Field component?
or is there any other way to do it
ronald
@ronstarcool
Oct 26 2017 09:49
Field, sounds like you have a ui framework?
alpox
@alpox
Oct 26 2017 09:49
@linkin-park Field component? Any framework involved?
@ronstarcool Ninjaed :D
ronald
@ronstarcool
Oct 26 2017 09:49
:)
linkin-park
@linkin-park
Oct 26 2017 09:49
well we have react js
alpox
@alpox
Oct 26 2017 09:49
@linkin-park React itself doesn't provide a Field component
linkin-park
@linkin-park
Oct 26 2017 09:50
no framework i see here
they have used react
alpox
@alpox
Oct 26 2017 09:50
@linkin-park And yet there is a Field? can you show a code snippet?
linkin-park
@linkin-park
Oct 26 2017 09:50
i cant show the snipped :/
its private repo
and code
you cant have Field class ?
alpox
@alpox
Oct 26 2017 09:51
@linkin-park Well as long as i don't know if a framework is involved or how "they" created maybe themselves a Field component, i cannot give a recommendation
Victor Abeledo
@victorja
Oct 26 2017 09:51
guys do you know how can I test this code???. Task: Write a function that takes as input a matrix of data and outputs a DOM structure representing a table. Attach it to the body of a given page.
https://jsfiddle.net/rbLzL4q3/
alpox
@alpox
Oct 26 2017 09:51
@linkin-park You can have one but it doesn't exist by default
linkin-park
@linkin-park
Oct 26 2017 09:52
did i say default?
sorry ....
alpox
@alpox
Oct 26 2017 09:53
@linkin-park You didn't but you didn't say where the Field is coming from. ReactJS doesn't include it
linkin-park
@linkin-park
Oct 26 2017 09:54
k
ronald
@ronstarcool
Oct 26 2017 09:54
well anyway linkin park, if you wanna display it...you'll have to provide it, you prob have something like this ({ prop1, prop2, error ]) and then in the component you do something like this:
{ error }
alpox
@alpox
Oct 26 2017 09:54
@linkin-park Considering you have only a normal input (No special component for a field) you would have to put the popup next to the input and group them both into some kind of field group or formgroup. Then use css to align the popup properly to the input using relative absolute positioning on the popup and relative positioning on the group
ronald
@ronstarcool
Oct 26 2017 09:54
then, if there is an error....it will show it. if there is none, nothing is shown
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 09:54
where you set the matrix element @victorja ?
linkin-park
@linkin-park
Oct 26 2017 09:54
that sucks
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 09:54
you call the function but without any argument
linkin-park
@linkin-park
Oct 26 2017 09:55
i want to use DOM :!
alpox
@alpox
Oct 26 2017 09:55
@linkin-park Well, UI frameworks make it better. And i really believe you have one right there :D
linkin-park
@linkin-park
Oct 26 2017 09:55
they didnt use any
alpox
@alpox
Oct 26 2017 09:55
@linkin-park You are using DOM :D
linkin-park
@linkin-park
Oct 26 2017 09:55
i may use DOM
Victor Abeledo
@victorja
Oct 26 2017 09:55
@tiagocorreiaalmeida I know, I tried putting values inside the onclick declaration but throws an error on the console
ronald
@ronstarcool
Oct 26 2017 09:55
haha
Victor Abeledo
@victorja
Oct 26 2017 09:56
@tiagocorreiaalmeida I just want to test the script but don't know how or where
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 09:56
what's the final idea?
of this jsfidle?
create a table on click?
Victor Abeledo
@victorja
Oct 26 2017 09:57
yes! then I'll add more functionality like adding values through textboxes in html, but for now I just want to create the table on click
alpox
@alpox
Oct 26 2017 09:57
@linkin-park Best, investigate where the Field is coming from ;-) then you know more
Should be imported at the beginning of the file (Top of the file)
linkin-park
@linkin-park
Oct 26 2017 09:58
lolz
you made my day @alpox will be back :)
Victor Abeledo
@victorja
Oct 26 2017 10:01
@tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 10:01
   <table id="myTable" cellpadding="2" cellspacing="2" border="1" onclick="tester()"></table>
        <script>
            var student;
            for (var j = 0; j < 10; j++) {
                student = {
                    name: "Name" + j,
                    rank: "Rank" + j,
                    stuclass: "Class" + j,
                };
                var table = document.getElementById("myTable");
                var row = table.insertRow(j);
                var cell1 = row.insertCell(0);
                var cell2 = row.insertCell(1);
                var cell3 = row.insertCell(2);

                cell1.innerHTML = student.name,
                cell2.innerHTML = student.rank,
                cell3.innerHTML = student.stuclass;
            }
        </script>
one example I found on stackoverflow
Victor Abeledo
@victorja
Oct 26 2017 10:14
thanks @tiagocorreiaalmeida
CamperBot
@camperbot
Oct 26 2017 10:14
victorja sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 408 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Victor Abeledo
@victorja
Oct 26 2017 10:14
I think javascript doesn't have multidimensional array support
so I'll have to create an array of arrays or sth like that
alpox
@alpox
Oct 26 2017 10:18
@victorja that exactly IS a multidimensional array :D
Victor Abeledo
@victorja
Oct 26 2017 10:20

I really can't understand how that code relates to mine

function newTable(matrix){
var table = document.createElement("TABLE");
var tbody = document.createElement("TBODY");
table.appendChild(tbody);

for(var row=0;row<matrix.length;row++){
    var tr = document.createElement("TR");
    //var textTr = document.createTextNode(String(matrix[row][col]));
    //tr.appendChild(textTr);
    tbody.appendChild(tr);
    for(var col=0;col<matrix[row].length;col++){
        var th = document.createElement("TH");
        var textTh = document.createTextNode(String(matrix[row][col]));
        th.appendChild(textTh);
        tr.appendChild(th);
    }
}

}

var matrix = [
[2,3,6],
[4,66,23],
[25,65,0]
]

alpox
@alpox
Oct 26 2017 10:20
@victorja the code just shows
That there are specific functions to do the creation of rows and cols
Instead of your document.createElements for the rows and columns
DavidR
@davidrinconv
Oct 26 2017 10:21
Hi Guys, I'm building an app and when I fetch data from this website https://www.cryptocompare.com/api/data/coinlist I'm getting No 'Access-Control-Allow-Origin' header is present on the requested resource.
Any Ideas how to overcome that? reading online I cannot make sense of it
alpox
@alpox
Oct 26 2017 10:23
@davidrinconv thats a CORS issue. It means that the server doesnt provide the appropriate http headers to allow your domain to use the data. You can overcome it through either using JSONP requests or using a cors proxy
DavidR
@davidrinconv
Oct 26 2017 10:25
@alpox reading about JSONP it is just adding callback=? at the end? https://www.cryptocompare.com/api/data/coinlist?callback=?
linkin-park
@linkin-park
Oct 26 2017 10:26
the project with business complexity in O(n^2) fries your brain
alpox
@alpox
Oct 26 2017 10:27
@davidrinconv it is, in case you use jquery for requests
But ONLY with jquery
@linkin-park what project?
Hmm algorithms can have that complexity. I dont think there is business complexity which can be counted like that :D
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:29
hi,
I want to create a 3 months calendar (starting from current date) in php which is used to book consecutive number of dates and store it in database . Also after booking the calendar should change its colour for those booked days.
please help.
linkin-park
@linkin-park
Oct 26 2017 10:30
sounds like a homework @AmruthaPatil
@alpox there are
alpox
@alpox
Oct 26 2017 10:30
@AmruthaPatil i believe that is a too wide and big topic to provide you help over chat :D
@linkin-park like?
DavidR
@davidrinconv
Oct 26 2017 10:31
@alpox oh great that is quite helpful .... now looking at React Fetch and JSONP
alpox
@alpox
Oct 26 2017 10:31
@davidrinconv fetch is not tied to react. Its a native api. Fetch cannot help you to do jsonp requests
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:32
@linkin-park more like a learning project. yea :)
alpox
@alpox
Oct 26 2017 10:32
@davidrinconv that is, because JSONP is actually quite insecure and a bit of a hack
linkin-park
@linkin-park
Oct 26 2017 10:33
how power is consumed at X position at what rate
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:33
@alpox any little help would be appreciated :)
alpox
@alpox
Oct 26 2017 10:33
It implies adding script tags to the DOM to make the browser load a resource and call a specific method when its loaded, then remove the script tag from the DOM.
@linkin-park well thats not a project but a business logic algorithm.
@AmruthaPatil well, one would wonder where to start. Choose a database? MySQL? :D
linkin-park
@linkin-park
Oct 26 2017 10:34
lolz
@alpox
ofcourse ill give part of business requirement
why would i say the project?
alpox
@alpox
Oct 26 2017 10:35
You said "the project in business complexity"
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:36
@alpox yep. using xampp
alpox
@alpox
Oct 26 2017 10:36
@AmruthaPatil okay. Any previous knowledge of php, javascript, html?
linkin-park
@linkin-park
Oct 26 2017 10:36
its with @alpox
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:37
@alpox yes. all of thm :)
alpox
@alpox
Oct 26 2017 10:37
@AmruthaPatil so, any specific questions about the project? :D
linkin-park
@linkin-park
Oct 26 2017 10:38
well @AmruthaPatil wants to do the project @alpox
alpox
@alpox
Oct 26 2017 10:38
@linkin-park hmm the project with business complexity...? That doesnt sound right to me :D a project contains many different business logic parts with different complexity
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:38
well,
I am using xampp and I am already working on it. but right now I am facing problem with the booking and colour of the calendar .
alpox
@alpox
Oct 26 2017 10:40
@AmruthaPatil also, do you do clientside rendering or serverside?
@AmruthaPatil hmm what problem do you face?
Amrutha Patil
@AmruthaPatil
Oct 26 2017 10:43
@alpox clientside rendering
linkin-park
@linkin-park
Oct 26 2017 10:44
who said no ? @alpox
lolz @alpox you made my day :)
Ashwin
@ashwins93
Oct 26 2017 10:47

how power is consumed at X position at what rate

in business its referred to as throughput

management accounting @linkin-park
alpox
@alpox
Oct 26 2017 10:47
@AmruthaPatil do you have a problem with persisting the changes?
linkin-park
@linkin-park
Oct 26 2017 10:48
i told to my manager never go for node :) its an April fool joke.
linkin-park
@linkin-park
Oct 26 2017 10:55
? @ashwins93
Ashwin
@ashwins93
Oct 26 2017 10:56
@linkin-park You said business complexity. Its called throughput
DavidR
@davidrinconv
Oct 26 2017 11:03
@alpox Thank you!
CamperBot
@camperbot
Oct 26 2017 11:03
davidrinconv sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1403 | @alpox |http://www.freecodecamp.com/alpox
Radu Matees
@RaduMatees
Oct 26 2017 11:16
hello fellow coders
I am a bit stuck at the TwitchTV project

$(document).ready(function() {

var streamers = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"]
var url = ""

for (i=0; i<streamers.length; i++) {
populatePage(i)
}

function populatePage(i) {

url = "https://wind-bow.gomix.me/twitch-api/users/" + streamers[i]

$.ajax({
  type:"GET",
  url: url,
  async: false,
  dataType: "jsonp",
  success: function(json) {
    $('.my-list').append("<li class='my-list-item'><div class='my-round-avatars'> \
    <img src='" + json.logo + "'></div><span class='my-list-names'>" + json.display_name + " \
    </span></li>")
    $('.my-list-item').wrap("<a href='https://go.twitch.tv/" + json.display_name + "' target=_blank></a>")
  },
  error: function(errorMessage){
    alert('Error')
  }
})

}

})

I poorly pasted the code it seems
anyway
I am iterrating through a list of streamers.... and everything is working fine, for each streamer, I am adding a new customized list item
but it seems that the wrapping A Tag is always the same... a random one
I think is has something to do with JS-s asynchronyus behaviour... but I am abit noobish, don't know much about it
so, what I am doing worong?
rscales02
@rscales02
Oct 26 2017 11:22
can you post your codepen?
@RaduMatees
Radu Matees
@RaduMatees
Oct 26 2017 11:23
I am working locally
korzo
@korzo
Oct 26 2017 11:23
@RaduMatees $('.my-list-item').wrap wraps all .my-list-item, not just last.
Radu Matees
@RaduMatees
Oct 26 2017 11:24
Give me a minute or 2 too put it on codepen
Stephen James
@sjames1958gm
Oct 26 2017 11:25
@RaduMatees You need to use a different class for each streamer or your wrap refers to all the ones before it
Radu Matees
@RaduMatees
Oct 26 2017 11:25
@korzo That's it.. the link Tag it's always the last one, not random
thank you very much
yes, that's it.. thank you
I thought it was something much more complicated... it just seems I wasn't paying attention
William Pederzoli
@wpederzoli
Oct 26 2017 11:28
hello everyone
Fabien SHAN
@X140hu4
Oct 26 2017 11:29
Hello
korzo
@korzo
Oct 26 2017 11:33
@RaduMatees Glad it helped.
@X140hu4 @wpederzoli Hi
Radu Matees
@RaduMatees
Oct 26 2017 11:35
yes... I just changed the selection with $('.my-list-item:last') ... and it works just fine now
thanks again :)
Ken Haduch
@khaduch
Oct 26 2017 11:44
@wpederzoli @X140hu4 - hello :wave:
rscales02
@rscales02
Oct 26 2017 11:50
function playerClick(team){

    $('.gamebtn').click(function (argument) {
        /* body... */
         var id = $(this).attr('id');
        if ($('#' + id).text() == ""){
            $('#' + id).text(team);

        } else {
            alert("This tile has already been played, try again...");   
        }

        return id;
    });
}

function playBall(players, team){
    var player1 = 'X';
    var player2 = "O";
    var player1Turn = true;
    var id;
    var tiles = ["#", "#", "#", "#", "#", "#", "#", "#", "#"];
    var wins = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]];

    if (team == 'O'){
        player1 = 'O';
        player2 = 'X';
    }

    if (player1Turn == true){
        id = playerClick(player1);
        console.log(id); //immediate return of undefined, no return upon player click
        tiles[id] = player1;
        player1Turn = false;
    } else {
        id = playerClick(player2);
        tiles[id] = player2;
        player1Turn = true;
    }
}

how do I get playBall() to pause and wait for playerClick() to finish (i.e. wait for user input), also what am I doing wrong with playerClick() as it doesn't seem to be returning anything...

Also once playerClick() starts, it doesn't seem to finish (i.e. it doesn't change from X to O

Lee
@LeeConnelly12
Oct 26 2017 11:53
@rscales02 I rewrote some of the code you had, it's not perfect but it will give you an idea,
https://codepen.io/JavaPerson/pen/KXOavm
rscales02
@rscales02
Oct 26 2017 12:12
@LeeConnelly12 that code is super buggy and doesn't really help me understand what I'm doing wrong... Also, from what I have been told by a couple of people, global variables are a bad thing...
alpox
@alpox
Oct 26 2017 12:14
@rscales02 Please be aware that everytime you run playerClick, it registers a new eventhandler. (Just to go sure).
Then, if you want to run playerBall only if a click happened, just call the function playBall from the click callback
@rscales02 Also, your function playerClick only registers an eventhandler and does not run a click itself.
@rscales02 Returning an id from a click event handler doesn't really do anything and also does not return the id from playerClick. The click happens much later than your click handler registration through playerClick
rscales02
@rscales02
Oct 26 2017 12:17
how would I get playerClick to return the id of the clicked button?
alpox
@alpox
Oct 26 2017 12:18
@rscales02 You don't. That cannot happen - because you would have to call playerClick at some point, but how would you go sure that the button was just clicked at the time you call that function? And only in that case you could get the id?
As you see, this is a major timing problem and you cannot just randomly call a function which registers click events and want to have a return value from the clicks.
rscales02
@rscales02
Oct 26 2017 12:19
is there a problem with it regestering a new event handler? I am not tracking anything through it, just trying checking if that button is ok to click and populating the box with the play...
alpox
@alpox
Oct 26 2017 12:19
@rscales02 The normal way would be to ONLY register click events (Not in a function! Except you just call that function ONCE to register all handlers at application start)
@rscales02 If you register an event handler for a button, it will stay there and LISTEN to all clicks happening to the button
And it will stay there for the runtime of your application or until it gets unregistered by some code
rscales02
@rscales02
Oct 26 2017 12:20
@alpox alright, back to square one then...
alpox
@alpox
Oct 26 2017 12:21
So you only know that someone clicked the button, when the click callback gets happened.
$(...).click(function() {
    // Here you know that the element was clicked
});
@rscales02 And from that point you can call other functions or implement any logic that should happen when a user clicks the element
rscales02
@rscales02
Oct 26 2017 12:22
I thought that was what I was doing already...
Lee
@LeeConnelly12
Oct 26 2017 12:37
@rscales02 You should handle logic such as who clicked the game button inside the click event handler, you don't need to wrap the click event in a function either
rscales02
@rscales02
Oct 26 2017 12:40
I thought I was wrapping it in the function so it would only register when it was the appropriate time
Lee
@LeeConnelly12
Oct 26 2017 12:41
@rscales02 yeah but each time a game button is clicked, you want something to happen
rscales02
@rscales02
Oct 26 2017 12:41
also so I could reuse the code for player 1 and player 2
Lee
@LeeConnelly12
Oct 26 2017 12:50
@rscales02 I think this how your click event should look
let player1Turn = true;
let tiles = ["#", "#", "#", "#", "#", "#", "#", "#", "#"];

$('.gamebtn').click(function () {
    var id = $(this).attr('id');

    // If the tile the user clicked is not empty, alert and return
    if ($(this).text() != "") {
        alert("This tile has already been played, try again...");
        return;
    }

    // The tile was clicked when it was player 1's turn
    if (player1Turn) {
        tiles[id] = player1;
        $(this).text(player1);
        player1Turn = false;

    // The tile was clicked when it was player 2's turn
    } else {
        tiles[id] = player2;
        $(this).text(player2);
        player1Turn = true;
    }
});
@rscales02 more readable/manageable imo
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 13:45
@alpox around?
been trying to improv all the code
router.get("/go/:id", (req, res) => {
    if (req.user) {
        let userID = req.user.id;
        let location = req.params.id;
        Place.findOne({ id_place: location }).then((data) => {
            if (data) {
                Place.findOne({ id_place: location, users_going: userID}).then((data) => {
                    if (data) {
                        return Place.findOneAndUpdate({ id_place: location, users_going: userID }, { $pull: { users_going: userID }},{new:true});
                    } else {
                        return Place.findOneAndUpdate({ id_place: location }, { $push: { users_going: userID }},{new:true});
                    }
                }).then((data)=>{
                    let users_going = data.toObject().users_going.length;
                    res.send(JSON.stringify({users_going}));
                }).catch((e) => {
                    console.log(e);
                });
            } else { res.send(JSON.stringify({ error: true })); }
        }).catch((e) => console.log(e));
    } else { res.send(JSON.stringify({ error: true })); }
});
this one could be even more flat right?
alpox
@alpox
Oct 26 2017 14:11
@tiagocorreiaalmeida Looks okayish but you can take one level less
@tiagocorreiaalmeida the second findOne can be returned to the outside before chaining
linkin-park
@linkin-park
Oct 26 2017 14:37
hi
Spyrantis Theodoros
@thodorisanta
Oct 26 2017 14:38
Can someone check my html - css and tell me if its "bad coding". I kinda did everything manually and im certain that there are way more better ways to do it. Check it and tell me please :)
https://codepen.io/oshikurou/pen/mBNVKM?editors=1100
Kaz Baig
@kbaig
Oct 26 2017 14:40
@thodorisanta inner circle still off center :(
@thodorisanta also, the inner circle goes fuzzy during the on/off button transition
alpox
@alpox
Oct 26 2017 14:41
@kbaig What browser do you use? I see nothing of that :D
Kaz Baig
@kbaig
Oct 26 2017 14:42
@alpox chrome
alpox
@alpox
Oct 26 2017 14:42
@kbaig Hmm me too o.O
Kaz Baig
@kbaig
Oct 26 2017 14:44
@thodorisanta The title looks off center but that might actually be because of the spacing of the middle button/display row. Maybe make that row a 2 col layout with the display one col and buttons the other?
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 14:49
in a real world situation do you think in a interview they will take in consider some of the fcc projects? im in the point that im not sure if I should just create something unique as ui per project to have some portfolio or jsut use standard bootstrrap things
in this case for the backend projects
Kaz Baig
@kbaig
Oct 26 2017 14:49
Guys any feedback on this little bit of UI? https://codepen.io/kbaig/pen/BwXVRG
@tiagocorreiaalmeida I'd say depends on what you're trying to demonstrate via that project if it's a piece on your portfolio
/ what kind of job the interview is for
alpox
@alpox
Oct 26 2017 14:52
@tiagocorreiaalmeida Its always good to have some good reference online. Something i lack :D
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 14:54
yeah was thinking about making use of this projects to make some portfolio projects that could show bakcend/frotnend when the time for need comes
thanks for the opinions tough
Kaz Baig
@kbaig
Oct 26 2017 15:00
(try hovering/clicking things)
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 15:06
who me?
I know how things work I was just thinking if it was worth the time of doing it but since I dont have much I can use as portfolio will take this one
Kaz Baig
@kbaig
Oct 26 2017 15:07
Clicking/hovering things on the pen I linked
Spyrantis Theodoros
@thodorisanta
Oct 26 2017 15:13
@kbaig what, how? looks good to me
Fredrik Strand Oseberg
@FredrikOseberg
Oct 26 2017 15:17
Anyone experienced issues with create react app autoprefixer and flexbox in Safari?
Kaz Baig
@kbaig
Oct 26 2017 15:19
@thodorisanta sorry, what do you mean by what, how
Spyrantis Theodoros
@thodorisanta
Oct 26 2017 15:20
@kbaig inner circle looks centered to me and when i press the switch nothing changes
rscales02
@rscales02
Oct 26 2017 15:35
$('#choice').text('Player 1, choose your side...'); any reason that this bit of code doesn't work?
line 21...
alpox
@alpox
Oct 26 2017 15:37
@tiagocorreiaalmeida i should make a portfolio for myself too once but i dont have design to present :D im just much more of a programmer
Id have the opensource validationlibrary to present now :D
There are already 50 downloads! :D
Lee
@LeeConnelly12
Oct 26 2017 15:39
@rscales02 Because your adding the class hidden to the id playerNumber
@rscales02 playerNumber is the div wrapping around the p tag you're trying to change the text of
shivam gupta
@shivamg11000
Oct 26 2017 15:40
offset-sm-2 not working any ideas in bs4
https://codepen.io/shivamg11000/pen/yPBLoM?editors=1100
rscales02
@rscales02
Oct 26 2017 15:43
@LeeConnelly12 playerType is the wrapping div around the element I am trying to change... also why would changing the class of the wrapper affect whether or not the text in the p element is changed?
Lee
@LeeConnelly12
Oct 26 2017 15:44
@rscales02 You're hiding the element wrapping the p you're changing the text of.
alpox
@alpox
Oct 26 2017 15:44
@tiagocorreiaalmeida for the fcc portfolio they also suggest to use the fcc projects as showcase in your portfolio. Its good to be able to show off what you created.
Lee
@LeeConnelly12
Oct 26 2017 15:44
@rscales02 So you hide the p tag as well
rscales02
@rscales02
Oct 26 2017 15:45
that p element is hidden until line 26 calls it out...
@LeeConnelly12 nevermind, I am an idiot...
Lee
@LeeConnelly12
Oct 26 2017 15:48
@rscales02
    //number of players
    $('.players').click(function() {
        var id = $(this).attr('id');
        if (id == 'btn1') {
            num = 1;
        } else {
            num = 2;
            $('#choice').text('Player 1, choose your side...');

        }

        $('#playerNumber').addClass('hidden');// remove this
        $('#playerType').removeClass('hidden');
rscales02
@rscales02
Oct 26 2017 15:48
I put the id in the wrong p element
Lee
@LeeConnelly12
Oct 26 2017 15:49
@rscales02 oh ok
DavidR
@davidrinconv
Oct 26 2017 17:12
@davidrinconv
Hi Guys, I'm building an app and when I fetch data from this website https://www.cryptocompare.com/api/data/coinlist I'm getting No 'Access-Control-Allow-Origin' header is present on the requested resource.
Any Ideas how to overcome that? reading online I cannot make sense of it
I'm guessing I should cache the JSON file and then serve it locally to my app... but how to do taht?
This is a webapp at the moment
https://davidrinconv.github.io/cryptochart/
Kaz Baig
@kbaig
Oct 26 2017 17:29
@davidrinconv just opening it in the browser works soooo
are you calling the api via node?
DavidR
@davidrinconv
Oct 26 2017 17:31
@kbaig I'm using fetch
Kaz Baig
@kbaig
Oct 26 2017 17:31
on your front end?
DavidR
@davidrinconv
Oct 26 2017 17:31
yes
Kaz Baig
@kbaig
Oct 26 2017 17:31
gotcha
btw im seeing the data being plotted on your app
DavidR
@davidrinconv
Oct 26 2017 17:32
yes I'm using https://cors-anywhere.herokuapp.com/ to get around but it is slow
the site is currently hosted in github pages
Are you suggesting I need to make the request into "my server" then use it locally?
Kaz Baig
@kbaig
Oct 26 2017 17:33
No I was asking because people forget to enable CORS if they're doing it through node
DavidR
@davidrinconv
Oct 26 2017 17:34
I think the workaround is to save the file locally and then load it into the application. I realise this is a listing of coins so need to be from the web all the time
*no need
Kaz Baig
@kbaig
Oct 26 2017 17:36
well I don't see why you can't just make the call every time the page is loaded like you are now
unless you really care about load times
I see the data being plotted and no console errors. Is there still a problem with the api call or no?
DavidR
@davidrinconv
Oct 26 2017 17:36
no i dont care about load times.... but the cors-anywhere app was down today
so my site was not working
I'm looking to expand it but try to remove this step to make it more reliable
Kaz Baig
@kbaig
Oct 26 2017 17:37
I don't think you need cors if you're making a call via the front end
DavidR
@davidrinconv
Oct 26 2017 17:58
@kbaig :)
@kbaig thank you!
CamperBot
@camperbot
Oct 26 2017 17:58
davidrinconv sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 377 | @kbaig |http://www.freecodecamp.com/kbaig
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 18:04
@alpox there's a good course on udemy to give you explanations of things about design aswell and not only css and html but not sure if you are interested :D
alpox
@alpox
Oct 26 2017 18:13
@tiagocorreiaalmeida meeh i dont like designing :D but thanks ^^
CamperBot
@camperbot
Oct 26 2017 18:13
alpox sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 410 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Oct 26 2017 18:14
its quite awesome tough :D and forgot it covers sass aswell but yeah I understand :D
Antoni7s
@Antoni7s
Oct 26 2017 18:16
Hello everyone, I have one simple problem and i can't fix it. Maybe someone can help?
So, I want to get user position with HTML5 geolocation and later store it in variable.
I declared 2 global variables longitude and latitude. In function I assigned value to variables and now when i try to access it outsite the scope, it show's undefined.
Here is code: https://jsfiddle.net/0q1v62fn/2/
Theo M.
@cnngraphics
Oct 26 2017 18:17
it works on my end
@Antoni7s you may have disable geolocation by accident in your browser
your code is good
Ooops, my bad
I did not see the undefined
Antoni7s
@Antoni7s
Oct 26 2017 18:19
Yes it shows me also my position, but only when it is accessed in scope. On paragraph which is acessed outsite function shows latitude:undefined.
Theo M.
@cnngraphics
Oct 26 2017 18:19
I am checking
Kaz Baig
@kbaig
Oct 26 2017 18:29
@Antoni7s It's not because of scoping, it's because navigator.geolocation.getCurrentPosition is asynchronous. If you want to use latitude and longitude, you have to do it within the navigator.geolocation.getCurrentPosition callback https://stackoverflow.com/questions/9802039/javascript-object-method-returning-undefined
Antoni7s
@Antoni7s
Oct 26 2017 18:34
So there is problem.Thank you for help @kbaig !
CamperBot
@camperbot
Oct 26 2017 18:34
antoni7s sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 378 | @kbaig |http://www.freecodecamp.com/kbaig
Kaz Baig
@kbaig
Oct 26 2017 18:36
@Antoni7s so basically the problem is that latitude and longitude are being assigned values after they are needed (hence still undefined)
Any iOS devs here? Basic knowledge is enough
mbpiner
@mbpiner
Oct 26 2017 18:45
@Antoni7s I had this problem just a few days ago!
The thing is, you cant "return" the variable like a normal function
You'll have to put the code using those lat/long variables inside the function or inside a callback function
function getLocation(callback){ navigator.geolocation.getCurrentPosition(function(pos) { callback(coordinates); //long = pos.coords.longitude; }); } getLocation( result => { console.log(result); });
oops!
Theo M.
@cnngraphics
Oct 26 2017 18:48
I would like to see to working version of that code, I tried without success with a callback function
Kaz Baig
@kbaig
Oct 26 2017 18:49
@cnngraphics https://jsfiddle.net/bco8h219/ just have to move latitude into the showPosition function
mbpiner
@mbpiner
Oct 26 2017 18:49
//var coordinates defined somewhere up here

function getLocation(callback){

navigator.geolocation.getCurrentPosition(function(pos) {

coordinates.push(pos.coords.latitude);
coordinates.push(pos.coords.longitude);
callback(coordinates);

});
}
getLocation( result => { console.log(result); });
Theo M.
@cnngraphics
Oct 26 2017 18:50
@mbpiner if you add the code between 3 ` it will be well formatted here in the chat
mbpiner
@mbpiner
Oct 26 2017 18:51
@cnngraphics so three ``` before and after?
Kaz Baig
@kbaig
Oct 26 2017 18:51
above and below
on new lines
mbpiner
@mbpiner
Oct 26 2017 18:51
ahh cool ty
Kaz Baig
@kbaig
Oct 26 2017 18:51
try editing the last code block ;)
hover on message and click the ... to find the edit option
Theo M.
@cnngraphics
Oct 26 2017 18:52
>
function getLocation(callback){
navigator.geolocation.getCurrentPosition(function(pos) {
coordinates.push(pos.coords.latitude);
coordinates.push(pos.coords.longitude);
callback(coordinates);
});
}
getLocation( result => { console.log(result); });
mbpiner
@mbpiner
Oct 26 2017 18:53
just did it...awesome
Theo M.
@cnngraphics
Oct 26 2017 18:53
Yep!
better for all of us!
mbpiner
@mbpiner
Oct 26 2017 18:53
can write code but cant figure out a chat client haha
Kaz Baig
@kbaig
Oct 26 2017 18:53
it's markdown
useful to know outside of gitter
we're not allowed to use a cloud note taking app at work so I use a markdown note taking app
mbpiner
@mbpiner
Oct 26 2017 18:55
I'll remember it from now on.
btw for anybody having that asynchronicity problem the first answer to this really helped me -
I've got a JS question though -
Kaz Baig
@kbaig
Oct 26 2017 18:56
Since JS is primarily for the web, async is a v core concept to know
mbpiner
@mbpiner
Oct 26 2017 18:59
Yea I had no idea about it until 2 days ago. Was listening to a podcast that was explaining it last night and the best explanation of the concept I've heard was like a fast food restaurant. They have you pay, they start making your order, then you leave the line so the next person can pay, and then they "call you back" when your food is done. Making each customer pay and then wait in line until their food is done would obv be very inefficient.
The explanations I heard before that made logical since but were not nearly as clear as that. At least to me.
Theo M.
@cnngraphics
Oct 26 2017 19:00
share a podcast URL
mbpiner
@mbpiner
Oct 26 2017 19:00
sense*
Kaz Baig
@kbaig
Oct 26 2017 19:00
That's analogy is also used to explain single vs multithreading
for NodeJS
mbpiner
@mbpiner
Oct 26 2017 19:01
That one was a youtube video now that I think about it
Havent'
Haven't even messed with node at all yet but I thought that was an excellent video. That guys videos from harvards CS classes are all great
@kbaig So isn't that essentially javascripts way of multi-threading while being a single thread?
I guess it would be a "paradigm" right?
alpox
@alpox
Oct 26 2017 19:09
It would be a burner if my university would make some node classes :-/
mbpiner
@mbpiner
Oct 26 2017 19:10
@alpox you totally got me looking into that tuesday
@alpox A switch statement, as long as each statement has break; breaks out of the switch once it finds a true case, right?
Kaz Baig
@kbaig
Oct 26 2017 19:11
@mbpiner it's not multithreading, it's making a single thread work more efficiently than multiple threads would (at scale)
it is multitasking
if it was multithreaded, you would have to open a new thread for each request and then close that thread. While a thread is waiting for things like server responses, it would be doing nothing else
In single threading, the sole thread will go do other stuff while waiting
Such as running the code outside of the callback even though the variables are not defined yet (since they will be assigned once the callback is invoked after a server response)
alpox
@alpox
Oct 26 2017 19:15
@mbpiner I did? How comes :D
Yes thats true
Kaz Baig
@kbaig
Oct 26 2017 19:16
@mbpiner you're right about the switch, unless of course you return instead of breaking
alpox
@alpox
Oct 26 2017 19:17
@kbaig Can we really say that it works more efficient? I would rather say it makes a single thread do its work asynchonously. It doesn't really get more efficient
Kaz Baig
@kbaig
Oct 26 2017 19:17
average efficiency per thread goes up
or call it average capacity utilization goes up if you want to use a business operations term
If you're doing it in a multi threaded paradigm, you'd have to invest in more threads to process more request. This is expensive relative to investing in my computational power for one thread AFAIK
alpox
@alpox
Oct 26 2017 19:20
@kbaig Not really, it just schedules the work in a way which allows for a better spread of the work to different eventsources
Kaz Baig
@kbaig
Oct 26 2017 19:20
I'm inclined to believe you over myself
Joshua Waller
@Obscureether1
Oct 26 2017 19:20
hey all hows it going
alpox
@alpox
Oct 26 2017 19:21
@kbaig Its just that the performance of one thread doesn't really go better or worse unless you change its priority. It cannot suddenly have a better performance depending on the usage of the thread
Kaz Baig
@kbaig
Oct 26 2017 19:22
I'm not saying it's performing better, I'm saying it's being put to work more
it doesn't get breaks while waiting for other things to happen
alpox
@alpox
Oct 26 2017 19:23
Which is only because it does all work in one thread :-) you're right that it gets itself less breaks like this. But that doesn't really matter much
Kaz Baig
@kbaig
Oct 26 2017 19:23
hence the claim that capacity utilization goes up, another way of saying that
alpox
@alpox
Oct 26 2017 19:23
The cpu is smart enough to schedule its resources to the places and threads which need the capacity
Joshua Waller
@Obscureether1
Oct 26 2017 19:24
could i get you all to tell me where/what im missing here... one of them days....
``` <div class="responsive">
<div class="gallery">
<a target="_blank" href="https://codepen.io/Obscureether1/pen/dRRXZp">
<img src='https://codepen.io/Obscureether1/pen/dRRXZp' alt="Trolltunga Norway" width="300" height="100">
</a>
<div class="desc">Wedding</div>
</div>
</div>
Kaz Baig
@kbaig
Oct 26 2017 19:24
pshh I have a business degree not a STEM degree
Joshua Waller
@Obscureether1
Oct 26 2017 19:24
<div class="responsive"> <div class="gallery"> <a target="_blank" href="https://codepen.io/Obscureether1/pen/dRRXZp"> <img src='https://codepen.io/Obscureether1/pen/dRRXZp' alt="Trolltunga Norway" width="300" height="100"> </a> <div class="desc">Wedding</div> </div> </div>
alpox
@alpox
Oct 26 2017 19:25
@kbaig Well yes, the utilisation goes up, but i'm not sure if that can be considered a good thing :D
Kaz Baig
@kbaig
Oct 26 2017 19:25
@Obscureether1 what are you trying to do
<div class="responsive">
  <div class="gallery">
    <a target="_blank" href="https://codepen.io/Obscureether1/pen/dRRXZp">
      <img src='https://codepen.io/Obscureether1/pen/dRRXZp' alt="Trolltunga Norway" width="300" height="100">
    </a>
    <div class="desc">Wedding</div>
  </div>
</div>
Joshua Waller
@Obscureether1
Oct 26 2017 19:25
add some photos side by side, from a web site ( from codpen) projects ive done
alpox
@alpox
Oct 26 2017 19:26
@Obscureether1 You cannot link a whole website (Which isn't simply a link to a picture) as an image
Kaz Baig
@kbaig
Oct 26 2017 19:26
yeah that link isn't an imagfe
it's just a webpage
alpox
@alpox
Oct 26 2017 19:26
You will have to make a picture of the website, host it and link to that one
Joshua Waller
@Obscureether1
Oct 26 2017 19:26
gopt ya... thinking too big...lol
Kaz Baig
@kbaig
Oct 26 2017 19:26
or go to that pen and click the embed button to find the code for embedding
Joshua Waller
@Obscureether1
Oct 26 2017 19:26
Thanks @alpox
CamperBot
@camperbot
Oct 26 2017 19:26
obscureether1 sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1404 | @alpox |http://www.freecodecamp.com/alpox
Joshua Waller
@Obscureether1
Oct 26 2017 19:26
told you one of then days
thaks everyone !
need to go back to sleep... or not do this while working
alpox
@alpox
Oct 26 2017 19:28
@kbaig STEM degree? :D
Ah... we call that MINT
Kaz Baig
@kbaig
Oct 26 2017 19:29
@alpox what does that stand for? I've never heard of it
alpox
@alpox
Oct 26 2017 19:29
@kbaig Well its the german one for the same thing
Kaz Baig
@kbaig
Oct 26 2017 19:29
oo
alpox
@alpox
Oct 26 2017 19:30
@kbaig Stands for: Mathematik, Informatik, Naturwissenschaft und Technik
I'll get my bachelor degree of CS next summer
Kaz Baig
@kbaig
Oct 26 2017 19:31
math, CS, science, technology
close enough
alpox
@alpox
Oct 26 2017 19:31
Yep thats it in english
mbpiner
@mbpiner
Oct 26 2017 19:32
@alpox you answered my question about why that weather project code wouldn't work and told me it was the asynchronicity, got me figuring it out
alpox
@alpox
Oct 26 2017 19:32
@mbpiner Ah right :D
mbpiner
@mbpiner
Oct 26 2017 19:32
I've got one last problem with that project though and its driving me fucking mad though!
alpox
@alpox
Oct 26 2017 19:33
@mbpiner Tell us :D
mbpiner
@mbpiner
Oct 26 2017 19:33
Remember, I said I was including a feature that lets you search for another location's weather?
alpox
@alpox
Oct 26 2017 19:33
@mbpiner Hmm foggy
But yea ok
mbpiner
@mbpiner
Oct 26 2017 19:34
So by default it loads your locations weather. And I've just got a text box and a "search location" button, with a "my location" button beside it that returns to your original location
everythings good, except now the celsius to fahrenheit wont work everytime. I'd just link the pen but I think I've isolated the problem
So it loads your locations weather, and C -> F works fine back and forth.
You search for a location, it pops up, and C ->F doesnt work. You have to click the "search location" button again and then it will work
once you do that (have clicked "search location" twice, if you click "my location", same issue. Until you click "my location" again
alpox
@alpox
Oct 26 2017 19:37
@mbpiner I'd have to see the pen :D
mbpiner
@mbpiner
Oct 26 2017 19:37
I think i maybe figured out the issue though, its this code
$("#temp").click(function(){

    if($(this).text() == tempC + "°C"){
          console.log($(this).text());
          $(this).text(tempF + "°F")
          tempChange = true;
          console.log($(this).text());
    }
      else if ($(this).text() == tempF + "°F"){
          console.log($(this).text());
          $(this).text(tempC + "°C")
          //tempChange = true;
          console.log($(this).text());
    }
});
maybe its code outside and the way the functions are setup that are causing it to act this way...ignore the tempChange stuff
alpox
@alpox
Oct 26 2017 19:40
Yea i guess this doesn't help much to see the problem
mbpiner
@mbpiner
Oct 26 2017 19:40
ok so console.log, say the first time it works,
app starts with C. so it prints C, Changes it to F with next statement, then prints F
alpox
@alpox
Oct 26 2017 19:41
Yes
Kaz Baig
@kbaig
Oct 26 2017 19:42
btw you could replace the whole callback function contents with
$(this).text($(this).text() === tempC + '°C' ? tempF + '°F' : tempC + '°C')
alpox
@alpox
Oct 26 2017 19:42
Do you set the new temperature to #temp directly after you load the new data?
And do you set the appropriate tempC and tempF?
mbpiner
@mbpiner
Oct 26 2017 19:45
Ill just post the pen lol
@alpox Just dont judge me haha code is messy as all hell.
Shiran
@shiranag
Oct 26 2017 19:49

@shiranag
hi have problem with the chalange Sort Arrays with sort
You should have sorted the array from largest to smallest
var array = [1, 12, 21, 2];
array.sort(function(a, b) {
return b-a;
});
// Only change code below this line.

array.sort();

mbpiner
@mbpiner
Oct 26 2017 19:49
Are they aware that the directions aren't really accurate, that sometimes the FCC weather api just sends the icon like "10d" or whatever?
Kaz Baig
@kbaig
Oct 26 2017 19:50
@shiranag can u link the prob
mbpiner
@mbpiner
Oct 26 2017 19:51
I'm going to add an if that goes to "http://openweathermap.org/img/w/" + result["weather"][0].icon + ".png" if there isn't a link so it will work...but I feel like they should update the directions instead of saying the icon image is always at result["weather"][0].icon
Kaz Baig
@kbaig
Oct 26 2017 19:52
@shiranag you added code above the comment saying only write below this line instead of editing the array.sort() below the comment
Lee
@LeeConnelly12
Oct 26 2017 19:52
@shiranag

var array = [1, 12, 21, 2];
array.sort(function(a, b) {
  return b - a;
});
Kaz Baig
@kbaig
Oct 26 2017 19:52
just replace the array.sort() with what you wrote above the comment
Shiran
@shiranag
Oct 26 2017 19:53
mbpiner
@mbpiner
Oct 26 2017 19:54
@kbaig thx btw, I forgot all about ternarys in JS.
Love them they make everything so clean looking.
CamperBot
@camperbot
Oct 26 2017 19:54
mbpiner sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 380 | @kbaig |http://www.freecodecamp.com/kbaig
Kaz Baig
@kbaig
Oct 26 2017 19:55
@mbpiner ya i see u changed it haha
alpox
@alpox
Oct 26 2017 19:55
@mbpiner I don't really think it makes it clean looking. They can become a bad thing actually if used too often
mbpiner
@mbpiner
Oct 26 2017 19:56
@alpox Yea I'd agree, clean maybe isnt the right word. Readability isn't the greatest
Kaz Baig
@kbaig
Oct 26 2017 19:56
@mbpiner i put console.log(tempC, tempF) in the click listener and see that it's actually adding one more listener every time you click my location or search location
mbpiner
@mbpiner
Oct 26 2017 19:56
@alpox Great for code golf though. I like seeing if I can solve an algorithm with one line
alpox
@alpox
Oct 26 2017 19:56
@mbpiner Lol :D i know whats happening there in your code :D
mbpiner
@mbpiner
Oct 26 2017 19:57
Yea, thats what I was about to tell you guys
I had that beforehand
alpox
@alpox
Oct 26 2017 19:57
1 time click - you got one listener - you change it normally.
2 time click - you got 2 listeners - you change the temperature to F and back do C instantly.
3 time click - you got 3 listeners .....
:D
mbpiner
@mbpiner
Oct 26 2017 19:57
Yea exactly
alpox
@alpox
Oct 26 2017 19:58
@mbpiner Just take the click event registration out of the function
One level out
mbpiner
@mbpiner
Oct 26 2017 19:58
So I thought it was like, the if statement changed it from C-F, which made the next statement true, which switched it from F-C like nothing happened
Yea
alpox
@alpox
Oct 26 2017 19:58
@mbpiner Btw. once in between, pls click the Tidy JS button :D
Kaz Baig
@kbaig
Oct 26 2017 19:59
@mbpiner it's because you're using the html method here: $("#temp").html(tempC + "°C");
so it's adding a new click listener every time
jk that's not it
mbpiner
@mbpiner
Oct 26 2017 20:00
I just facepalmed
I SWEAR I tried that
Kaz Baig
@kbaig
Oct 26 2017 20:00
that's not it i don't think
mbpiner
@mbpiner
Oct 26 2017 20:00
It works now that I moved it out
Kaz Baig
@kbaig
Oct 26 2017 20:00
o
oke
I just refreshed and it's not working @mbpiner
toggle unit works when page loads, doesn't work if i click my location and then try it
mbpiner
@mbpiner
Oct 26 2017 20:03
I think I moved it out too far before. I probably moved it to every location but one level out :)
@kbaig try now
Kaz Baig
@kbaig
Oct 26 2017 20:03
there we go
mbpiner
@mbpiner
Oct 26 2017 20:03
maybe you did what I did, moved it to wrong spot?
alpox
@alpox
Oct 26 2017 20:03
@mbpiner Click tidy, dude :D
mbpiner
@mbpiner
Oct 26 2017 20:04
or maybe you had the old one cached?
Kaz Baig
@kbaig
Oct 26 2017 20:04
nah not caching
maybe just timing
mbpiner
@mbpiner
Oct 26 2017 20:04
@alpox its beautiful
lol
alpox
@alpox
Oct 26 2017 20:05
@mbpiner Clean code formatting is crucial for being able to read code clearly
mbpiner
@mbpiner
Oct 26 2017 20:05
wow. I probably would have figured that out in 5 minutes if the code looked like that. Lesson learned
Yup. lesson learned
alpox
@alpox
Oct 26 2017 20:05
Yea. Always format your code fully clean with the right identations
I learned that without an auto-formatter :D
Kaz Baig
@kbaig
Oct 26 2017 20:05
yeaah I used to hit the tidy button all the tmie
good learning tool
alpox
@alpox
Oct 26 2017 20:06
But if your braces don't match up and their content is not indented you don't see with one eye where which code belongs
mbpiner
@mbpiner
Oct 26 2017 20:06
When I was doing ruby I did, idk why not with JS
I guess JS just drives me nuts lol
alpox
@alpox
Oct 26 2017 20:06
:D
Kaz Baig
@kbaig
Oct 26 2017 20:06
ruby
in 2017
lul
jk
alpox
@alpox
Oct 26 2017 20:06
Well still a lot of people use ruby on rails :D
But that thing is probably the slowest language/tool i've ever seen
Kaz Baig
@kbaig
Oct 26 2017 20:07
using ruby is like using a sword made of rubies
it's shiny but...why????
mbpiner
@mbpiner
Oct 26 2017 20:07
I'm no expert, only recently started coding again like 2 months ago since I had enjoyed it as a kid
but I think after using ruby it has it purposes
I mean rapid development
Kaz Baig
@kbaig
Oct 26 2017 20:07
JS till I die
mbpiner
@mbpiner
Oct 26 2017 20:07
MVP minimum viable product
alpox
@alpox
Oct 26 2017 20:08
@kbaig Nah JS is also one of the worst languages out there :D
Kaz Baig
@kbaig
Oct 26 2017 20:08
shhh
alpox
@alpox
Oct 26 2017 20:08
I know JS the best of all languages and still have to say that :D
Kaz Baig
@kbaig
Oct 26 2017 20:08
Mathematica exists so uhhh
mbpiner
@mbpiner
Oct 26 2017 20:08
for a startup who needs to get something made and then iterate though?
Kaz Baig
@kbaig
Oct 26 2017 20:08
I'd put that up as a contender
alpox
@alpox
Oct 26 2017 20:08
@kbaig d'uh i had to use that a little at university... i always refused :D
Kaz Baig
@kbaig
Oct 26 2017 20:08
What do you think of it
alpox
@alpox
Oct 26 2017 20:08
Now.. Matlab >.<
Kaz Baig
@kbaig
Oct 26 2017 20:09
honestly
Mathematica
alpox
@alpox
Oct 26 2017 20:09
Mathematica? cmon, take a biotrash and throw it in and hope its not radioactive and pollutes the nature
Kaz Baig
@kbaig
Oct 26 2017 20:09
heh
I'm not allowed to say I dislike Mathematica
I'd get fired
alpox
@alpox
Oct 26 2017 20:10
Lol why :D
Kaz Baig
@kbaig
Oct 26 2017 20:10
...because I work for the company
lul
alpox
@alpox
Oct 26 2017 20:10
Oupsy :D
I really like wolframalpha tho
Kaz Baig
@kbaig
Oct 26 2017 20:11
I do license agreements for that (among other things)
alpox
@alpox
Oct 26 2017 20:11
To just look some math stuff up the easy way :D
mbpiner
@mbpiner
Oct 26 2017 20:11
Hey guys the right side of the = gets evaluated in JS first right
Kaz Baig
@kbaig
Oct 26 2017 20:11
ya
it does
alpox
@alpox
Oct 26 2017 20:11
But i now use matlab in most cases
Matlab is just superior in most math cases
I just don't understand why they are 1-indexed and not 0 >.<
Kaz Baig
@kbaig
Oct 26 2017 20:12
Maybe but WL can do way more than just math/visualization
alpox
@alpox
Oct 26 2017 20:12
I mean... dude...
Kaz Baig
@kbaig
Oct 26 2017 20:12
For WL it's because functional programming
alpox
@alpox
Oct 26 2017 20:12
@kbaig Yea idk what all
@mbpiner yep it does
Kaz Baig
@kbaig
Oct 26 2017 20:12
The 0 index is hidden and reserved for the type basically
The 'head' of the 'symbol'
alpox
@alpox
Oct 26 2017 20:14
@kbaig Still... dude... it makes indexing so much harder
Kaz Baig
@kbaig
Oct 26 2017 20:14
You can even hook it into Unity to develop games
alpox
@alpox
Oct 26 2017 20:14
@kbaig Thats a heck lot :D not bad
But i guess i'll never dive into that language
Kaz Baig
@kbaig
Oct 26 2017 20:14
I mean unless you have a semi-computational/data use case
or prototyping use case
you don't need to
alpox
@alpox
Oct 26 2017 20:15
@kbaig I use python/matlab
I don't think i need anything else
Kaz Baig
@kbaig
Oct 26 2017 20:15
That's what all the CS majors in the last decade say
alpox
@alpox
Oct 26 2017 20:15
SciPy can pretty much everything :D
@kbaig I'll maybe look into mathematica a bit more sometime if needed. I guess i didn't look for what else it can do than the stuff i've seen in lecture
I just had the horror of its plain size and how heavy it was on the computer
Kaz Baig
@kbaig
Oct 26 2017 20:20
It does everything in memory which is annoying
alpox
@alpox
Oct 26 2017 20:20
But actually matlab is not much better when it comes to heavy
When ive seen that i have to download 11gb and my laptop told me that i have 15 free, i got angry :D
Kaz Baig
@kbaig
Oct 26 2017 20:21
oops
alpox
@alpox
Oct 26 2017 20:22
@kbaig You say mathematica is functional? Not imperative like matlab?
Kaz Baig
@kbaig
Oct 26 2017 20:23
functional all the way down
alpox
@alpox
Oct 26 2017 20:23
Hmm thats actually a huge plus
kudos :D
Kaz Baig
@kbaig
Oct 26 2017 20:23
to do anything it's f[a][b][c][d]
alpox
@alpox
Oct 26 2017 20:23
I hope we have the same idea of functional :D
Kaz Baig
@kbaig
Oct 26 2017 20:24
functional as in functional programming yes
mbpiner
@mbpiner
Oct 26 2017 20:24
hey, does this change for you guys on every refresh?
its london
changes from mist to fog on every refresh and its not me its the API
alpox
@alpox
Oct 26 2017 20:24
@kbaig So everything immutable?
Kaz Baig
@kbaig
Oct 26 2017 20:24
@mbpiner ye
alpox
@alpox
Oct 26 2017 20:25
@mbpiner Yup
Kaz Baig
@kbaig
Oct 26 2017 20:25
@alpox pretty much never any side effects
alpox
@alpox
Oct 26 2017 20:25
@kbaig Nice
But i don't see in any documentation anything about how you could really program something - its always a oneliner to just show something
Kaz Baig
@kbaig
Oct 26 2017 20:26
Yeah that's a consistent challenge
You can go to the demonstrations page on the wolfram site to find examples
alpox
@alpox
Oct 26 2017 20:26
@kbaig Thats pretty bad documentation in that case :D programmers like me are totally thrown off by that
I see: Cool, you can show some stuff. Now. How do i write all my computations in it?
Kaz Baig
@kbaig
Oct 26 2017 20:27
Some major functions do have a 'neat examples' section where they build stuff
alpox
@alpox
Oct 26 2017 20:27
20 pages later: ah screw it - i'm out
Kaz Baig
@kbaig
Oct 26 2017 20:27
@alpox http://reference.wolfram.com/language/ref/FormPage.html see neat examples section at bottom of page
alpox
@alpox
Oct 26 2017 20:28
@kbaig Thats no real example for a programmer. Thats again a oneliner just showing some data
Kaz Baig
@kbaig
Oct 26 2017 20:28
Yeah maybe not the best example. There are longer examples in some neat examples sections
But part of the strength of WL is to be able to do a lot in few lines
alpox
@alpox
Oct 26 2017 20:29
I see a longer example - but its just a huge nested, on multiple lines spread one-liner
What about defining multiple functions, pre-bound data and their reuse?
Scripting files?
Kaz Baig
@kbaig
Oct 26 2017 20:29
Lots of tools for that
alpox
@alpox
Oct 26 2017 20:29
But no docs :D
Kaz Baig
@kbaig
Oct 26 2017 20:30
sure there are
alpox
@alpox
Oct 26 2017 20:30
D'uh then i'm too stupid to find them
Kaz Baig
@kbaig
Oct 26 2017 20:30
But it is supplemented by guides rather than docs for how to do things
alpox
@alpox
Oct 26 2017 20:30
I already looked some time earlier
I am just saying that this things throw off all normal programmers
Kaz Baig
@kbaig
Oct 26 2017 20:30
I agree
I struggle to learn WL all the time
But it's worth it
alpox
@alpox
Oct 26 2017 20:31
I ran away after 2 hours of searching for anything viable
Kaz Baig
@kbaig
Oct 26 2017 20:31
Welcome to ~25% of my job
alpox
@alpox
Oct 26 2017 20:31
Don't they want to do something against that?
Kaz Baig
@kbaig
Oct 26 2017 20:31
They're working on it
alpox
@alpox
Oct 26 2017 20:32
Thats good :-) i'd really like to give it a go if i wouldn't have to look for a normal tutorial for a normal programmer for 3 hours
Kaz Baig
@kbaig
Oct 26 2017 20:32
Well you can always @ me lol
alpox
@alpox
Oct 26 2017 20:32
@kbaig :thumbsup: :D
Well for now i have to go with matlab - no more space left for mathematica :D
My profs only talk to us through matlab slang and code snippets :D
Kaz Baig
@kbaig
Oct 26 2017 20:33
uninstall!
alpox
@alpox
Oct 26 2017 20:33
So i kinda need it ^^
I'll give it a try when it comes to special transformations for machine learning
But i'm not sure if i will need it. I now have an assignment to train a neural network to categorize sentences to swiss dialects
Kaz Baig
@kbaig
Oct 26 2017 20:35
That's a perfect use case
alpox
@alpox
Oct 26 2017 20:38
It will be done in python, but i guess i will do the calculations somewhere else :D like mathematica
Kaz Baig
@kbaig
Oct 26 2017 20:39
You can train neural nets in WL literally in 5 lines or less
alpox
@alpox
Oct 26 2017 20:39
@kbaig Sounds nice :D but i have to use python though
Kaz Baig
@kbaig
Oct 26 2017 20:39
o
alpox
@alpox
Oct 26 2017 20:40
They give us predefined code and we have to improve upon it
kiran JD
@kiranjd
Oct 26 2017 20:40
hello! Anybody familiar with handling MySQLdb with Python?
alpox
@alpox
Oct 26 2017 20:40
@kiranjd
MySQL - yes.
Python - kinda
MySQL + Python - nope thanks :D
CamperBot
@camperbot
Oct 26 2017 20:40
alpox sends brownie points to @kiranjd :sparkles: :thumbsup: :sparkles:
:cookie: 256 | @kiranjd |http://www.freecodecamp.com/kiranjd
kiran JD
@kiranjd
Oct 26 2017 20:41
@alpox n_o thanks
Kaz Baig
@kbaig
Oct 26 2017 21:02
@kiranjd depends on the question. I've used SQLite and Python
And MySQL separately
Ivan Ngundela
@ingundela
Oct 26 2017 21:31
hello everyone.. please help... there is something very anoing happe
Kaz Baig
@kbaig
Oct 26 2017 21:33
...dies
whoops
Ivan Ngundela
@ingundela
Oct 26 2017 21:34
hello everyone.. please help... there is something very anoing happening with a build a website using bootstrap.... I prefer to use the local files that I have downloaded right... from nothing it don't work.. but when I link to cdn links it bootstrap worked.. is there any reason for that to be happening? I most of the time when to download the files again a link....
Tom
@moT01
Oct 26 2017 21:37
@ingundela its not quite clear to me, what you're asking - but it sounds like you maybe improperly linked the bootstrap file?
Kaz Baig
@kbaig
Oct 26 2017 21:38
@moT01 He is saying that apparently linking to the CDN works but using local files does not
@ingundela probably best to share the cdn links, links to where you are getting the files, and code you are using to import boostrap in either case
Tom
@moT01
Oct 26 2017 21:38
that's kinda what i guessed
what's the folder/file structure like
and the link
is the html in the same folder as the bootstrap source?
Ivan Ngundela
@ingundela
Oct 26 2017 21:40
@moT01 yes it's in the same folder
Tom
@moT01
Oct 26 2017 21:42
no typos?
@ingundela probably best to share the cdn links, links to where you are getting the files, and code you are using to import boostrap in either case
Ivan Ngundela
@ingundela
Oct 26 2017 21:43
@moT01 @kbaig I do this every day and every time I start a new project... believe me, I can use the same bootstrap files I have downloded and used in a project right? so I don't have to download the files every time I start a new project... so those file some time just don't work...
Tom
@moT01
Oct 26 2017 21:46
i guess maybe
just gonna have to start over with no bootstrap
Ivan Ngundela
@ingundela
Oct 26 2017 21:50
@moT01 kkk.....Alway for help my friend and also share my learning experience.... maybe there is something I'm doing wrong....
Tom
@moT01
Oct 26 2017 21:53
yes, you can use the same source files for as many projects as you want - as far as I know
why not just use cdn?
korzo
@korzo
Oct 26 2017 22:02
@ingundela did you check your Dev console for errors?
I suspect there should be problem with relative URL for files.
Could you post your code/relevant part of the code?
thinsoldier
@thinsoldier
Oct 26 2017 23:31
If a project is just a few hundred long informational pages (business case study stuff) is there any real benefit to rebuilding it with Angular or React?
Kaz Baig
@kbaig
Oct 26 2017 23:46
@thinsoldier well still depends on what the functionality you want is
korzo
@korzo
Oct 26 2017 23:55
@thinsoldier No. I would use static page generator