These are chat archives for FreeCodeCamp/Help

16th
Oct 2017
Yaroslav
@YariPL
Oct 16 2017 01:20
what is better - to learn or to get a job and work/learn there? I mean not from the money perspective but where can be more progress at the same time?
Long Nguyen
@longnt80
Oct 16 2017 01:41
@YariPL IMO, I think learning while working is better
even when learning, it's better to learn by doing anyway
Helloxiaoya
@Helloxiaoya
Oct 16 2017 02:34
hello
does someone here
and i meet some problem how could i get this solution
inputherf
@inputherf
Oct 16 2017 02:36
hello world
Ken Haduch
@khaduch
Oct 16 2017 02:38
@Helloxiaoya - you should post your question here, and code that you've written and ask questions about it. If you have a CodePen pen for it, then post the URL with your questions.
@inputherf - hello - new at freeCodeCamp? If so, welcome!
Helloxiaoya
@Helloxiaoya
Oct 16 2017 02:40
ok wait

CSS has a property called width that controls an element's width. Just like with fonts, we'll use px (pixels) to specify the image's width.

For example, if we wanted to create a CSS class called larger-image that gave HTML elements a width of 500 pixels, we'd use:

<style>
.larger-image {
width: 500px;
}
</style>
Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide.

the problem is Q17, i don't know how to change image size
@khaduch sorry I am a new learner,so the question may very easy, look forward your responce
Ken Haduch
@khaduch
Oct 16 2017 02:43
@Helloxiaoya - the code that you posted shows an HTML <style> section that has a class definition for the class .larger-image. You have to create the same type of entry, within the same set of <style> tags with a class .smaller-image, and just replace the CSS width: property's value with 100px; Then you have to add the class to an <img in your HTML <body> section with the attibute class="smaller-image"
Ken Haduch
@khaduch
Oct 16 2017 02:54

@Helloxiaoya - if that explanation was a little too abstract, it is helpful if you can post your code, it makes it easier to provide direction. Use the Markdown code posting format, which is to put a line of backquotes ``` on a line by itself, then your code, then a final line with three ``` all by itself. In other words, you post this:
```

<style>
.larger-image {
width: 500px;
}
</style>
```
And it comes out like this:

<style>
.larger-image {
    width: 500px;
}
</style>
Kyle Holm
@thekholm80
Oct 16 2017 02:55
@heroiczero @DarrenfJ @Manish-Giri ty
CamperBot
@camperbot
Oct 16 2017 02:55
thekholm80 sends brownie points to @heroiczero and @darrenfj and @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 6656 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 1885 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 2138 | @darrenfj |http://www.freecodecamp.com/darrenfj
Ken Haduch
@khaduch
Oct 16 2017 02:56
@Helloxiaoya - you can find the Markdown code posting details here: https://forum.freecodecamp.com/t/markdown-code-formatting/18391
Darren
@DarrenfJ
Oct 16 2017 03:00
evening fCC
my usual kudos to the regulars
Ken Haduch
@khaduch
Oct 16 2017 03:01
@DarrenfJ - good evening, and thanks!
CamperBot
@camperbot
Oct 16 2017 03:01
khaduch sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2139 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Oct 16 2017 03:01
thanks @heroiczero @khaduch @Manish-Giri @GitHub-Henry @sjames1958gm @daddycardona @thekholm80
CamperBot
@camperbot
Oct 16 2017 03:02
darrenfj sends brownie points to @heroiczero and @khaduch and @manish-giri and @github-henry and @sjames1958gm and @daddycardona and @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1886 | @heroiczero |http://www.freecodecamp.com/heroiczero
:cookie: 392 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 6657 | @manish-giri |http://www.freecodecamp.com/manish-giri
:cookie: 392 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 1511 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:star2: 3370 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 8559 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
inputherf
@inputherf
Oct 16 2017 03:04
@khaduch thanks, I am a new learner
heroiczero
@heroiczero
Oct 16 2017 04:01
@DarrenfJ @khaduch @Manish-Giri @GitHub-Henry @sjames1958gm @daddycardona @thekholm80 @alpox TY for helping people keep up the good work :)
CamperBot
@camperbot
Oct 16 2017 04:01
heroiczero sends brownie points to @darrenfj and @khaduch and @manish-giri and @github-henry and @sjames1958gm and @daddycardona and @thekholm80 and @alpox :sparkles: :thumbsup: :sparkles:
:cookie: 393 | @github-henry |http://www.freecodecamp.com/github-henry
:star2: 2140 | @darrenfj |http://www.freecodecamp.com/darrenfj
:star2: 3371 | @khaduch |http://www.freecodecamp.com/khaduch
:star2: 6658 | @manish-giri |http://www.freecodecamp.com/manish-giri
:star2: 1512 | @thekholm80 |http://www.freecodecamp.com/thekholm80
:cookie: 393 | @daddycardona |http://www.freecodecamp.com/daddycardona
:star2: 8560 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 1362 | @alpox |http://www.freecodecamp.com/alpox
Henry
@GitHub-Henry
Oct 16 2017 05:25
@heroiczero hello & ty for the brownies
CamperBot
@camperbot
Oct 16 2017 05:25
github-henry sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1889 | @heroiczero |http://www.freecodecamp.com/heroiczero
Henry
@GitHub-Henry
Oct 16 2017 05:47
@DarrenfJ hello and ty for the brownies
CamperBot
@camperbot
Oct 16 2017 05:47
github-henry sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2141 | @darrenfj |http://www.freecodecamp.com/darrenfj
Deepak Kumar
@deepakdk619
Oct 16 2017 06:05
hellooo
Alex
@alexandrupintilei
Oct 16 2017 11:33
Hello!Can someone tell me how to install matlab on ubuntu?thx
rscales02
@rscales02
Oct 16 2017 12:02
If I console.log something right before I return it, why would the log print an answer and the return be undefined?
Momozor
@momozor
Oct 16 2017 12:32
@rscales02 Would you mind to show the code example too?
99zqw
@99zqw
Oct 16 2017 12:44

<style type="text/css">

ww{

color: blue;}

</style>
<h2 id = "ww">我家的猫咪</h2>

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

大佬,这个哪有问题
Stephen James
@sjames1958gm
Oct 16 2017 13:09
@rscales02 if (argArray.length == 1){ if this is not true you don't return anything.
rscales02
@rscales02
Oct 16 2017 13:11
if that is not true, I run through the program again and eventually splice out another array
allowing for symmetric differences of many arrays
with else {sym(argArray)}
Stephen James
@sjames1958gm
Oct 16 2017 13:43
@rscales02 Yes and when that returns you go to the end of the function and return nothing.
  if (argArray.length == 1){
  console.log(argArray[0]);
    return argArray[0];
  } else {

    sym(argArray);
  }

// There is no return here. 

}
Fazil
@faizilfanie
Oct 16 2017 14:08

Hey guys not sure where I'm going wrong here: function sequentialSizes(val) {
var answer = "";
// Only change code below this line

case 1:
case 2:
case 3:
result = "Low";
break;
case 4:
case 5:
case 6:
result = "Mid";
break;
case 7:
case 8:
case 9:
result = "High";
break;

// Only change code above this line
return answer;
}

// Change this value to test
sequentialSizes(1);

