BSL & Pythagorean Triples

28 Jul 2020

So far, today has been an awesome day, and currently it’s only 1PM. I actually wrote the Leo section first thing this morning, because I was so proud of him. Now, I’m proud of me too!

I was, honestly, not looking forward to cleaning up my euler 9 that I solved yesterday. I kinda wanted to just push it and be rid of it, because it had taken me a long time to solve and it was a mess, so I was afraid of breaking it. But I did it anyway.

When I solved euler 9 yesterday, my namespace 46 lines which included eight long, messy, complicated functions, one of which was 11 lines long, and to be honest, they all had horrible names that didn’t describe at all what they were doing. Four of the functions called a common function at the top of the space to manipulate its output in four different ways because I didn’t feel like putting long lists into the tests. I even had a hideous function that changed the initial input value so that it wouldn’t run through every number in range 1 to n, because it took too long–talk about future bugs there. The whole thing just felt wrong, and I felt gross for writing it–i couldn’t even take pleasure in that it worked…

Today, my euler 9 namespace has 20 lines of code which include 5 functions. Personally, I think that one of the functions shouldn’t even count, because it’s just there to be nice to the reader–it’s a square root function. Instead of putting (int (Math/pow num (/1 2))) into my actual function, i was able to put (sqrt num), which read nicer.

Two of the 5 functions tied for longest with a whopping 4 lines!!! And in both of these, it’s really 3 lines, because the first line is essentially just declaring a variable.

Now, I will say that the get-triples function might be doing more than one thing, but I’m honestly not sure… I’m still not sure what “one thing” is–I think I’m supposed to learn this tomorrow in my dad’s class. I could do a separate function to actually do the sqrts, but yuck; i feel like that would be even more ugly.
Anyway, if you can’t tell in the tone of my blog, I’m pretty excited about this work! On to TTT.

Ok, it’s 5 something now, and I’ve got to go again. Worked on TTT. Didn’t get as far as I wanted. My algorithm keeps returning every single output without comparison, so I’m working on getting that down.


Rex:
Rex has made it his job to wake up Leo every morning at 5:20am. It’s awesome.

Leo:
Today was a very exciting day for Leo, and I am so proud of him! He communicated with me today with a defined, deliberate, and clearly understood signal. With Rex, I’d started using American Sign Language (or Baby Sign Language–BSL) for certain common words very early on. With Leo, I regret that I wasn’t as consistent with it, but in the recent weeks, I’ve been making a point to be so.

Then today, out of nowhere, he got my attention by crying for me–I thought it was because I’d set him down on the floor to crawl. Instead he looked at me with the saddest eyes, and in a very deliberate motion despite his hand being down by his side, he closed & opened his left fist twice as, what I interpreted to be, a very clear request for milk. I responded by simultaneously repeating the sign back to him and exclaiming, “Oh! You want milk?!”. He confirmed his communicative intent with a response to my understanding that included an ear-to-ear, wide-opened-mouth smile and so much excitement that he almost fell over. I scooped him and met his request promptly to reinforce his action.

In a way, this was Leo’s first defined attempt at cleaning up his current, often incomprehensible code of cries & wails.