These are chat archives for FreeCodeCamp/Help

17th
Nov 2017
Long Nguyen
@longnt80
Nov 17 2017 01:14
morning everyone! :sun_with_face:
Henry
@GitHub-Henry
Nov 17 2017 01:18
hello :sunrise:
Ken Haduch
@khaduch
Nov 17 2017 02:34
@longnt80 - good morning to you (good evening / night to me... :) )
Claudio Restifo
@Marmiz
Nov 17 2017 03:37
@longnt80 started the new job yet?
Nahuel Ovejero
@NahuelOvejero
Nov 17 2017 04:59
sup people! does someone know how to use mysql triggers?
Albert Cardona II
@daddycardona
Nov 17 2017 05:13
@GitHub-Henry thanks for that github site I will look into it ;)
CamperBot
@camperbot
Nov 17 2017 05:13
daddycardona sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 486 | @github-henry |http://www.freecodecamp.org/github-henry
Albert Cardona II
@daddycardona
Nov 17 2017 05:13
Hello everyone :)
Claudio Restifo
@Marmiz
Nov 17 2017 05:14

@NahuelOvejero geez don't use mysql in ages so don't quote me on that too much,
but as for what I remember you define a trigger associated to a CUD action on a table.

The example I remember with is that imagine I have a table of expenses: I can set a trigger that anytime a new INSERT is added trigger a function that sum all the entries in that collection and give a result.

Like with Excel ^^

But better luck on the official docs

Nahuel Ovejero
@NahuelOvejero
Nov 17 2017 05:15
@Marmiz Do you know how the hell I can store in a variable the data from a row? even the official docs fails to me. I've been working with triggers in oracle, but this is literally driving me insane
@daddycardona hello!
Albert Cardona II
@daddycardona
Nov 17 2017 05:17
if you having a hard time with this look into stack overflow they probably already have an answer lol
@NahuelOvejero
Claudio Restifo
@Marmiz
Nov 17 2017 05:18

@NahuelOvejero not sure ( as said I don't really use mysql anymore) but I remember using @SOMETHING to access a value.
Something like: @balance = @balance + NEW value or stuff like that.

But again not sure at all.

Nahuel Ovejero
@NahuelOvejero
Nov 17 2017 05:18
Their answer didn't work for me, even multiples ones I tried
Albert Cardona II
@daddycardona
Nov 17 2017 05:19
did you post your question or just read their answers?
Nahuel Ovejero
@NahuelOvejero
Nov 17 2017 05:19
yeah, I read at docs that @var is used to create a new var, but it's giving me error still... well, going to investigate a bit more
@daddycardona @Marmiz ty
CamperBot
@camperbot
Nov 17 2017 05:19
nahuelovejero sends brownie points to @daddycardona and @marmiz :sparkles: :thumbsup: :sparkles:
:cookie: 487 | @daddycardona |http://www.freecodecamp.org/daddycardona
:star2: 1100 | @marmiz |http://www.freecodecamp.org/marmiz
Albert Cardona II
@daddycardona
Nov 17 2017 05:20
just came by to say hi have a good morning or a good night later ;)
Ken Haduch
@khaduch
Nov 17 2017 05:44
@daddycardona - not sure if you really signed off... just wanted to say hello back! :)
LukaszSamulnik
@LukaszSamulnik
Nov 17 2017 07:16
Hi guys, does anyone can help me with this one - cannot log in with github, since this was my only logging method seems like I dont have acces to FCC for quite a long time, anyone of you experienced it before and know how to handle this?
Yaroslav
@YariPL
Nov 17 2017 10:47
question to freelancers. how much would you take for creating/editing(old one) csv generator on php5 with symfony 1.4?
Stephen James
@sjames1958gm
Nov 17 2017 11:30
@inputherf You need to return the value of the property name stored in val not the object itself
Dušan Todorović
@krckyboy
Nov 17 2017 12:05
Is there a connection between arrays and database? I'm just wondering if I'm ever going to use arrays to store some info and then send it to a database, and if it's not a common practice, is it possible? Thank you!
Stephen James
@sjames1958gm
Nov 17 2017 12:12
@krckyboy If you use a database like Mongo then there is certainly a connection as you store 'json' documents that can contain arrays.
If you are using using something like mysql and you want to update several records you might use an array and have a function that
converts an array to a set of SQL statements
Dušan Todorović
@krckyboy
Nov 17 2017 12:17
@sjames1958gm Thank you very much! :)
CamperBot
@camperbot
Nov 17 2017 12:17
krckyboy sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8692 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Nov 17 2017 12:18
@krckyboy :+1:
Long Nguyen
@longnt80
Nov 17 2017 13:05
@Marmiz yeah, getting my ass kicked in the first week
I thought I was going to do React mostly but they gave me a Vue project
so doing and learning at the same time now
Marc
@MWBauer
Nov 17 2017 13:12
Morning all
Care to help me sort out the mess I've made?

