These are chat archives for FreeCodeCamp/HelpJavaScript

7th
Nov 2017
Jason Luboff
@JLuboff
Nov 07 2017 00:00
Ya... actually should be quicker than the trading app if I spend some time on it
Bryan Reese
@breese8009
Nov 07 2017 00:02
@JLuboff :wave:
Jason Luboff
@JLuboff
Nov 07 2017 00:02
@breese8009 Yo
Bryan Reese
@breese8009
Nov 07 2017 00:03
@JLuboff whats good?
Jason Luboff
@JLuboff
Nov 07 2017 00:03
Actually spending a little time on my Pinterest clone..you?
Bryan Reese
@breese8009
Nov 07 2017 00:11
@JLuboff nice ur doin a pinterest clone?
sounds fun
what are u using?
for db front end etc...
Jason Luboff
@JLuboff
Nov 07 2017 00:13
@breese8009 Its the last backend project...I wouldn't be doing it otherwise (I've never used Pinterest).
Bryan Reese
@breese8009
Nov 07 2017 00:14
@JLuboff lol my wife uses it often
Jason Luboff
@JLuboff
Nov 07 2017 00:14
Mongodb, node(express), hbs (template engine), and bootstrap or bulma
Ya so does my wife
Bryan Reese
@breese8009
Nov 07 2017 00:14
nice man
ur almost done with fcc hu?
Jason Luboff
@JLuboff
Nov 07 2017 00:14
They recomend using Masonary JS as well https://masonry.desandro.com/ creates a tile layout for you I guess
@breese8009 This will complete backend, then I'll still have data viz
Bryan Reese
@breese8009
Nov 07 2017 00:17
nice man
Jason Luboff
@JLuboff
Nov 07 2017 00:17
What're you working on?
scarejar
@scarejar
Nov 07 2017 00:50
can node_modules/npm modules be used on the client ?
like, the client using express for example (bad example)
Jason Luboff
@JLuboff
Nov 07 2017 00:52
You can expose them and use them.. like if oyu want jquery to reside on your node server
hillsie
@Hillsie
Nov 07 2017 00:59
@Masd925 Finally got the difference between lexical and dynamic scoping.
scarejar
@scarejar
Nov 07 2017 01:01
@JLuboff you would still have to <script></script> on client side right ?
to get the functionality
scarejar
@scarejar
Nov 07 2017 01:12
ohh
better example would be bootstrap, npm i boostrap, why would you want to do this ?
Uriel Guzmán
@Burinson
Nov 07 2017 03:39
function sym() {
   var args = Array.prototype.slice.call(arguments);


  function symDiff(arrOne, arrTwo) {
    var reduced = arrOne.concat(arrTwo);
    var filter = reduced.filter(function(element) {

      if (reduced.indexOf(element) === reduced.lastIndexOf(element)) {
        return element;
      }

    });
    //console.log(filter);
    return filter;
  }
  return args.reduce(symDiff);
}

sym([1, 1, 2, 5], [2, 2, 3, 5], [3, 4, 5, 5]);
How can I make this work?
Claudio Restifo
@Marmiz
Nov 07 2017 03:44
@Burinson afaik lastIndexOf is a string method. What are you trying to achieve with this?
if (reduced.indexOf(element) === reduced.lastIndexOf(element))
well TIL that exists also for Array :)
but that line still puzzle me...
you are asking if that element index is the same as the last possible index, again I fail to see what you wish to achieve.
Uriel Guzmán
@Burinson
Nov 07 2017 03:53
@Marmiz If the first match of a given index is at the same position as the last match of the same index, it means that there is only one of them inside the array
Since they are merged together, a symmetric similarity would have 2 or more of the same items inside the merged array
For example: [1,2,3],[1,2] merged [1,1,2,2,3], the first match of 3's index is 4, the last match is also 4, which means it is a symmetric difference
Claudio Restifo
@Marmiz
Nov 07 2017 03:55
@Burinson Oh I see... now makes more sense.
In all honesty tho if my ultimate goal is to see which elements of two arrays are unique I won't merge and look for a symmetric similarity...
I'd simply look for what element are not present in the other one :)
Because looks to me that then you want to return only the elements that are unique in the array... or am I wrong?
Uriel Guzmán
@Burinson
Nov 07 2017 03:57
@Marmiz It returns the symmetric difference, not the symmetric similarity
I know my method is weird, haha
What method would you use?
Claudio Restifo
@Marmiz
Nov 07 2017 03:59

@Burinson as I told you, If I have

[1,2,3],[1,2]

I won't merge and look for similarity...
I'd simply look what elements in the 2nd array are not in the first...

Uriel Guzmán
@Burinson
Nov 07 2017 03:59
I feel dirty, I used forEach, not because I came up with it, but because I peeked at the solutions
Claudio Restifo
@Marmiz
Nov 07 2017 04:12
@Burinson so you ended up concatenating them all and then reducing?
Long Nguyen
@longnt80
Nov 07 2017 04:52

@Marmiz I have this code:

Object.defineProperty(
  Array.prototype, 
  'sum', 
  { 
    get: function() { 
      return this.reduce((acc, next) => acc + next, 0); 
    } 
  }
);

which produce this:

[1,2,3,4].sum // result is 10
what's the difference between this and using:
Array.prototype.sum = get function () {
  return this.reduce(function (acc, val) {
    return acc + val
  });
};

