These are chat archives for FreeCodeCamp/Help

1st
Mar 2015
Dominic Jones
@towwiow
Mar 01 2015 00:06
anyone with ubuntu experience help me figure out how to clean this
oops
one moment, gotta upload it somewhere.
alt
there we go lol
Dominic Jones
@towwiow
Mar 01 2015 00:13
any help would be mightily obliged. I tried the sudo apt-get clean command and it doesn't even recognize it.
I'm a linux command line n00b.
Cristián Berríos
@crisberrios
Mar 01 2015 00:16
seems that you don't have enough disk space on the partition
but it says /boot and that's weird since Ubuntu shouldn't be on /boot
Dominic Jones
@towwiow
Mar 01 2015 00:20
I have no idea man.
anyway we can skype and I can show you my screen and you can look around in it?
I just went through the startup process lol and i've been running it for a couple months now. Have had some issues with mounting to disk and crashes when it overheats but other than that, everything else has been smooth.
If you can't, no big deal, just let me know.
Darryl Dixon - Piece Digital
@piecedigital
Mar 01 2015 01:08
Are you using a partition? it looks like you need to check into making the partition bigger.
Dominic Jones
@towwiow
Mar 01 2015 01:13
no, it's the only thing running on this laptop now my friend.
i wiped the windows that was on it and fully replaced it with ubuntu
Hannan Ali
@abdulhannanali
Mar 01 2015 01:13
@towwiow How much space did you allocate to /boot partition?
Dominic Jones
@towwiow
Mar 01 2015 01:14
whatever it is by default. I don't remember changing anything on it at all @abdulhannanali
Hannan Ali
@abdulhannanali
Mar 01 2015 01:15
@towwiow Go to Disk Usage Analyzer in Ubuntu
Send a screenshot
Dominic Jones
@towwiow
Mar 01 2015 01:15
yessir.
one moment sir
Hannan Ali
@abdulhannanali
Mar 01 2015 01:17
click on the name of your computer and then make a screenshot
Like this one
blob
Dominic Jones
@towwiow
Mar 01 2015 01:18
ok
Hannan Ali
@abdulhannanali
Mar 01 2015 01:18
It's okay if there's disk instead of squares
blob
Dominic Jones
@towwiow
Mar 01 2015 01:19
linux_data.png
I don't even see /boot in there
Hannan Ali
@abdulhannanali
Mar 01 2015 01:19
Yeah me too
Nathan
@terakilobyte
Mar 01 2015 01:20
is this the fcc vm?
Hannan Ali
@abdulhannanali
Mar 01 2015 01:20
I think that's related to this problem
@terakilobyte Does FCC has a virtual machine?
Nathan
@terakilobyte
Mar 01 2015 01:20
yep
you can find the link on the forums
Hannan Ali
@abdulhannanali
Mar 01 2015 01:21
@terakilobyte WOW!
Okay
@terakilobyte Please help us
Nathan
@terakilobyte
Mar 01 2015 01:21
yeah I preconfigured a vm image for everyone
that’s fully set up for web dev
Hannan Ali
@abdulhannanali
Mar 01 2015 01:21
There's no boot folder in the screenshot of @towwiow
Nathan
@terakilobyte
Mar 01 2015 01:21
that’s not really alarming
but is alarming is the fact that two folders are almost the same size
smacks of data duplication
Dominic Jones
@towwiow
Mar 01 2015 01:22
this is of my own laptop @terakilobyte - not on the fcc VM
Hannan Ali
@abdulhannanali
Mar 01 2015 01:22
@terakilobyte Yup but it's not letting him update some things
Dominic Jones
@towwiow
Mar 01 2015 01:22
I've never access the FCC VM (yet)
Screenshot from 2015-02-28 20:20:32.png
Hannan Ali
@abdulhannanali
Mar 01 2015 01:23
@towwiow Ok! He's saying it's not an issue
Nathan
@terakilobyte
Mar 01 2015 01:23
I think you need to clean up other stuff and linux will allocate space as it needs
Hannan Ali
@abdulhannanali
Mar 01 2015 01:23
But let's see what can we do
@towwiow Is it a kernel update you wanna do?
Dominic Jones
@towwiow
Mar 01 2015 01:25
I've just been accepting all the software updates that I see.
Hannan Ali
@abdulhannanali
Mar 01 2015 01:25
@towwiow Cool!
Dominic Jones
@towwiow
Mar 01 2015 01:25
I'll click on the settings next time.
Hannan Ali
@abdulhannanali
Mar 01 2015 01:26
@towwiow How old is the installation?
Dominic Jones
@towwiow
Mar 01 2015 01:26
once I've installed applications, it's okay to delete the .deb packages?
Hannan Ali
@abdulhannanali
Mar 01 2015 01:27
@towwiow Yeah
Dominic Jones
@towwiow
Mar 01 2015 01:27
just a couple months
Hannan Ali
@abdulhannanali
Mar 01 2015 01:27
One way to fix this problem is to remove the old kernel versions you are not using
@towwiow Are you okay with that?
Did you run sudo apt-get clean?
Dominic Jones
@towwiow
Mar 01 2015 01:29
as long as I figure out how to do it. check the private chat.
Yeah I did run that command and it didn't work, said it doesn't exit
well nevermind, it just worked i think..
asked me for my password, then just went back to the regular command line after I entered the password
Hannan Ali
@abdulhannanali
Mar 01 2015 01:31
@towwiow Yeah you have to enter the password
@towwiow next time update comes update it and if shows error again please let me know in P<
PM
We'll figure it out
@towwiow If you want to be Familiar with linux there's a free course offering on edx known as Introduction to Linuxx
given by linux foundation
Check that out
Bye gotta go
Dominic Jones
@towwiow
Mar 01 2015 01:52
Hannan Ali
@abdulhannanali
Mar 01 2015 01:52
@towwiow So is it solved?
Dominic Jones
@towwiow
Mar 01 2015 01:52
@abdulhannanali I'm taking that course, just haven't had enough time to get through it.
Hannan Ali
@abdulhannanali
Mar 01 2015 01:53
oh
Dominic Jones
@towwiow
Mar 01 2015 01:53
check PM
Ashley Drake
@aldraco
Mar 01 2015 02:08
i am one. penny. off. on the cash register :)
Ashley Drake
@aldraco
Mar 01 2015 02:14
ok, got the correct values, but the formatting of the numbers in the tests is inconsistent ... sometimes two decimal places, sometimes there's a trailing zero, other times not. Am I missing something? or is it the tests?
Todd Smith
@tenspeed
Mar 01 2015 02:48
hey everyone
I'm having a problem with challenge number 8
(Get Started With jQuery)
Cristián Berríos
@crisberrios
Mar 01 2015 02:56
what's the problem?
Todd Smith
@tenspeed
Mar 01 2015 03:03
I figured it out
I thought my browser was having issues with the code school site
but it was just me :)
John Ellis
@johnmellis
Mar 01 2015 05:08
Need a little help on Angular.js (lesson 2.10)
Cristián Berríos
@crisberrios
Mar 01 2015 05:12
hey john
what's troubling you?
Angular is my weakest link but let's try
John Ellis
@johnmellis
Mar 01 2015 05:13
I got through it but I don't quite understand what it's doing
I created a controller that would set the current image to a value
so the ending 'ng-src' was
ng-src="products.images[gallery.current]"
but I don't understand why it's working
Cristián Berríos
@crisberrios
Mar 01 2015 05:14
hmm well, as soon as you add ng-app to the html
John Ellis
@johnmellis
Mar 01 2015 05:14
``` <!-- Image Gallery -->
<div class='gallery' ng-show="product.images.length">
<img ng-src="{{product.images[0]}}" />
<ul class="list-inline thumbs">
<li class="thumbnail" ng-repeat="image in product.images">
<img ng-src="{{image}}" />
</li>
</ul>
</div>
Cristián Berríos
@crisberrios
Mar 01 2015 05:14
angular starts doing it's magic
John Ellis
@johnmellis
Mar 01 2015 05:14
that's the code
I changed product.image[0] to what i pasted before
Here's the gallery controller
app.controller('GalleryController', function(){
this.current = 0;
this.setCurrent = function(newGallery){
this.current = newGallery || 0;
};
});
I just don't understand what it's doing
it's like voodoo and chicken bones
Cristián Berríos
@crisberrios
Mar 01 2015 05:15
that's angular :P
I'll also have to redo CodeSchool course (plus the new, more advanced one)
and already have some books in my reading queue
Darryl Dixon - Piece Digital
@piecedigital
Mar 01 2015 05:34
@johnmellis Here's the thing about CodeSchool
All of their lessons in that format, where they auto check your code, are bugged.
Sometimes they don't get the entire code when you type it.
Ganesh Kumar Subramanian
@gans220
Mar 01 2015 09:59
Hi guys! I am having a very hard time understanding nodejs. I am able to complete challenges but with zero understanding. Any suggestions on how I can cope up?
Nathan
@terakilobyte
Mar 01 2015 10:00
nodeschool.io
both excellent resources
Ganesh Kumar Subramanian
@gans220
Mar 01 2015 10:01
Thanks @terakilobyte , I ll check em out right away! :)
John Ellis
@johnmellis
Mar 01 2015 15:33
Angular breaks my brain
Meta Hirschl
@MetaCoderHirschl
Mar 01 2015 18:34
need help on bonfire...it's only the third one but can't get it to work. Of coures I think my logic is good...gr. anyone available?
Ashley Drake
@aldraco
Mar 01 2015 18:34
what do you have so far? i can try and help.
Oliver
@Dadsaster
Mar 01 2015 18:40
you can post code by typing ``` before and after the code block
(which is on the tilde key ~)
Hannan Ali
@abdulhannanali
Mar 01 2015 19:11
Hello World
Meta Hirschl
@MetaCoderHirschl
Mar 01 2015 19:18
how many bonfires are there? how can you tell where you are in the process? the Challenges were so clear, I was just wondering....thanks
Danny Fritz
@dannyfritz
Mar 01 2015 19:18
@MetaCoderHirschl you can find all the bonfires here: https://github.com/FreeCodeCamp/freecodecamp/blob/master/seed_data/bonfires.json
Meta Hirschl
@MetaCoderHirschl
Mar 01 2015 19:26
so, 73? does that sound right. whew that's a lot!
oh, wrong number, counted all 'names' some are in code, will recalc
John Ellis
@johnmellis
Mar 01 2015 19:31
If anyone needs a 2 day pass for codeschool - use this link to get some http://go.codeschool.com/bmsxuA
Meta Hirschl
@MetaCoderHirschl
Mar 01 2015 19:39
okay recalc on bonfires -- appear to be 40 of them, fyi!
Nathan
@terakilobyte
Mar 01 2015 21:23
we’ll be adding in the ability to see all bonfires soon
sorry for the inconvenience
you’ll also be able to see other user’s solutions in the future
work in progress, we’re still bolting the spaceship together ;)
Hannan Ali
@abdulhannanali
Mar 01 2015 21:31
@terakilobyte WOW! That's cool!
Bonfires experience is better than coderbyte
Nathan
@terakilobyte
Mar 01 2015 21:36
thanks, it’s why we made it ;)
give you guys a better product
Hannan Ali
@abdulhannanali
Mar 01 2015 21:45
I don't know what's wrong here the code seems fine to me. I think there's a problem with ma formula of orbital period but I have typed it exactly as the Kepler's formula states can somebody help. This is Challenge Map The Debris. The 4th challenge from the last.
function orbitalPeriod(arr) {
//Use 398600.4418 for GM. Look up any other values on wolfram alpha
    var newArr = [];
    var GM = 398600.4418;
    arr.map(function(value, index, array){
        var obj = {};
        obj.name = value.name;
        var orbitalPeriod = Math.round(2*Math.PI*(Math.sqrt((Math.pow(value.avgAlt,3))/GM)));
        obj.orbitalPeriod = orbitalPeriod;
        newArr.push(obj);
    });
    return newArr;

}
Nathan
@terakilobyte
Mar 01 2015 21:46
how large is the earth?
and are orbital periods calculated from the center of the orbited body or the surface?
;)
Hannan Ali
@abdulhannanali
Mar 01 2015 21:47
The GM value is as specified by you in comments in bonfires.
Nathan
@terakilobyte
Mar 01 2015 21:48
yep it sure is
but you aren’t taking into account the radius of the earth
avgalt is the distance it is above the earth’s surface
Hannan Ali
@abdulhannanali
Mar 01 2015 21:49
Oh
Nathan
@terakilobyte
Mar 01 2015 21:49
;)
Hannan Ali
@abdulhannanali
Mar 01 2015 21:49
So I have to add the radius of the earth too
Nathan
@terakilobyte
Mar 01 2015 21:49
perhaps
time, a little bit of code, and a couple tests will tell!
Hannan Ali
@abdulhannanali
Mar 01 2015 21:49
@terakilobyte Thank you very much...
Oliver
@Dadsaster
Mar 01 2015 22:08
I just finished this challenge and the code works but it feels dirty to me. Does anyone have a more elegant solution?
function pairwise(arr, arg) {
   var cop = arr;
   var total = 0;
   for(var i = 0;i < cop.length; i++){
       for (var j = i+1; j <cop.length; j++){
           if(cop[i]+cop[j] === arg && arr[i]+arr[j] === arg) {
             total +=  cop.indexOf(cop[i]) + cop.indexOf(cop[j]);
             arr[i] = "x";
             arr[j] = "x";
           }
       }
   }
   return total;
}

pairwise([0, 0, 0, 0, 1, 1], 1);
Ashley Drake
@aldraco
Mar 01 2015 22:12
@Dadsaster you could use an array.forEach instead of a for loop, that might make it seem cleaner.
Oliver
@Dadsaster
Mar 01 2015 22:17
@aldraco thanks - I think it's the assigning of "x" on arr that makes me feel dirty not the for loops. Do array.forEach and a for loop process at the same speed?
Ashley Drake
@aldraco
Mar 01 2015 22:18
i have no idea - but i'd love to know
Hannan Ali
@abdulhannanali
Mar 01 2015 22:18
@Dadsaster Yeah you're right
Ashley Drake
@aldraco
Mar 01 2015 22:18
i would think it's faster, because a for loop has to check a variable and update a variable every time
while forEach just goes through until it stops
Hannan Ali
@abdulhannanali
Mar 01 2015 22:19
My solution is very identical to yours
@Dadsaster So I also want to make it some more efficient
Oliver
@Dadsaster
Mar 01 2015 22:20
@aldraco - I think you are probably right
Julie Myers
@BlueOceanView
Mar 01 2015 22:23
@Dadsaster There is also an array.prototype.reduce() method that does all the math for you.
Here is an example:
[0, 1, 2, 3, 4].reduce(function(previousValue, currentValue, index, array) {
  return previousValue + currentValue;
});
result is 10
Oliver
@Dadsaster
Mar 01 2015 22:27
@BlueOceanView Ahhhhh! - me likey
Vince
@Vince33
Mar 01 2015 22:29
@Dadsaster I like the last one
Julie Myers
@BlueOceanView
Mar 01 2015 22:29
:)
@Dadsaster The coding I put in doesn't solve the entire problem. But, it does do all the adding.
Ashley Drake
@aldraco
Mar 01 2015 23:01
anybody tackled no repeats yet?
Nathan
@terakilobyte
Mar 01 2015 23:11
I did! @aldraco
Ashley Drake
@aldraco
Mar 01 2015 23:14
Can I sanity check my approach real quick? In trying to solve it mathematically, ie not by actually building each permit ion ... Am I on the right track?
Ashley Drake
@aldraco
Mar 01 2015 23:19
I probably need to make sure I'm not using a bad formula.
Danny Fritz
@dannyfritz
Mar 01 2015 23:49
@aldraco i'm doing that bonfire now, but i have one test case failing and i'm not sure why yet
it is hard to figure out why i get 2660 combinations and the bonfire has 2640 combinations
Danny Fritz
@dannyfritz
Mar 01 2015 23:54
oh nvm, i got it
Ashley Drake
@aldraco
Mar 01 2015 23:56
That's encouraging! Nice job! So you're done now too!
Danny Fritz
@dannyfritz
Mar 01 2015 23:56
i did it in a way that only looks at ones that are possible too
didn't look at all combinations
did you get yours to not look at every combination like you wanted too?