These are chat archives for FreeCodeCamp/Help

20th
Mar 2015
Quincy Larson
@QuincyLarson
Mar 20 2015 01:16
@Buzzlightyear90 thanks again for filing the ticket. We’ve fixed it.
Oleg
@OlegKuts
Mar 20 2015 07:26
morning all :smile:
Viacheslav
@Stee1House
Mar 20 2015 10:06
help please with bonfire -
function bouncer(arr) {
  var count = 0;
  for(var i = 0; i < arr.length; i++) {
    if (arr[i] === false || arr[i] ===  null || arr[i] ===  0 || arr[i] === "" || arr[i] ===  undefined || arr[i] ===  NaN) {
      console.log(arr[i]);
      arr.splice(i, 1);
    } else {
      break;
    }
  }
  return arr;
}

console.log(bouncer([7, 'ate', '', false, 9]));
Sudeepto
@Sudeepto
Mar 20 2015 10:16
@Stee1House Link of the bonfire ?
Viacheslav
@Stee1House
Mar 20 2015 10:28
okay i'm change some code
function bouncer(arr) {
  for(var i = 0; i <= arr.length; i++) {
    if (!(arr[i])) {
      arr.splice(i, 1);
    }
}
  return arr;
}

console.log(bouncer([7, 'ate', '', false, 9]));
but don't work
Viacheslav
@Stee1House
Mar 20 2015 11:00
all work
Sudeepto
@Sudeepto
Mar 20 2015 11:09
@Stee1House Did you solved it ??
Sudeepto
@Sudeepto
Mar 20 2015 11:28
@Stee1House There is a one-line solution for it. PM me if you want to see it.
JMCQ87
@JMCQ87
Mar 20 2015 14:27

If anyone else also has problems understanding Regex (Challenge 33), I put together a few links a friend suggested to me in a blog post: http://europreneur.net/2015/03/freecodecamp-part-4-beyond-codecademy-js-regex-bonfires/

Haven't looked through all of it yet, but some of it seems to be helpful.

Brian
@bconner22
Mar 20 2015 16:19
hey guys! question on the bonfire where you have to compare members of collection and source, the romeo and juliet example. I don't want the answer, just to know if I'm on the right track. In the first test, it's comparing an array of objects to an object. In the remaining tests, it compares an array of objects to an array of objects. My question is, do I have to seek out the type of variables I'm comparing first, and decide how to loop over them depending on if I'm comparing array of objects > object, or array of objects > array of objects? Or am I missing something simple and can use the same loop to do both scenarios? I can't get a length of an object!
Meta Hirschl
@MetaCoderHirschl
Mar 20 2015 16:21
@JMCQ87 nice to offer additional help like that.
Oliver
@Dadsaster
Mar 20 2015 16:40
@bconner22 you can use a for in loop to iterate over an array or an object. I only vaguely remember the bonfire. If you post the test cases I might be able to be a little more helpful.
Brian
@bconner22
Mar 20 2015 16:44
hmmm @Dadsaster I read that using a for in loop on arrays was a bad idea
Evan Davis
@davisec52
Mar 20 2015 16:44
@bconner22 apologies if this does not help--but the way I approached this was to compare the key:value pairs of the second argument to the key:value pairs of the objects in the array.
@davisec52 actually that does help, thanks! I was so focused on the for loop part that I was mentally blocked on the key:value thing... that's what I get for taking a couple of weeks off!
Evan Davis
@davisec52
Mar 20 2015 16:45

'Morning/afternoon everybody. I'm working my way through the Nodejs Succinctly book.
I am on the error handling chapter, and overall it is going well, but I have
a question.

Following the instructions, I have created an error logger demo
and coded it to be logged to c:\temp. Although the code creates
the error log file, I can't seem to get it to place it in the
directory /temp.

Below, I have included
the code from my loggerdemo.js file:


var log4js = require('log4js');

log4js.loadAppender('file');
log4js.addAppender(log4js.appenders.file('c:\temp\myapplication.log'), 'myapplication');  

var logger = log4js.getLogger('myapplication');
logger.info('Application is running');
logger.warn('Module cannot be loaded');
logger.error('Saved data was error');                  //test error messages 
logger.fatal('Server could not process');
logger.debug("some debug messages");

Here is the output from the Node.js command prompt panel:


Your environment has been set up for using Node.js 0.12.0 (ia32) and npm.

C:\Documents and Settings\Evan>node loggerdemo.js
[2015-03-20 11:23:31.190] [INFO] myapplication - Application is running
[2015-03-20 11:23:31.198] [WARN] myapplication - Module cannot be loaded
[2015-03-20 11:23:31.200] [ERROR] myapplication - Saved data was error
[2015-03-20 11:23:31.201] [FATAL] myapplication - Server could not process
[2015-03-20 11:23:31.201] [DEBUG] myapplication - some debug messages
log4js.fileAppender - Writing to file c:        empmyapplication.log, error happ
ened  { [Error: ENOENT, open 'c:\Documents and Settings\Evan\   empmyapplication
.log']
  errno: -4058,
  code: 'ENOENT',
  path: 'c:\\Documents and Settings\\Evan\\\tempmyapplication.log' }

C:\Documents and Settings\Evan>
Ashley Drake
@aldraco
Mar 20 2015 16:45
^^ check out the functions for the global Object to find ones that will give you key values.
Brian
@bconner22
Mar 20 2015 16:46
@aldraco thanks! Sometimes it just takes a nudge to get back in gear.... appreciate the help guys/gals!
Ashley Drake
@aldraco
Mar 20 2015 16:47
indeed!
Jason Braun
@jasonbraun
Mar 20 2015 20:48
Hey everyone, is it just me? it keeps rejecting my login
lotbs
@LookOnTheBrightSide
Mar 20 2015 20:54
hey all
having some trouble with express
can anyone help
Ashley Drake
@aldraco
Mar 20 2015 21:05
@LookOnTheBrightSide what's the issue?