[1, 2, 3,4].sum(); // result is 10
Long Nguyen
@longnt80
Nov 07 2017 05:28
anyone? :point_up:
Markus Kiili
@Masd925
Nov 07 2017 06:40
@longnt80 Does the second one work?
Long Nguyen
@longnt80
Nov 07 2017 06:41
@Masd925 no, it shouldn't have the get in there. It was my bad copy and paste
Markus Kiili
@Masd925
Nov 07 2017 06:45
@longnt80 Second code makes a normal method that is called like [].sum();. The first one creates a virtual method that runs the given function when you use the property [].sum.
A setter would bind a function for assigning to that property [].sum=5;
So with setters and getters, you can run functions that do things under the hood when someone reads or assigns into a property.
Long Nguyen
@longnt80
Nov 07 2017 06:52
@Masd925 so the difference is the getter?
Markus Kiili
@Masd925
Nov 07 2017 07:07
@longnt80 It is mostly just two ways of doing the same thing. Whether you wan't to do things by arr.getSum() and arr.setSum(5) or by arr.sum and arr.sum=5.
The second one (with setters and getters) allows you to run function under the hood although it looks like just standard accessing or assigning into a property.
Long Nguyen
@longnt80
Nov 07 2017 07:09
@Masd925 thank you
CamperBot
@camperbot
Nov 07 2017 07:09
longnt80 sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4565 | @masd925 |http://www.freecodecamp.com/masd925
Bryan Reese
@breese8009
Nov 07 2017 10:48
hello
Markus Kiili
@Masd925
Nov 07 2017 10:49
@breese8009 Hi.
Bryan Reese
@breese8009
Nov 07 2017 10:50
@Masd925 hey ha
Markus Kiili
@Masd925
Nov 07 2017 10:50
@breese8009 No, sorry.
Bryan Reese
@breese8009
Nov 07 2017 10:50
@Masd925 no worries
do they teach mongoose on here?
bilaal-s
@bilaal-s
Nov 07 2017 11:21
:wave:
quick question guys: how come in this fiddle the function defined called onLoadTextFile produces an error when called as an event handler in the html onchange attribute? https://jsfiddle.net/bilaals/0ocenvnd/
Markus Kiili
@Masd925
Nov 07 2017 11:24
@bilaal-s What is the error?
bilaal-s
@bilaal-s
Nov 07 2017 11:24
@Masd925 (index):72 Uncaught ReferenceError: onLoadTextFile is not defined
at HTMLInputElement.onchange
@Masd925 nvm will try codepen
@Masd925 im sure it will work there >.>
Markus Kiili
@Masd925
Nov 07 2017 11:25
@bilaal-s Good idea.
bilaal-s
@bilaal-s
Nov 07 2017 11:26
@Masd925 works now >.>
<.<
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 11:27
anyone who uses glitch around?
Theodore P.
@Ierofantis
Nov 07 2017 11:39

Can anyone explain to me the following code?

var obj = { };
for (var i = 0, j = arr.length; i < j; i++) {
   obj[arr[i]] = (obj[arr[i]] || 0) + 1;
}

console.log(obj);
/**
 *  {
 *      "ab" : 3,
 *      "pq" : 1,
 *      "mn" : 2      
 *  }
 */

first of all why the for loop is like this and not for(var i = 0; i<arr.length ...

and secondly what does obj[arr[i]] = (obj[arr[i]] || 0) + 1; means? I know what it does but i can't get this line || 0) + 1. What zero means?

Markus Kiili
@Masd925
Nov 07 2017 11:42
@Ierofantis That way is a bit more efficient because the length is accessed only once and assigned to j, instead of accessing arr.length on each loop.
@Ierofantis obj[arr[i]] || 0 will use the property value or 0 if the property doesn't exist and therefore returns undefined.
When you use || on values other that true/false, the operator returns the value that terminated the evaluation. Here if obj[arr[i] is a number other than zero, it is truthy and the operation evaluates to that number. Otherwise it evaluates to the second operand 0.
Stephen James
@sjames1958gm
Nov 07 2017 11:46
@Ierofantis from MDN expr1 || expr2 - Returns expr1 if it can be converted to true; otherwise, returns expr2. Thus, when used with Boolean values, || returns true if either operand is true.
@Ierofantis It is also called shortcut evaluation, the second expression is only evaluated if the first one results in "falsy"
Similarly for && except the second expression is evaluated only if the first expression returns "truthy"
Theodore P.
@Ierofantis
Nov 07 2017 11:49
@Masd925 So it checks if obj[arr[i]] exists and if not is returned undefined. I guess +1 outside the parenthesis increases the i if there is a concurency
Markus Kiili
@Masd925
Nov 07 2017 11:50
@Ierofantis It increments the existing property value and assigns 1 if it doesn't exist.
Diego Mayer
@Chrono79
Nov 07 2017 11:50
@Ierofantis undefined + 1 is NaN, that's why they use || 0to initialize obj[arr[i]]
Theodore P.
@Ierofantis
Nov 07 2017 11:50
@sjames1958gm it is like ternary operator?
Diego Mayer
@Chrono79
Nov 07 2017 11:51
obj[arr[i]] = obj[arr[i]] + 1 || 1; should work too
Markus Kiili
@Masd925
Nov 07 2017 11:51
@Ierofantis Another way would be to make a hasOwnProperty check first.
More clear way imo.
Theodore P.
@Ierofantis
Nov 07 2017 11:53
@Masd925 do you mean to do a checking like this obj.hasOwnProperty('..');
@Chrono79 Hey diego !
Diego Mayer
@Chrono79
Nov 07 2017 11:53
:wave:
Markus Kiili
@Masd925
Nov 07 2017 11:53
@Ierofantis Yes, if(obj.hasOwnProperty(arr[i]){...})
Theodore P.
@Ierofantis
Nov 07 2017 11:54
@Masd925 @sjames1958gm @Chrono79 ok guys thank you! I found this code very clever for a simple algorithmic solution. My solution was ten lines :P
CamperBot
@camperbot
Nov 07 2017 11:54
ierofantis sends brownie points to @masd925 and @sjames1958gm and @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 4566 | @masd925 |http://www.freecodecamp.com/masd925
:star2: 8677 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
:star2: 4596 | @chrono79 |http://www.freecodecamp.com/chrono79
Markus Kiili
@Masd925
Nov 07 2017 11:57
@Ierofantis I don't like that I have to look at the property values to see that the code is checking for property existence and then I understand the code. It is pretty standard and saves some space so I don't hang you for that ;)
Theodore P.
@Ierofantis
Nov 07 2017 12:01
@Masd925 :smile:
FlashHero
@FlashHero
Nov 07 2017 12:08
Why does a recursion function go back to get the values after its done executing
Blauelf
@Blauelf
Nov 07 2017 12:13

@FlashHero Could you explain what you mean, maybe with an example?

So far just guessing, what you might mean is that each call of the recursive function has its own scope and its own set of function-scope variables.

korzo
@korzo
Nov 07 2017 12:21
@FlashHero usually it's opposite. you call function recursively until you find desired output. Then return this value up to the top most function call
@FlashHero most of the time you can replace recursion with a loop.
Blauelf
@Blauelf
Nov 07 2017 12:27
@korzo If all your recursion looks like return recursiveFunction(...);, that's certainly true (in best case it's tail call recursion). If you however aggregate over multiple recursive calls, you would have to use a stack or something like that for keeping state. I did that kind of recursion on "no repeats, please". In many cases I can be more efficient than a solution implementing Heap's algorithm. Hard to do it in an iterative way.
korzo
@korzo
Nov 07 2017 12:41
@Blauelf yes, I had tail recursion on my mind as I think his question was related to code posted yesterday.
korzo
@korzo
Nov 07 2017 12:49
@Blauelf You are absolutely right. There are scenarios which can't be solved (or only with very ugly code) without recursion.
Yeah, I saw your "no repeats, please" solution last month. Very nice
Blauelf
@Blauelf
Nov 07 2017 12:50
The recursive implementation uses a stack (the call stack) for storing state. You could do the same manually. Whether that's more or less efficient probably depends.
korzo
@korzo
Nov 07 2017 12:58
@Blauelf As far as I can tell, loop is the most efficient , but usually difference is minimal.
Problem with recursion is that you can run out of call stack in some cases.
Blauelf
@Blauelf
Nov 07 2017 13:02

