- First day as a TA at Coding Dojo
- Worked up through the automated testing portion of the Django official tutorial
- Didn't have time to do any algorithms -- learned about a path-finding problem (2D array represents connections between nodes -- determine whether there is a path from A to B for arbitrary A and B)
- e.g. for nodes A, B, and C
- [ [0, 1, 0] , [0 , 0, 1], [0, 0, 0] ]
- First entry says A is connected to B, second that B is connected to C -- so there's a path from A to C.
- The connection relationship is not robust. A can be connected to B without B being connected to A. It must however in some sense give rise to another relationship that is at least transitive. If A and B are connected, and B and C are connected, then I can get from A to C. This does not mean, however, that I can get back from C to A.
- Initial thought was do something with recursion. Too complicated. And what if you have loops? Now it seems you just need a way to translate this information into a more manageable data structure -- for example the dynamic connectivity data structure.
I guess I should really be putting these things up in GitHub. The way I see it, the coding journal is just a place to share the code I write or study along with any notes I have about it. It's sort of a documentation LiveJournal, if you will. Anyway, this is a "study" for my project idea: create an app that will prompt the user for two dates, then calculate the difference between them. The burden of this study is twofold: (1) convert dates in standard American form (e.g. December 15, 1993) into dates in standard American numeric form (e.g. 12/15/1993); (2) create a numerical representation of the date. To process the date, I started with a list of the months. I then used a loop to create a dictionary that would attach a value to each month. Next I had to parse the user entry (I haven't added any debugging for incorrect entries yet). I did so by splitting the entry into "raw" data. I used my dictionary to process the month name into a number, str...
Comments
Post a Comment