function largestOfFour(arr) {
 var biggest = [];
  for (var i = 0; i < arr.length; i++) {
    var big = 0;
    for (var j = 0; j < arr[i].length; j++) {
      if (arr[i][j] > big) {
          big = arr[i][j];
      }
    biggest.push(big);
      }
    } return biggest;
Marc
@MWBauer
Nov 17 2017 13:19
Does Let and Var do anything different?
nvm
Marc
@MWBauer
Nov 17 2017 13:34
Hello?
I have coffee
:coffee:
Stephen James
@sjames1958gm
Nov 17 2017 13:36
@MWBauer That is the most straight forward way to do it.
There are other ways, such as using arr.map() for the outer loop, and using Math.max or sorting the array for the inner loop
Marc
@MWBauer
Nov 17 2017 13:37
Morning, sir
My issue was I forgot to write down my comparison line. I put that in and it worked fine.
Apparently, when I was copying my code I was in a trixy kinda' mood. I was dropping lines and not making some characters clear. But it's forced me to evaluate and logically walk thru the code to figure it out again.
do you see anything wrong with this?
```
function truncateString(str, num) {
if (num == str.length) {
return str;
} else if (num >= 4) {
var nStr = str.slice(0, num - 3);
return nStr += "...";
} else if (num < 4) {
var neStr = str.slice(0, num);
return neStr += "...";
}
}
Stephen James
@sjames1958gm
Nov 17 2017 13:39
var output = [];
for (var i = 0; i < arr.length; i++) {
   // do something with arr and push onto output
}
return output
this is a pattern that .map handles very well
return arr.map(function(elem) { // do something with elem and return a value });
@MWBauer if num > str.length then it fails
Marc
@MWBauer
Nov 17 2017 13:40
arr.map(push(big))
I don't have that line
Stephen James
@sjames1958gm
Nov 17 2017 13:41
.map handles the push for you
Marc
@MWBauer
Nov 17 2017 13:41
Ok. HOld on.
One topic at a time.
I don't have a num > str.length line
I have it ==
Stephen James
@sjames1958gm
Nov 17 2017 13:42
True, but if num >= str.length then return str
your == can be changed to >= to include more cases
Marc
@MWBauer
Nov 17 2017 13:43
What a beautiful mind you have.
thank you.
thanks @sjames1958gm
CamperBot
@camperbot
Nov 17 2017 13:43
mwbauer sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8694 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Marc
@MWBauer
Nov 17 2017 13:43
lol Ok...now...map
map does the pushing for me. I don't need to tell it to push?
Stephen James
@sjames1958gm
Nov 17 2017 13:44
@MWBauer The value you return from the callback function is "pushed" onto the output array
Marc
@MWBauer
Nov 17 2017 13:46
ok. so the proper setup for my function was?
arr.map(big)?
or biggest?
big was just a placeholder
Stephen James
@sjames1958gm
Nov 17 2017 14:04
Here using map and a for loop and Math.max, rather than the if statement
return arr.map(function (subarray) {
  var big = 0;
  for (var j = 0; j < subarray.length; j++) {
      big = Math.max(big, subarray[j]);
   }
   return big;
});
Marc
@MWBauer
Nov 17 2017 14:07
Ok. Math.max has what function?
compares the big and subarray?
Marc
@MWBauer
Nov 17 2017 14:28
Just looked up Math.max. It makes sense. The (big, subarray[j]) are the 2 arguments that it compares and then pushes the largest (max) to the big array
I'm out for now. Wife and I are going to pull trees out of the front rock wall
Ya'll have a great day.
Darren
@DarrenfJ
Nov 17 2017 15:59
morning fCC
Kaz Baig
@kbaig
Nov 17 2017 16:00
@DarrenfJ :wave:
Darren
@DarrenfJ
Nov 17 2017 16:00
@kbaig hey man, how goes the code? :D
Kaz Baig
@kbaig
Nov 17 2017 16:01
@DarrenfJ man I haven't made any progress on fCC in 2 weeks, feeling too tired from my new (first) job ramping up
I need to learn to hustle better
Darren
@DarrenfJ
Nov 17 2017 16:01
congrats on the new job!
Kaz Baig
@kbaig
Nov 17 2017 16:02
It's been 3 and a half months but thanks haha
Darren
@DarrenfJ
Nov 17 2017 16:02
my goal was to do a challenge or exercise a day.. just one
eventually, you get through them all
Kaz Baig
@kbaig
Nov 17 2017 16:03
I'm not in a huge hurry, not trying to get a dev job anyway :D I do need to learn the Wordpress API to make a portfolio site for a friend tho
Darren
@DarrenfJ
Nov 17 2017 16:03
it's like 5 minutes to whip through one (and usually once you get into it, you do 2 or 30.. but only book like 15 minutes to it, so you don't get stressed and have down time
Kaz Baig
@kbaig
Nov 17 2017 16:03
Promised to do that in the summer...whoops
Darren
@DarrenfJ
Nov 17 2017 16:03
I'd say just start building it and looking up what you need as you go
ok, off for a ridiculous number of meetings today
Kaz Baig
@kbaig
Nov 17 2017 16:04
Yeah but video games are so much easier to do :D
Darren
@DarrenfJ
Nov 17 2017 16:04
good luck
Kaz Baig
@kbaig
Nov 17 2017 16:04
Have fun!
Darren
@DarrenfJ
Nov 17 2017 16:04
(i hear yah) :D
Nazar
@IsaakNazar
Nov 17 2017 16:22
@DarrenfJ hi :)
Nahuel Ovejero
@NahuelOvejero
Nov 17 2017 17:20
:wave: everyone
Darren
@DarrenfJ
Nov 17 2017 18:07
hey guys :D :wave: 's back atcha!
Samuel Culpepper
@qzdl
Nov 17 2017 18:26
anyone online?
Nahuel Ovejero
@NahuelOvejero
Nov 17 2017 18:27
Eyo!
karinafarina
@karinafarina
Nov 17 2017 18:59
I am on the first challenge and am having trouble. "Use the function form of "use strict"" is the error I am getting
Kaz Baig
@kbaig
Nov 17 2017 19:07
@karinafarina which challenge
karinafarina
@karinafarina
Nov 17 2017 19:45
The very first one
@kbaig
ES6: Explore Problems with the var Keyword
Kaz Baig
@kbaig
Nov 17 2017 19:46
Can you link
Kaz Baig
@kbaig
Nov 17 2017 19:52
@karinafarina replace "use strict"; with
(function() { "use strict"; })();
karinafarina
@karinafarina
Nov 17 2017 19:55
@kbaig that didn't work
Kaz Baig
@kbaig
Nov 17 2017 19:57
@karinafarina my full code:
(function() { "use strict"; })();

let redNosedReindeer = "Rudolph";
let favorite = redNosedReindeer + " is Santa's favorite reindeer.";
karinafarina
@karinafarina
Nov 17 2017 19:59
Thanks you! That worked.
Darren
@DarrenfJ
Nov 17 2017 20:22
afternoon fCC
Kaz Baig
@kbaig
Nov 17 2017 20:22
:wave:
Darren
@DarrenfJ
Nov 17 2017 20:23
@kbaig hey thanks for helping out above.. help is always appreciated :D
CamperBot
@camperbot
Nov 17 2017 20:23
darrenfj sends brownie points to @kbaig :sparkles: :thumbsup: :sparkles:
:cookie: 430 | @kbaig |http://www.freecodecamp.org/kbaig
Darren
@DarrenfJ
Nov 17 2017 20:25
@SuperGeniusZeb hmm, so CodePen's bootstrap link is wrong? Any way to open tickets in CodePen? Seems crazy that they'de miss that
thanks @SuperGeniusZeb for sharing the info
CamperBot
@camperbot
Nov 17 2017 20:25
darrenfj sends brownie points to @supergeniuszeb :sparkles: :thumbsup: :sparkles:
api offline
Darren
@DarrenfJ
Nov 17 2017 20:28
@LukaszSamulnik you loggin into the beta on that question/ beta is now locked out even if you have had access previously.. it is 'read-only' now and not capturing progress for users until it's released (apparently anyway)
Kaz Baig
@kbaig
Nov 17 2017 20:50
@longnt80 Sounds like startup life to me haha
@DarrenfJ What's this about codepen's bootstrap link?
karinafarina
@karinafarina
Nov 17 2017 21:03
https://beta.freecodecamp.org/en/challenges/es6/mutate-an-array-declared-with-const
This is giving me errors even though the objective was accomplished.
Kaz Baig
@kbaig
Nov 17 2017 21:03
what's the error
@karinafarina
Randell Dawson
@RandellDawson
Nov 17 2017 21:12
@karinafarina it is a bug. I just completed that challenge and it will not pass the tests with the correct code.

You should be able to use:

s[0] = 2;
s[1] = 5;
s[2] = 7;

or

s.unshift(s.pop());

to past this challenge.

Darren
@DarrenfJ
Nov 17 2017 21:18
@kbaig lemme find it.. a thread from earlier

I figured out the problem with Bootstrap 4 on CodePen. Their Bootstrap 4 CSS include is the wrong file. They use the link to the grid component (https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap-grid.css), not the entire Bootstrap library. (https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css)

Hope that info is helpful to anyone else doing stuff on CodePen using Bootstrap 4.

Kaz Baig
@kbaig
Nov 17 2017 21:20
@DarrenfJ oh wow that's silly
Darren
@DarrenfJ
Nov 17 2017 21:21
does seem crazy doesn't it
Shiran
@shiranag
Nov 17 2017 22:36
hi guys i need help i worked on my website and i made form that some people can write user name and pass,email
how to get this elements to my mail ?
javascript
Darren
@DarrenfJ
Nov 17 2017 22:45
your trying to get an online form over to your email?
Shiran
@shiranag
Nov 17 2017 22:45
@DarrenfJ yes
Darren
@DarrenfJ
Nov 17 2017 22:47
I haven't really looked into it for a while but usually all the online info I ran into suggested the real way to do it witout exposing your email addy in the form is to use something one the back-end to get the server to do it
Shiran
@shiranag
Nov 17 2017 22:48
@DarrenfJ how to start?
Darren
@DarrenfJ
Nov 17 2017 22:48
people usually suggest using PHP for this.. I imagine over the next few years someone will start blogging about using node to do the same thing.. might even be info out there now on it
I did run into an article that suggested using google forms since it integrates with webpages but haven't tried it out much myself
i used a free service called wufu or something like that they let me use basic forms without needing to do anything on the back-end.. but you are limited in what you can do visually with them..
lemme google it
Shiran
@shiranag
Nov 17 2017 22:53
@DarrenfJ for biginng in this website is good but i want to start made more websites so i need to learn how to cooding in php you have some link or web that i can learn how to code
Darren
@DarrenfJ
Nov 17 2017 22:55
not really for php.. did a bunch of treehouse stuff on it a few years ago but hated the language been avoiding it ;)
Shiran
@shiranag
Nov 17 2017 22:56
thanks
it looks about like how I remembered it
Shiran
@shiranag
Nov 17 2017 22:58
:+1:
Long Nguyen
@longnt80
Nov 17 2017 22:59
@kbaig

Sounds like startup life to me haha

yup haha

Darren
@DarrenfJ
Nov 17 2017 23:01
@longnt80 yah they gottcha running don't they ;)
Alexander R Bott
@Abott1222
Nov 17 2017 23:01
@DarrenfJ wassssabbbbbbiiiiii
Darren
@DarrenfJ
Nov 17 2017 23:01
@Abott1222 hey buddy haven't seen you around in forever!
Long Nguyen
@longnt80
Nov 17 2017 23:01
@DarrenfJ yeah
Alexander R Bott
@Abott1222
Nov 17 2017 23:02
@DarrenfJ ya life has been weird hahah how are things?
Darren
@DarrenfJ
Nov 17 2017 23:02
busy.. the usual
whatcha been up to?
Alexander R Bott
@Abott1222
Nov 17 2017 23:03
busy got a react contract and in over my head hahaha
Darren
@DarrenfJ
Nov 17 2017 23:06
noice
@longnt80 's been over his head in Vue, right? but hired for react... you guys should collaborate ;)
Alexander R Bott
@Abott1222
Nov 17 2017 23:07
im down! cool appreciate the intro @DarrenfJ
@DarrenfJ ty
CamperBot
@camperbot
Nov 17 2017 23:07
abott1222 sends brownie points to @darrenfj :sparkles: :thumbsup: :sparkles:
:star2: 2276 | @darrenfj |http://www.freecodecamp.org/darrenfj
Darren
@DarrenfJ
Nov 17 2017 23:08
there's always too much work to do and never enough time :D
Alexander R Bott
@Abott1222
Nov 17 2017 23:09
ya dude I hear you. I cant wait until I can get a regular job instead of these intense contracts but just glad to have a little $ coming in
keep going 0 to 100 and wanna just cruise at 50 hahaaha XD
Darren
@DarrenfJ
Nov 17 2017 23:09
50 would be nice...
contracts are good cause of the flexibilty to whatever afterwards but finding that next contract is stressful too
plus there's something to be said for really knowing an app or set of software or product offering
which you get if you stay in one place ofr a while
Alexander R Bott
@Abott1222
Nov 17 2017 23:12
ya dude I need to fight for each contract
Darren
@DarrenfJ
Nov 17 2017 23:12
got an end day meeting gotta run but thanks for the chats
thanks @Abott1222 @longnt80
CamperBot
@camperbot
Nov 17 2017 23:13
darrenfj sends brownie points to @abott1222 and @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 212 | @abott1222 |http://www.freecodecamp.org/abott1222
:cookie: 671 | @longnt80 |http://www.freecodecamp.org/longnt80
Alexander R Bott
@Abott1222
Nov 17 2017 23:13
@DarrenfJ ok later dude!
Darren
@DarrenfJ
Nov 17 2017 23:13
and @shiranag hope it works out for yah
Shiran
@shiranag
Nov 17 2017 23:15
@DarrenfJ not working need more help how to sent it to server and how to get elements on beck end
Megan Brewer
@Meganbeccan
Nov 17 2017 23:34
Hey Guys