rscales02
@rscales02
Oct 16 2017 14:16
@sjames1958gm awesome, thanks!
CamperBot
@camperbot
Oct 16 2017 14:16
rscales02 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8562 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
rscales02
@rscales02
Oct 16 2017 14:24
@faizilfanie which one problem are you working on?
also using ` will help format your code.
if you put ``` on its own line before and after your code it will format the code into a code box and be much more readable
rscales02
@rscales02
Oct 16 2017 14:30
@faizilfanie I think you need to recheck your syntax on this switch case... switch expressions
Ken Haduch
@khaduch
Oct 16 2017 15:59
@DarrenfJ & @heroiczero - good day, and thanks for keeping the room going!
CamperBot
@camperbot
Oct 16 2017 15:59
khaduch sends brownie points to @darrenfj and @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1891 | @heroiczero |http://www.freecodecamp.com/heroiczero
:star2: 2142 | @darrenfj |http://www.freecodecamp.com/darrenfj
Darren
@DarrenfJ
Oct 16 2017 16:26
and thanks back :D
thanks @khaduch
CamperBot
@camperbot
Oct 16 2017 16:26
darrenfj sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3372 | @khaduch |http://www.freecodecamp.com/khaduch
Darren
@DarrenfJ
Oct 16 2017 16:27
but also thanks @rscales02 and @sjames1958gm for keeping the room active and helping out. as usual yer rawking it
CamperBot
@camperbot
Oct 16 2017 16:27
darrenfj sends brownie points to @rscales02 and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:cookie: 304 | @rscales02 |http://www.freecodecamp.com/rscales02
:star2: 8563 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Oct 16 2017 16:27
@DarrenfJ :wave:
Darren
@DarrenfJ
Oct 16 2017 16:31
:D
Ivan Ngundela
@ingundela
Oct 16 2017 17:54
@ingundela
Hello everyone... I'm almost done completing my portfolio website, when I click services from the nav menu it scroll down and an anoing blue color coming and the end of the service container and I can find a way to remove it.. Please help, the link for the website is https://ingundela.github.io/myportfolio/
also please give me some input to improve my Portfolio Website before I move forward... for now I have only added 2 project.....
Thank you in advance
CamperBot
@camperbot
Oct 16 2017 17:54
sorry ingundela, you can't send brownie points to yourself! :sparkles: :sparkles:
Mike
@MikeJSchorah
Oct 16 2017 19:06
What's the best way to increase website speed?
Pethaf
@Pethaf
Oct 16 2017 19:28
Use compression on your images.
BrewCoffeeSplash
@BrewCoffeeSplash
Oct 16 2017 19:59
@MikeJSchorah use a client-side imagemap
Mike
@MikeJSchorah
Oct 16 2017 20:00
@Pethaf I've done the following:
-Caching and database optimization
-CDN Set up
-Image Optimization
...or at least I hired someone to do the above :worried: It worked somewhat.
@BrewCoffeeSplash What is a client-side imagemap?
Adel
@AdelMahjoub
Oct 16 2017 20:18
@MikeJSchorah do you have access to the server code ?
@MikeJSchorah or only optimization for the static content
@MikeJSchorah for the client, build it with webpack, with html and css minification, and UglifyJs plugins, image-loader for a dramatic cut of image sizes, async css load https://github.com/filamentgroup/loadCSS
@MikeJSchorah set the cache control header to infinite, and use a manifest plugin with webpack; so it only request new files when the hash change https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
Mike
@MikeJSchorah
Oct 16 2017 20:23
@AdelMahjoub Do you think it might be because I have a Reseller account and not a VPS or Dedicated Server? I just did a site on a Dedicated server and it is fast and hell. And it's the only site that I've done so far that is fast. Not my account, though. And I don't have enough clients for a $200/month bill, haha
Adel
@AdelMahjoub
Oct 16 2017 20:25
@MikeJSchorah what kind of server they provided , apache or nginx ?
@MikeJSchorah and using an ssd will help alot that for sure
Yeah, it's shared.
It's the $19.95/month plan, haha
Adel
@AdelMahjoub
Oct 16 2017 20:31
@MikeJSchorah they don't mention if they are using ssd or not, and you can't setup apache according to what I saw in the demo
Mike
@MikeJSchorah
Oct 16 2017 20:34
@AdelMahjoub I mean. My site was pretty slow before I bought this:
https://www.fiverr.com/wordpresscholar/speed-up-wordpress-site-in-24-hours-or-less?funnel=33107f43-3707-452d-ac68-7173cba60984
It went from about 10 second load time to about a 5 second load time. But, I was thinking 100% that the issue is being on a shared server. Just had my suspicions.
Adel
@AdelMahjoub
Oct 16 2017 20:34
@MikeJSchorah try a digital ocean droplet, for the same price you get a v2cpu and a 40gb ssd, but you need to setup all the rest by yourself
Mike
@MikeJSchorah
Oct 16 2017 20:35
@AdelMahjoub Were you the one that mentioned digitalocean to me before? How much are their servers?
Adel
@AdelMahjoub
Oct 16 2017 20:35
@MikeJSchorah it was not me, but I tried it before
@MikeJSchorah the only 'problem' is you need to setup everything
Mike
@MikeJSchorah
Oct 16 2017 20:36
@AdelMahjoub Thanks. I'm going to take a look at digitalocean. Guess I'll just do $500 websites in the meantime. Haha
CamperBot
@camperbot
Oct 16 2017 20:36
mikejschorah sends brownie points to @adelmahjoub :sparkles: :thumbsup: :sparkles:
:cookie: 587 | @adelmahjoub |http://www.freecodecamp.com/adelmahjoub
Adel
@AdelMahjoub
Oct 16 2017 20:38
@MikeJSchorah where is the site you want to optimize, just to see how fast it loads
Adel
@AdelMahjoub
Oct 16 2017 20:47
@MikeJSchorah can you do all the suggested optimization without breaking anything ?
@MikeJSchorah idk if moving the js files at the end of the body, and async loading css will break that wordpress theme
Mike
@MikeJSchorah
Oct 16 2017 20:49
@AdelMahjoub What would I break? To me, the main issue seems like it's just time consuming.
I thought the same with regarding the files. Where do you even find the JS file in WordPress?
Adel
@AdelMahjoub
Oct 16 2017 20:52
@MikeJSchorah wp_content I think, try to add a function that async load css, and put all those js file request to the bottom of the end of the body, so at least it will show some content then request the ressources
@MikeJSchorah some css files are not minified too
Mike
@MikeJSchorah
Oct 16 2017 20:54
So being on a shared server is definitely not the issue?
The reason why I ask is because I built this site the exact same way and it is super fast: http://www.gotoadoc.com/
But, it is on a dedicated server (not my account). It's just unbelievable, the difference in speed and I did not optimize images or anything, bare bones as far as trying to increase the speed
Adel
@AdelMahjoub
Oct 16 2017 21:01
@MikeJSchorah better hardware is always more performant
Mike
@MikeJSchorah
Oct 16 2017 21:02
So my site went from 10 seconds load time to 5 seconds load time. If I upgrade to a VPS or dedicated server, that should get me to 2 seconds load time, right?
Adel
@AdelMahjoub
Oct 16 2017 21:04
@MikeJSchorah if it is the same bandwidth it should load faster
@MikeJSchorah but check with the support , I think they just use nginx for load balancing and ssl termination, but you still need to setup apache
@MikeJSchorah if that's the case try to check what apache modules are enabled
@MikeJSchorah with the optimization suggested by pagespeed you should be ok
Mike
@MikeJSchorah
Oct 16 2017 21:10
@AdelMahjoub What did you say could possibly break?
Adel
@AdelMahjoub
Oct 16 2017 21:12
@MikeJSchorah usually with the same js file loading order it should not break, but idk if there are some nested scripts inside the html in other pages that needs the top files
@MikeJSchorah the browser stop 'building the dom' for each request, and you are loosing some time for the top most requests
@MikeJSchorah you need to try modify that template locally and see if it breaks
Mike
@MikeJSchorah
Oct 16 2017 21:15
Sounds like a lot of work
Adel
@AdelMahjoub
Oct 16 2017 21:16
@MikeJSchorah you are safe when trying it locally at least
@MikeJSchorah and meanwhile setup a quick random webpack config with https://github.com/tcoopman/image-webpack-loader just to compress them to a maximum
@MikeJSchorah then use the images from the build, not the orginal images, check if loosing 5% of the quality is ok
@MikeJSchorah if 5% looks good, try more
@MikeJSchorah and if it help minify the html files too
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:27
    Poll.findOneAndUpdate({_id:req.params._id, "options.title":req.body.select},{$inc:{"options.votes":1}},{new:true}).then((data)=>{
        if(data){
            res.render("poll/"+data._id,{polldata: poll.toObject()});
        }else{
            res.redirect("/");
        }
    }).catch((e)=>{
        console.log(e);
    });
