These are chat archives for FreeCodeCamp/Help

3rd
Feb 2015
Ryan Malm
@Rybar
Feb 03 2015 00:07
like you don't understand what's being visualized, or ?
Suzanne Atkinson
@AdventureBear
Feb 03 2015 01:30
who is up for some CSS fun?
I am trying to make the superbowl shark
but this is all I ahve so far, lol
Ryan Malm
@Rybar
Feb 03 2015 01:56
@AdventureBear That seems like a fun project. For most of those shapes, I foresee a div with just its opposite corners rounded to 50% to give a lentil shape, rotated.
actually, 100%
Suzanne Atkinson
@AdventureBear
Feb 03 2015 02:01
awesome!
Dominic Jones
@towwiow
Feb 03 2015 02:01
Looks like a really fun project! if you don't find anyone else to collab. with you on it suzanne, hit me up about it tomorrow. I gotta get back in work mode. I'm off for the night ! ciao
Suzanne Atkinson
@AdventureBear
Feb 03 2015 02:24
it's getting better
Ryan Malm
@Rybar
Feb 03 2015 02:27
Awesome @AdventureBear
Nathan
@terakilobyte
Feb 03 2015 02:28
@AdventureBear getting work done Suzanne!
Ryan Malm
@Rybar
Feb 03 2015 02:28
I think for his fins you'll need 2 divs, one solid blue and a second white one smaller and positioned to color 1/2 the fin
Suzanne Atkinson
@AdventureBear
Feb 03 2015 02:28
@Rybar you've created a monster! I tried to do that but for some reason it worekd better when you did it.
that makes sense
@terakilobyte important work being done here...stand back!
thoughts about the positioning of the divs? by that I mean, what "position: xxx" syntax to use? reading over positining now. Also confused about "display: xxx"
Ryan Malm
@Rybar
Feb 03 2015 02:30
oh for picture projects like these I just do absolute positioning inside a container div
I tend to position things with transform: property over actual CSS, is more performant if you want to animate it after you're done
Suzanne Atkinson
@AdventureBear
Feb 03 2015 02:32
OK, that makes sense. If you look at my right fin, top & left seem to work opposite each other? not sure if that's because it's rotated? or do I use "right" and not "left"? confusing.
Ryan Malm
@Rybar
Feb 03 2015 02:34
I think it being rotated affects positioning behavior yes
you could get away with not rotating the side fins, just flip the border-radius attributes
Ryan Malm
@Rybar
Feb 03 2015 02:56
@AdventureBear Some inspiration for CSS monkeying around: http://css-tricks.com/examples/ShapesOfCSS/
Suzanne Atkinson
@AdventureBear
Feb 03 2015 03:09
@Rybar thanks!
Check my shark!!
Bin Ury
@teddy-error
Feb 03 2015 06:08

so I have a jQuery event listener

$(".hero").on("click", function(x){
        var teamSize = $("#team > li").length;
        if (teamSize !== 5) $(this).removeClass("hero").detach().appendTo("#team").addClass("selected");
    });

This listener waits for me to click on a picture of a hero, and moves the item over to the team list. However, I don't want the event to be the same once we move it over-- instead we should have the behavior change to click returns hero to hero pool from team list.

I have tried doing this by removing classes and toggling classes, etc. But it seems the event behavior is simply stuck to the LI no matter what class it is
nvm
It is important to note that .on() can only create event listeners on elements that exist at the time you set up the listeners.
Julie Myers
@BlueOceanView
Feb 03 2015 06:13
@teddy-error So, I know jQuery a little bit. So, when the photo gets clicked on the first time you want it moved over to the team list, which is does. But, when you click the same photo again, you want it to move back over to hero?
Bin Ury
@teddy-error
Feb 03 2015 06:13
Yeah I guess I need to add event listeners for the lists themselves instead of the list items
?
i think
Julie Myers
@BlueOceanView
Feb 03 2015 06:14
What element is the .hero class attached to?
I read somewhere that there is a really clean way to do it...I can't remember off the top of my head though.
Bin Ury
@teddy-error
Feb 03 2015 06:15
#heroes is the pool you can select from
#team is the list of heroes you selected
Suzanne Atkinson
@AdventureBear
Feb 03 2015 06:16
wow, glad to be a fly on the wall...sounds like somethin gthat would drive me nuts
Julie Myers
@BlueOceanView
Feb 03 2015 06:16
Try creating a second event, but target the selected class. Have this second event take the photo out of selected and into hero.
Suzanne Atkinson
@AdventureBear
Feb 03 2015 06:16
you guys are smart
Julie Myers
@BlueOceanView
Feb 03 2015 06:17
@AdventureBear THanks. :) It took months of studying. :)
Bin Ury
@teddy-error
Feb 03 2015 06:18
$("#heroes").on("click", "li", function(x){
        var teamSize = $("#team > li").length;
        if (teamSize !== 5) $(this).remove().appendTo("#team");
    });

    $("#team").on("click", "li", function(x){
        $(this).remove().appendTo("#heroes");
    });
