Review of April 26th, 2017

Time limit to complete post: 10 minutes (I shouldn't have as much to say as this is a little late coming).

Pencils down at 21:12.

Reading the Day's Posts

Daily Entry

This daily entry more closely resembles what I want the daily entry to look like. Just quick logs of what I'm doing and plan to do throughout the day.

Still need to make problem-statements out of the HackerRank coding test problems I did.

Also, I have more problems to make. Should probably brainstorm them today.

Review of April 25th

There's some stats in that post that I simply won't have for this review.

Find and Replace Problem-Statement and Post-Mortem

Just a real-life problem I had to solve more than once and that I should be able to do without looking things up, I think.

Stats

No stats today, didn't properly log them. Should be a goal of the daily entry to log throughout day, but I didn't.

I'll try to be better, Stephan.

Daily Entry: May 1st, 2017

Mon May 1 13:58:16 EDT 2017

I have a habit of hanging with family when waking up. So I'm starting this upstairs on my chromebook here.

Meaning I'm temporarily back to vim!

And it's a vim without any of my .vimrc.

Maybe I should just do emacs....

Mon May 1 14:06:02 EDT 2017

Emacs, woo!

I don't remember how to do anything!

Wait, I remember how to save (Ctrl-X Crtl-S).

Going to go out to eat with family.

Emacs may be a mistake. Perhaps I should create a training regimen for editors and IDEs before starting one.

Mon May 1 20:16:24 EDT 2017

Time to dance!

Mon May 1 20:53:49 EDT 2017

Kept it light today, as I've already eaten and am still quite full.

It's actually amazing that "light" now was almost too much about a month ago or so.

Mon May 1 20:54:18 EDT 2017

So, now starts the habit of coming here instead of going to YouTube or Reddit when I have momentary downtime.

Or, rather, now starts the attempt at cultivating such a habit.

I'll be showering soon, and afterwards I may be playing some Overwatch.

Just caught myself going to Five Thirty Eight.

Time to add that site to my "Premium Sites" list.

This reminds me, though, that I want to remake that extension. It's setup is flawed, I think. I gain currency to spend on the premium sites by not going there for periods of time. Perhaps it'd be better to gain currency by doing things I would like to do.

Mon May 1 20:59:51 EDT 2017

Let's review the days I haven't so far.

April 26th

This review is its own post.

It reminded me to log the things I should have logged so far throughout today:

  • 10 pull ups (with assistance).
  • 6 songs danced

April 27th

A nice, lazy day used to recharge.

April 28th

Another lazy day, but with exercise, kept stats.

April 29th

Lost to time. I honestly couldn't revive any proper memory of the day.

April 30th

"Properish" day is about right. Managed to do some productive web dev stuff for a friend. It ended up taking me longer than I anticipated, so I didn't review any of the things I would've liked to.

Took the day off from exercise as I had worked pretty hard the prior two days.

The web dev stuff I did could be made into a problem-statement for my training regimen, so I think I'll do that.

Mon May 1 21:15:36 EDT 2017

All right, so after shower, I will do some problem-statement construction.

I may also need to do some hard thinking on when I'll redo these problems.

Mon May 1 21:28:18 EDT 2017

Back from shower.

First instinct was to go to browser and maybe go to one of the usual sites. Not to note anything here.

Need to work on that.

Which this right here is a form of! Progress.

Mon May 1 21:30:12 EDT 2017

All right, I wanted to create about three problem-statements. Maybe more.

Let's do the two I did through HackerRank now.

Mon May 1 21:47:09 EDT 2017

Friend Circles Problem-Statement.

I will now play Overwatch. Tomorrow I'll do the other problem-statement, and hopefully one or two post-mortems.

Mon May 1 23:14:40 EDT 2017

Played Overwatch. Ate more.

Going to watch YouTube now.

Daily Entry: April 30th, 2017

Sun Apr 30 15:36:21 EDT 2017

Today should be a proper day.

Properish.

I am starting later than I feel I should.

It'd be ideal to have the habit of opening up this post first thing.

Something to strive for.

Yesterday I didn't even create a post. Weekends can be pretty distracting. Everyone's home and there's errands and chores to be done.

Not a valid excuse, just an additional hurdle to overcome and plan for.

Sun Apr 30 15:37:48 EDT 2017

Other than productive things and project stuff, however, things have been going really well! Finally tackled some tickler items instead of throwing them to the future. Am fully planning to tackle more tomorrow (some have to be done on a weekday). My exercise regimen is becoming more consistent and slowly mutating to ever-more improvement along the things I care about.

My diet has been under control the last three days as well. I have once-again adopted the single-meal a day strat. During the non-meal part of the day, I can eat fruit and drink coffee (with the soy creamer I like). The first two days were hard, but now I am quite liking it.

It's pretty amazing, actually. There's this realization I have every once in a while that I am having once again. I have a craving and I know from experience that acting on that craving will do me no good. However, experience simply does not help by itself, for me. I need to craft a system from that experience to properly act on it.

So, the single meal strat helps me act on the various ways that being allowed to eat at any time of day hurts me.

But there's also the next realization that I have again and again. The system is a game. And, like any game, I will be bad at first. There's no real helping it, I just need to keep playing until I'm better.

Simple as that.

I can have various stepping stones and stuff, but failure will be a key part to a successful implementation of any system I wish to hire.

Sometimes, I'll move backwards. Sometimes I'll stop for a while and be rusty and bad at the system again.

It doesn't necessarily mean the system doesn't work (though it can mean that, I can always strive for better design).

Sun Apr 30 15:47:25 EDT 2017

So, I missed a few days of logging. That's fine. I'm glad I'm striving for it, and I hope to continue getting better at it.

Today, I want to review the days I haven't reviewed, and then do a "Weekly Review" of sorts, but it'll be all the days that I have reviewed so far.

Then, I have some projects to work on.

Sun Apr 30 16:24:02 EDT 2017

Bought some plane tickets first.

Sun Apr 30 16:24:08 EDT 2017

Okay, let's time-block this. I will be eating at 1800. I will work on some JavaScript stuff until 1700, and then do various diary things until 1800.

No promises on anything from 1800 to 2100.

At 2100, I'd like to time-block my remaining time.

Daily Entry: April 28th, 2017

Second day of being bad about this.

I need to be more strict about doing a time block in the morning. I don't have to follow it, it's just a good means to say, "I have this much time, and if I am doing something other than I planned it better be more important because I won't have time for the thing I planned, probably."

I'm just going to give some stats and throw everything else to tomorrow.

Fri Apr 28 23:28:28 EDT 2017

Weight: 212 lbs

Exercise:

  • Ran half a mile
  • Danced 13 songs
  • Quick stretch routine
  • 3 pull ups
  • 4 hours of standing or so

Watched:

  • First episode of Better Call Saul
  • An episode of Bob's Burgers

Cooked:

  • Roasted red bell pepper hummus

Cleaned:

  • Kitty-litter (daily chore now)
  • Kitchen

Responsibilities:

  • Caught up on tickler
Fri Apr 28 23:30:45 EDT 2017

Good enough. Tomorrow morning needs to start with time blocking.

Daily Entry: April 27th, 2017

Thu Apr 27 21:58:26 EDT 2017

Today was a lazy day without proper logging for a variety of reasons.

Tomorrow I'll review both yesterday and today. Yesterday's review should be of reasonable lenght, today's will be super short. Today's review will not be its own post.

Find and Replace Problem-Statement

On Tuesday, April 25th, I realized that I had set the tags in each blog post incorrectly. I thought they were delimited via commans, when they were actually delimited via an unordered list with the '-' character used as a bullet.

This is a common find/replace problem that can be solved in a variety of ways. It's a good simple problem to regularly solve. Also, it is easily mutated with different find/replace challenges.

The Problem-Statement

A series of blog post files have their tags set incorrectly.

Each file has a list of tags set via:

1
2
3
4
5
---
title: Title
date: date
tags: tag1, tag2, tag3
---

When it should be:

1
2
3
4
5
6
7
8
---
title: Title
date: date
tags:
- tag1
- tag2
- tag3
---

Programmatically fix this incorrect setup.

Mutations

Do It Backwards

Find/replace in the reverse order.

Switch:

1
2
3
4
5
6
7
8
---
title: Title
date: date
tags:
- tag1
- tag2
- tag3
---

to:

1
2
3
4
5
---
title: Title
date: date
tags: tag1, tag2, tag3
---

Sed One-Liner

First attempt did this with two sed commands. It can definitely be done in one.

Attempts

[1]

Review of April 25th, 2017

Time-limit to complete post: 30 minutes.

Pencils down at 10:38:35 EDT 2017

Reading the Days Posts

Daily Entry

The formatting of this page is all weird for some reason. Oh, it's because there's a single-spaced indent on all lines. Making each line-break in the markdown filea a line-break in the page.

Fixed.

I used sed to solve a problem with how I incorrectly did tags in these diary posts.

This should probably be a problem statement.

I constantly distracted myself throughout the day. I'm doing it while writing this post, as well. I'll stop, walk away from the computer, and pace thinking about any given thing.

I do not have proper control over my brain right now.

Creating time-limit for this post.

I decided to separate stretching from other exercise, because I like to stretch before exercise, and when I exercise is less predictable because exercise starts via dancing with my wife.

This was a good decision.

I have started the habit of writing notes while watching TV. I'd like to try to start some proper analysis of what I watch.

Vatic Labs Problem-Statement

The first problem-statement of my training regimen. Hopefully the beginning of something very valuable to me.

Vatic Labs Post-Mortem

This will be of use to me next time I tackle the given problem.

Usefule stuff right now from this post:

  • I want to create a project creation recipe
  • I want to create a common speed bottleneck list

Stats

Exercise:

  • Ran 2 miles in over 20 minutes
  • Danced 9 songs in Just Dance
  • Did 4 pull-ups
  • Did a full stretch routine
  • 1-minute plank
  • 1-minute horse stance

Writing:

  • Wrote three diary posts
  • Wrote an argumentative comment on YouTube
  • Wrote a short update email to head-hunter

Watched:

  • Episode of Rick and Morty
  • 2 episodes of Elementary
  • 2 episodes of Iron Fist

Read:

  • Love Joy Feminism blog post
  • Pharyngula blog post
  • Random tweets
  • YouTube comment

Overall

Distractions limited output of the day. Need to work on conquering distractions.

Daily Entry: April 26th, 2017

Wed Apr 26 10:03:34 EDT 2017

So, now that I'm actively planning multiple posts per day, I suppose it is prudent to explain how the daily entry will work.

The daily entry will be the "first" post of the day. However, it'll be updated throughout the day, and I will announce in this post when I've switched to working on other posts.

Other posts will also be updated live to blog, because they aren't serious enough to work on in draft form and then properly publish. However, they will be written in a single go and only edited later if I need to correct mistakes.

Wed Apr 26 10:07:42 EDT 2017

I will now work on yesterday's review.

Wed Apr 26 10:17:13 EDT 2017

After I finish the review, I will make a "find/replace" problem-statement.

Wed Apr 26 10:22:46 EDT 2017

After "find/replace" problem, I will resurrect my 2015 timer. I may even end up using it for my own purposes.

Wed Apr 26 10:30:34 EDT 2017

After timer, create project creation recipe and create common speed bottleneck list.

Wed Apr 26 10:51:39 EDT 2017

Review done, and find/replace problem-statement and first post-mortem done.

Now it's time to resurrect the timer.

Wed Apr 26 11:13:47 EDT 2017

The timer has returned!

Wed Apr 26 11:34:24 EDT 2017

Time to work on the sample test on HackerRank from Two Sigma.

Wed Apr 26 13:21:49 EDT 2017

I am done with sample test (no good problems to keep for training regimen) and the actual Two Sigma test (two problems total, both good short problems).

Am creating problem-statement and saving my solutions before "finishing test".

Actually, I'm not allowed to copy-paste the text, I'll print it to pdf for now and write it in by hand later.

Wed Apr 26 13:35:14 EDT 2017

I'd like to put another hour in towards some form of training, but first I'm going to watch some stuff with family.

Vatic Labs Code Test Post-Mortem

The Problem Statement

Goals of This Post-Mortem

Specifically, I would like to capture stats to use as metrics for comparison against future attempts.

I would also like to mutate the challenge for future attempts, for improvement purposes.

Further, I would like to consider the four questions, Stephan:

  1. What did we do well, that if we don't discuss we might forget?
  2. What did we learn?
  3. What should we do differently next time?
  4. What still puzzles us?

I wish to answers these four questions on this attempt, as well as the process I am creating by repeatedly doing these problems and then post-morteming them.

Stats of Interest

Started: Sun Apr 23 08:30:00 EDT 2017

Ended: Mon Apr 24 08:30:00 EDT 2017

Time to complete task: 24 hours

Tests created for this attempt: 4

End-to-end tests (usable in future attempts): 3

Past test results: N/A

Current test results: all passed

Future test results: N/A

Final result:

  • Passed speed constraint
  • Failed system test
    • Meaning unknown
    • Possibly failed memory constraint
    • Possibly failed implementation

Constraints for next attempt:

  • Same constraints as in problem-statement except:
    • Three hours allotted time to complete task
    • Create larger suite of tests in general
      • Test every edge condition
      • Test every specified constraint of final executable
      • Rewrite end-to-end test such that they run a vatic_code_test executable
        • This will allow end-to-end tests to run against non-python attempts

What did we do well, that if we don't discuss we might forget?

Given the options, I decided to tackle the question in the language I knew best, and, if I had time, then port it to the language I didn't know as well.

I believe this was the correct decision.

I setup my environment pretty quickly, and was even using pylint throughout (caught small errors that might've wasted my time pretty quickly).

What did we learn?

If I am going to take using different editors and IDEs seriously, I have to:

  • note whenever I want something to be different
  • note bad habits
    • make bad habits impossible

Otherwise, I might as well stick to vim.

Pandas is a cool library that I want to get better at.

Printing to stdout is slow! I've learned this multiple times now and I'm now going to create a list of common speed enemies.

Only solve a problem once it is proven to be a problem. Again, learned this multiple times now, but it's a hard habit to break. Specifically, I tried to optimize away rounding error before verifying it would be a problem, and it ended up making my program too slow.

What should we do differently next time?

Git Init

I need to start cultivating a checklist (some people call them recipes and I like that metaphor) for general startup purposes.

I've dabbled in them in the past, and I think it's a good idea to dabble in them again.

But that's really specifically to do something differently next time that I surprisingly forgot to do this time. I did not start my project with:

git init

I didn't even consider properly versioning my code until I was almost done with my first implementation.

Even if my instinct is to make quick prototypes that I delete (more on that later), there's nothing wrong with versioning those prototypes. The repo will be deleted just as easily as the code.

Break It Down, Prototype, Start-Over

The problem was well-defined. I was given input, I was given output.

The problem is not particularly complicated, but it does have layers and many steps.

I needed to define the sub-goals, prototype an answer, get something working, and then redo it so it would naturally be a bit cleaner.

The final product ended up being a lot messier than I would like, probably in part because of my failure to do this.

Super Starting Over

Six hours in, I submitted my first code to see what result I would get.

"Time Limit Exceeded"

I panicked. I reread the problem-statement, I noticed that I was allowed numpy and pandas, and so I started over with the goal of solving the problem using that library.

I'm super glad I did this, but I should not do it again. Not like how I did.

Noting the third-party libraries that are explicitly allowed is ideal, and specifically using those libraries attempts not the first one for the purpose of getting better at those libraries is also a good idea.

Using a new library on a problem I hadn't properly finished before when it was not a requirement was incorrect. Especially since I already had a solution and I hadn't tested it in any way to see how close to fast-enough it was.

The non-working solution I made in pandas ended up over 10x slower than my original attempt.

All I needed to do to make my original program fast enough was save printing to stdout until the very end, and use floats instead of decimal.Decimal.

Had I made the dataset to test the speed of my code first, and tinkered with things to see if I could speed things up, I would've found this out and had time to further debug my code.

What still puzzles us?

How do I make fast pandas code?

I really want to know. Pandas is a library that could be of signficant use to me in future projects, I think.

What test did I fail?

I think it's possible I exceeded the memory limit, but rereading the problem-statement makes me think perhaps I did liquidity wrong.

Things I Should Do in Future Post-Mortems

All right, this post-mortem is taking me long enough. In fact, it's already taken me too long.

Next post-mortem: time-limit of 30 minutes.

I let myself get distracted too often and it wastes a lot of time. I will stop at the 30-minute mark next time. Even if it's in mid-sentence.

If this happens, I'll put a "pencils down" at the end of the post, I guess.

I would also like to make the code I made available.

I'll put it up on github in some way, I think.

"Pencils down."