Commit graph

1650 commits

Author SHA1 Message Date
William Carroll
26bc3c01e5 Update displays.el
Today is my first day back in the office at Google (this time at MP2 in
Sunnyvale)! As such, I have a new desk, new monitors, so expect some changes to
my configuration until I stabilize everything.
2021-10-06 16:40:27 -07:00
William Carroll
3758f2ef85 Delete finances.org
I'm using ynab.com for now, so I no longer need this playbook.
2021-10-06 16:38:53 -07:00
William Carroll
077b0fbcd9 Add Ramp's technical assessment
More technical interviews
2021-10-06 16:36:51 -07:00
William Carroll
b70dda5dcb Refactor window-manager-logout
`sudo systemctl suspend` wasn't working because it required a secure password
prompt to read the user's password for `sudo`. The recommended way to call
`shell-command` with a `sudo` command (from what I read online) is to set
`default-directory` to `/sudo::` before calling `shell-command`. This works just
fine, so I refactored the function, `window-manager-logout`.
2021-03-23 11:32:42 -04:00
William Carroll
2e1ccb7a90 Uninstall telegram-desktop
I'm spending way too much time on Telegram (both on my phone and on my
computer). I'm going to remove it from my computer, so that I can better focus.
2021-03-02 17:21:06 +00:00
William Carroll
09f768a175 Update LOCs table in README
This time, I'm excluding languages like CSS,HTML,Markdown,Org, which I think
makes the output a bit noisier than I'd like it to be.

TODO(wpcarro): Automate this process
Re-run `tokei --hidden --type=<comma-sep'd-langs> --sort code .` to update this
table.
2021-01-22 11:50:25 +00:00
William Carroll
fcd02d75aa Disable lint-emacs step from CI pipeline
Most of the errors at the moment are related to line-lengths exceeding my 80
character limit. While these are valid, the linter doesn't currently support
disabling these checks, which means that my Elisp code always fails this CI
step. This creates too much noise and conditions me to care less about CI
failures.

When the Elisp linter support this feature, I will gladly re-enable this step.
2021-01-22 11:22:03 +00:00
William Carroll
bc3b0ead7e Update BuildKite badge
I changed the name of my Pipeline from briefcase -> post-receive, which broke
the URL for the badge.

This is easily fixed by visiting BuildKite's "Pipeline Settings" page.
2021-01-22 11:19:20 +00:00
William Carroll
42ba9cce79 Prefer POST /verify to GET /verify
To make things easier for testing, I setup the /verify endpoint as a GET, so
that I could email myself clickable URLs. With POST /verify, my options are:
- send email with an HTML button and form that POSTs to /verify
- email myself the curl instruction

I'm preferring the latter for now...
2021-01-22 11:13:50 +00:00
William Carroll
e326b0da45 Add 'assessments/tt/' from commit 'ee8e75231cd9d3d4aa3ffbbfa0e3b8511712e1ee'
git-subtree-dir: assessments/tt
git-subtree-mainline: 67e0f93b3b
git-subtree-split: ee8e75231c
2021-01-22 11:00:51 +00:00
William Carroll
67e0f93b3b Complete another LC problem
Another challenging but useful LeetCode problem...
2021-01-22 10:45:32 +00:00
William Carroll
97b5563a89 Rename "finances_2020" sheet to "finances"
Clerical stuff
2021-01-22 10:45:12 +00:00
William Carroll
fdbef2874c Update haveWatched for IMDB 250 movies
It's been awhile since I've updated this list, and I haven't stopped watching
movies. Adding movies like "The Help", "Three Colours: Red" (and the whole
trilogy for that matter), "The Elephant Man", and others. All worth watching.
2021-01-18 16:01:10 +00:00
William Carroll
1783f371e9 Finish Tree section of LC problems
Wahoo! I need to remember that the inorder traversal of a BST should be
sorted. This piece of trivia comes in handy for a variety of BST related
problems.

I also think being able to do a {pre,in,post}-order traversal recursively and
iteratively is a skill that I need to develop.
2020-12-25 03:56:44 +00:00
William Carroll
93d7b5d8ea Solve a few String questions
Valid Anagram

This one is a classic: `sorted(a) == sorted(b)`

Group Anagrams

Using product of prime numbers to create a key for anagrams is much faster than
sorting the characters in each word. It is also satisfyingly simple.

Encode and Decode Strings

My initial implementation was clumsy and prone to fail for edge-cases. A more
elegant solution is using something like:

```python
def encode(words):
  return "".join("{}:{}".format(len(x), x) for x in words)
```
2020-12-25 03:52:54 +00:00
William Carroll
c34a3e2e97 Tread lightly into the Dynamic Programming section
After solving this, I was immediately stumped by the other DP questions, so I'm
taking a break.
2020-12-25 03:52:13 +00:00
William Carroll
4732a7456b Solve Binary "Sum of Two Integers"
This is tricky because Python has variable-width integers, so relying on two's
complement to support the sum of negative numbers results in infinite
recursion. I know three ways to combat this:
  1. Use Java.
  2. Conditionally branch and handle either addition or subtraction accordingly.
  3. Use a mask to enforce fixed-width integers in Python.
2020-12-25 03:50:18 +00:00
William Carroll
c389b46ecf Solve additional Tree problems
Only three more to go!
2020-12-22 18:22:40 +00:00
William Carroll
23b5dd754e Solve additional Matrix problems
Looks like "Rotate Image" is the only Matrix problem that remains. It was nice
to learn more about "Backtracking" -- a term I often encounter -- while
attempting to solve "Word Search".

From my current understanding, it is like Brute Force but with
short-circuiting. It also seems quite similar to Depth First Search, and I'm
currently unaware of how DFS and Backtracking differ. I'm hoping to learn more
though.
2020-12-22 03:03:11 +00:00
William Carroll
983b0fb276 Solve the Linked List questions
I did these during my flight from LON->NYC without wifi. I managed to get both
correct on the first attempt although I did not find the *optimal* solution for
"Reorder List". IMO "Reorder List" is the best Linked List question I've seen
because it covers a few essential Linked List tricks.
2020-12-18 19:55:18 +00:00
William Carroll
039e712656 Nest URLs beneath TODO entries
Tidying things up.
2020-12-18 14:41:26 +00:00
William Carroll
fd6029db69 Update remaining LC questions
Looks like I should prioritize the following topics:
- Dynamic Programming
- String
- Graph

Although I'm not sure how common DP questions are in interviews, DP is a useful
dragon to slay IMO.
2020-12-18 09:43:54 +00:00
William Carroll
9610ae5f5b Update Linked List LC questions
Snapshot my progress with Linked Lists...
2020-12-18 09:40:05 +00:00
William Carroll
88a22aba3d Update LC String questions
Looks like I have a few string questions to solve before closing that chapter.
2020-12-18 09:38:23 +00:00
William Carroll
262a0b45fb Mark LC Tree questions as done
Making sure that this document closely approximates the state of my LC
progress.
2020-12-18 09:36:28 +00:00
William Carroll
a30bc0f21d Create offline, org file from TeamBlind LC questions
TeamBlind.com hosts a curated list of DS&As questions from LeetCode.com that the
author claims appropriately samples the topics worth exploring. I'm creating an
offline list so that I can track my progress and work while I'm traveling.
2020-12-18 09:31:50 +00:00
William Carroll
1cff020d66 Show Morning and Evening habits by default
Now that I've deployed this, and I have an iPad running in kiosk mode, I
realized that I'd like to show my morning routine and my evening routine.
2020-12-13 15:14:19 +00:00
William Carroll
27585cd874 Update Sunday and Morning chains
Adapting to changes.
2020-12-13 15:13:18 +00:00
William Carroll
894615af52 Add -r to cp to copy the directory
This should be the last hold-out before deploying habit-screens! :)
2020-12-13 14:25:18 +00:00
William Carroll
f99b61305b Commit compiled file, output.css to habit-screens
As you can see, I was previously `.gitignore`-ing this file, but because my
`default.nix` attempts to `cp output.css`, I need that file available.
2020-12-13 14:16:14 +00:00
William Carroll
6b9eae2fa3 Productionize habit-screens
At some point I should document or write a script for how I package Elm projects
with Nix to be deployed on my website. For now, I'm modeling everything after my
previous success LearnPianoChords.
2020-12-13 13:33:49 +00:00
William Carroll
e3c72f3fd6 Add project-local .gitignore
Since the `default.nix` file is specific to my tooling, I'm ignoring it.
2020-12-12 02:59:49 +00:00
William Carroll
cc4f67c388 Add usage instructions to top-level README
Also delete redundant `README` from `server` directory.
2020-12-12 02:49:49 +00:00
William Carroll
8c5e4e77ed Expose functions at API layer
Creating a simple HTTP RESTful API for exposing our `Server.semiprime`
function. It supports some help messages, primitive parsing and error handling,
and singular vs. batch processing of arguments.

