Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Tuesday, January 14, 2014

Weekly for January 12, 2014

New Resources
* Programming with Asserts

Existing Resources
* PHP: The Right Way

Interesting Posts
* How To Be A Great Developer

On My Bookshelf
* Learning Python. (Returned library book. Page 1,024)
* Node.js In Action, borrowed from a colleague (20%)
* Getting Started with NoSQL (70%)
* Programming Python, 4th Edition (not started)
* PHP Objects, Patterns and Practice (page 65)

Summarize later
* The Art of Agile Development
* 97 Things Every Programmer Should Know
* PHP Web Services

Wish List
* JavaScript: The Good Parts

This week I continue my search for a Python (or, dare I say, Ruby) open source project to work with. I also have a couple of good suggestions on Facebook to work in the jQuery library.

Friday, January 3, 2014

What is the equation for my weight?

I’ve been actively running since early September. I much prefer riding a bicycle, especially to work, which used to be 9.5 miles either way. Unfortunately a bicycle is a poor transportation choice for toddlers.

Accordingly, I’ve lost quite a bit of weight. 20 pounds in 4 months, which isn’t too shabby. The rate of loss seems to have slowed, so I decided to figure out what equation is the best fit for my weight.

Naturally, there’s a way to do this in Python, and it’s pretty easy.

from numpy import polyfit

x = [<a whole bunch of integers representing days since 9/1/13>]
y = [<a whole bunch of doubles representing weight>]

# this part is interactive:

>>> polyfit(x,y,2)
array([  5.36576978e-04,  -2.05927136e-01,   2.30620968e+02])

Well. That was easy. So the equation approximating my weight is:

.000536x^2 -.205921 x + 230.62

Naturally, I wanted to know what I’d weigh in the future.

>>> (a, b, c) = polyfit(x,y,2)
# this seems... silly
>>> d = [c,b,a]
>>> Poly = numpy.polynomial.polynomial.polyval

Day 121 checks out, so things are good. What about the future?

>>> Poly(200, d)
210.89861954517085
>>> Poly(300,d)
217.13475489610073
>>> Poly(400,d)
234.10242981212033
>>> Poly(1000, d)
561.27081017512194

Uh oh. I didn’t plan on doubling my weight 3 years from now. Maybe my weight isn’t a 2nd degree polynomial with a positive coefficient.

What I’m looking for looks a lot more like 1/x. Which, if I recall, is by definition not a polynomial. The search continues…

Tuesday, December 31, 2013

Hello World

Written with StackEdit.

Hello World

However you came to stumble upon this blog, welcome! This blog isn’t designed to have an audience, but you’re welcome to join me for the ride.

The purpose of this blog is to organize my thoughts, figure out my focus as a professional, growing web developer, and then do something about it.

The first of these is to pick up Markdown syntax, since that’s what GitHub uses for its README files. StackEdit is a Markdown editor that saves files in the local browser cache but also allows me to publish to Blogger.

Perhaps the best way to jump into this is to parse out what I’ve been reading lately…

What’s On My Bookshelf

  • Learning Python. A library book, ‘til 1/14. (66%)
  • Node.js In Action, borrowed from a colleague (20%)
  • 97 Things Every Programmer Should Know (finished)
  • Getting Started with NoSQL (70%)
  • PHP Web Services (finished)
  • Programming Python, 4th Edition (not started)
  • The Art of Agile Development (finished)

The First Topic: Why Python?

While I do identify as a web developer, I see Python as an good object-oriented, yet general, programming language. It’s platform-neutral, portable, and widely supported. Sublime Text 2’s extensions are written in Python. Formatting and writing code is a breeze, and from what I’ve gathered through Learning Python, the language’s rules and syntax are simple and make sense.

Though Python is likely behind PHP (my currently-native language), Java and .NET in terms of use on the web, it still seems like a good “glue” language to pick up, especially when it comes to learning the basics of picking up design patterns.

If time allows, it might be worth perusing the Django web framework to see what sort of web philosophy is behind that framework.

A Note About Frequency

I’m a dad to a 19-month old. So I don’t plan on posting daily, or even every other day. Frankly, once a week would be nice, if only to get my priorities straight.

Welcome aboard!