Wednesday, December 31, 2014

Project Shining Runners Cap

Greetings my dear reader (readers? - I dunno how many of you reads my scribbles)!

When I started running I made one more resolution - to stop procrastination. To never ever postpone doing something I wanted to. Usually I had a lot on my mind (mostly stuff related to work) and all this pulls me from bringing my new cool ideas to life. The end result is that I waste my time - I don't have power to do the things I had to so I just... wander around the Internet for too much time. This era has definitely ended and now I will carry out all my ideas :) I say NO to procrastination!



Project origins


During October I was usually running few hours after work which means at around 8 or 9 pm (20/21 in polish time). The place I run has some parts with lights, but some parts are covered in darkness. To avoid collisions with bikers and other people (and to be less scared of darkness) I used simple app on my phone that uses flash light to blink at some intervals. The app is called Tiny Flashlight and can be found in Google Play. The strobe mode can be found here (there is some problem with that link... I don't know why, it works for me (I have this app installed) but not for other users...).

During my night runs I was thinking how to better light myself (not literally!) - eg. use colourful lights to show the pace or the music that I'm listening. That's how it all started...

The result


After few single person brain storms done while running I decided to upgrade my current cap with lightings. I grab some led lights from older projects, convinced my wife to prepare some material and this is what I get:



As you can see from the video it is in very early pre-alpha state. I used some W2801 led stripe sewed into scrap of material. It is connected to Arduino (control, on the right) and some DC/DC inverter (power, on the left). It supposed to be letter A... at the back of the cap there are four more lights.

All in all I'm not satisfied with current version. The led stripe is difficult to strap to material, its connectors are prone to be damage by bending (like iphone... maybe it should be named iCap;) and at the moment it looks just bad. That's why I'm abandoning this version and  leaving it in this unfinished state. It's not worth putting the work when you can have much better lights (they are already coming thanks to aliexpress.com!).

Somewhere in the future I will describe in details all the plans and parts for my super-duper cap!

Ohh and: Happy new year!

Monday, December 15, 2014

Ka-Pow*! First challenge shattered into pieces!

* for the felons not familiar with internet gibberish - kapow in urban dictionary :)


BAM! The countdown has finished! I made it, the first challenge has been beaten to the ground! 500km before the new year is achieved today, the 15th of December! It was publicly announced (on the blog) on the 1st of December (I came with that idea a week or so ealier). I worked hard, run highest number of kilometres per week (8-14.12: 44.42km) and finished well before the New Year's Eve. Nothing more to say than easy peasy lemon squeezy:


Now to the point - challenge yourself, find WHAT you want to achieve, plan HOW you will do it, and then stick strictly to the plan and just DO IT. There is one important requirement - LIKE doing the thing (you have chosen to do).

As for myself I'm in a need for new short-term challenge so here you go:
Run more kilometres than ever in one month (current record: 134km in October).

One more thing to note - to celebrate my small success I tried to break the 5km record but failed by 4 seconds cause I forgot what it was during the run. It reminded me about one thing - do not be afraid of failures. Failure is part of the game, you have to accept it. I know that next time I will beat the crap out of this record. It's just a matter of time. Also... I broke 3miles and 3km record :)

Time to finish this with some motivational sentence for future:

Next challenge (half marathon) better watch out, cause I'm coming for Ya! And when it happens... BAM! In a blink of an eye... You dead.

TL;DR

I've finished first of running challenges - run at least 500km before the end of the year. As there is a lot of time to go I decided to try to break my record of number of kilometres run in one month (134km).

Sunday, December 14, 2014

Hackathon numer 1!!11!!!!1!!

The idea of late night coding

Some time ago a friend of mine linked me this article:
http://en.codeceo.com/why-programmers-work-at-night.html

It strikes me that I totally agree with all the arguments about why coding at night is productive. Unfortunately my work obligations require me to get up early on every Monday, Tuesday and sometimes on Thursday. Despite this, last week I tried late-night coding at it was fun, it reminds me of the times when we were constructing and programming sumo robots whole night, just before the competition!

Goal definition

Encouraged by the success of this programming effort I decided to do it again on the weekend. As weekend should be free from work stuff I went for my own secret project that I was planning during my running workouts. I found some inaccuracies in the way the Endomonod (application + website I use for recording my runs) calculates records and lap time. More details about this in some future post. In short the planned app has to be able to:

  • read the *.tcx file (holds all the information about activity like all the trackpoints)  exported from Endomondo website,
  • calculate the distance travelled based on longitude, latitude and altitude data,
  • show the data on charts.

As you may know, writing an app is not as much fun as writing it in a new language! Killing two birds with one stone - writing the app and learning the basics of Python was my goal!

