walk-stats (part 1)

Let’s develop something

Introduction

Sometimes you need to keep yourself busy doing something, so I decided to document the birth and evolution of my next project from the early beginnings to a working stage (hopefully).

I will develop an application to keep track and create statistics on walks I make around here when I have some free time.

There are already programs that basically do the same thing like map my walk, walk log and so on.

I know it’s not nice to answer a question with another one, but to the question why another one? I would simply answer, why not?

This could be an interesting project and I haven’t seen much documentation about the process of developing a project from the beginning.

I’ll try to be as clear as I can and document each choice I make to make some sense of this in the end.

I think doing this could:

  • Keep me busy, making me think about something else.
  • Be an interesting challenge to solve.
  • Make me learn something new.
  • Let me experiment on things.
  • Make my coding skills better.
  • Help somebody who’s curious about anything I’ll talk about here.

First things first!

Well I like to do code while listening to music, so the first thing to do is finding something to listen to.

Getting back home from work I was thinking about the record I.V. by the band Loma Prieta.

I don’t have it on my phone so the choice it’s pretty easy on what to listen to for me, you can buy it by clicking on the links.

Here’s the player from bandcamp if you want to check them out:

What do I want to do?

Programming basically consists of finding ways to solve problems and make a computer do it for you in the best way possible.

What I want to do is to keep track of when I walk and calculate statistics to see how things are going.

That’s basically it for now, later on I’ll try to analyze this in more details and try to find a solution each subproblem to come up with something that would work for me.

Decisions, decisions, decisions…

How to write it?

I like the Java programming language, I also use it every day at my job, so the choice for me it’s pretty easy, using it 🙂

How to call it?

Well this should keep track of my walks and do statistics on them, why not calling it walk-stats?

Sounds reasonable, and it’s not already taken, so be it, welcome walk-stats.

How to release it?

I’m a pretty strange person, I’m a bit of a misanthropist, but I still believe that helping someone who needs it (and while programming you came across a lot of challenges) it’s a nice thing to do.

I also think that more people looking and collaborating at something would make it better.

So I’m releasing the code for this project with the BSD 2-clause license, basically, do whatever you want with this program as long as you keep the license for the code I wrote in source and binary form.

Analysing the problem a bit more in depth

A nice way to attack and solve a problem it’s dividing it in smaller subproblems, as a lot of people said before: divide et impera, it worked then, and still works today.

So from keep track of when I walk and calculate statistics on it, it’s easy to divide it into 2 smaller problems:

  1. Keep track of when I walk.
  2. Calculate statistics on it.

This is helpful  because I can focus on the first problem first and move on with the second part later.

Keep track of when I walk

Questions? Answers!

How can I record data from a walk?

Well, I don’t feel like writing a full pledged gps logger application for my Android phone, I just want to aggregate the data in a unique place and make some computations about it, so Logger GPS for Android would sure do.

It’s open source and the code it’s available on github, free to download from the Google Play Store.

With it I can save data in the GPX format, which is pretty cool.

What’s the data I need to save about each walk?

For now, without worrying too much about it I guess I need to save:

  • The date and time I was walking
  • The actual data GPS positions from the walk

Where can I store that data to make it easily accessible and usable?

Probably in a database, where I can structure the data and query it.

How do I want to see the data?

Well it would be cool to see the actual map with the track on it, so I’ll try to keep it an option. But it’s good enough to see the numbers too as the first release.

Calculate statistics on the data

Other questions and answers

What do I need to compute from the saved data?

It should be useful to see:

  • Total time.
  • Total distance.
  • Average speed.
  • Maximum instantaneous speed.

All of this also from all walks together. (this should be be easy from the single aggregated data).

How do I want to see the data?

Again, graphically a graph would be cool, I’m not a graphic so I would keep that in mind, but just the raw data it’s good enough for the first release.

Let’s start setting up the project

Distributed version control system for the code

I think it’s important to keep the code under version control, it helps focusing on what you’re doing, and all the others nice things like distributed development, versioning, history, rollbacks and so on.

I like git, my code is open so I will use github as the public repository for this project.

I won’t focus much on how git or github works, if you need help there’s a nice documentation about them.

It works like this:

  1. Create a github account
  2. Login
  3. Create a new repository
  4. Add a .gitignore and/or a license and/or a readme if needed
  5. Profit

So here it is, the repository for the project!

That’s it for now, but the fun part is yet to come 🙂 See ya!

Advertisements

timeTable

I’m fed up with the transportation service of my city, it’s slow and it gives no clue about what bus to catch when you need to go somewhere.

I’m planning to do a web application to use with it and I’m developing a website in Django/Python to implement the timetable with a search for routes.

The final goal will be to put a “I’m here” button which would tell the nearest stop and tell you the next useful bus to catch.

After learning a bit of Python to work with the Tumblr API I’ve noticed that it’s a quite nice web oriented language to use, so I choose it in combination with the Django project and programming dynamic web pages it’s not as bad as I remembered from high school. 🙂

You can find if you want the source files in this Bitbucket repository!

solarPower ideas

After some testing and brainstorming within myself I think the main improvements I can do to this little projects are:

  • Adding a microcontroller for :
    • Output voltage (amperage??) monitoring
    • Battery overcharging
    • Getting a nice low power display to show this stuff..
  • Get the output voltage a bit higher for losses in cables or due to battery drainage.

Basically this.. Maybe I can just use an op-amp with a voltage reference to disconnect the solar power when the battery voltage it’s high enough.

More to follow, just a quick post…

solarPower first prototype!

Hi, I had two 9V/1W solar panels laying around at home and I was wondering what to do with them for a long time. Hopefully I’ve put them to good use finally! I also happened to have around some MC34063 DC/DC switching converters, wich I would like to use too, so this is basically what came out of them!

Continue reading “solarPower first prototype!”

TumblrPicUploader first release!

Hi, this is just a quick post, I’ve prepared a little python application to upload pictures from a pc/mac/linux box with python installed using their REST API V2.

I tried to use java at first but there was some problem with the photoset uploading wich was driving me mad..

After some searching I’ve found out that the tumblr team wrote an example in python to do just that (a bunch of person had the same problem apparently).
So, I learned python and went for it..
That’s what I came up with..

Bitbucket Repository – TumblrPicUploader

Have fun with that, read the readme file and if you have any question, just write me here or on my email.

Bye!