These are chat archives for FreeCodeCamp/Help

28th
Feb 2015
Ryan Malm
@Rybar
Feb 28 2015 00:11
I am
Danny Fritz
@dannyfritz
Feb 28 2015 00:32
Cristián Berríos
@crisberrios
Feb 28 2015 01:36
:/ how come there isn't 1 decent sftp module in npm
I'll try with gulp
Hannan Ali
@abdulhannanali
Feb 28 2015 01:42
@dannyfritz
It can work in any site
if they don't have it added in their lib
Danny Fritz
@dannyfritz
Feb 28 2015 01:43
yeah, but only if the site puts the script on their page. or if everyone inserts it manually
just sharing a link isn't enough if the site doesn't have the script
Hannan Ali
@abdulhannanali
Feb 28 2015 01:43
@dannyfritz it is needed by one person to manually add it
Danny Fritz
@dannyfritz
Feb 28 2015 01:43
nope, by all of them
Hannan Ali
@abdulhannanali
Feb 28 2015 01:44
@dannyfritz Did you click the last link?
I shared
Danny Fritz
@dannyfritz
Feb 28 2015 01:44
yeah, freecodecamp includes the script on the page already
which is the github post i linked
Hannan Ali
@abdulhannanali
Feb 28 2015 01:44
Yeah okay it's cool
FCC cares
Danny Fritz
@dannyfritz
Feb 28 2015 01:46
:)
did you finish your prime summer?
Hannan Ali
@abdulhannanali
Feb 28 2015 01:51
@dannyfritz Yup! I did! :)
Danny Fritz
@dannyfritz
Feb 28 2015 01:51
did you end up being more efficient than brute force?
Hannan Ali
@abdulhannanali
Feb 28 2015 01:51
Math.sqrt method was bruteforce too.
So Better than checking all of 'em
Cristián Berríos
@crisberrios
Feb 28 2015 01:52
[19:49:49] gulp-sftp: Uploaded: 1425073823167-table.csv => /kwitansicsv/1425073823167-table.csv
[19:49:50] gulp-sftp: Uploaded: 1425073882908-table.csv => /kwitansicsv/1425073882908-table.csv
[19:49:50] gulp-sftp: 2 files uploaded successfully
[19:49:50] SFTP :: SFTP session closed
[19:49:50] Connection :: end
at last!
gulp made things easier :D
Hannan Ali
@abdulhannanali
Feb 28 2015 01:52
but I'll implement the Sieve of Eratosthenes afterwards
Danny Fritz
@dannyfritz
Feb 28 2015 01:53
deploy in your build step? :)
Cristián Berríos
@crisberrios
Feb 28 2015 01:53
no
we have to receive json data
and upload it as csv throug sftp
since the nonprofit doesn't have a webservice yet
Danny Fritz
@dannyfritz
Feb 28 2015 01:54
cool
Hannan Ali
@abdulhannanali
Feb 28 2015 01:54
@dannyfritz Your sound cloud username is super cool
TECHNOCAT
Danny Fritz
@dannyfritz
Feb 28 2015 01:54
technocat used to be what i went by online
when i went to university i switched to dannyfritz
Cristián Berríos
@crisberrios
Feb 28 2015 01:54
now I only have to add some error handling and watcher
Hannan Ali
@abdulhannanali
Feb 28 2015 02:00
@dannyfritz Both are super cool.
I need some help with smallest common multiple challenge.
Stuck on it.
I am calculating the product by multiplying all the numbers in a given range
but after doing it I know I have to find the GCD.. but need suggestions on how to proceed
Danny Fritz
@dannyfritz
Feb 28 2015 02:07
@abdulhannanali i just implemented the sieve. you want to see it?
Hannan Ali
@abdulhannanali
Feb 28 2015 02:07
@dannyfritz Yeah!
Send me the link
Danny Fritz
@dannyfritz
Feb 28 2015 02:10
trying to get ramda into jsbin
Hannan Ali
@abdulhannanali
Feb 28 2015 02:14
@dannyfritz Thanks!
Christopher Hutchinson
@cshutchinson
Feb 28 2015 02:15
its rewarding to finally find a bug after two days of looking ;)
Danny Fritz
@dannyfritz
Feb 28 2015 02:17
wow, 2 days
where was it hiding
Christopher Hutchinson
@cshutchinson
Feb 28 2015 02:45
@dannyfritz a capital letter in a ng-directive in the wrong place :)
Danny Fritz
@dannyfritz
Feb 28 2015 02:53
haha yeah, the hardest to find bugs are always the most trivial
when i first picked up angular.js in 2012 i quickly dropped it after finding debugging it was a nightmare
Christopher Hutchinson
@cshutchinson
Feb 28 2015 02:56
i was looking in passport, express-js , passport local debugging the hell out of them… nothing…only when i started going up the chain did I stumble across it
Cristián Berríos
@crisberrios
Feb 28 2015 02:56
@dannyfritz what's your take on the pros of learning Angular vs other popular framework as a skill to have in your CV? I really, really want to avoid Angular, but also I don't want to further limit my job options
Christopher Hutchinson
@cshutchinson
Feb 28 2015 02:56
learned a lot in process however
hi @crisberrios
Cristián Berríos
@crisberrios
Feb 28 2015 02:57
hi @cshutchinson
Danny Fritz
@dannyfritz
Feb 28 2015 02:57
you can learn angular quick enough you can put it on your resume after a couple days
and then just use it as a talking point
recruiters love ticking that box off
Cristián Berríos
@crisberrios
Feb 28 2015 02:58
I guess I'd have to do at least something interesting with the framework and put it in my portfolio
Danny Fritz
@dannyfritz
Feb 28 2015 02:59
yeah, just build a quick little app with it and move on
Christopher Hutchinson
@cshutchinson
Feb 28 2015 02:59
what do you guys focus your time on if not angular?
Danny Fritz
@dannyfritz
Feb 28 2015 02:59
i wouldn't become super good at angular unless i was being paid
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 02:59
Besides no backwards compatibility what's the issue with AngularJS?
Danny Fritz
@dannyfritz
Feb 28 2015 03:00
the html parser is a huge hole that makes it harder to debug
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:00
Oh.
Danny Fritz
@dannyfritz
Feb 28 2015 03:00
the factory, service, $scope, etc. abstractions are nuts
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:00
:)
Danny Fritz
@dannyfritz
Feb 28 2015 03:00
back in 2012 when i first started using angular, you couldn't use jqueyr with it because of the DI system
Cristián Berríos
@crisberrios
Feb 28 2015 03:01
I just don't like gluing everything together with ng-thingies everywhere
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:01
danny what tools / packages do you work with most?
outside of node mongo and express?
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:01
ty
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:01
I don't like the idea of it being hard to debug. I make bugs all the time LOL
Danny Fritz
@dannyfritz
Feb 28 2015 03:01
we all do
debugging is sometimes the majority of your time spent
so make it as easy as possible
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:02
Good thing I didn't use it for my blog then. I spent a few days on that.
Danny Fritz
@dannyfritz
Feb 28 2015 03:03
i tend to gravitate to the smaller frameworks
some people gravitate to the larger ones
you just need to find your place
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:03
I don't want anything over complicated.
Is reactJS over complicated?
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:04
@dannyfritz you are right; i am trying to find my place still travelling the desert of despair
Danny Fritz
@dannyfritz
Feb 28 2015 03:04
i think it is, but i also think reactjs is great. i just use vue.js instead
the smaller version of react is https://github.com/Matt-Esch/virtual-dom
this faq is pretty good at describing differences between view frameworks http://vuejs.org/guide/faq.html
Cristián Berríos
@crisberrios
Feb 28 2015 03:09
I haven't seen riotjs mentioned much, maybe it's not that good or not so popular yet. Learned about it in Programming JavaScript Applications
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:09
@dannyfritz thanks for links
Nathan
@terakilobyte
Feb 28 2015 03:10
React itself isn’t very complicated I don’t think
the trimmings you add to the plate to make an isomorphic application certainly add a ton of complexity though
as we switch fcc over to loopback in preparation of stacking flux/react/rxjs on top the server is becoming more complex in a way, but simpler in others
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:14
I hate the idea of all of my teachings being uprooted
Nathan
@terakilobyte
Feb 28 2015 03:14
why?
you’re going to have to constantly learn new things
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:15
Yeah but not so quick before I get to learn it.
I
I've been told it's not good to "lang-hop" when learning languages.
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:15
hi @terakilobyte
Nathan
@terakilobyte
Feb 28 2015 03:15
until you get a job that has architecture deeply rooted in certain frameworks you should really strive to at least be a tad familiar with the major frameworks and methods out there
and they aren’t all that different. Any of the “functional” component frameworks all have the same base idea from what Iv’e seen. Same for the traditional frameworks
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:16
I have yet to use them. :/
Danny Fritz
@dannyfritz
Feb 28 2015 03:17
i'm finding nuclear-js and vue.js to be really dreamy.
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:17
I switched once from Ruby to JS
Nathan
@terakilobyte
Feb 28 2015 03:19
yeah I have the links you’ve posted marked to read later @dannyfritz
hey there @cshutchinson !
and you may very well end up switching back one day if your employer wants you to
it’s never really relearning
it’s just learning more
relearning implies you’ve forgotten or learned the wrong thing
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:23
nathan can you open a web browser in a pane of web storm?
i thought I saw you with something like that going on in twitch one night
Nathan
@terakilobyte
Feb 28 2015 03:23
not sure, never tried
not in a pane inside
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:23
kk thanks
Hannan Ali
@abdulhannanali
Feb 28 2015 03:24
@dannyfritz I built an app using angular js it's similar to their phone catalog official tutorial
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:24
love have console tabs open beside the editor that is cole
Nathan
@terakilobyte
Feb 28 2015 03:24
it will open a browser for you though and do a liveload preview if you have it configured correctly
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:24
yes
i paid up and bought it; learning keyboard shortcuts
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:24
Yeah, true.. but does learning not involve doing? Because I still have yet to "do"
Nathan
@terakilobyte
Feb 28 2015 03:24
you should be doing while learning
if you aren’t you’re wasting your time imo
I didn’t just read some react stuff and watch videos
I read tutorials, grabbed the repo from github to follow along, changed stuff, did stuff extra just to test ideas
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:25
I need something to apply it to. I planned on using angular and sass for the website I'm building.
Nathan
@terakilobyte
Feb 28 2015 03:25
same while watching video recordings from meetups
Hannan Ali
@abdulhannanali
Feb 28 2015 03:26
@terakilobyte Is react similar to angular?
Nathan
@terakilobyte
Feb 28 2015 03:27
not in the slightest way
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:27
but now I'm having second thoughts about angular
Nathan
@terakilobyte
Feb 28 2015 03:28
I think @dannyfritz gave you some excellent advice
make something simple, even use it in a non-profit
Hannan Ali
@abdulhannanali
Feb 28 2015 03:28
@terakilobyte I am focusing on mean stack still but how do people come to know about these other frameworks like react, ramda?
Nathan
@terakilobyte
Feb 28 2015 03:28
ramda is a library
Hannan Ali
@abdulhannanali
Feb 28 2015 03:29
@terakilobyte Sorry!
Nathan
@terakilobyte
Feb 28 2015 03:29
just pay attention to tweets from people in the industry, read blogs, keep learning
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 03:29
Ok, I guess I can make something small. I'm not yet at the non-profits.
I'd been focused on getting there.
Hannan Ali
@abdulhannanali
Feb 28 2015 03:30
@terakilobyte Thank you. So I guess it's just the continuation of the never ending learning process.
Nathan
@terakilobyte
Feb 28 2015 03:30
pretty much
my personal goal is to learn as much as I can. I’m pretty good with angular as it is
Hannan Ali
@abdulhannanali
Feb 28 2015 03:31
@terakilobyte I was watching you pair program and you were super cool there. :+1:
Nathan
@terakilobyte
Feb 28 2015 03:31
now I’d like to learn react/flux/ and a frp library
then I’ll probably look into meteor
when I apply for a job I’ll be able to say I’m familiar with all of them and present bodies of work that use all of them
Hannan Ali
@abdulhannanali
Feb 28 2015 03:31
@terakilobyte When is the next session of pair program?
Nathan
@terakilobyte
Feb 28 2015 03:31
if the job requires angular, I’ll focus on it
believe it’s next tuesday at 9 pm est
I’m in korea now so I don’t do the live streams anymore
though I’ll probably start a weekend stream
Hannan Ali
@abdulhannanali
Feb 28 2015 03:32
@terakilobyte Cool! You should...
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:32
i miss you being around during the old normal hours
Nathan
@terakilobyte
Feb 28 2015 03:32
:)
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:33
i see you on when I am at work :)
Nathan
@terakilobyte
Feb 28 2015 03:33
lol yep
well @AmmarAliShah needed help on the graveyard shift he said
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:33
lol
Nathan
@terakilobyte
Feb 28 2015 03:33
I’m like Ron Burgandy in anchorman 2
;)
salon quality hair and give the viewers what they want
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:34
any idea when you get back to the states?
Hannan Ali
@abdulhannanali
Feb 28 2015 03:34
@terakilobyte Which are some companies you'd love to work in?
Nathan
@terakilobyte
Feb 28 2015 03:34
yeah July
hmm
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:34
be here before we know it
Nathan
@terakilobyte
Feb 28 2015 03:34
my dream job would be at google in the deep learning department
or ibm
Uber has some people there I like from seeing videos of meetups
strongloop also has some people I don’t think I’d mind working with
MS is also a possibility since I’ll be getting out of the Army while I live in washington
Hannan Ali
@abdulhannanali
Feb 28 2015 03:36
@terakilobyte Really Nice Choice!
Nathan
@terakilobyte
Feb 28 2015 03:36
hell I wouldn’t even mind working at facebook
even though I don’t have a facebook account
Hannan Ali
@abdulhannanali
Feb 28 2015 03:38
@terakilobyte Don't worry Bing Developers also use google for answers
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:38
wherever you end up you are going to do great things
Nathan
@terakilobyte
Feb 28 2015 03:38
thanks
Hannan Ali
@abdulhannanali
Feb 28 2015 03:39
@cshutchinson Agreed!
Nathan
@terakilobyte
Feb 28 2015 03:39
also once FCC becomes ridiculously popular maybe I’ll just work at FCC
I’ll already know all the systems in and out ;)
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:40
who is BerkleyTrue Nathan? did he just come aboard?
contract hit man?
the issues were rolling non-stop for like 12 hours
none of my business I guess; just curious
Nathan
@terakilobyte
Feb 28 2015 03:42
no Berkley is one of the original authors of FCC along with quincy
really smart and nice guy
him, quincy, and myself are converting FCC into an isomorphic single page app
Julie Myers
@BlueOceanView
Feb 28 2015 03:44
@terakilobyte What does an isomorphic single page app consist of?
Nathan
@terakilobyte
Feb 28 2015 03:44
well it’s an idea and architecture
a spa (single page app) never actually fetches a full page from the server except the first load
as things change it just changes the views
like google mail
or inbox by google
Julie Myers
@BlueOceanView
Feb 28 2015 03:45
that's cool. So, will it use a lot of AJAX?
Nathan
@terakilobyte
Feb 28 2015 03:46
isomorphic means the front and back are synced and a lot of the same code that runs on the server runs in the browser
meteor is isomorphic for example
well not just ajax
so when we finally convert over and get everything going, imagine this
you are pairing on a bonfire with someone
they run the code
the server reacts and looks to see who is paring with them
it notifies your partner and refreshes the bonfire view, as well as the output, and the test display
and they didn’t have to touch anything
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:48
good stuff
how close are you
Julie Myers
@BlueOceanView
Feb 28 2015 03:49
I've seen that kind of coding. It's really user friendly.
Nathan
@terakilobyte
Feb 28 2015 03:49
another example, our new forums will be constantly broadcasting. Say someone sends you a pm, the forums will broadcast out “hey I have a message for so and so”. Your view will automatically update to show a little icon over the forums link letting you know you have a new message
or if a new message came in to a thread you were subscribed to
then anyone subscribed would get notified by having their view upated
we’re still a ways off
right now we’re converting from express to loopback (a framework built on top of express)
then we’ll mockup the site in react
then start adding all the interactivity and events and whatnot
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:51
how do you sleep at night; i dream in code already
Nathan
@terakilobyte
Feb 28 2015 03:52
don’t drink coffee after 5?
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:52
yeah I had to cut that out, but the coffee keeps the code flowing
Nathan
@terakilobyte
Feb 28 2015 03:52
lol
I don’t mind dreaming in code
I make some gnarly algorithms in my dreams
Julie Myers
@BlueOceanView
Feb 28 2015 03:53
That sounds great @terakilobyte. I look forward to it's completion.
Cristián Berríos
@crisberrios
Feb 28 2015 03:55
@dannyfritz are you there?
Nathan
@terakilobyte
Feb 28 2015 03:55
You all should make 5 bonfires a piece and submit a pr ;)
especially @crisberrios
the smarty can probably make some wicked challenges
Cristián Berríos
@crisberrios
Feb 28 2015 03:55
I have a WONDERFUL idea for a bonfire
Nathan
@terakilobyte
Feb 28 2015 03:55
oh?
Cristián Berríos
@crisberrios
Feb 28 2015 03:55
so wonderful I still have to solve it
:P
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:56
lol
Nathan
@terakilobyte
Feb 28 2015 03:56
do tell :)
ooh I need to make “Make a Person - part 2'
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:57
nathan do you have a retina macbook pro by chance 15”?
Julie Myers
@BlueOceanView
Feb 28 2015 03:57
I've done the first 6 bonfires. Need to get back to 'em.
Nathan
@terakilobyte
Feb 28 2015 03:57
@cshutchinson I do
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:57
my 5 year old MBP needs to go to my daughter
its a 17” do you like the display size?
Nathan
@terakilobyte
Feb 28 2015 03:58
yeah I like the display size
the pixel density is worth
Christopher Hutchinson
@cshutchinson
Feb 28 2015 03:58
what resolution is preferred on that model?
Nathan
@terakilobyte
Feb 28 2015 03:59
well it displays in 1440x900
but the display itsel fis 2880x1800
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:00
i hate to leave my 1920x1200 behind i love it
Nathan
@terakilobyte
Feb 28 2015 04:00
you get used to it
I also use an app called duet
turns my ipad air into an external display
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:01
i am see a new retina in my future
Nathan
@terakilobyte
Feb 28 2015 04:01
when I get back and situated in the states I’ll probably get a 27” imac 5k
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:01
yeah was looking at those earlier; pretty incredible
Nathan
@terakilobyte
Feb 28 2015 04:01
or if I make some duckets between now and then I’ll go with a mac pro and buy an external super high res display
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:01
i love my imac but I hate where I have to sit with it
easier being with the family to have the laptop
Nathan
@terakilobyte
Feb 28 2015 04:02
I want 3 hi-res displays side by side ultimately
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:02
and easier to take my project along to work for lunch
Nathan
@terakilobyte
Feb 28 2015 04:02
yep
that’s why you have the macbook!
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:02
yes and github
back and forth
Nathan
@terakilobyte
Feb 28 2015 04:03
when my macbook finally kicks the bucket I’ll probably go with a mba
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:03
my wife has one the display drives me insane
Nathan
@terakilobyte
Feb 28 2015 04:03
plenty powerful enough to do webdev
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:03
yes it is, but everything is so big on the display
Nathan
@terakilobyte
Feb 28 2015 04:04
keyboard shortcuts
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:04
i just want a little more resolution; its so portable
Nathan
@terakilobyte
Feb 28 2015 04:04
just get used to switching between views
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:04
ctrl tab baby
command tab
sorry
and my favorite command , and command shift 4
Nathan
@terakilobyte
Feb 28 2015 04:05
lol
control uparrow is good too
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:06
you win
lol
Nathan
@terakilobyte
Feb 28 2015 04:06
I use it when I have a lot of stuf fopen
Danny Fritz
@dannyfritz
Feb 28 2015 04:07
@crisberrios i'm here now.
Christopher Hutchinson
@cshutchinson
Feb 28 2015 04:07
brb
Cristián Berríos
@crisberrios
Feb 28 2015 04:07
I'm trying to do something in gulp, maybe you can guide me
Danny Fritz
@dannyfritz
Feb 28 2015 04:07
sure
Cristián Berríos
@crisberrios
Feb 28 2015 04:07