this seems to solve the issue
This second, selector parameter tells the handler to listen for the specified event, and when it hears it, check to see if the triggering element for that event matches the second parameter. In this case, the triggering event is our anchor tag, which matches that parameter.
Julie Myers
@BlueOceanView
Feb 03 2015 06:19
cool. I am curious, you have a parameter x for your function but never use it in coding. I think I read when you have a parameter and don't assign it anything JS gives it a value of undefined. If you aren't using the parameter, best to take it out.
Bin Ury
@teddy-error
Feb 03 2015 06:20
haha i'm just tired and forgot about that. i wanted to see what it passed into the callback.
Julie Myers
@BlueOceanView
Feb 03 2015 06:20
cool.
Bin Ury
@teddy-error
Feb 03 2015 06:20
its useful for debugging
you can see what exactly is selected
Julie Myers
@BlueOceanView
Feb 03 2015 06:21
oh, cool. I'll have to give that a try.
The jquery website has really good documentation.
Bin Ury
@teddy-error
Feb 03 2015 06:27
It's thorough for sure. although it's a little overwhelming for me so I've been using http://learn.jquery.com and http://devdocs.io
Julie Myers
@BlueOceanView
Feb 03 2015 06:29
Going through learn.jquery.com is towards the top of my list of things to do. Anything to really help drive jQuery into my head.
Bin Ury
@teddy-error
Feb 03 2015 06:31
:D are you working on any projects
@BlueOceanView https://github.com/makersquare/admissions-challenge-2
this was a fun little project i did to scratch the surface with jquery
Julie Myers
@BlueOceanView
Feb 03 2015 06:33
Not at the moment. I'll eventually get to signing up for a project. Right now, I want to get front end stuff down better before I dive into the MEAN stack.
Oh, you mean just a project in general...not yet. I have a couple of them in mind.
How do I get to running your project on github? I'm really not getting how to do that.
Bin Ury
@teddy-error
Feb 03 2015 06:37
you can click download zip
or you could just copy paste the html into a file on your desktop
Julie Myers
@BlueOceanView
Feb 03 2015 06:37
Oh, you have to download the files first. And then run it on my machine. Well, that explains that.
Bin Ury
@teddy-error
Feb 03 2015 06:37
its not my project per se, it's like a skeleton project for a challenge
i solved it and it helped me learn jquery
Julie Myers
@BlueOceanView
Feb 03 2015 06:41
oh...I see. That's a neat way to learn.
Julie Myers
@BlueOceanView
Feb 03 2015 06:47
I need to hit the hay. Later.
Bastian B.
@DeXtr0niC
Feb 03 2015 18:30
hey everyone :)
Nathan
@terakilobyte
Feb 03 2015 18:37
hey there dex
want to discuss that fib challenge?
Bastian B.
@DeXtr0niC
Feb 03 2015 18:38
yea would help me alot
Nathan
@terakilobyte
Feb 03 2015 18:38
alright go ahead and post the code you have so far
and we can step through it
Bastian B.
@DeXtr0niC
Feb 03 2015 18:39
ok, but i wrote that when i was not quite sure if i understand the task^^
Nathan
@terakilobyte
Feb 03 2015 18:39
it's ok
Bastian B.
@DeXtr0niC
Feb 03 2015 18:39

'''function sumFibs(n) {

if (n === 0) return 0;
if (n == 1) return 1;

var prevPrev = 0;
var prev = 1;
var result = 0;
var end = 1;

for (var i = 2; i <= n+1; i++)
{
    result = prev + prevPrev;
    prevPrev = prev;
    prev = result;
  if(result%2 !== 0){
    end = end + result;
  }

}

return end;

}'''

