59
I told our new cat, if you try and pick a fight with the big cat, it would be kind of like trying to pick a fight with a whale, or a hill, not much would happen.
This week in Algorithms class we covered Depth First Search, Breadth First Search, Knapsack problem, Travelling Salesperson problem, permutations, I reviewed combinatorics, and we had a pretty hard quiz and really fun homework set.
Some of these topics I covered in Algorithms I class which was also invaluable.
Working on the homework set, I had a huge epiphany. One of the problems asked us to do something that was pretty common sense but required a small decision tree of conditionals for the correct output. Depending on your insight the tree got smaller. So after thinking about it for a long time and running initial versions and testing and simplifying I got it down to four cases, two of which being partly unified. Which got me on a method to unify all of them. Here is what I did:
First I put all the things that happen with trivial counter parts into all the alternate branches. For example if " Hello " was added to the answer in branch four with something like answer=answer+" Hello "
(Java) then in all the branches that didn't have something similar I put a trivial counterpart like answer=answer+""
So then by that pattern I filled out all the things that happen in all the branches. It was four or five things in each instead of two in one, one in another, and five in another, or something, now they all have five. But now the first line can be taken out, put ahead of all of them, and changed to something like answer=answer+(conditional?" Hello ":"")
And you can keep going with that and do the next line answer=answer+(conditional2?" 2nd variation ":"")
and take all the statements out of the conditionals, turning them inside out. Then in my case I was able to fill out each of the conditionals and turn them into one line with built-in inline conditionals, something like answer=answer+(conditional2?" 2nd variation ":(conditional?" Hello ":(conditional3?" variation3 ":"")))
and the whole tree of conditionals becomes one line.
Outside class I am finding my hierarchical modeling software, AccountBlaster is turning out to be invaluable for doing taxes, keeping track of my accounting AND doing inventory, tracking locations of enormous trees of items. Then you can move stuff around. I'm finding it absolutely invaluable helping me sort a bunch of rusty tools and parts my dad gave me which aren't valuable per se but mean a lot to me personally, because of what my dad was trying to teach me about working on cars and taking care of stuff, so I am sorting them out, and I know where everything is because I put it all into AccountBlaster. I search Torque Wrench and it says Existence>Earth>USA>California>Bay Area>Santa Cruz>Mid Town>Felt Street>1813>Garage>SE Corner>Tool Box>Torque Wrench and then I know where to look. I put the outer layers just to make a point, obviously, I'm not cataloging stuff off earth. But AccountBlaster is proving iself over and over again. And the more I think about it, there isn't any other hierarchical modeling software! Right? I don't know how QuickBooks works, maybe it is, but AccountBlaster is awesome. Perhaps I'll make a mobile version for my final project - or - fix my game - or - add features to WebBlaster - or AppraisalBlaster
Comments
Post a Comment