gulp.task('upload', function () {
  return gulp.src('csv/*.csv')
    .pipe(plumber({
      errorHandler: function (err) {
        debug(err)
      }
    }))
    .pipe(watch('csv/*.csv'))
    .pipe(sftp(config.ftpOptions));
});
this is my current code
Danny Fritz
@dannyfritz
Feb 28 2015 04:08
should that watch be in there?
Cristián Berríos
@crisberrios
Feb 28 2015 04:08
I think it does...
well... the thing is
Danny Fritz
@dannyfritz
Feb 28 2015 04:09
which npm package is that sftp
Cristián Berríos
@crisberrios
Feb 28 2015 04:09
I purposedly added a wrong parameter to sftp
gulp-sftp
in order to cause an error
Danny Fritz
@dannyfritz
Feb 28 2015 04:09
and then the task never finishes?
Cristián Berríos
@crisberrios
Feb 28 2015 04:09
and after sftp there should be a "del" function
which deletes source files
Danny Fritz
@dannyfritz
Feb 28 2015 04:09
that doesn't sound good. lol
Cristián Berríos
@crisberrios
Feb 28 2015 04:09
the problem is, the app crashes (even with plumber)
but I want it so if the sftp portion fails
the source files don't get deleted
I followed the example of vinylPaths
task is being started with gulp.start('upload')
Danny Fritz
@dannyfritz
Feb 28 2015 04:11
i think maybe errorHandler needs to be passed a done callback
if it is non-default
gulp.task('upload', function (done) {
then make sure done gets the err passed into its call too on error
Cristián Berríos
@crisberrios
Feb 28 2015 04:16
hmm
Danny Fritz
@dannyfritz
Feb 28 2015 04:17
here is what i had in mind
gulp.task('upload', function (done) {
  return gulp.src('csv/*.csv')
    .pipe(plumber({
      errorHandler: function (err) {
        debug(err);
        done(err);
      }
    }))
    .pipe(watch('csv/*.csv'))
    .pipe(sftp(config.ftpOptions));
});
i'm assuming debug is a function you wrote
Cristián Berríos
@crisberrios
Feb 28 2015 04:19
gulp.task('upload', function (done) {
  return gulp.src('csv/*.csv')
    .pipe(plumber())
    .pipe(watch('csv/*.csv'))
    .pipe(sftp(config.ftpOptions))
    .pipe(vp(del));
});
Danny Fritz
@dannyfritz
Feb 28 2015 04:19
i guess that doesn't fix it crashing
Cristián Berríos
@crisberrios
Feb 28 2015 04:19
this is the non error-handled working code
(minus plumber)
I guess I could wrap sftp in a try catch block
but I'm not sure that's the right way of handling the error
Danny Fritz
@dannyfritz
Feb 28 2015 04:31
i don't think you can pipe a try catch
have you tried doing an .on('error', function) after the sftp pipe?
is sftp an actual pipe?
Cristián Berríos
@crisberrios
Feb 28 2015 04:34
it should be
if the config is ok it uploads the files and passes the stream to vp(del)
but plumber does not contain the crash
Danny Fritz
@dannyfritz
Feb 28 2015 04:35
and the crash is within sftp?
Cristián Berríos
@crisberrios
Feb 28 2015 04:36
within one of it's modules
Error: getaddrinfo ENOTFOUND kopernik.inf
    at errnoException (dns.js:44:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
Danny Fritz
@dannyfritz
Feb 28 2015 04:40
yeah, it looks like plumber should be handling that
floatdrop/gulp-plumber#27
floatdrop is a cool guy. i had a comment about his gulp-batch lib a month ago and he responded really quickly. floatdrop/gulp-batch#14
Cristián Berríos
@crisberrios
Feb 28 2015 04:44
I managed to stop the crash adding gulp-util
Danny Fritz
@dannyfritz
Feb 28 2015 04:44
pluginError?
Cristián Berríos
@crisberrios
Feb 28 2015 04:45
then adding .on('error',handler) after sftp line
Danny Fritz
@dannyfritz
Feb 28 2015 04:46
with gulp, make sure it completes the task and also can errorr gracefully. sometimes i would fix one, but then break the other.
Cristián Berríos
@crisberrios
Feb 28 2015 04:50
now it breaks again hmmm
Danny Fritz
@dannyfritz
Feb 28 2015 05:03
is there a partitioning bonfire?
Split an array into 2 arrays partitioned by its mean.
[1,6,4,7,8] => [[1,4],[6,7,8]]
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:08
@dannyfritz sort of
Danny Fritz
@dannyfritz
Feb 28 2015 05:08
which one is that?
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:09
chunky monkey, i think
yeah
Danny Fritz
@dannyfritz
Feb 28 2015 05:09
ah yeah, partitioning an array into n size chunks
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:10
Yep. Although it doesn't require to sort the array.
But it'd still be a bit repetative.
Danny Fritz
@dannyfritz
Feb 28 2015 05:10
well, this would split a partition into 2. everything in the first partition is less than the mean of the array, and the second is evertyhign greater than the mean
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:11
When more bonfires are added I'd like some that introduce really helpful tools like map, filter, reduce, splice, slice, etc.
'cause not all of them are that obvious. That's what I think would make bonfire a bigger step above Coderbyte.
Danny Fritz
@dannyfritz
Feb 28 2015 05:12
i think bonfire focuses more on the algorithm than the JS API. at least it seemed that way to me.
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:15
Yeah, and being a part of the curriculum and mandatory before going on to non-profits I think making helpful bonfires that teach a bit more directly would be good, rather than just throwing things at you and saying "solve it."
Danny Fritz
@dannyfritz
Feb 28 2015 05:16
i could make a PR for some easier ones that specifically mention some of the Array protoype methods
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:16
Honestly algorithms make my head spin sometimes lol. If I wasn't learning Javascript a few months prior to working through them I'd probably have a break down, and I don't doubt that someone might have a similar situation.
That'd be great!
Danny Fritz
@dannyfritz
Feb 28 2015 05:17
but first i have to spin up a VM and get the FCC site running locally. :frowning:
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:17
Are you on Windows?
Danny Fritz
@dannyfritz
Feb 28 2015 05:18
yeah, so i'm spinning up an ubuntu vm
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:19
If you have room on your hard drive you could install Ubuntu beside Windows. That's what I did.
Danny Fritz
@dannyfritz
Feb 28 2015 05:19
i'm good with vm's
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:19
And it's less taxing.
My thing thing is too weak for a VM so I had no choice LOL
Danny Fritz
@dannyfritz
Feb 28 2015 05:19
VT-x makes vm's very speedy
i have a nice cpu and enough ram to prefer the VM route
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:22
Cool! More power to ya.
Literally hah
Danny Fritz
@dannyfritz
Feb 28 2015 05:22
lol
already installed and booted up. takes like 3 minuets. i love it
Darryl Dixon - Piece Digital
@piecedigital
Feb 28 2015 05:23
Takes me 6-8 minutes to start windows lol
Danny Fritz
@dannyfritz
Feb 28 2015 05:23
now to clone the repo and run this thing
Cristián Berríos
@crisberrios
Feb 28 2015 05:24
gulp.task('upload', function () {
  return gulp.src('csv/*.csv')
    .pipe(pipeErrorStop(sftp(config.ftpOptions)))
    .pipe(vp(del));
});

function sendData() {
  debug(JSON.stringify(config.ftpOptions, null, "\t"));
  gulp.start('upload');
  gulp.watch('csv/*.csv',['upload']);
}
pipe-error-stop module was the solution
Danny Fritz
@dannyfritz
Feb 28 2015 05:25
what does it do that plumber didn't?
Cristián Berríos
@crisberrios
Feb 28 2015 05:25
del only runs if sftp goes without errors
plumber keeps the stream going
also it was unable to stop the sftp module crash
Danny Fritz
@dannyfritz
Feb 28 2015 05:26
i see
Julie Myers
@BlueOceanView
Feb 28 2015 05:26

I am doing the Falsey Bouncer bonfire. Shouldn't

if(!arr[i]){

test to see if any of the elements are a falsey? Here is the entire code:

function bouncer(arr) {
  for(var i=0; i<arr.length; i++){
    if(!arr[i]){
      arr.splice(i, 1);
    }
  }
  return arr;
}

//bouncer([7, 'ate', '', false, 9]);
bouncer([false, null, 0,8]);
The problem is the condition is not seeing null as a falsey.
Christopher Hutchinson
@cshutchinson
Feb 28 2015 05:28
I thought much like you did, but I ended up testing against undefined and ‘’ as well
Danny Fritz
@dannyfritz
Feb 28 2015 05:29
@BlueOceanView you are removing items from an array as you are iterating over it
Cristián Berríos
@crisberrios
Feb 28 2015 05:29
^
Danny Fritz
@dannyfritz
Feb 28 2015 05:29
your index is sliding each time you remove
Julie Myers
@BlueOceanView
Feb 28 2015 05:29
Oh...duh
Hannan Ali
@abdulhannanali
Feb 28 2015 05:31
@dannyfritz Is it worth taking a course in Engineering SaaS?
Danny Fritz
@dannyfritz
Feb 28 2015 05:32
no idea. :P
Hannan Ali
@abdulhannanali
Feb 28 2015 05:36
@dannyfritz Any intuition please?
Cristián Berríos
@crisberrios
Feb 28 2015 05:45
any course you take will add value, but you have to focus on something
I'd really like to take music classes, but that (probably) won't help me get a job any sooner
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:46
@crisberrios lol
Hannan Ali
@abdulhannanali
Feb 28 2015 05:47
@AmmarAliShah How was your sleep?
Danny Fritz
@dannyfritz
Feb 28 2015 05:47
i got a minor in music theory in university. fun
Hannan Ali
@abdulhannanali
Feb 28 2015 05:47
@dannyfritz You got some cool tracks on soundcloud
Danny Fritz
@dannyfritz
Feb 28 2015 05:47
thanks
Hannan Ali
@abdulhannanali
Feb 28 2015 05:48
@crisberrios Software As A Service is related to web development
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:48
@abdulhannanali Very peaceful until my cat decided to come sleep on my stomach and eventually take over the bed
Hannan Ali
@abdulhannanali
Feb 28 2015 05:48
so I just want to know whether it should be taken now or not
Cristián Berríos
@crisberrios
Feb 28 2015 05:48
@abdulhannanali I know, so taking it or not depends on your personal goals
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:48
@dannyfritz What's "Music Theory"?
Cristián Berríos
@crisberrios
Feb 28 2015 05:49
SaaS is more ops-related than code related
Danny Fritz
@dannyfritz
Feb 28 2015 05:49
the theory of music. :P
it is about the rules and reasons behind music
Hannan Ali
@abdulhannanali
Feb 28 2015 05:49
@crisberrios Yeah I think that I should focus on code more
Cos SaaS is for proficient developers
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:50
@dannyfritz tempo and melody and that stuff?
Danny Fritz
@dannyfritz
Feb 28 2015 05:50
yeah, all of that
chords
progressions
form
scales
instruments
voices
Hannan Ali
@abdulhannanali
Feb 28 2015 05:51
And I don't think I am that proficient yet in web development
I'll have to debug many error messages about which I have no ide
a
@AmmarAliShah Have you heard of
convo?
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:53
@abdulhannanali convo?
Hannan Ali
@abdulhannanali
Feb 28 2015 05:53
Yeah search it
It's one of the most successful startups
of Pakistan
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:54
@abdulhannanali I'll check it out.
Hannan Ali
@abdulhannanali
Feb 28 2015 05:55
If you want to apply for job or internship in Pakistan it might be one of the best place.
They guarantee that one year in their company = 3 years in other Pakistani startups
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 05:56
I don't think they will accept 17 year olds
Hannan Ali
@abdulhannanali
Feb 28 2015 05:57
Anytime in the future. I thought it will be a good info to give.
They're san fransisco and islamabad based startup
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 06:00
thanks for the info
Hannan Ali
@abdulhannanali
Feb 28 2015 06:01
no prob...
@AmmarAliShah I have a friend he completed A levels in 8 months
He did it as a homeschooled kid
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 06:01
You can do it in 2 months
personal capability
I'm going for 14 months
If possible
If not, then 24 months it is
Hannan Ali
@abdulhannanali
Feb 28 2015 06:02
Subjects
?
Ammar Ali Shah
@AmmarAliShah
Feb 28 2015 06:04
  • Maths
  • Advance Maths
  • Chemistry
  • Physics
  • Computer Science
  • General English
6 subjects
Hannan Ali
@abdulhannanali
Feb 28 2015 06:06
@AmmarAliShah Nice!
Ganesh Kumar Subramanian
@gans220
Feb 28 2015 11:20
Is there a way I can check the completed bonfires?
Nathan
@terakilobyte
Feb 28 2015 11:20
not at the moment
Victor
@pahlsson
Feb 28 2015 11:56
@terakilobyte will there be a way? it'd be great to compare solutions with others'
Nathan
@terakilobyte
Feb 28 2015 12:37
@pahlsson yes there will be a way
you’ll be able to view someone’s profile and see their bonfire solutions if you’ve also solved that bonfire
Victor
@pahlsson
Feb 28 2015 13:25
nice!
Hannan Ali
@abdulhannanali
Feb 28 2015 15:43
Hello This is my mutation bonfire code
Can anybody tell me why is it not working?
function mutation(arr) {
  var newRegex = (new RegExp(arr[0],"g"));
  var result = newRegex.exec(arr[1]);
  if (result){
   return true; 
  }
  else{
    return false;
  }
}
Cristián Berríos
@crisberrios
Feb 28 2015 15:45
use backticks ```
what's the challenge?
Hannan Ali
@abdulhannanali
Feb 28 2015 15:47
@crisberrios Thanks I was trying to do it for a very long and didn't know that it was on my keyboard too.
@crisberrios The problems were added yesterday today in bonfires
But I don't know why it is not working.
Seems right to me
printf("hello world\n")
Wow it works
printf("C is awesome")
Cristián Berríos
@crisberrios
Feb 28 2015 15:52
I think you are getting it backwards?
you are testing if the 1st element is contained in the 2nd
Hannan Ali
@abdulhannanali
Feb 28 2015 15:54
@crisberrios Still doesn't work
I tried that too
Danny Fritz
@dannyfritz
Feb 28 2015 15:54
i just solved mutation
Hannan Ali
@abdulhannanali
Feb 28 2015 15:55
blob
Danny Fritz
@dannyfritz
Feb 28 2015 15:55
it looks like you are on the right path
test doesn't return an index does it? it returns a boolean i thought
Hannan Ali
@abdulhannanali
Feb 28 2015 15:56
@dannyfritz I was doing this but when I check if test is true or false it gives me this
blob
Danny Fritz
@dannyfritz
Feb 28 2015 15:57
yeah, but it is definitely more correct
code-wise
Hannan Ali
@abdulhannanali
Feb 28 2015 15:57
@dannyfritz Yup!
Nathan
@terakilobyte
Feb 28 2015 16:01
one of the most satisfying things about authoring bonfires is people working on them and solving them
Hannan Ali
@abdulhannanali
Feb 28 2015 16:02
@dannyfritz I was using a global search flag but after using case insensitive flag I get a one more correct result just one more to validate. I think I am on my way thanks.
Nathan
@terakilobyte
Feb 28 2015 16:03
I personally used match in some way to validate this bonfire
Hannan Ali
@abdulhannanali
Feb 28 2015 16:03
@terakilobyte Bonfires are really challenging and FreeCodeCamp Campers love challenges.
@terakilobyte I'm gonna try it out.
Nathan
@terakilobyte
Feb 28 2015 16:05
@crisberrios or @dannyfritz have either of you two beasts nailed missing letters or pairwise yet?
Danny Fritz
@dannyfritz
Feb 28 2015 16:05
i'm on missing letters now
working out the algo i thought of
Nathan
@terakilobyte
Feb 28 2015 16:10
awesome
Danny Fritz
@dannyfritz
Feb 28 2015 16:11
okay, solved missing letters
Nathan
@terakilobyte
Feb 28 2015 16:11
very nice
pm me your solution?
Ashley Drake
@aldraco
Feb 28 2015 16:16
i just got missing letters
:)
Nathan
@terakilobyte
Feb 28 2015 16:17
:)
Ashley Drake
@aldraco
Feb 28 2015 16:17
and if I can solve pairwise i'll be back on the symmetric diff again for round two
Nathan
@terakilobyte
Feb 28 2015 16:17
now on to pairwise!
Ashley Drake
@aldraco
Feb 28 2015 16:17
it's going down
Nathan
@terakilobyte
Feb 28 2015 16:17
I’m going to have to think of harder challenges
you guys are killing them
Christopher Hutchinson
@cshutchinson
Feb 28 2015 16:17
Hi everyone
Nathan
@terakilobyte
Feb 28 2015 16:18
g’morning @cshutchinson
Ashley Drake
@aldraco
Feb 28 2015 16:18
what about module - related ones? where you have to construct something that hides some variables and exposes others?
those could be fun
morning @cshutchinson how's your app coming?
Christopher Hutchinson
@cshutchinson
Feb 28 2015 16:18
Very well aldraco no more issues so far
No
Oliver
@Dadsaster
Feb 28 2015 16:19
I'm working on symmetric difference - it's harder than it looks
Ashley Drake
@aldraco
Feb 28 2015 16:19
@Dadsaster :+1 to that
are our points next to our picture in any way related to the "100 hours" idea? just curious.
Christopher Hutchinson
@cshutchinson
Feb 28 2015 16:21
Interesting observation
Hannan Ali
@abdulhannanali
Feb 28 2015 16:21
I am done with mutation but my code is I think a little bit inefficient I am using 2 regex. cos the first test want's you to validate in the reverse order. So I am first comparing string with original order regex and then with reverse order. Is there any cool way to do it with only one regex? Didn't find any flag for it
Here's the code
function mutation(arr) {
  var newRegex = (new RegExp(arr[1],"gi"));
  var result = arr[0].match(newRegex);
  if (result !== null){
   return true; 
  }
  else{
    newRegex = (new RegExp(arr[1].split("").reverse().join(""),"gi"));
    result = arr[0].match(newRegex);
    if (result !== null){
      return true;
    }
  }
  return false;
}
mutation(['hello', 'Hello']);
Danny Fritz
@dannyfritz
Feb 28 2015 16:30
that is the same algorithm as mine, mine just has a different control flow
i used test intead of match too
Hannan Ali
@abdulhannanali
Feb 28 2015 16:33
@dannyfritz Is there any way to construct a RegExp which can do both things?
@dannyfritz Yeah I think it'd be more efficient cos we don't need an array in this case.
Danny Fritz
@dannyfritz
Feb 28 2015 16:36
function mutation(arr) {
  return new RegExp(arr[1] + '|' + R.pipe(R.reverse, R.join(''))(arr[1]), 'gi').test(arr[0]);
}
Hannan Ali
@abdulhannanali
Feb 28 2015 16:37
@dannyfritz Thank you very much That's the thing I was finding.
@dannyfritz what's the R here?
Danny Fritz
@dannyfritz
Feb 28 2015 16:41
you can do it just as easy with String.prototype.split Array.prototype.reverse and Array.prototype.join
Hannan Ali
@abdulhannanali
Feb 28 2015 16:42
@dannyfritz What's the advantage if I use Ramda instead of Vanilla? I am unfamiliar with it. So please tell me
Danny Fritz
@dannyfritz
Feb 28 2015 16:43
ramda just makes FP approaches easier
Ashley Drake
@aldraco
Feb 28 2015 16:44
FP approaches = ?
Hannan Ali
@abdulhannanali
Feb 28 2015 16:44
@dannyfritz I want to take a start in Functional Programming. Where should I start?
Ashley Drake
@aldraco
Feb 28 2015 16:44
ah
Hannan Ali
@abdulhannanali
Feb 28 2015 16:44
@aldraco Functional Programming
Ashley Drake
@aldraco
Feb 28 2015 16:44
thx
Hannan Ali
@abdulhannanali
Feb 28 2015 16:44
@dannyfritz Is it easier than OOP?
Danny Fritz
@dannyfritz
Feb 28 2015 16:46
none of them are easier than one another. :P
they all have pros and cons
imperative, OOP, and FP
just view them as tools
choose the right tool for the job
Hannan Ali
@abdulhannanali
Feb 28 2015 16:48
@dannyfritz Thanks! Yeah we should look them as tools.
I am definitely going to look into ramda seems cool
Danny Fritz
@dannyfritz
Feb 28 2015 16:52
i also recommend lodash
Nathan
@terakilobyte
Feb 28 2015 16:53
I’ve thought about adding lodash into bonfire
be aware that _ in bonfire is just an alias for R
Danny Fritz
@dannyfritz
Feb 28 2015 16:54
yeah, @crisberrios noticed that. :P
Oliver
@Dadsaster
Feb 28 2015 16:55
Anyone have a good recommendation for a book on thinking in OOP?
Danny Fritz
@dannyfritz
Feb 28 2015 16:55
learning Java or C# are good ways to learn OOP
Ashley Drake
@aldraco
Feb 28 2015 16:57
solved pairwise, though with an exceptionally ugly solution. :)
Danny Fritz
@dannyfritz
Feb 28 2015 16:59
what made it ugly?
@Dadsaster this is the book i bought to learn OOP. Gang of Four's Design Patterns I wouldn't recommend it to someone learning to program though.
Ashley Drake
@aldraco
Feb 28 2015 17:01
@dannyfritz lots of conditionals.
Danny Fritz
@dannyfritz
Feb 28 2015 17:01
mine had 3 conditionals in it.
Ashley Drake
@aldraco
Feb 28 2015 17:01
just seems like there has to be a more streamlined solution, that's all
forgive me for asking ... how do we embed gists in this chat?
Danny Fritz
@dannyfritz
Feb 28 2015 17:02
triple back ticks
on their own lines
Ashley Drake
@aldraco
Feb 28 2015 17:02
oh same way ok
thanks
Danny Fritz
@dannyfritz
Feb 28 2015 17:02
oh wait gists, not sure, try just pasting the links
Hannan Ali
@abdulhannanali
Feb 28 2015 17:04
@dannyfritz There are so many libraries how do you even learn them all?
Jonathan
@jonathantimm
Feb 28 2015 17:05
Hey guys, does anyone see a problem here?
Danny Fritz
@dannyfritz
Feb 28 2015 17:05
@abdulhannanali libraries are written faster than you can read the titles of them. it isn't about learning them all. it is about learning useful ones to save you time.
Jonathan
@jonathantimm
Feb 28 2015 17:05
$(document).ready(function() {
    $('div').slideDown('slow');
});
Hannan Ali
@abdulhannanali
Feb 28 2015 17:06
@dannyfritz Yeah A real practical approach to them.
Danny Fritz
@dannyfritz
Feb 28 2015 17:06
@jonathantimm looks fine to me. what is the problem.
Hannan Ali
@abdulhannanali
Feb 28 2015 17:06
That makes a coder a practical coder
Danny Fritz
@dannyfritz
Feb 28 2015 17:06
@abdulhannanali the goal of a library is to provide prebaked and maintained solutions. so i don't have to keep writing solutions myself.
Jonathan
@jonathantimm
Feb 28 2015 17:06
weird. code academy is saying "Whoops, did you put your 'div' insde of '$()'?
Danny Fritz
@dannyfritz
Feb 28 2015 17:06
and when i make a fix to a library, everyone using the library benefits
Jonathan
@jonathantimm
Feb 28 2015 17:07
@dannyfritz oh it's because I was editing on the html page instead of the script.js page. hehe
Hannan Ali
@abdulhannanali
Feb 28 2015 17:08
@dannyfritz So whenever I need a library for a certain task I can search for good ones and pick the one which is most suitable to my needs.
That's why js is awesome . Cos of it's flexibility.
Jonathan
@jonathantimm
Feb 28 2015 17:29
Hey guys, sorry, but another issue :-(
$(document).ready(function() {
    $('div').mouseenter(function() {
        $('div').fadeTo('fast', 1);
    });
)};
anyone see anything wrong there?
Cristián Berríos
@crisberrios
Feb 28 2015 17:37
are you trying to fade all the divs
or just the one selected?
Jonathan
@jonathantimm
Feb 28 2015 18:33
all the divs
@crisberrios
anybody know?
Cristián Berríos
@crisberrios
Feb 28 2015 18:37
hmm
so you want the divs to animate their opacity to 1 right?
do you have a pen with an example?
Jonathan
@jonathantimm
Feb 28 2015 18:38
no, it's just a codeacademy exercise
and yeah, i want the divs to fade to 1 opacity when the mouse hovers over them
it looks exactly like their example code, but still is giving me an error
maybe it's something on the html? cause the div isn't showing up at all
<html>
<script type="text/javascript" src="script.js">
    <head>
        <title>Button Magic</title>
        <link rel='stylesheet' type='text/css' href='stylesheet.css'/>
    </head>
    <body>
     <div><br/><strong>Click Me!</strong></div>   
    </body>
</script>
</html>
Cristián Berríos
@crisberrios
Feb 28 2015 18:41
seems that you had a wrong parenthesis
$(document).ready(function() {
    $('div').mouseenter(function() {
        $('div').fadeTo('fast', 1);
    });
});
Jonathan
@jonathantimm
Feb 28 2015 18:43
hm
it still isn't working on code academy
this must be a bug on their end
Cristián Berríos
@crisberrios
Feb 28 2015 18:43
it might be
Jonathan
@jonathantimm
Feb 28 2015 18:43
there's no button showing up on the preview even
and this is all about manipulating the button
Cristián Berríos
@crisberrios
Feb 28 2015 18:44
$(document).ready(function() {
    $('div').mouseenter(function() {
        $(this).fadeTo('fast', 1);
    });
});
maybe they want you to do this?
since it's kind of wrong wanting to fade all the divs on hover
Jonathan
@jonathantimm
Feb 28 2015 18:46
hm, that doesn't work either
i'll try starting over
the whole section
Cristián Berríos
@crisberrios
Feb 28 2015 18:46
read the instructions well, a subtle change and it won't validate
Jonathan
@jonathantimm
Feb 28 2015 18:46
the thing is even before i start, i'm getting this in their preview interface: "Uncaught SyntaxError: Unexpected token {"
i'm starting with an error
$(document).ready() {(
)};
that's how it starts
code academy, you are currently the bane of my existence
Cristián Berríos
@crisberrios
Feb 28 2015 18:49
well, of course that code is wrong
is it written by default?
Jonathan
@jonathantimm
Feb 28 2015 18:51
yeah that's its default that i'm supposed to change
this is so bizarre
i started over and did exactly what it told me to do and it's still wrong, but it's not telling me what's wrong
i should give up coding forever :P
wait. i figured it out
in my html, I had my script tags messed up. I thought that the closing script tag had to be at the end of the document, but apparently not. I misunderstood the way that works
Hannan Ali
@abdulhannanali
Feb 28 2015 18:55
@jonathantimm Don't give up
Jonathan
@jonathantimm
Feb 28 2015 18:55
if you look above, you can see that my script tag is at the end
i thought that everything in the html had to be inside the script tags, like it all has to be within html tags, but i guess not
thanks @abdulhannanali
Hannan Ali
@abdulhannanali
Feb 28 2015 18:56
@jonathantimm The above code is wrong...
Do you know about anonymous functions?
Jonathan
@jonathantimm
Feb 28 2015 18:57
right. no i don't
Hannan Ali
@abdulhannanali
Feb 28 2015 18:57
You have to pass an anonymous function as an argument to $(document).ready()
Jonathan
@jonathantimm
Feb 28 2015 18:58
i'm not sure what that means
Hannan Ali
@abdulhannanali
Feb 28 2015 18:58
In there you can execute statements
Jonathan
@jonathantimm
Feb 28 2015 18:59
right, right
Hannan Ali
@abdulhannanali
Feb 28 2015 18:59
Functions are just objects in javascript so as you can pass a variable or an int value to a function you can pass a function to a function too.
Our language is very good at doing this.
just consider function as a value
That's why JS allows syntax like this
var x = function(){
console.log("Hello Jonathan");
}
Jonathan
@jonathantimm
Feb 28 2015 19:02
gotcha
Hannan Ali
@abdulhannanali
Feb 28 2015 19:02
so if I have x = 1
I can pass it like this to a function
function(x){
console.log(x)
}
similarly there's no problem if I pass x and it's function x is a function. Console.log will log if any value is returned on executing the function passed as an argument x
This is a big cool thing of JS
So you need to pass document.ready() function an anonymous function..
So Does it solve your problem?
Jonathan
@jonathantimm
Feb 28 2015 19:34
yeah, I don't know. the whole codeacademy lesson was just not working even when i started it fresh, so i'm just back on the codeschool one for FCC
i thought it would help to do both but that just gave me too many issues
Jonathan
@jonathantimm
Feb 28 2015 19:46
One thing I don't get is when in javascript you use the period and when the #
when selecting things
Cristián Berríos
@crisberrios
Feb 28 2015 19:50
# are for id's
dot is for classes
id's should be unique within the document
but many elements may have the same class
Jonathan
@jonathantimm
Feb 28 2015 19:53
i see
thank you!
Ashley Drake
@aldraco
Feb 28 2015 20:32
on the Bob challenge ... i'm passing all the test except for the one that says bob is an instance of person. what am I missing?
Cristián Berríos
@crisberrios
Feb 28 2015 20:59
don't know without seeing the code
most probably you aren't using Person as a constructor
Ashley Drake
@aldraco
Feb 28 2015 21:17
sorry i stepped away
may i show you my code?
Hannan Ali
@abdulhannanali
Feb 28 2015 21:18
Hello Campers!
I have figured out the logic to calculate lcm of two numbers but don't know how to do it for multiple people. Campers who didn't start this challenge yet. Just don't look at it.
function smallestCommons(arr) {
  var realThang = [];
  for (var i = arr[0]; i <= arr[1]; i++){
    realThang.push(i);
  }
}

function lcm(x,y){
  if (x === 0 || y === 0){
    return 0;
  }

  return ((x*y)/gcd(x,y));
}

function gcd(x,y){
    if (x <= 0){
        return y;
    }
    if (y <= 0){
        return x;
    }
    return gcd (y, x%y);
}
I am using Euclidean Algorithm to calculate gcd
@aldraco Which challenge you are talking about I might have solved that?
Ashley Drake
@aldraco
Feb 28 2015 21:20
@abdulhannanali lcm is associative, meaning you can use the results of one to compare to the next
Hannan Ali
@abdulhannanali
Feb 28 2015 21:20
This message was deleted
Ashley Drake
@aldraco
Feb 28 2015 21:20
it's the make a person challenge, i'ts after lcm :)
here is my code though -
var Person = function(firstAndLast) {
  //private variables  
    var name = firstAndLast;
    var firstName = name.split(' ')[0];
    var lastName = name.split(' ')[1];

  //return an object with functions
  return {
    getFullName: function() {
      return name;
    },
    getLastName: function() {
      return lastName;
    },
    getFirstName: function() {
      return firstName;
    },
    setFullName: function(input) {
      name = input;
    },
    setFirstName: function(input) {
      firstName = input;
    },
    setLastName: function(input) {
      lastName = input; 
    }
  };

};

var bob = new Person('Bob Ross');
console.log(Object.getPrototypeOf(bob));
bob.getFullName();
the error is that bob is not an instance of Person
Hannan Ali
@abdulhannanali
Feb 28 2015 21:22
@aldraco Yeah I figured it out that it's a associative but I have an array which can be of any lenght
cos the user can enter any range he wants
Ashley Drake
@aldraco
Feb 28 2015 21:23
right
so you can find lcm of (a,b)
and then use that with c
and so on
Hannan Ali
@abdulhannanali
Feb 28 2015 21:23
@aldraco So you mean recursion is possible here.
Ashley Drake
@aldraco
Feb 28 2015 21:24
why not try it?
i used reduce
but i'd be curious to see how recursion works as well
Hannan Ali
@abdulhannanali
Feb 28 2015 21:24
@aldraco Ah! Reduce!
I am already using recursion for lcm
I am going to implement it the both ways
I'll send you the code ASAP
Thanks!
Cristián Berríos
@crisberrios
Feb 28 2015 21:28
@aldraco the code is right, but since you use a function for returning an object, the object returned is not an instance of Person
Ashley Drake
@aldraco
Feb 28 2015 21:30
hm ok. i will have to do some more reading I guess. I would think that since Person is presented as a function, it would have to return an object in order to do anything with it.
or are you saying that a function is itself an object?
Cristián Berríos
@crisberrios
Feb 28 2015 21:32
I'm saying that you use Person as a function, and return an object from within. That object is not an instance of Person.
Ashley Drake
@aldraco
Feb 28 2015 21:32
I see.
Cristián Berríos
@crisberrios
Feb 28 2015 21:32
it's used as a constructor function, but not a constructor object
depending on what you want, your approach is preferred
except you won't be able to use prototypal inheritance from Person
Ashley Drake
@aldraco
Feb 28 2015 21:33
bam
i got it now :)
thanks
so the way I had it is a bit more secure, correct? since now i could access bob.getFirstName and change it, whereas before I could not, because of a closure? anyway ... more fodder for reading
Cristián Berríos
@crisberrios
Feb 28 2015 21:35
that's it
Ashley Drake
@aldraco
Feb 28 2015 21:35
awesome. thanks for your help
Cristián Berríos
@crisberrios
Feb 28 2015 21:35
https://github.com/ericelliott/stampit this library is from "Programming JavaScript Applications"
I have yet to use it in a project
but I'm looking forward on integrating it to my workflow
Ashley Drake
@aldraco
Feb 28 2015 21:37
now that's a useful README
Hannan Ali
@abdulhannanali
Feb 28 2015 21:38
@aldraco Thanks I solved using reduce. Just because of you.
Ashley Drake
@aldraco
Feb 28 2015 21:39
hooray! not just because of me though
more like just because of MDN haha
Hannan Ali
@abdulhannanali
Feb 28 2015 21:39
Haha :)