Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 14 2020 22:38
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:37
    @bjorno43 banned @real-action
  • Feb 01 2020 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 2019 19:46
    @mstellaluna banned @zhonghuacx
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:09
    thecodingaviator commented #31179
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:07
    thecodingaviator commented #31182
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator commented #31190
  • Apr 01 2019 18:05
    thecodingaviator commented #31157
  • Apr 01 2019 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

Bjorn
@bjorno43
And the good thing about ISPConfig is that they have tutorials for most unix versions on how to install everything from scratch. Including the unix version
Gersho
@Gersho
wamp ? is there some windows without graphical interface ?
oh ISPconfig looks cool, bind9 is annoying me so maybe i'll try that
Bjorn
@bjorno43
Nah. Wamp is just a program that installes Apache, MySQL and PHP
Gersho
@Gersho
yeah i know
but i mean, lamp would be better since windows would hog ressources for a screen nobody is gonna look at
Bjorn
@bjorno43
True. I used to call a server that has a monitor, keyboard and mouse "fancy" xD
Gersho
@Gersho
btw about your laptop thing, i had a similar idea, but i was wondering, is that ok to have multiple projects on the same OS ?
Jeremy Cherer
@JavaLavaMT

https://codepen.io/JavaLavaMT/pen/baMEPO

I used the same method for .getJSON as i did for the weather project but this one isnt working and i cant understand what is different

Bjorn
@bjorno43
As long as they don't interfere with eachother, it should be fine. But keep in mind that multple projects running at the same time means more resources used. It can slow everything down
Gersho
@Gersho
@JavaLavaMT var title=main.query.pages.title; is wrong
Bjorn
@bjorno43
@JavaLavaMT $.getJSON="http://en <-- use HTTPS
Gersho
@Gersho
there's an array
{"batchcomplete":true,"query":{"pages":[{"pageid":15580374,"ns":0,"title":"Main Page","revisions":[{"contentformat":"text/x-wiki","contentmodel":"wikitext","content":"<!
so main.query.pages[0]title i guess ? lazy to check
Jeremy Cherer
@JavaLavaMT
@Gersho correct @bjorno43 i have tried that
@Gersho if you dont mind how did you see the array
Gersho
@Gersho
there's a [
Bjorn
@bjorno43
I'm not saying it solves your issue. I'm saying that you have to do it. Codepen won't work if you use http
Jeremy Cherer
@JavaLavaMT
@Gersho I missed that, thank you!
CamperBot
@camperbot
javalavamt sends brownie points to @gersho :sparkles: :thumbsup: :sparkles:
:cookie: 574 | @gersho |http://www.freecodecamp.org/gersho
slri
@slri
image.png
looking at the things that were removed from php7 lmao
lynnchuh
@zhuzhulyn
0
Eunice Park
@eunicode

I'm having trouble with a problem bc I'm not sure how the arguments get passed

Problem: Create a function addByX that returns a function that will add an input by x.

For example I should get these results:

var addByTwo = addByX(2);
addByTwo(1); //should return 3 (1 + 2)

var addByThree = addByX(3);
addByThree(1); //should return 4 (1 + 3)

var addByFour = addByX(4);
addByFour(1); //should return 5 (1 + 4)

I've tried

function addByX(x) {
    return function(input) {
    let total = input + x;
    return total;
  }
}

var addByTwo = addByX(2);
addByTwo(1);  // Returns 3

But I'm not entirely sure why this works, and when I add console logs some unexpected things get printed

Bjorn
@bjorno43
In your example, input is undefined. So you'll have to start like this: function addByX(x, input){ ... }
Aditya
@ezioda004
@eunipa It works because of closure
Eunice Park
@eunicode
@bjorno43 thank you, but I don't think input is undefined?
function addByX(x) {
  return function(input) {
    console.log(`input: ${input}`); // Prints 1
    let total = input + x;
    return total;
  }
}

var addByTwo = addByX(2); 
addByTwo(1);
CamperBot
@camperbot
eunipa sends brownie points to @bjorno43 :sparkles: :thumbsup: :sparkles:
:cookie: 184 | @bjorno43 |http://www.freecodecamp.org/bjorno43
Eunice Park
@eunicode
@ezioda004 thank you, that's a topic I'm still hazy on
CamperBot
@camperbot
eunipa sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
:cookie: 375 | @ezioda004 |http://www.freecodecamp.org/ezioda004
Aditya
@ezioda004
You can read about it here .They have an adder example there if you scroll down a little bit.
Bjorn
@bjorno43
@eunipa Seems odd to me. Unless you've defined input somewhere else..
Eunice Park
@eunicode
@ezioda004 Thanks for pointing me to the adder example
CamperBot
@camperbot
eunipa sends brownie points to @ezioda004 :sparkles: :thumbsup: :sparkles:
api offline
Eunice Park
@eunicode
@bjorno43 I haven't, just some how, mysteriously, the argument passed to addByTwo becomes input in the anonymous function
Alexander Jarman
@HeinousTugboat
Because addByX returns a new function, and that new function's only argument is input.
Gersho
@Gersho
could you use console.log(arguments) at the start of the AddbyX function ? we could see what happens to the 1
Eunice Park
@eunicode
@HeinousTugboat Ahhh, thank you. I guess I'm not used to the idea of a function returning a function
CamperBot
@camperbot
eunipa sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @heinoustugboat |http://www.freecodecamp.org/heinoustugboat
Alexander Jarman
@HeinousTugboat
@eunipa NP! Yeah, it's definitely weird. That's a big part of FP, though. Functions being first class and all that jazz.
Aditya
@ezioda004
@eunipa Basically when you do var addByTwo = addByX(2);, addByTwo becomes the reference to the inner function
Alexander Jarman
@HeinousTugboat
With a closure where 'x' = 2. ;-)
Bjorn
@bjorno43
@HeinousTugboat Ah, now I see how it works. Thanks for the explanation :)
CamperBot
@camperbot
bjorno43 sends brownie points to @heinoustugboat :sparkles: :thumbsup: :sparkles: