HN user

vthommeret

512 karma

exploring deep learning, music, etc... formerly product/eng/design at signal sciences, etsy, meetup.

thommeret.com instagram.com/vthommeret

Posts12
Comments37
View on HN

If you're interested in more relative chord progression analysis, check out Hooktheory (I'm not affiliated but I think love their two books / apps):

https://www.hooktheory.com/theorytab/index

It's "just" 32K songs, but you can see the top chord progressions:

https://www.hooktheory.com/theorytab/common-chord-progressio...

And see which songs follow any chord progression you choose (either absolute or relative chords):

https://www.hooktheory.com/trends

I haven't used this program specifically but I'm using an OK one (called "Take a break") and credit it with letting me look at screens again.

A few years ago my eyes would dry out within a few minutes of using a screen. I tried eye drops, resting my eyes, taking longer breaks, etc... which didn't work.

I did some research and there's something called the 20-20-20 rule which means looking at something at least 20 feet away for 20 seconds every 20 minutes. I found this app and it fixed my issues. Turns out the issue is your eye not changing what it's focusing on.

Highly recommend trying it even if you're not actively experiencing issues.

Your app looks a lot nicer than the one I'm using so I'll give it a try!

Thanks! Yeah I've seen a few similar projects (particularly written Java which I wasn't excited about). That looks like a nice project. It's written in Python and says it can take from an hour to several days depending on the computer and they don't recommend running it on a Mac.

I don't have up-to-date benchmarks but my project is written in Go and everything was designed to be as highly parallel as possible, broken up into multiple pipeline steps (splitting the Wiktionary dump, lexing, parsing, resolving, etc...) with a high emphasis on performance so I would assume it's faster but would need to do a head-to-head test.

I saw a few posts discuss using the Wiktionary dump directly vs. the freeDictionary API, which is difficult to do because the raw wiki text isn't immediately usable. I actually created and open sourced a project several years ago that I never publicized that lexes and parses the Wiktionary dump:

https://github.com/vthommeret/glossterm

Specifically it can understand and execute 21 different wiki text templates (e.g. "cog", "borrow", "gloss", "prefix", "qualifier”), e.g. {{inh|es|la|gelātus}}:

https://github.com/vthommeret/glossterm/tree/master/lib/tpl

And eventually parse it into this structure, which has a list of all definitions (distinguished into nouns, adjectives, verbs, adverbs, etc...), etymology, links, and descendants for a given word:

https://github.com/vthommeret/glossterm/blob/master/lib/gt/p...

Further parts of the pipeline turned different relationships into edges that I could stick into a graph database and do certain graph queries. This allowed me to do certain queries like find French, Spanish, and English words that share a Latin root.

I ended up parallelizing this specific query using Apache Beam and then dumping the results into Firestore so they could be queried via a web app. Here's an example for the Spanish word: helado

https://cognate.app/words/es/helado

Under the "Cognates" section, it knows that it comes from the Latin root "gelatus" from which English has borrowed the word "gelato".

I originally started this project when I was learning Spanish. If you just look up the definition of helado (ice cream) it doesn't necessarily help you learn it. But I found that if I could relate it to languages I already knew (e.g. English and French), it was easier to remember. In this case helado is related to gelato, but you won't find that in e.g. Google Translate or SpanishDict.

Ultimately, I found that while the Wiktionary data is amazing, it’s also a bit of a quagmire for finding cognates. I would miss certain etymologies where you had to follow a descendant tree 2 or 3 levels deep. Or a definition would just mention a word it was related to. But if I expanded the query to include these instances, then it significantly increased the amount of non-cognates that showed up in the results.

So I created a useful set of tools (which I never wrote about until now), but I realized the end result of a web UI that showed the relationships between words would require a significant investment in data quality that likely wasn’t possible without changing Wiktionary itself / community investment.

Reposting my previous notes on Playwright (https://news.ycombinator.com/item?id=30060135):

I just want to plug Playwright by Microsoft as I've been using it over the past month and have had a really great experience with it: https://playwright.dev It's built by the founders of Puppeteer which came out of the Chrome team. Some things I like about it:

1. It's reliable and implements auto-waiting as described in the article. You can use modern async/await syntax and it ensures elements are a) attached to the DOM, visible, stable (not animating), can receive events, and are enabled: https://playwright.dev/docs/actionability

2. It's fast — It creates multiple processes and runs tests in parallel, unlike e.g. Cypress.

3. It's cross-browser — supports Chrome, Safari, and Firefox out-of-the-box. 4. The tracing tools are incredible, you can step through the entire test execution and get a live DOM that you can inspect with your browser's existing developer tools, see all console.logs, etc...

5. The developers and community are incredibly responsive. This is one of the biggest ones — issues are quickly responded to and addressed often by the founders, pull requests are welcomed and Slack is highly active and respectful.

My prior experience with end-to-end tests was that they were highly buggy and unreliable and so Playwright was a welcome surprise and inspired me to fully test all the variations of our checkout flow.

I did, but only very briefly. I originally wasn't looking for an E2E tool but was evaluating another tool for a different problem (Nx) which included Cypress as part of its opinionated defaults.

Cypress was a surprisingly nice experience as well and led me to research other modern e2e tools. Most of the points above can be compared against Cypress — Playwright supports parallel execution of tests within the same file on the same machine, which Cypress doesn't, and so is much faster. Cypress doesn't use modern async / await syntax. Due to its architecture, Playwright can test across tabs, work with iframes easily, which Cypress can't.

The UI for Cypress's developer tools is nice, but... as I said, Playwright's tracing UI is really excellent and the documentation is also really well done. This is also a personal thing, but I trust tools that came out of browser teams (Chrome) to emulate browsers in a more efficient way, e.g. spinning up cheap, isolated browser contexts in Chrome, the details of waiting for an element to be ready, etc...

Another post on this: https://alisterbscott.com/2021/10/27/five-reasons-why-playwr...

I just want to plug Playwright by Microsoft as I've been using it over the past month and have had a really great experience with it: https://playwright.dev

It's built by the founders of Puppeteer which came out of the Chrome team. Some things I like about it:

1. It's reliable and implements auto-waiting as described in the article. You can use modern async/await syntax and it ensures elements are a) attached to the DOM, visible, stable (not animating), can receive events, and are enabled: https://playwright.dev/docs/actionability

2. It's fast — It creates multiple processes and runs tests in parallel, unlike e.g. Cypress.

3. It's cross-browser — supports Chrome, Safari, and Firefox out-of-the-box.

4. The tracing tools are incredible, you can step through the entire test execution and get a live DOM that you can inspect with your browser's existing developer tools, see all console.logs, etc...

5. The developers and community are incredibly responsive. This is one of the biggest ones — issues are quickly responded to and addressed often by the founders, pull requests are welcomed and Slack is highly active and respectful.

My prior experience with end-to-end tests was that they were highly buggy and unreliable and so Playwright was a welcome surprise and inspired me to fully test all the variations of our checkout flow.

One benefit I've taken more advantage of, that I've found a lot of people aren't familiar with is the concierge service. You can call or email them (which is now my preference).

In addition to some obvious things like finding a hotel or calling a car rental agency on my behalf (being able to send a quick email is significantly more convenient than waiting on hold for an hour) they've...

1. Helped me find an air conditioner along my driving route in CA when they were mostly all sold out. This took place over 48 hours. They would give me updates every 6 hours either via email, phone, or both.

2. Called several bike repair shops with information that was important to me — turnaround time, walking distance, price, etc...

3. Researched comparative information on model years of a car I was thinking about buying. E.g. 2017 adds these features, 2018 has these changes from 2017, etc...

4. I've called them to see if there are any road closures or issues with my route while driving.

As mentioned below, the card is really $250 a year or roughly $20/month and is it worth it for this benefit alone. I've used Magic ($35/hr...) and Fancy Hands and I've actually found the service to be superior. And I don't have to worry about the amount of time they spend.

From what I can tell they have what seems to be employed professionals who answer the phone (and maybe the initial emails) who are very personable and knowledgeable and then farm out a lot of the actual grunt work to different researchers. While the quality I've gotten from Fancy Hands / Magic has been much lower in terms of actually understanding what I'm asking for. Seems to be more college students / gig workers.

That's separate from the very good car rental insurance... DashPass (no delivery fees, reduced fees), 10X Lyft points. And things like extended purchase and warranty protection which I haven't used yet.

Some really beautiful pieces. Some unsolicited advice... if you haven't already considered Etsy (I used to work there) it can be a great place to sell your work.

I've bought a lot of furniture (some custom) on Etsy and people have been surprised by that / think there isn't necessarily high quality work there.

In addition to the larger pieces, if you have work that's easily repeatable you can make a lot with e.g. tissue boxes or cutting boards, etc...

For example this shop made these beautiful boxes with brass inlays and I was able to commission a custom box with dividers for individual tea packets: https://www.etsy.com/shop/SawdustProductionsCo/sold

Since we're sharing... I started a project a while ago whose goal was to show how intervals could be visualized horizontally or vertically and then "stacked" or composed in different ways to create scales and chord shapes up and down the fretboard.

I didn't end up finishing the project but created some fun visuals...

https://user-images.githubusercontent.com/42359/88242522-6bb...

https://user-images.githubusercontent.com/42359/88242530-724...

I got a basic page up that lets you draw Freboard shapes (and play sounds using Tone.js) declaratively:

  <div class="pattern" data-notes="1, b3,  4^, 5,  b7^, 8"></div>
Where the notes represent scale degrees and the caret is a string skip:

https://intuitivemusic.com/fretboard.js/

Using a similar framework I also created a page where I attempted to make sense of saxophone fingerings (you can hold down on shapes to hear sounds):

https://intuitivemusic.com/saxophone.js/

I recently switched from Apple Music to Spotify and one feature I was surprised was missing was a notification on song changes. I built an app to add this feature and also the ability to control Spotify via the menubar.

One fun emergent behavior is that because Spotify synchronizes player state between all your devices, you can play music on your phone, and if you have Spotify open on your desktop, it'll show notifications for all songs and even let you control playback.

Happy for any and all feedback!

Skulpt does support the Python 3.7.3 grammar [0], but it's a work in progress. I have it enabled here:

https://github.com/vthommeret/mathtocode/blob/0d5f780be4f218...

Is there something specific that did work for you? I tried all the examples on Python 3.7.3 and they worked for me. One notable thing that's missing is that the @ operator for matrix multiplication, but I hope to add that in the future.

[0] http://skulpt.org Python 3 Grammar. The master branch is now building and running using the grammar for Python 3.7.3. There are still lots of things to implement under the hood, but we have made a huge leap forward in Python 3 compatibility. We will still support Python 2 as an option going forward for projects that rely on it.

That's close, but basically you need to take the square of each element first, e.g. `m * * 2` [0]. This keeps the shape of the matrix while `m.prod()` returns a single number (multiplying each element together).

So it should look something like this: `np.sqrt((m * * 2).sum())`

Re: The error message, it looks like it's occurring because `sum` doesn't normally take any parameters and interprets the argument as an "axis" parameter — https://numpy.org/doc/1.18/reference/generated/numpy.sum.htm...

Order of operations is tricky and I could do a better job breaking it down. Still plan to add the Show Solution button but need to get some sleep :-).

In the meantime you can see all the possible solutions in the repo! https://github.com/vthommeret/mathtocode/tree/master/questio...

[0] Remove the space between the asterisks / I had to add it since HN interprets them as italics.

Hmm interesting, thanks for the report! I'll see if I can set up some kind of client-side error tracker so I can investigate more easily in the future.

It's possible that it timed out when computing the result — it evaluates the answer in a web worker with a 2.5s timeout and execution is slower on mobile. I used to get timeouts more regularly, but it's fairly optimized now — it checks all of the test inputs and evaluates both the expected solution and user-provided solution in a single Python function.

Agreed. Particularly because NumPy has a mix of functions and methods where you need to balance parentheses.

I'd like to more clearly show the answers / I originally didn't show what the test inputs (e.g. if square root is tested with 25, 9, and 4) so you couldn't just return 5 if 25, 3 if 9, etc... but I could display some of the test inputs and not all of them.

It definitely would be great to show the intermediate results of the calculations and for things like matrix multiplication `a.dot(b)` isn't very complicated, but it doesn't give you intuition on what's happening under the hood.

Thanks for the iPhone feedback — I tried my best to make sure it worked well on mobile. The few examples I could find of interactive Python tutorials usually involved spinning up a VM with multi-second lag for each question and textareas which were not at all mobile-optimized so I wanted to try and do something better :-).

Thanks for the feedback. I think I was being overly clever by trying to make the product example more complicated than just `m.prod()` similar to the `m.sum()` example, but as you mentioned I was fitting two concepts in one question — operating on an already manipulated variable in addition to the new operator.

I've simplified question 9 to just `m.prod()` from the previous solution of `(m * 3).prod()` for now.

Re: Methods vs. functions — I completely agree! I actually originally implemented Math to Code using Tensorflow.js (which was simpler than using a Python interpreter) where the syntax was:

  m.pow(2).sum().sqrt()
Vs.
  np.sqrt((m ** 2).sum())
I decided to go with NumPy + Python because I felt it would be more immediately applicable vs. just learning the Tensorflow.js syntax. Also Python allows operator overloading so you can just do `2 * m` vs. `m.mul(2)`.

PyTorch has a similarly clean syntax to Tensorflow.js and includes operator overloading, but there doesn't seem to be a PyTorch shim for Skulpt, but that would be a fun project.