loading...
Cover image for Nov. 24, 2019: What did you learn this week?

Nov. 24, 2019: What did you learn this week?

nickytonline profile image Nick Taylor (he/him) Updated on ใƒป1 min read

Weekly Learnings 2019 (6 Part Series)

1) Nov. 24, 2019: What did you learn this week? 2) Nov. 29, 2019: What did you learn this week? 3 ... 4 3) Dec. 6, 2019: What did you learn this week? 4) Dec. 13, 2019: What did you learn this week? 5) Dec. 20, 2019: What did you learn this week? 6) Dec. 27, 2019: What did you learn this week?

This is not a new concept for a post or Tweet. David Walsh usually posts one every week.

Having said that, I thought itโ€™d be fun to start a weekly series on DEV where people just comment with something they learnt this week. It could be programming tips, career advice etc.

Neo in the matrix having just learnt kungfu

And if something you learnt was a big win for you, then you know where to drop it as well.๐Ÿ‘‡๐Ÿ‘‡๐Ÿป๐Ÿ‘‡๐Ÿผ๐Ÿ‘‡๐Ÿฝ๐Ÿ‘‡๐Ÿพ๐Ÿ‘‡๐Ÿฟ

Obama drops the mic

Letโ€™s see how this goes. ๐Ÿ˜ธ

Discussion

markdown guide
 

I was thrown into a job involving .NET, C# and SQL without much knowledge in any of that.

So I learned a lot this week.

I learned the value in good naming schemes for column names and table names in databases. For example, in one database, a foreign key is called entityid and its related column is entid which irks me, and can lead to potential confusion and coding problems.

I learned the value in consistency and standardization of programming styles. I saw a variable that was named x and I didn't like that. So I changed it and committed the change.

I learned the value in taking deep dives into even old and obsolete libraries. For example, I had to learn jQuery Grid yesterday all of a sudden, because I was tasked to create three columns on a web app. Whoever made this app originally picked jQuery Grid.

I learned things that appear simple on the outside are often not, especially at the enterprise level. Adding 3 new columns to a spreadsheet used for bulk insertion turned into an exhaustive 3 day exercise in hunting down and modifying a number of tables and SQL commands.

 
 

I dig it!

This week I learned a little more about how sounds and intervals work - I've always known that pitches were related and octaves especially so, but never realized it was so simple and so physical - an octave is specifically a 2:1 ratio in frequency. You double the frequency of a pitch to get the pitch an octave higher. A4 on a piano is 440Hz, and A5 is 880Hz. This is further divided into 12 semitones, corresponding to adjacent keys on a piano. Each of those is further divided into 100 cents. Given a base frequency in Hertz and a number of cents to increase along the logarithmic scale, you can calculate the final frequency quite easily:

cents formula

For example, to add a single semitone from A4 up to Bโ™ญ4, you increase by a twelfth of of what doubling it does: 440 * 2^(1/12). This works out to approximately 466.164, and that floating point imprecision is why intervals are defined as ratios calculated from a set standard instead of fixed numeric values. You don't get another whole number until you go up or down a full octave, to A3 - 220Hz or A5 - 880Hz.

This may be "common" knowledge, but it was new to me. Neat.

 

Is this somewhat related to the circle of fifths?

 

Totally related - the circle of fifths relates intervals to key signatures. A fifth is an interval with a 3:2 ratio, which is also 7 semitones. An octave has 12 semitones, so 12 keys in a given octave. Octaves start at C, so that's kinda like 0, and has no sharps or flat in the key signature. To get the next key in the circle, which has one sharp, you increase a 5th, or 7 semitones, which by counting on a piano gets you to G. To get through all the key signatures incrementally, one accidental at a time, you keep going up by perfect fifths. Once you come all the way back to C, you'll have hit all 12 keys, encompassing all possible key signatures.

circle

That's to go clockwise - to go counter-clockwise, go up by a perfect fourth every time, which is 5 semitones.

Fun fact: a cello is tuned to C, G, D, and A, which is the first four parts of the circle of fifths.

Violins are tuned a fifth higher (G, D, A, & E), so you can count the string you are on for an easy way to tell how many sharps are in the key signature - A = third string = three sharps.

Hah, awesome! I actually played cello for a few years in elementary school, and I guess at that age they don't really go heavy on the theory. I never put this together even after learning all this stuff in high school.

 

Not exactly - the circle of fifths is to do with chords, rather than individual pitches.

If you add a fifth to a given chord, you get the next key signature, so

C (0 #) --> G(1 #) --> A (2 #) etc
 

Awesome! Thatโ€™s sounds (pun intended) really cool!

 

This system tuning called twelve-tone equal temperament which was introduced around 18th century by Bach! Another fun fact: double bass tuning is opposite as violin which is E, A, D, G.

 

This was a small learning but this past week I learned about Rails reflect_on_all_associations method. You can use it to list out all related tables for an ActiveRecord::Model which is super helpful when you are trying to look at all related data for a single entry.

api.rubyonrails.org/classes/Active...

 

I sat down and built a tiny web app using Vue. I was surprised how easy it was to pick up and figure out, so that felt pretty great ๐Ÿ˜„

 

Well, i work mainly with C# dotnet core.

I used specflow to do BDD in an webapi that i already made, had some problems with the installation to make it work.

At the same time, solved some issues with async and tasks.

And now i am studying and following tutorial to use Graphql in this webapi, also trying to continue my course of web development bootcamp.

 

Learned how to set up and connect to a postgresql RDB on AWS. Lots of tiny steps and seemed to be nothing out there for a AWS newbie in terms of a tutorial in how to get up a simple RDB set up on AWS for a node project. (There are tons on mongodb out there). Looks like itโ€™s time to share what I learned with a post.

 

I baked my first wild yeast bread.

 

Sounds yummy. Fresh hot bread is hard to resist. ๐Ÿ˜‰

 

It is yummy and very hard to resist, especially on my one-meal-a-day days. It's quite a change from the usual stuff I do, mostly biscuits (cookies), and the odd dessert (see cooking blog.)

 

I learned about the web share API and how it improve the experience for users in a PWA.

Also, I wrote about it ๐Ÿ˜‰

 

Nice! Care to share your post you wrote here in the comments?

 
 
 

I learned to deploy to Elastic Beanstalk from a docker-compose file.

 

GraphQL fragments let you return different types of data - which I didn't think was possible.

 

This week I've started to learn how to use DocFX to generate static HTML pages from xml documentation of an open source .Net project I've been working on as a side project.

 

BE: Securing a GraphQL server
SysOps: proxmox

 

So this week I learned that SwiftUI multiline text fields are not something Apple thought would be obvious in the first release, the discovery and workaround continues :)

Thanks Apple!