For more sophisticated parsing and error-checking, I prefer to use Haskell's
Servant library.
2020-12-12 02:43:40 +00:00
William Carroll
45877a8b9c Include cache hit/miss info in return type
This can be useful downstream for diagnostics.
2020-12-12 02:43:35 +00:00
William Carroll
1a404a58de Expand 10^5 in README
I think it's more readable this way.
2020-12-12 02:41:09 +00:00
William Carroll
686766929a Simple Math tests
Calling `assert` within the `Enum.map` makes the errors more usable.
2020-12-12 01:36:22 +00:00
William Carroll
ee96a818e1 Define Server.semiprime
- Clear the boilerplate that `mix` generated
- Consume `Math.factor` to test which inputs are semiprimes
- Cache all inputs that are semiprimes as soon as we discover that they are
- semiprimes

I considered a couple things related to the Cache:
- Could save space by storing all semiprime factors in a tree. This would make
  the lookups more expensive. Also because the tree's depth would never exceed
  two (because all semiprimes only have two factors), the tree would be quite
  broad, and we may not be saving enough space for the trade to be worthwhile. I
  might be wrong about that though.
- We could consider pre-computing all semiprimes when we start the app, but
  without running some tests firsts, I'm not sure whether or not it's worth the
  trouble.
2020-12-12 01:32:31 +00:00
William Carroll
ab73220280 Define Cache.{list,clear} to help debugging
Since I'm often using `iex` for interactive development, these functions are
useful.
2020-12-12 01:31:51 +00:00
William Carroll
714ec29743 Define Cache and convert app to OTP
Define a simple in-memory key-value store for our cache.

TL;DR:
- Define `Cache` as a simple state-keeping `Agent`
- Define `Sup`, which starts our Cache process
- Define `App`, which starts our Supervisor process
- Whitelist `App` in `mix.exs`, so that it starts after calling `iex -S mix`
2020-12-12 01:04:39 +00:00
William Carroll
c0a88ba7d5 Add moduledoc to Extras
9 out of 10 doctors agree that every module needs a doc. Ask your doctor if
moduledocs are right for you!
2020-12-11 22:48:12 +00:00
William Carroll
9e2fbfde8e Move the habit-screens project into //website
I'd like to eventually deploy this to wpcarro.dev. Coming soon!
2020-12-11 22:47:04 +00:00
William Carroll
3feb8ceb9a Delete //website/habits
Accommodating space for my habit-screens project.
2020-12-11 22:46:37 +00:00
William Carroll
90035da32e Delete //website/habitgarden
This is change #2 in a series of other larger changes...
2020-12-11 22:45:39 +00:00
William Carroll
381c344563 Delete //website/days-of-week-habits
This is one small change in a series of other, larger changes.
2020-12-11 22:45:14 +00:00
William Carroll
1eab926121 Define stubbed default.nix
In case I want to package this project with Nix. For now, it's useful to store
this at the project root because it help my Emacs's `project-find-file`
function.
2020-12-11 22:43:53 +00:00
William Carroll
f1e4582392 Define Math module
Support `Math.factor` and cover it with tests.
2020-12-11 22:43:26 +00:00
William Carroll
6af5e4b82e Define Extras module
I'll use as the host for utility functions needed to extend the stdlib.
2020-12-11 22:42:55 +00:00
William Carroll
6ff814a6d3 Init Elixir project
Starting fresh with...

```shell
mix new server
```
2020-12-11 22:42:16 +00:00
William Carroll
c23a12746c Initialize the Semiprimes Service
This is an exciting take-home assignment because I get to write a service in
Elixir!
2020-12-11 18:52:35 +00:00