Building tools for myself: grocery receipt tracking

Today was another good day for writing code. I finally built that quick-feedback receipt item tracker I’ve been thinking about for a while. I’d built a simpler version into Quantified Awesome (not linked from the main interface, since it was very rough), but I found the browser roundtrip too disruptive. Today’s implementation uses Angular for faster responses. For good measure, I’ve got a NodeJS server proxying the requests to either my local development copy of Quantified Awesome or to my production version.

Here’s a screenshot:

2015-05-26 22_21_38-sachachua.com_8080_receipt

On the left side, I have a scanned receipt in Autodesk Sketchbook Pro (or a paper receipt on the side). On the right, my autocompleting tracking interface. It’s not pretty, but it fits what I have in my head. I like the way that typing in the first few characters of the receipt line item is often enough to uniquely identify the receipt item type and retrieve the price history. This means that as I track, I also get a sense of the price trends and what a good sale is.

Aside from keeping track of the prices, I’m also looking forward to analyzing our consumption by category on a more regular basis. I did a few analyses along those lines before (here’s a year of data), but it might be neat to have that kind of feedback on a daily basis. Entering my receipt archive was easy. I ended up typing in the receipts from here to January because it was fun. =)

Next up: fast categorization, some graphing… I’m also looking forward to making a quick price book interface. Hmm, if I dust off that grocery list tool I had started building into Quantified Aweome and I integrate the price book, that might be handy.

Thinking about adaptive menus for tracking

I’ve been thinking about building more tools for myself. Some of the ideas I’ve been playing around with are around simplifying activity tracking further, possibly getting it to the point where it suggests things for me to do when my brain is fuzzy.

My current tracking system has two tiers. For my most-common activities, I use a custom menu that I can open from my phone’s home screen. I created the menu using Tasker. It’s easy to configure menu items to update my Quantified Awesome activity records as well as run other logic on my phone. For example:

  • “Eat dinner” creates an activity record for “Dinner”, then starts MyFitnessPal so that I can log the meal
  • “Walk home” creates an activity record for “Walk – Other”, then starts step-by-step navigation of the walk back to my house
  • “Sleep” creates an activity record, then launches Sleep as Android
  • “Ni No Kuni” creates an activity record, prompts me for what I want to do after an hour of playing, opens a page with tips for the game, and then reminds me of my plans after that hour passes

One advantage of using something on my phone is that I don’t have to wait for the initial web page from Quantified Awesome to load. My keyboard occasionally takes a while to come up, too, so the menu-based interface gets around that as well. Also, as I get the hang of using Tasker, I can set up more intelligent processes. The menu has a link to open the web version, so if I want to track something less frequent, I can always use the web interface.

In the web interface, I usually type a substring to identify the category I want to track. For example, “kitch” results in an activity record for “Clean the kitchen”. I use this interface if I need to backdate entries (ex: -5m), too.

In addition to the two interfaces above, I’ve been thinking about taking advantage of the predictability of my schedule.

Research into adaptive menus turns up quite a few design ideas and considerations. Since I’m building this for myself, I can get around many of the challenges of adaptive interfaces, such as privacy and predictability. I’m curious about the following options:

  • Text-based input with minimal cues, as part of a more powerful command line
  • Context-sensitive menu with a handful of items (3-4, with a link to more): I can probably suggest candidate activities based on the past two activity records. That might mean a little bit of latency as I check, though. It also means that the menu will keep shifting, so I’ll need to read it and find the item I want to click on.
    • For everyday use?
    • For really fuzzy moments?
  • Static menu of frequent items, but adaptive highlighting (ex: green or bold, or fading out other things slightly)
    • Abrupt onset, others fading in over 500ms
    • Colour?
    • Weight?
  • Split menu: frequent items on top, everything else below
    • Static
    • Adaptive
  • Hierarchy of menus: speedy, but lots of tapping
  • Cut off menu: show only the activities that come after the one I’ve just tracked

Hmm… It might be interesting to play around with different menu options. It would be good to experiment with NFC as well, especially early in the morning. =)

Related:

Weekly review: Week ending May 22, 2015

Almost 26 hours of playing video games this week – Ni No Kuni is such an engaging option for my fuzzy brain. Some thoughts and conversations, though, so I didn’t vegetate the entire time. =)

Planning to take it easy over the next couple of weeks: games, drawing, writing, some code…

2015-05-25a Week ending 2015-05-22 -- index card #journal #weekly

output

Blog posts

Sketches

Link round-up

Focus areas and time review

  • Business (20.1h – 11%)
    • Earn (7.8h – 38% of Business)
      • Earn: E1: 1-2 days of consulting
    • Build (10.0h – 49% of Business)
      • Drawing (8.9h)
      • Paperwork (1.1h)
        • Calculate deductions
        • Transfer money for salary
        • Write and deposit cheque
        • Remit deductions
        • File payroll in Quickbooks
    • Connect (2.3h – 11% of Business)
      • Chat with Michael Crogan about Emacs
      • Chat with Ab Velasco about Quantified Self talk
  • Relationships (10.7h – 6%)
    • Work on personal project
  • Discretionary – Productive (9.9h – 5%)
    • Emacs (0.0h – 0% of all)
    • Make a list of all my TFSA contributions
    • Verify Jen’s public key by calling
    • Review Createspace
    • Add to my TFSA
    • Writing (2.9h)
  • Discretionary – Play (25.7h – 15%)
  • Personal routines (22.5h – 13%)
  • Unpaid work (21.4h – 12%)
  • Sleep (57.6h – 34% – average of 8.2 per day)