I guess my non-recursive solution

function steamrollArray(arr) {
  arr = arr.slice(); // create a copy
  var i = 0;
  while (i < arr.length) {
    if (Array.isArray(arr[i])) {
      arr.splice(i, 1, ...arr[i]); // ES6
      // or Array.prototype.splice.apply(arr, [i, 1].concat(arr[i]));
    } else {
      i++;
    }
  }
  return arr;
}

is less efficient than some recursive solutions not using splice.

Non-recursive

function steamrollArray(arr) {
  while (arr.some(Array.isArray)) {
    arr = [].concat(...arr); // ES6
    // or arr = Array.prototype.concat.apply([], arr);
  }
  return arr;
}

should not suffer from the same problems, assuming concat is a lot more efficient.

korzo
@korzo
Nov 07 2017 13:07
@Blauelf As far as I remember, my non recursive solution was faster .
function steamrollArray(arr) {  
  return arr.reduce(function (acc, cur) {
    return acc.concat(Array.isArray(cur) ? steamrollArray(cur) : cur);
  }, []);
} 

function steamrollArray(arr) {
  var i = -1;
  while(++i !== arr.length) {    
    if (Array.isArray(arr[i])) {      
      //Array.prototype.splice.apply(arr, [].concat(i, 1, arr[i--]));
      arr.splice(i, 1, ...arr[i--]);
    }
  }
  return arr;
}
Blauelf
@Blauelf
Nov 07 2017 13:09
which is almost same as my splice-based solution (difference in details only). Would have to benchmark those.
korzo
@korzo
Nov 07 2017 13:16
I think I have benchmark.js test for this.
If not, I'll create jsperf for this
Blauelf
@Blauelf
Nov 07 2017 13:18
I tried in a repl.it, but runtimes are almost same. For really big nested arrays, the recursive function is slightly slower.
steamrollArray1: 78ms // my splice-based, including a slice at the beginning
steamrollArray2: 68ms // my concat-based
steamrollArray3: 200ms // your reduce-based
steamrollArray4: 74ms // your splice-based

That's an array created by

var arr = [1,2,3,4,5];
for (var i = 0; i < 5; i++)
  arr = Array.from({length:5}, ()=>[arr, ...arr]);

containing 500000 elements (multiplying by 10 each iteration)

Numbers are varying greatly. Would have to set up jsperf.

For even larger arrays, splice seems to become less efficient again, and recursive is faster.
korzo
@korzo
Nov 07 2017 13:25
I thought that my reduce solution will be slowest, but this this is big difference.
Blauelf
@Blauelf
Nov 07 2017 13:35
I have initial arrays of 5 or 6 elements each. Maybe it's different with smaller or larger arrays.
But without proper benchmarking suite, those values contain too much variation.
Blauelf
@Blauelf
Nov 07 2017 13:43
Oh, f***. Actually called the same function all the time.
Markus Kiili
@Masd925
Nov 07 2017 13:46
@Blauelf Very surprising error for a man who can be more efficient than the Heap's algorithm: In many cases I can be more efficient than a solution implementing Heap's algorithm. ;)
Blauelf
@Blauelf
Nov 07 2017 13:49
Heap's algorithm generates all permutations. I can skip some.
Blauelf
@Blauelf
Nov 07 2017 13:55
@korzo My concat-based solution fails on large arrays due to limit in number of function arguments.
korzo
@korzo
Nov 07 2017 13:56
@Blauelf How much is limit for arguments? :)
Blauelf
@Blauelf
Nov 07 2017 13:57
Depends on platform. But usually more than the 16k or 65k it used to be.
As far as I know, there's no limit in the specification.
korzo
@korzo
Nov 07 2017 13:58
@Blauelf You are right.
chrome 65535
Firefox 262143
https://stackoverflow.com/a/22747272/1412452
Blauelf
@Blauelf
Nov 07 2017 14:00
262143 on my Firefox. 65535 on my Chrome. So numbers still apply.
Blauelf
@Blauelf
Nov 07 2017 14:19
@korzo https://jsperf.com/freecodecamp-steamroll-solutions/1
My concat-based loop is fastest on Chrome until it fails due to maximum number of arguments :(
(the comparison based on a single array is a bit arbitrary, I think)
My concat-based loop is by far slowest on Firefox, though, with your fancy-increment splice solution being fastest.
korzo
@korzo
Nov 07 2017 14:22
@Blauelf fancy increments :)
Blauelf
@Blauelf
Nov 07 2017 14:23
With all those ++ and --, you seem to have gotten a slight advantage.
korzo
@korzo
Nov 07 2017 14:24
You beat me to it. I was planning to do it at evening.
Yeah, I was trying to save a line or two.
I will add loop based recursion to see how it performs.
Blauelf
@Blauelf
Nov 07 2017 14:24
I'm impressed by the difference between Firefox and Chrome, both in absolute and relative speed.
korzo
@korzo
Nov 07 2017 14:26
I will ask some friends to run it that we can see comparison across range of devices/browsers ...and graphs
korzo
@korzo
Nov 07 2017 15:02
@Blauelf There is also big difference between versions of Firefox.
What I'm surprised is that Vivaldi is 4x faster than Firefox
Blauelf
@Blauelf
Nov 07 2017 15:06
Vivaldi?
korzo
@korzo
Nov 07 2017 15:09
Yes, for Splice-based by Blauelf it's 4x (FF) and 3x (Chrome) faster
Diego Mayer
@Chrono79
Nov 07 2017 15:33
@korzo 4 seasons faster :trollface:
Diego Mayer
@Chrono79
Nov 07 2017 15:39
Do you use that browser? How is it?
Kelechi Chinaka
@ke1echi
Nov 07 2017 15:43
:wave: guys
Diego Mayer
@Chrono79
Nov 07 2017 15:44
:wave:
Kelechi Chinaka
@ke1echi
Nov 07 2017 15:46
the chrome issue was fixed @Chrono79
Kelechi Chinaka
@ke1echi
Nov 07 2017 15:51
o nice i saw you here @Chrono79 been tryna crack this one.. the question confuses me https://www.codewars.com/kata/good-vs-evil
Diego Mayer
@Chrono79
Nov 07 2017 15:55
@kelechy what's the problem?
Have you seen the comments in discourse?
Kelechi Chinaka
@ke1echi
Nov 07 2017 15:57
i think am missing something in the description
no..i will check it out
Jason Luboff
@JLuboff
Nov 07 2017 16:10

@scarejar Hi sorry, was off for the rest of the day. You are correct, you would still need your <script> tags on the client side. Bootstrap is a good example, its so you can have everything server side and not need a CDN for example. You would use something like

app.use('/css', express.static(__dirname + '/node_modules/bootstrap/dist/css'));
app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js'));

To expose the bootstrap files to your frontend.. and in the front end have

<link rel="stylesheet" href="/css/bootstrap.min.css">
<script src="/js/bootstrap.min.js"></script>
Stephen James
@sjames1958gm
Nov 07 2017 16:13
@kelechy Look at the example inputs , each character in the string represents the number of each participant.
Christopher McCormack
@cmccormack
Nov 07 2017 16:30
:wave:
Anyone mind reviewing my image search api? https://imagus.glitch.me/
Jason Luboff
@JLuboff
Nov 07 2017 16:34
Already finished it?
@cmccormack Looks good. Somebody likes puppies
Christopher McCormack
@cmccormack
Nov 07 2017 16:35
guilty :)
Thanks for looking @JLuboff
CamperBot
@camperbot
Nov 07 2017 16:35
cmccormack sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2249 | @jluboff |http://www.freecodecamp.com/jluboff
Jason Luboff
@JLuboff
Nov 07 2017 16:35
I guess the API projects really only took me 1-3 days depending. They are pretty quick to complete
Kelechi Chinaka
@ke1echi
Nov 07 2017 16:36
just coming back from school...will look at it soon @Chrono79 @sjames1958gm
Markus Kiili
@Masd925
Nov 07 2017 16:36
@JLuboff Maybe I could do one in 1-3 years :rat:
Christopher McCormack
@cmccormack
Nov 07 2017 16:36
@JLuboff yeah I've been trying to knock one out a day this week so I can move on to the more challenging
Jason Luboff
@JLuboff
Nov 07 2017 16:37
@Masd925 Hows that portfolio coming along? :joy:
Markus Kiili
@Masd925
Nov 07 2017 16:37
bye
Jason Luboff
@JLuboff
Nov 07 2017 16:38
@cmccormack Ya.. the dyanmic web apps have taken me 2-3 weeks per. The Game Trader being the longest at over a month. Pinterest has only taken time becuase I haven't working on it
Christopher McCormack
@cmccormack
Nov 07 2017 16:39
@Masd925 haha you ok?
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 16:39
@JLuboff lazy
Jason Luboff
@JLuboff
Nov 07 2017 16:39
@RoniqueRicketts Eh... I've been dedicating more time to studying for my certification tests that actually earn me more money ;)
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 16:40
@JLuboff which cert? Are you actually going to school?
Markus Kiili
@Masd925
Nov 07 2017 16:41
@cmccormack Yeah. Just trying to motivate myself.
Christopher McCormack
@cmccormack
Nov 07 2017 16:41
@Masd925 try to do one a day! That's motivation
Markus Kiili
@Masd925
Nov 07 2017 16:43
@cmccormack I have been using my spare time refreshing my java skills. Maybe some FCC during XMas holiday I hope.
Jason Luboff
@JLuboff
Nov 07 2017 16:44
At this point.. MTA (Microsoft Technology Associate): Software Developer. Have already earned MTA: Database and MTA: IT Infastructure. After, I'll be going for MCSA: SQL Server
@RoniqueRicketts
Christopher McCormack
@cmccormack
Nov 07 2017 16:44
@Masd925 need to add another 12 hours to each day :D
Markus Kiili
@Masd925
Nov 07 2017 16:45
@cmccormack That would be something...
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 17:15
hello everyone
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:20
@JLuboff nice man. Keep nerding out
Jason Luboff
@JLuboff
Nov 07 2017 17:21
@RoniqueRicketts Thanks, and will do! I've been learning some C# for this latest test.
CamperBot
@camperbot
Nov 07 2017 17:21
jluboff sends brownie points to @roniquericketts :sparkles: :thumbsup: :sparkles:
:cookie: 401 | @roniquericketts |http://www.freecodecamp.com/roniquericketts
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:22
@JLuboff wow now thats a solid language man. Hope to use one of ya'll application someday :)
Jason Luboff
@JLuboff
Nov 07 2017 17:35
We'll see...lol
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:39
idk what I am doing with my project. Have you ever started a project and don't know what is the first line of code to right?
Jason Luboff
@JLuboff
Nov 07 2017 17:46
Ya...all the time :P
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:46
how do you deal with it
Jason Luboff
@JLuboff
Nov 07 2017 17:47
Procastinate until I say "fuck...I really should work on this.." :D
Christopher McCormack
@cmccormack
Nov 07 2017 17:50
@RoniqueRicketts don't write code, write pseudocode in comments
then you can figure out how to solve the problems you pose on your pseudocode
Jason Luboff
@JLuboff
Nov 07 2017 17:50
Oh looky here.. mr.I have a good answer
Christopher McCormack
@cmccormack
Nov 07 2017 17:52