oh, did not quite get the markup
Nathan
@terakilobyte
Feb 03 2015 18:40
alright
Bastian B.
@DeXtr0niC
Feb 03 2015 18:40
*markdown
so basically i just created the fib
Nathan
@terakilobyte
Feb 03 2015 18:40
first, as I hinted I'd use an array to generate seed some fibs and also store new fibs
something like fibs = [1,1,2,3,5]; to start it off
Bastian B.
@DeXtr0niC
Feb 03 2015 18:41
yea ok, so that you don't have to rely on your fibonacci algorithm
now ,to find the odd fib numbers i could simply iterate through the array. but that does not solve the problem that i only want the first N odd fib numbers
a naive approach: I just create a new array, only including the odd fib numbers and sum them up?
Nathan
@terakilobyte
Feb 03 2015 18:45
well, I assert there's a better way
you should take a look at the Array.prototype.filter method on the MDN
Bastian B.
@DeXtr0niC
Feb 03 2015 18:49
ok, i guess with this i could filter our all odd numbers, <= my n
Nathan
@terakilobyte
Feb 03 2015 18:50
right
and you can generate those numbers with a while loop I'd think
while (fibs[fibs.length -1] < num)
inside the while loop construct a new fibonacci number and push it into the array
this ensures you don't calculate more fibonaccis than you have to
Cristián Berríos
@crisberrios
Feb 03 2015 18:53
You could even sum it in one go, without pushing to the array
Nathan
@terakilobyte
Feb 03 2015 18:53
^ another valid solution
Bastian B.
@DeXtr0niC
Feb 03 2015 18:54
ok thanks so far, i will take a breack from my mac and then try to solve it. will let you know!
*break
Nathan
@terakilobyte
Feb 03 2015 18:55
sounds good, have fun and good luck
Banun Idris
@mininsomniac
Feb 03 2015 19:41
just done pair programming for the first time which i would not have been able to do without your advice and excellent video sharing prowess @terakilobyte
thank you
Suzanne Atkinson
@AdventureBear
Feb 03 2015 21:45
hey guys what's up today?
Cristián Berríos
@crisberrios
Feb 03 2015 21:53
<rant>Well, kind of angry, around here everyone wants to scam you, $0.10 or $100, warranties, refunds, etc... It seriously grinds through your patience and mood when you have to deal with that everyday.</rant>
Nathan
@terakilobyte
Feb 03 2015 22:02
@minisomniac it's my real job to pass on advice
Suzanne Atkinson
@AdventureBear
Feb 03 2015 22:02
@crisberrios huh. Sorry to hear that! who is everyone?
Nathan
@terakilobyte
Feb 03 2015 22:02
glad it helped
Jason Rueckert
@jsonify
Feb 03 2015 22:03
@zersiax @brndnb great job guys!!!!
Branden Byers
@brandenbyers
Feb 03 2015 22:04
@phlacin Thanks, and thanks for putting up with listening to my stuttering due to confusion of my echoing voice!
Michael D. Johnson
@CodeNonprofit
Feb 03 2015 22:05
You guys did very well. I was watching the stream in between calls and emails all afternoon
Cristián Berríos
@crisberrios
Feb 03 2015 22:05
@AdventureBear every salesman and people involved in transactions of any kind here in Mexico City.
Suzanne Atkinson
@AdventureBear
Feb 03 2015 22:05
do you live there?
Cristián Berríos
@crisberrios
Feb 03 2015 22:05
We've had more troubles in 6 months than I've had in a lifetime back in my country
Suzanne Atkinson
@AdventureBear
Feb 03 2015 22:06
just keep saying "no". I forget why I posted in the help forum in the first place, but thanks for the reply. What country are you from?
Cristián Berríos
@crisberrios
Feb 03 2015 22:06
@AdventureBear yep, I'll be here for 3-4 more years
I'm from Chile
Michael D. Johnson
@CodeNonprofit
Feb 03 2015 22:06
@crisberrios de dondé eres?
oh
Suzanne Atkinson
@AdventureBear
Feb 03 2015 22:06
haah
beat me to it!
hablo un poco espanol.
Michael D. Johnson
@CodeNonprofit
Feb 03 2015 22:07
@crisberrios I’m doing my best to get you on a project ASAP. Thank you for adding yourself to so many.
Cristián Berríos
@crisberrios
Feb 03 2015 22:08
I like some others too but I left out the ones that are too complex IMHO, like building a CRM from scratch
@AdventureBear y yo un poco de inglés :thumbsup:
Michael D. Johnson
@CodeNonprofit
Feb 03 2015 22:08
That’s ok
Cristián Berríos
@crisberrios
Feb 03 2015 22:09
I'm also very interested in the one from a sewage company. I've developed solutions just like that one but "truck side" using AVL hardware and mobile data terminals.
.
Michael D. Johnson
@CodeNonprofit
Feb 03 2015 22:10
The only thing that hangs us up is waiting for another camper who is A) interested in the same projects as you and B) is willing to commit the same amount of time a week for it
We’re not going to pair you with someone only willing to commit 10 hrs
While you’ll commit 40
Cristián Berríos
@crisberrios
Feb 03 2015 22:16
Also it'd be nice if we are in near timezones
Suzanne Atkinson
@AdventureBear
Feb 03 2015 23:28
here is an angular questoin
I have an images folder with some thumbnails. It'd be nice to code the "./images/" into just one place rather than storing the iamge file name as image = "images/picture.jpg" so that in the event hte folder moves, I can update in one place and not everyplace in the data.
This is just a practice application from the code school gem store project
http://java.dzone.com/articles/angularjs-tip-avoid-multiple this addresses it, but codeschool hasn't learned me about $scope yet.
any thoughts or is this exactly what i need?