16 Jun 2016

Automated refactoring

History / Edit / PDF / EPUB / BIB / 1 min read (~179 words)
php

  • Component extraction (find all dependencies and attempt to create a self-contained library)
  • Convert function-based code into class-based code (static calls)
    • Copy all functions in a file into a new class where each function is static
    • Find all calls to the initial functions and replace them with calls to the class
    • Verify that all entry points load the autoloader (how to check that? search for the autoload.php string and require/include calls?)
  • Template/logic separation
  • Extraction of functions into a separate file
  • Extraction and replacement of inline style
  • Extraction of string resources
  • Extraction of inline JS
  • Extraction of inline CSS
  • Conversion of raw view logic to template logic
  • Removal of inline PHP code in js code
  • Convert raw SQL into builder queries
  • Move queries in controller into a service/repository
  • Convert <? to <?php
  • Convert echo calls to string concat + return
  • Update outdated phpdoc
  • Improve typing (parameters and return)

  • Lot of code is SQL queries

12 Feb 2016

Javascript datastores

History / Edit / PDF / EPUB / BIB / 1 min read (~183 words)
javascript database datastore

I am currently looking into javascript based libraries that will allow me to do in-browser queries, similar to how a server-side application would query a NoSQL database.

In order to pick the most appropriate database for my project, I first search for available solutions online. Then, I build a comparison table like the one below in order to determine the most popular database and its current health.

Repository Watch Stars Forks Last commit Open issues Open PR
pouchdb/pouchdb 245 5730 630 2016-02-12T17:23:21Z 128 8
google/lovefield 173 4143 195 2016-02-11T05:59:09Z 17 1
louischatriot/nedb 167 3680 237 2016-02-11T11:23:44Z 19 8
typicode/lowdb 87 2833 96 2016-02-09T21:16:31Z 9 3
techfort/LokiJS 102 1800 167 2016-02-08T19:18:40Z 64 0
coresmart/persistencejs 89 1586 226 2015-09-08T18:47:06Z 66 14
typicaljoe/taffydb 100 1309 215 2016-01-07T22:21:06Z 57 16
agershun/alasql 60 927 107 2016-02-09T15:35:07Z 250 0
Irrelon/ForerunnerDB 25 439 33 2016-02-12T16:20:29Z 17 0
13 Nov 2015

My AGI journey

History / Edit / PDF / EPUB / BIB / 3 min read (~468 words)
ai agi

Over the next year (and hopefully years), I plan on working on AI, but more particularly what is known as AGI, Artificial General Intelligence.

Since I am the kind of person that enjoys to overly plan, I've been thinking about the whole process for a while. Here's a brief overview of how I plan to construct my days as well as my work.

  • Decide and plan on which projects I will work today
  • Video log
    • What will I be doing today?
    • What might be blocking me or will be difficult and how do I plan to tackle that?

  • Record my thoughts: Either through video logs or through written notes, which is the more likely option. This will allow me to search my thoughts as well as organize them as necessary. Furthermore, I hope I'll be able to optimize my thought flow through tools.

  • Video log
    • What have I done during the day?
    • What are the key takeaway of the day?
    • What didn't I do?

  • Take notes (of interesting sections and ideas)
  • Write down thoughts
  • Write down questions related to what is being read (for further exploration)
  • Explore right away a question I might have had

I plan on working on multiple mini projects in order to ensure diversity as well as to allow me to spot projects which have the potential to be interesting and rewarding. However all projects are valuable in their own and it is important to reflect on the project at the end in order to extract things we'll want to repeat in the future as well as things we'll want to avoid.

  • Post mortem
    • What went wrong
    • What went right

  • Update the status of all tracked activities
  • Write a list of things that were done during the month regarding each activity that was done. The purpose is to review what was done as well as provide a way to determine how well a project may/may not be progressing. It is also a good time for me to look at each individual activity that was done during the month and evaluate if I want to keep doing it or not.
  • Write a post-mortem of the month, describing the good/bad of my current process and progress, with a section suggesting improvements to try for the next few months.
  • Plan the projects/activities I will be working on next month, as well as their time allocation.

I will be experimenting with this process in the next few weeks and will iterate on it as I see fit. I will thus be updating this post as changes occurs and I think of better ways to do my work.