Hell, it's about time to start The Hackathon!

It all started at 6:00 pm and finished at 2:16 am (not that late!) with some breaks in-between (eating, discussing differences between programming languages with friend and so on).

The whole process was documented and can be found on github (tried to commit changes regularly):
https://github.com/Michal-Fularz/python_tcxVisualizer

This was my first foray into the Python world, and oh boy, what a ride it was! I don't know where to start so maybe I will just write how the hackathon went and then present my thoughts on Python.

I used Python Tools For Visual Studio with Visual Studio 2013 Community Edition and Python 3.4. All the necessary packages were downloaded from this dedicated website. (lxml, scipy).

As reinventing the wheel was not my goal so I started with a search for libraries / code that can help me with my task. I found this and was able to almost immediately start working with the data from *.tcx files. Then I ask google about the way to calculate the distance between two points described by latitude and longitude and found a link to a Python implementation through a wiki page. Almost all the code was found somewhere in the internet (as I didn't know how to iterate through the collection, how to write if statement or even for loop). Fortunately there are so many good tutorials and info pages that I was able to accomplish my goals - prepared application reads the data from *.tcx file, put it into designed object, calculates all the interesting values (lap times, average speed, total distance, etc.) and shows them on the charts. I manually added some values from Endomondo website to compare with the ones I calculated. Image below shows my app printing some calculated values.

Results printed by my program. Also the speed chart (I run over 80 km/h at some point!).

Summary

To sum up this lengthy post (keep in mind that these are beginner thoughts on Python):

I have a lot of fun programming this simple app in Python. What really surprised me is how much examples you can find (almost all my problems were resolved with just one query to google). The syntax is really neat. The way you handle most things is different than C/C++ or C# (languages I'm familiar the most). I have to thank a lot Przemek Walkowiak (przemkovv) for his tips about Python. He showed me some secret magic like list cohesion, bisect and zip functions. Instead of using this tools I was for looping (C-style) most of the time :)

8-hour hackathon was nice experience and I'm satisfied with what I achieved.

What the future holds

The program still requires some work - it can't handle lack of altitude filed in *.tcx files. It will fail if there were stops during the workout. The charts require some polishing. There should be some automatic way to download the data from endomondo website (I found this). All in all two or more hackathons are required two finish this little project. See you soon!

TL; DR

I taken part in my own 8-hour hackathon and learned Python programming language while writing the program to analyse and visualise the data from my workouts (Endomonod website). Result can be found on my github.

Monday, December 1, 2014

I've got a confession to make...

I hide it... I truly conceal it... This whole idea of blogging was somewhere in my mind. But the thing that motivated me to start it, to do it came from running.

Running is simple, it's just you against yourself, your weakness. Everything depends on you, each run is a challenge, which you can overcome. When I am running with my favourite music I feel I can do whatever I want, it just a matter of going all-out. It's not easy, it takes time, but if you're persistent and strongly believe that you could succeed you will.

Each and every day you can sit on your ass and watch some funny tv shows or youtube movies, play games or just waste your time. But the same time can be used for something else, juts decide what you really want and do it! Or start with believing that you can do it and it will happen sooner or later!

This is the origin of the blog name. Running makes me believe, that if you want you can. Just do it, don't stop, don't complain, it will take time and sweat but everything is possible if you want. Sound crazy and pathetic but who cares.

I returned to running last year after a break of high school, whole studies and two more additional years. At first I run with my wife in some really old shoes, it was just casual jogging but after few tries I realized that I like it. I bought professional shoes to keep my knees in good shape for later parts of my life :) I finished the year with something like 20, maybe 25 runs. The winter and spring was a long break, but I came back with full power. I don't remember when exactly I run first, but I starter recording my activities on 25.07.2014 with Endomondo app.

You can find info about my progress here (I'm putting some description for each run):
https://www.endomondo.com/profile/17457362

All this running is done, cause some time ago I decided I need a long term goal to test if I'm able to fulfil it. Unfortunately I'm more of a "flash in the pan" type of guy - start with a lot of energy and motivation, that runs out quickly. So I challenged myself - next year (2015) - half marathon and then full marathon. That's the first and most important of my challenges.

A week ago I was analysing my progress thus far and find out that I've run almost 400 km this year (only recorded ones count) so I decided to break 500 km mark this year!



TL; DR

Plan something, challenge yourself, believe that you can do it and it will happen!

My running challenges:
- run in half-marathon in first half of the 2015,
- run in full marathon in second half of 2015,
- finish 2014 with 500km under the belt (check my Endomondo profile to see how I'm doing).