Month: April 2017

What is the end goal? Musings on programming.

Posted on

I a doing FreeCodeCamp’s Build a Weather app for the 2nd time. (maybe 3rd? who knows)

This time I thought I would get fancy, try to get the location from HTML5 first, then if an error, get the location from a IP geolocation service.

Well, I am finding that some functions don’t wait for the return of data from another, and rather than having an orchastrator function I would need to chain the functions together.

example:

Original:  master() call geoHTML5; if error master() call geoIP;

now: master() call geoHTML5 call geoIP() call….

Now I could just forgo HTML5 geolocation since IP geolocation works and actually has better data than HTML5 gelocation.

What is my end goal? To finish the project? Then ip geolocation would be the right choice, dont waster time on other things.

But what is my REAL end goal? TO get better at programming and learn the ins and outs of javascropt. That means I need to deal with my original plan and found out how to implement it..

What is the end goal? I’ve already done a weather app. The goal is to get better at programming.

Advertisement

paper.js hue problems

Posted on Updated on

Had this code:

var animatedCircle = new Path.Circle(new Point(300,300), 100).fillColor=”green”;
function onFrame(event){ animatedCircle.fillColor.hue += 1 ;}

was getting and error  :  Cannot read property ‘hue’ of undefined

solution was to add fillColor to animatedCircle AFTER initialization on a new line.

animatedCircle.fillColor=”green”;