image.png
this is the standard document
missing anything?
updated the typo on the req.params.id
to*
still I think my mongoose query is not correct
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:34
anyone?
Mayur Wadhwani
@mayurdw
Oct 16 2017 21:37
@tiagocorreiaalmeida what are you doing
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:39
trying to find adoc by id and array.propprety value = to something
and then incanother value
increment
Adel
@AdelMahjoub
Oct 16 2017 21:42
@tiagocorreiaalmeida why new: true
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:42
to retuen the updated value for what I saw in the docs
Adel
@AdelMahjoub
Oct 16 2017 21:43
@tiagocorreiaalmeida only for new documents
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:43
just runned the query on robomongo doesnt work sadly
oh ok didnt knew
Adel
@AdelMahjoub
Oct 16 2017 21:43
@tiagocorreiaalmeida in your case the poll should exists
@tiagocorreiaalmeida if not you respond with an appropriate error
@tiagocorreiaalmeida you should use the options id, why using titles
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:44
cause an user can go th the html set some other option that doenst exist
and hit submit button
I think about those crazy things
image.png
Adel
@AdelMahjoub
Oct 16 2017 21:45
@tiagocorreiaalmeida yes and it could modify the title too
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:45
and yeah
Adel
@AdelMahjoub
Oct 16 2017 21:45
@tiagocorreiaalmeida or the pollid
@tiagocorreiaalmeida you need to make appropriate checks for that
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:45
but then would only change the db for an existent
data
strange why th equery doesnt return nothign him
Adel
@AdelMahjoub
Oct 16 2017 21:46
sanitize req.params.id
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:47
db.getCollection('polls').find({_id:"59e32ecdf9fecc2cb0bb233a", "options.title":"great"})
running onrobomongo
and returns nothing
Adel
@AdelMahjoub
Oct 16 2017 21:52
@tiagocorreiaalmeida ObjectId
db.getCollection('polls').find({_id: ObjectId("59e32ecdf9fecc2cb0bb233a")})
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:53
image.png
Adel
@AdelMahjoub
Oct 16 2017 21:53
@AdelMahjoub var ObjectID = require('mongodb').ObjectID,
@tiagocorreiaalmeida check the records again
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:54
still exists doenst return nothing
Adel
@AdelMahjoub
Oct 16 2017 21:54
@tiagocorreiaalmeida I'm trying this in robomongo too and it works db.getCollection('polls').find({_id: ObjectId("594992b768cdde0010a79dbd")}
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:55
im doing this on robomongo before evne moving into programing
returns 0 what a strange thing
Adel
@AdelMahjoub
Oct 16 2017 21:55
@tiagocorreiaalmeida check the id maybe a typo
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:56
yeah yo uwere right
Adel
@AdelMahjoub
Oct 16 2017 21:56
@tiagocorreiaalmeida from the image you have no _id that ends with a
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 21:56
yeah
was picking another id mate
sorry
took more than eeded
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:07
image.png
almost there still some issue in the inc
Poll.findOne({_id, "options.title":req.body.select},{$inc:{"options.votes":1}})
can you spot some mistake?
the id is a variable equal to the _id on the qury so I dont need to set the proprety value equal to the same thing
es6
you probably know it just no need to paste the entire code
Adel
@AdelMahjoub
Oct 16 2017 22:13
@tiagocorreiaalmeida try with .update not .findOne
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:14
another typo changed to findoneandupdate
im using mongoose
image.png
Adel
@AdelMahjoub
Oct 16 2017 22:19
@tiagocorreiaalmeida check what that query returns first
@tiagocorreiaalmeida and try update, not findOneAndUpdate, you expect it to be unique
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:21
the poll is unique so as hte voting option hum
Adel
@AdelMahjoub
Oct 16 2017 22:21
@tiagocorreiaalmeida what this query returnsPoll.findOne({_id, "options.title":req.body.select})
@tiagocorreiaalmeida try with .update not .findOneAndUpdate
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:22
the findone returns
image.png
the correct data
Adel
@AdelMahjoub
Oct 16 2017 22:23
@tiagocorreiaalmeida now try $inc with update
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:24
same issue hum
image.png
Adel
@AdelMahjoub
Oct 16 2017 22:27
@tiagocorreiaalmeida in worst case you can query that document and increment with javascript, then use .save
@tiagocorreiaalmeida is that the code throwing the error ? post the full handler
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:28
yeah im just feeling like this is strange, im not sure maybe im calling $inc incorrectly
router.post("/:id",(req,res)=>{
    let _id = ObjectID(req.params.id);
    Poll.update({_id, "options.title":req.body.select},{$inc:{"options.votes":1}}).then((data)=>{
        console.log(data);
        if(data){
            res.redirect("poll/"+data._id);
        }else{
            res.redirect("/");
        }
    }).catch((e)=>{
        console.log(e);
    });
});
its throwing the catch error
Adel
@AdelMahjoub
Oct 16 2017 22:29
@tiagocorreiaalmeida if it is mongoose, don't use ObjectId
@tiagocorreiaalmeida try without ObjectId
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:30
I installed mongodb
const {ObjectID} = require("mongodb");
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:32
trying that right now :D
lets see ghow it goes
URRAH, worked thanks @AdelMahjoub
CamperBot
@camperbot
Oct 16 2017 22:33
tiagocorreiaalmeida sends brownie points to @adelmahjoub :sparkles: :thumbsup: :sparkles:
:cookie: 588 | @adelmahjoub |http://www.freecodecamp.com/adelmahjoub
Adel
@AdelMahjoub
Oct 16 2017 22:34
@tiagocorreiaalmeida I mean that means we both need to review mongodb :smile:
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:34
yeah im starting a course they have tomorrow
it takes 7weeks
since im new to backend seems a worth thing
Adel
@AdelMahjoub
Oct 16 2017 22:35
@tiagocorreiaalmeida have not used it for a while, mostly using mySQl
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:37
I used to work with mysql, on my comppany we got an erp that runs with connection to sql server so still got some of the things fresh in the head its kinda confusing comming from sql and get into mongo
Adel
@AdelMahjoub
Oct 16 2017 22:38
it make working with relational data harder
sql queries are 'superpower'
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 22:40
yeah, and so easy to link data where's innerjoins, here its still confusing for me maybe on some projects that requires alot of relational data the idea is just go to some sql and not mongo
Adel
@AdelMahjoub
Oct 16 2017 22:40
check this out, it will be possible to use it as a document store too https://dev.mysql.com/doc/refman/5.7/en/document-store.html
Joshua Arnett
@josha5
Oct 16 2017 22:50
Could anyone help me with creating AI for tic tac toe
I've been stuck for a while can't figure out how to even implement it..
Stephen James
@sjames1958gm
Oct 16 2017 22:58
@josha5 I did not want an unbeatable AI so I implemented these rules.
  1. Take the center square if not already taken
  2. Win if possible
  3. Block if needed
    4 Random play
Tiago Correia
@tiagocorreiaalmeida
Oct 16 2017 23:01
@AdelMahjoub just anoter question
im using push everytime some query runs
instead of pushing into the array
is pushing to the array then into the first value of the array
oh wait nm this is correct ;)
will give a look into the link
time for some rest see you all tomorrow have a rest of a good day
Joshua Arnett
@josha5
Oct 16 2017 23:07
@sjames1958gm I having trouble getting my AI to take a turn
Stephen James
@sjames1958gm
Oct 16 2017 23:08
@josha5 After your human plays, then you call your AI function for the computer's turn.
Stephen James
@sjames1958gm
Oct 16 2017 23:08
You can call from the click handler for the player turn
In the else of this if if(checkPlayerWon("O")) {
Start with a random Ai, then improve as desired
Joshua Arnett
@josha5
Oct 16 2017 23:15
Oh ok
Think i'm gonna have to take a break I'm not wrapping my head around anything at this point