12 Nov 2015

Things I do

History / Edit / PDF / EPUB / BIB / 1 min read (~40 words)
self
  • Work
    • Software development
    • Analysis
    • Conception
    • Implementation
    • Testing
    • Debugging
    • Deployment
    • QA
    • Maintenance
    • System administration
  • Sleep
  • Eat
  • Exercise
  • Entertainment
    • TV series
    • Reddit
    • Youtube
    • Twitch
    • Streams
    • Video games
  • Read
  • Write
  • Chat
  • Email
  • Transit
  • Anki
  • Piano
  • Guitar
  • Google
  • Prepare food
  • Bathroom
  • Shower
  • Wikipedia
  • Groceries
07 Nov 2015

Fitness trackers

History / Edit / PDF / EPUB / BIB / 4 min read (~764 words)
health fitness

I've recently become interested in the Quantified Self and wanted to compare a few trackers in order to determine the quality of their solution.

In this study, I compare the Fitbit Charge HR, the Jawbone UP3 and the RS300X. The Fitbit and the Jawbone are known as activity/fitness trackers while the RS300X is an heart rate tracker.

Fitbit and Jawbone are known fitness brand trackers. It's been a couple of years now that these types of trackers are popular, so I'd expect them to have come to some level of maturity. The goal of this study is to evaluate the quality of the products, as much in term of hardware as software.

In my case, I will be testing the Android applications since I own a Nexus 5. I would expect the experience to be quite similar on iOS.

I've also bought an RS300X in order to test a live heart rate tracker.

  • Has a little OLED display.
  • UI/UX is pretty straightforward.

  • The bracelet broke about 3 months after I purchased it. Fitbit support was excellent though and I received a replacement bracelet within 2 days.
  • Website errored out when I tried to create an application (preventing people from creating apps?)
  • Cannot get fine grained data.
  • Heart rate day availability is very odd. Seems to lag out and may display only in chunks.
  • Shows up in my android smart lock as a bluetooth device I could pair with, but I can't select it.

  • None at the moment.

  • The bracelet broke about 4 months after I purchased it.
  • Cannot get fine grained data.
  • Doesn't do real time heart rate tracking.
  • Heart rate day availability is very odd. Seems to lag out and may display only in chunks.
  • No idea why they decided to go with some weird buckle design. It looks like it's a nice point of failure.
  • After about a month it feels like the buckle is becoming loose. It is more and more frequent that it becomes undone and comes close to falling and I have to attach it back...
  • After about two months the buckle is becoming loose very frequently. I'd say I have to "re-buckle" it at least 10-20 times per day. That is ignoring the fact that it'll unbuckle while I sleep, making it pretty useless to sleep heart rate while sleeping.
  • The four heart rate sensors on the lower part of the bracelet are uncomfortable.
  • All the people I've shown the device to asked "why is there no display, show at least the time...".
  • Terribly clunky UI/UX. Why can't I just swipe from day to day in any of the stats
  • For that matter, why is it so hard to display the metrics I'm interested in and get rid of all those "pretty" suggestions cards?
  • Why would you put unit selection (metric or imperial) as being configured through my height or weight? Is it to save me time or to confuse me?

The following chart is the data I've collected over 3 days. In black is the Jawbone UP3 data and in blue the Fitbit Charge HR data.

Overall, the Fitbit Charge HR data is more consistent (every 5 minutes) while the Jawbone UP3 may end up having no data point for up to 2 hours. I assume this might be caused by how I've been wearing the bracelet but that is a weak argument.

Accuracy between the two devices can vary a lot.

[Pedometer chart for comparison]

Both devices seem to measure approximately the same amount of sleep. However the Jawbone UP3 has a nicer chart that goes into the various stages of sleep while the Fitbit Charge HR only displays Asleep/Restless/Awake.

[Sleep monitoring chart for comparison]

  • None at the moment.

  • Cannot get data out of device (for free).
  • "If you want your data, pay us another 70\$ +taxes for a transmission device".
  • "Oh, and by the way, you're going to send us those precious data over our web service so we can mine it for \$".
  • Watch freaks out if too close from chest strap.
  • Who thought of this terrible buckle design? If I want to break the strap, that's how I'd design the buckle.