Building tools for my future self

I was thinking about steps towards personal digital assistants. In a separate thread, I was also thinking about the psychology of aging. In a third thread, I was thinking about projects I might want to build to help me learn more. It makes sense to bring all these threads together: thinking of systems I can build to improve the quality of life I’ll enjoy in the future.

I think this might be a better fit for my experimental learning than either a hypothetical market or specific people. After all, I’ll always have a future self who could benefit. (And if I don’t, I’ll be past caring!) If the things I build along the way turn out to be useful for others, all the better.

Anyway, I was thinking about the kind of simple, deterministic, idiosyncratic assistant I could build to make life a teensy bit better in the medium term and the long term.

I could start with a text box interface on a webpage, then move to alternative inputs like dictation or neuro-integration(!) when that becomes reliable. It would be great to have some kind of offline buffering, too.

In terms of logic, I could start with stateless well-defined responses, add synonyms, support conversational interfaces, use weighted factors, add feedback mechanisms, and then eventually reach proactive notification and action. Inferences would be awesome, but I don’t have to wait for them to be sorted out. Ditto for program generation and adaptation.

In terms of sensing and acting, I can start with existing APIs and tools, write specific adapters for other sites, push into the physical world with sensors and actuators, use context and probability to simplify, and then take advantage of improvements in fields like computer vision or biometric analysis as other people build and commoditize cool tech.

But first, it starts with building a simple tool. Hmm, maybe a little thing that suggests what to do next (and coincidentally makes it easy to track)…

What it’s like to work with data

How did I learn to work with data?

I learned the basics of SQL in high school, I think. In university, I got most of my kicks from the extracurricular projects I worked on because doing so let me hang out with interesting people. As those people graduated, I moved to handling those systems on my own. Blogging have me another reason to explore data analysis, since I was curious about my stats. Eventually, with Quantified Self, I started collecting and scraping my own data.

I do a lot of data analysis and report creation as part of my social business consulting. It has deepened my appreciation of database indexes, subqueries, common table expressions, recursive queries, caching tables, arrays, partitioned queries, string manipulation with regular expressions, and visualization tools. I’d love to get together with other social business data geeks so that we could swap analysis questions and techniques, but we’d need to get approval for sharing data or set up a sanitization protocol that my clients would be comfortable with. We’re doing some pretty cool stuff.
What is it like when my clients ask me data questions, or when I think of a question I’d like to explore?
I start by thinking of whether we have the data to answer that question, or how I can collect the data we need. I think about whether there are similar questions that are easier to answer. Then I start thinking about how to bring everything together: which tables, which joins, which conditions. Sometimes I have to use subqueries to combine the data. I’m getting into the habit of using common table expressions to make those easier to read. I feel satisfied when I can connect everything in a way that makes sense to me. I also like seeing the common threads among different questions, and turning those insights into parameterized reports.
Sometimes the first report I make fits the situation perfectly. Other times, we go back and forth a little to figure out what the real question is. I really appreciate it when other people help me sanity-check the numbers, because I occasionally overlook things. I’d like to get better at catching those errors.
Once the report settles down, I can think about the performance. Sometimes it’s as simple as adding an index or creating a table that caches complex calculations. Other times, I might need to modify the presentation or the question a little.
In addition to making my reports more reliable, I’d like to get better at visualizing the data so that people can get an intuitive feel for what’s going on.
I also want to get better at making inferences based on the data, especially when it comes to teasing out time-delayed or multivariate factors. I think my data sets are usually too small for things like that, though.
Anyway, that’s what it’s like to enjoy crunching the numbers. I love being able to do it, and I like exploring the kinds of questions that people imagine. =)

Fuzzy brain; also Ni No Kuni

Low energy both physically and mentally today, but I managed to squeeze in a 90-minute walk that included the library and the supermarket, so my walking streak continues. I can feel the fuzziness start to encroach, so ah well. Time to indulge a little. Aside from the walk and the usual chores, in fact, I spent practically the entire day playing Ni no Kuni: Wrath of the White Witch.

I like playing role-playing games, particularly ones that are forgiving enough to let you restart or change your mind if a battle’s too much for you. I enjoy watching the story unfold, and I like slowly getting the hang of the battle system and character development.

I prefer turn-based games like Persona 4 Golden where you have a little time to review the situation and think about what you’re going to do. But Ni no Kuni is such a pretty game – gorgeous visuals and sound (Studio Ghibli! the Tokyo Philharmonic!) – that I’m working on getting the hang of the real-time battle system. I expect the game to take me a while, though. This is good, because I happen to have said while.

There are many things I could do with my time, and I’m sure they’ll rise higher on my list after I settle in. There’ll be time enough for other things.