@RoniqueRicketts like for the url shortener project, this was some of my pseudocode:

    // Read current counter from db if not locked

    // Lock counter temporarily

    // Use counter value to calculate shortened string

    // Push hash + shortened string + url to DB

    // Update counter and increment
...

I ended up moving some of it around but in the end the functionality matches what I wrote and it was much easier to get started after writing it

Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:52
@cmccormack @cmccormack thanks :) gonna try that
CamperBot
@camperbot
Nov 07 2017 17:52
roniquericketts sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1260 | @cmccormack |http://www.freecodecamp.com/cmccormack
Christopher McCormack
@cmccormack
Nov 07 2017 17:53
@JLuboff your method works for me too though - that's how I do it in my head :)
I'll put it off until an idea strikes me then jump into it
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:54
I'm o do that now
im o try the timestamp
Christopher McCormack
@cmccormack
Nov 07 2017 17:56
@RoniqueRicketts I think learnyonode had a timestamp example, did you do that?
Ronique Ricketts
@RoniqueRicketts
Nov 07 2017 17:57
@cmccormack no i stopped :(
Christopher McCormack
@cmccormack
Nov 07 2017 17:57
Well either you you'll learn by doing
Christopher McCormack
@cmccormack
Nov 07 2017 18:12
@JLuboff :joy:
Jason Luboff
@JLuboff
Nov 07 2017 18:13
I got a kick out of it
lobsang samdup
@lobsam
Nov 07 2017 18:13
hello every one
Christopher McCormack
@cmccormack
Nov 07 2017 18:13
Complexity analysis is one of the more simple concepts in Theoretical Computer Science
@lobsam hello
Bryan Reese
@breese8009
Nov 07 2017 18:14
whats good homies
Christopher McCormack
@cmccormack
Nov 07 2017 18:15
@breese8009 yo
Bryan Reese
@breese8009
Nov 07 2017 18:15
JS homies
@cmccormack how are you?
Jason Luboff
@JLuboff
Nov 07 2017 18:15
My man!
Christopher McCormack
@cmccormack
Nov 07 2017 18:15
Good good just starting the next project, like always
Bryan Reese
@breese8009
Nov 07 2017 18:15
@JLuboff whats up mang!
Jason Luboff
@JLuboff
Nov 07 2017 18:15
Just working
Bryan Reese
@breese8009
Nov 07 2017 18:16
@JLuboff are u a dev?
Jason Luboff
@JLuboff
Nov 07 2017 18:16
Nah... I work in IT though. And maintain our companies intranet page. And studying up to take over the programming/SQL admin position
Bryan Reese
@breese8009
Nov 07 2017 18:17
nice
Jason Luboff
@JLuboff
Nov 07 2017 18:17
Ya. Its legit. Plenty of time to study/code
I saw you were still on here at like 3 in the morning
Bryan Reese
@breese8009
Nov 07 2017 18:18
yea I have been on a coding spree
lol
Jason Luboff
@JLuboff
Nov 07 2017 18:19
When do you work?
Christopher McCormack
@cmccormack
Nov 07 2017 18:23
@JLuboff he doesn't work, he code sprees
Jason Luboff
@JLuboff
Nov 07 2017 18:24
:joy:
Christopher McCormack
@cmccormack
Nov 07 2017 18:31
I guess he went back to spreeing
Jason Luboff
@JLuboff
Nov 07 2017 18:32
Or peeing
Christopher McCormack
@cmccormack
Nov 07 2017 18:33
haha
Christopher McCormack
@cmccormack
Nov 07 2017 18:45
Out for now, ttyl
Jason Luboff
@JLuboff
Nov 07 2017 18:46
:wave:
Khalid Powell
@KhalidPowell
Nov 07 2017 19:07
Hey I'm on the seek and destroy challenge and I'm confused because it wis passed multiple params but the function only takes one. How do I store or reference the multiple params passed in?
Jason Luboff
@JLuboff
Nov 07 2017 19:07
@KhalidPowell You need to use the arguments object
Khalid Powell
@KhalidPowell
Nov 07 2017 19:10
Could I get an example if say its a function(arr) { //stuff }
@JLuboff
Jason Luboff
@JLuboff
Nov 07 2017 19:12
function myFunc(arr){
for(let i = 0; i < arguments.length; i++){
console.log(arguments[i]);
}}

myFunc([1,2,3], "potato", 7);
This will log
Loop 1: [1,2,3]
Loop 2: "potato"
Loop 3: 7
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:14
was testing your app found a hole on it @JLuboff heuebeu just wanted to see how you behave towards one problem that I was facing
Jason Luboff
@JLuboff
Nov 07 2017 19:14
@tiagocorreiaalmeida Which app?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:15
the stock one
Jason Luboff
@JLuboff
Nov 07 2017 19:15
Whats the problem?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:15
there's some api request from the quandl that return and empty array on the data as example if you try to add a stock codecalled exactly app, it will return soemthing and an empty array
image.png
Jason Luboff
@JLuboff
Nov 07 2017 19:16
Oh hmm
Why you breaking my shit man? :P
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:16
cause mine was broke aswell :D
Isaiah Trembley
@IsaiahCT
Nov 07 2017 19:17
my virgin ears have been corrupted
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:17
I always seem t ofind the strangest bugs and fail problems :D
Jason Luboff
@JLuboff
Nov 07 2017 19:17
I'm guessing thats a now defunct stock symbol?
I only get the last year of data, so if it doesn't have anything in the last year, it would be a blank array
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:18
something like taht I would say, im going to avoid saving an empty array and that will solve it I think
Im saving data from the last 2 years just to give functionality to all the buttons :DDD
Jason Luboff
@JLuboff
Nov 07 2017 19:19
My buttons were made by me...so...I control their functionality lol
But I think I should be able to do a quick fix for that
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:19
yeah np I didnt told you to somehow make you feel "forced" to do it just trying to help
im confused about a situation tough, I got a request on a new code insert or delete
Jason Luboff
@JLuboff
Nov 07 2017 19:19
@tiagocorreiaalmeida Nah its all good, I appreciate it. Thanks. We have to look out for each other, right?
CamperBot
@camperbot
Nov 07 2017 19:19
jluboff sends brownie points to @tiagocorreiaalmeida :sparkles: :thumbsup: :sparkles:
:cookie: 431 | @tiagocorreiaalmeida |http://www.freecodecamp.com/tiagocorreiaalmeida
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:20
but both of them can return an error message from my backend
you only make a socket emit after behing sure everythign went well right?
but that makes quit no sense since it forces a new request to the backend or maybe im confused
Jason Luboff
@JLuboff
Nov 07 2017 19:21
I only emit when I have data or need to update the front end for some reason (if that makes sense)
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:21
and yeah @JLuboff anytime, sometimes when im confused I try to see others work to get ideas to improve mine, I think its the only way of getting a reference point to what imdoing wrong or could be doing right
Khalid Powell
@KhalidPowell
Nov 07 2017 19:22
thanks @JLuboff
CamperBot
@camperbot
Nov 07 2017 19:22
khalidpowell sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2251 | @jluboff |http://www.freecodecamp.com/jluboff
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:22
completly ;) so imagine I testeed out a none stock code on your app it returns me a message saying there was no such code or something like that, do you make a request to the backend like using ajax or something and then based on the result of that you decide to emit or no right? just trying to get someideas im missing the sockets part
Jason Luboff
@JLuboff
Nov 07 2017 19:23
Ah. Gotcha. Let me look at my code. It's been a little while so I'm trying to refresh myself on what I did lol
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:23
np and thanks for helping
Jason Luboff
@JLuboff
Nov 07 2017 19:25
Ok.. so when a user clicks the button to add a stock, I have it emit to the backend which then checks for the stock. It first checks the database to see if its in there, then checks to see if its from today, if it is, it sends it. If not, it then queries the API, if my dataset comes back as undefined, I send the emit back with my message of Symbol not recognized (and only to the person who requested it)
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:30
yeah might have to go that way aswell lets see trying to remove current data from the cart on delete after that sockets time :D, thanks @JLuboff
CamperBot
@camperbot
Nov 07 2017 19:30
tiagocorreiaalmeida sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2252 | @jluboff |http://www.freecodecamp.com/jluboff
Jason Luboff
@JLuboff
Nov 07 2017 19:38
@tiagocorreiaalmeida Fixed my issue :+1:
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 19:41
will break it once again in a few minutes need to try to finish mine first :p
just kidding
Jason Luboff
@JLuboff
Nov 07 2017 19:41
Lol sounds good
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 20:52
@JLuboff in mongo native when you remove a doc
does it gives you any state about it?
by this I mean how to you know it was removed?
nm found a work around !
Jason Luboff
@JLuboff
Nov 07 2017 20:54
It returns back a writeresult with the number removed I believe
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 20:54
I changed to findoneandremove seems better for this situation
if it returns a doc on the then call then it was removed if not I know its not an existent doc, I feel like im gonna get to mongodb course project and want to use mongoose, and I dont know if that's accepeted been thinking on this since the start :D
Jason Luboff
@JLuboff
Nov 07 2017 21:01
No, you need to use vanilla mongo
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:02
cool, learn quite a few things allready with it tough some of them im even using on this project
Jason Luboff
@JLuboff
Nov 07 2017 21:04
Ya its a great course
Kristina
@kikidesignnet
Nov 07 2017 21:16
Hello everyone!!
Can I ask for help?
Isaiah Trembley
@IsaiahCT
Nov 07 2017 21:18
of course
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:18
this is the right room for that :D
Ken Haduch
@khaduch
Nov 07 2017 21:19
@kikidesignnet - it depends on which area you're working in - this is the JavaScript help room - there is also a FrontEnd room, and Help that are fairly active... ask away
Kristina
@kikidesignnet
Nov 07 2017 21:20
I'm asking for help on my JS Calculator. My codepen is https://codepen.io/kikibres/pen/MEQvqv
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:20
ehehe @kikidesignnet yesterday I tried to explain it
you change the mainmath to the result
3+3 = 6
then you append the main math to the existent calc
Kristina
@kikidesignnet
Nov 07 2017 21:20
but my code is now updated...
but with more additional errors...
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:21
oh ok
will try to give it a look then
Kristina
@kikidesignnet
Nov 07 2017 21:21
thanks
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:22
what's the error @kikidesignnet ? so I can avoid read all the post above :D btw seems you took the approach of only saving the last result that allready solved you the proble mof yesterday!!!!
@JLuboff
Kristina
@kikidesignnet
Nov 07 2017 21:24
Those are the new problems. It seems that it happens after I press "clear"
  1. When pressing “0”, the history (subMath) shows “0-3”. However, after pressing “=” and the pressing “clear”, I press “0”, but it didn’t show up in the history.
  2. Multiply operations works the first time. However, after clicking “=” and then pressing “clear”, it didn’t show the full operations. For example, if I entered “1”, then “+”, it shows up in history(subMath) as “1+”, then I press “2” and “+”, it clears the history(subMath), showing instead “2+”.
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:24
did you figure out what was the meaning of the values that came from the api something like '184.413998'
I feel like there's no reference point to the user when he goes there to understand what the values mean
Kristina
@kikidesignnet
Nov 07 2017 21:25
???
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:25
was talking to @JLuboff , sec
Kristina
@kikidesignnet
Nov 07 2017 21:25
oh :)
Isaiah Trembley
@IsaiahCT
Nov 07 2017 21:25
why is it that this line keeps moving when the other divs aren't
Jason Luboff
@JLuboff
Nov 07 2017 21:26
@tiagocorreiaalmeida You have to give me more context then that
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:26
@kikidesignnet for what I get the first proble mis imagine you do 9+9
and thenyou do +0
it adss to 81 0 right? so 810
?
@JLuboff the api quandl gives you adily data every day as a value associated with it,im trying to understand what those values are, what unit measures them
@kikidesignnet there's a simple solution for the first question, when the user click on the 0 you can check if the last value of the string is one operator if not dont add the value if it is you do add it :D
Kristina
@kikidesignnet
Nov 07 2017 21:29
No, that works perfectly for first time. The problems starts after I press "C" for clear for "0" as in "0-81" and doesn't work for multiply operations like "9 + 9 + 3".
?
could you provide a solution please?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:30
this way you avoid the 0 appearing if the last one is not a operator, but there's a problem with this soltuion this wont work if you press 0 as the first number of the string so this forces you to check if the string.length is equal to 0 , then you can insert the 0 value to the string or if lengh > 1 you have to check if the last value of the string is an operator if so you do insert the value
Kristina
@kikidesignnet
Nov 07 2017 21:30
@IsaiahCT which line?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:30
oh then I got confused and found another bug :D
Jason Luboff
@JLuboff
Nov 07 2017 21:30
@tiagocorreiaalmeida I'm not sure where you're getting that number from? Can you show the JSON?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:31
image.png
data[0][1]
im confusing what's the meaning of that value
Jason Luboff
@JLuboff
Nov 07 2017 21:31
Oh, it's in $
thats the end of day stock price
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:31
thanks!!!!
strange google stock is only worth 1000 $?
Jason Luboff
@JLuboff
Nov 07 2017 21:32
Youre previous number confused me since it wasn't rounded
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:32
nm that isnt google :D
solved and thanks @JLuboff
CamperBot
@camperbot
Nov 07 2017 21:32
tiagocorreiaalmeida sends brownie points to @jluboff :sparkles: :thumbsup: :sparkles:
:star2: 2253 | @jluboff |http://www.freecodecamp.com/jluboff
Jason Luboff
@JLuboff
Nov 07 2017 21:32
Google is $1025.9 as of close yesterday
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:32
@kikidesignnet there's a pproblem with your calculator try to add 3+3 and then press a 0 after it
image.png
this happens the solution for this is a above explained maybe not the correct way but I feel like im bad at expressing myself if you need help let me know
Kristina
@kikidesignnet
Nov 07 2017 21:35
@tiagocorreiaalmeida I understand what you mean but I don't know if it is really a problem that needs fixing or not....
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:35
well try the above and then press =
Diego Mayer
@Chrono79
Nov 07 2017 21:37
@kikidesignnet you should catch when someone clicks an operator more than once
Kristina
@kikidesignnet
Nov 07 2017 21:38
@tiagocorreiaalmeida It's like this. If I entered "3 + 3 =" to get "6". I might want to change "6" to "60" and then press "+ 1" to get "61". Therefore, I'm not sure if it's really a problem for some people........ But if you think that this needs fixing, I'll try to fix it...
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:38
ok then, the second problem was about click 33333*3 right?
333*3
crap :D
3*3*3*3*3
Jason Luboff
@JLuboff
Nov 07 2017 21:39
@kikidesignnet Thats not how a calculator works though
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:39
it keeps cleaning the value before right?
Kristina
@kikidesignnet
Nov 07 2017 21:39
@Chrono79 Thanks. I just added it to my problems list
CamperBot
@camperbot
Nov 07 2017 21:39
kikidesignnet sends brownie points to @chrono79 :sparkles: :thumbsup: :sparkles:
:star2: 4597 | @chrono79 |http://www.freecodecamp.com/chrono79
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:40
@kikidesignnet having a problem list is not so bad those are things you are going to learn when fixing it so
anyway about the second problem is what I mention above right?
Diego Mayer
@Chrono79
Nov 07 2017 21:40
@kikidesignnet You're welcome, I'm good at breaking things ;) (specially if I didn't make them)
I'm also good at making broken things :P
Kristina
@kikidesignnet
Nov 07 2017 21:41
@JLuboff I just checked it out on Apple calculator. You were right. I'll fix it soon...
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:41
for what @Chrono79 metionted there's a good fix tough
its just checking the last value of the string
for the other problem of when doing 934 = value
Kristina
@kikidesignnet
Nov 07 2017 21:42
@tiagocorreiaalmeida I don't really understand what you mean by the last problem. I checked it out and it works fine...
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:43
and then value 3 3 it will replace all the string for a 3 for a what I saw
image.png
if now I press num numm
it will replace the result for that num
Christopher McCormack
@cmccormack
Nov 07 2017 21:46
@tiagocorreiaalmeida haha use backticks
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:46
yeah the * and # kill me
once I was trying to tell someone how to target an id and...
Christopher McCormack
@cmccormack
Nov 07 2017 21:46
Careful with Apple calculator @kikidesignnet https://www.macrumors.com/2017/10/24/ios-11-calculator-animation-bug/
@tiagocorreiaalmeida so use the markdown!
Jason Luboff
@JLuboff
Nov 07 2017 21:48
@cmccormack Holy fuck. How did they fuck that up?
Christopher McCormack
@cmccormack
Nov 07 2017 21:49
@JLuboff Agreed, that's a whole new level of sloppy for a company that is worth almost a $trillion
Kristina
@kikidesignnet
Nov 07 2017 21:49
I'm using a desktop calculator. My laptop is MacBook Pro. That problem you mentioned is only for iPhone, right?
Jason Luboff
@JLuboff
Nov 07 2017 21:49
Seriousily. I just tried it and verified its still there...
Christopher McCormack
@cmccormack
Nov 07 2017 21:49
@kikidesignnet hope so
I'm a super amateur compared to Apple developers but I still made sure I did rigorous testing on my calc app to make sure animations didn't cause an issue
Kristina
@kikidesignnet
Nov 07 2017 21:50
I did entered "1 + 2 + 3" in that calculator on my laptop and it did show "6"
Christopher McCormack
@cmccormack
Nov 07 2017 21:51
@kikidesignnet you're probably fine then hopefully
Kristina
@kikidesignnet
Nov 07 2017 21:51
:)
Anyway, I need to console.log every statement in my code based on someone's suggestion in order to figure out the problems... This challenge is taking me longer than I thought it should and I wanted to finish right away and move on to other things... to get my front-end development certification and study Angular and SASS
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:54
you sound like me :D
good old days :D
Kristina
@kikidesignnet
Nov 07 2017 21:54
Yeah, What do you do?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:55
about wanting to finish everything and wanting to learn always new things, the proble mwitah me was I almost ended up doing all at once and wasted a bit of time but well here I am
Kristina
@kikidesignnet
Nov 07 2017 21:55
and I'm sort of a perfectionist, making sure that my calculator works more like a real calculator...
Are you working as a front-end developer?
I'm searching for a front-end developer job opportunity in either South Florida or St. Louis..
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 21:58
and yeah the calculator is a bit more difficulted compared to the previous ones but will give you a good thinking on things trust me, aaa nah not yet im here to learn the most I can and maybe soon try to get my shot at somewhere :), learning angular and sass sounds a good idea, I can tell you learning sass after knowing css takes you only a few days to get used :) there's to ways or writing sass, scss or sass and scss its almost css in every aspects the difference is you have more tools in hand to use, but dont worry you will get there
two*
Kristina
@kikidesignnet
Nov 07 2017 22:00
Thanks! My only wish at this point for my Calculator is to have someone check my code line by line and circle in red what's wrong and some explanation so that we can go back and forth in order for me to figure out solutions... more like taking a test in which the teacher marks what's wrong in order for me to review what I missed...
So in conclusion, a mentor?
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:01
part of being developer is doing your red mark by debugging, but tomorrow morning if you still have it not working I will take a hour or what takes to solve it oK?
but only if you now take the rest of your time debugging :D
Kristina
@kikidesignnet
Nov 07 2017 22:02
okay. Thanks! I'm going now to console.log and debug my code. Bye! It was nice talking to you!
Btw, how do I find out more about you? I'm curious about you
Never mind. Just saw your freeCodeCamp profile. Congratulations on your certification!!
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:28
im just a random guy who had alot of support on the start cmccormack forkerino and sjames1958gm are probably the reason I didnt gave up, they probably dont remember but in may I would spam this chat with questions about everything :D
Jason Luboff
@JLuboff
Nov 07 2017 22:28
Dang I don't get any credit?
Christopher McCormack
@cmccormack
Nov 07 2017 22:29
@tiagocorreiaalmeida oh we remember
:D
@JLuboff I appreciate your help!
alpox
@alpox
Nov 07 2017 22:31
@tiagocorreiaalmeida good that you made it through that man ;)
Jason Luboff
@JLuboff
Nov 07 2017 22:31
@cmccormack And I appreciate yours my friend
Christopher McCormack
@cmccormack
Nov 07 2017 22:32
@JLuboff did you just use glitch and mlab for your web apps?
I just finished my APIs and looking to gather details
Jason Luboff
@JLuboff
Nov 07 2017 22:32
Yes.. well Heroku or Glitch and mlab
I've had more trouble with deployment on Heroku then glitch, and never investigated why just went to glitch lol
Christopher McCormack
@cmccormack
Nov 07 2017 22:33
Glitch is so simple I'm not sure why we'd use Heroku honestly
Jason Luboff
@JLuboff
Nov 07 2017 22:34
Auto-github update on heroku is awesome. With glitch, you have to go in, grant access, then import from github each time you make a change
Christopher McCormack
@cmccormack
Nov 07 2017 22:34
yeah that's fair
Jason Luboff
@JLuboff
Nov 07 2017 22:35
Thats my only real gripe with glitch. Otherwise, ya, it has a built in editor which is nice if I want to do a quick production test I don't have to go changing things locally, push to github and wait a minute for deployment
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:38
sorry :D alpox and you helped me quite alot in the last weeks but on the start it was a big struggle for me
Jason Luboff
@JLuboff
Nov 07 2017 22:38
@cmccormack I'm saving the day with storage... zipping up a bunch of folders.. Started at 1.07TB used space, have it down to 820 ( I think when I checked last at least). On the last folder which is 263 GB unzipped.. should reduce down to ~130 GB after zipping
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:38
anyway wanna break my app @JLuboff ?:D
Christopher McCormack
@cmccormack
Nov 07 2017 22:39
@JLuboff personal storage?
Jason Luboff
@JLuboff
Nov 07 2017 22:39
@cmccormack Nah, work storage
@tiagocorreiaalmeida I can try
Christopher McCormack
@cmccormack
Nov 07 2017 22:39
Do they have to unzip to use or is it old?
alpox
@alpox
Nov 07 2017 22:39
@tiagocorreiaalmeida haha no worries my friend. I actually couldnt help you much, i was just your duck for your rubber duck debugging :D
Jason Luboff
@JLuboff
Nov 07 2017 22:40
It's backups of terminated user data, so its for archival purposes. I doubt they'll ever be used again lol @cmccormack
Christopher McCormack
@cmccormack
Nov 07 2017 22:40
hah burn it
Jason Luboff
@JLuboff
Nov 07 2017 22:40
If only...
We've been running out of storage space on our main system (netapp) so started looking at our other storage devices to see what else we could save
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:43
@alpox you made me see how promises should be really used :D life saver :D
alpox
@alpox
Nov 07 2017 22:43
@tiagocorreiaalmeida ah well that little thing :D
Christopher McCormack
@cmccormack
Nov 07 2017 22:44
@JLuboff how long do you keep it? You could put it in Amazon glacier
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:45
https://tiagocorreia-marketstocks.glitch.me/ dont look at the design for now :D , break it in half!!
Christopher McCormack
@cmccormack
Nov 07 2017 22:53
@tiagocorreiaalmeida I would suggest you add a keyboard event handler for 'enter'/'return' in your stock input
since you didn't use a form
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:54
yeah I did that on the nightlife that's the parts that I leave for last was on my checklist :D
found any issue?
is*
Christopher McCormack
@cmccormack
Nov 07 2017 22:55
Yeah return doesn't submit my query
:)
@tiagocorreiaalmeida I think it looks great
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:57
took me a while to make those things work all together tbh and was the first time using sockets on something created by me even tough it wasnt nothing of special :D
Christopher McCormack
@cmccormack
Nov 07 2017 22:57
Maybe move your input above the chart for smaller screens
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 22:57
time for some codewars :D
yeah Im gonna change entire ui
Christopher McCormack
@cmccormack
Nov 07 2017 22:57
see ya
Tiago Correia
@tiagocorreiaalmeida
Nov 07 2017 23:00
thanks for looking into it and testing @cmccormack see you all tomorrow
CamperBot
@camperbot
Nov 07 2017 23:00
tiagocorreiaalmeida sends brownie points to @cmccormack :sparkles: :thumbsup: :sparkles:
:star2: 1264 | @cmccormack |http://www.freecodecamp.com/cmccormack
Jason Luboff
@JLuboff
Nov 07 2017 23:23
@cmccormack Amazon glaciar maybe a solution but technically the storage device this is on isn't mission critical so..eh.
@tiagocorreiaalmeida App looks good. Only problem I see is after entering an invalid symbol, the message doesn't disappear on my next search.