Jon Rumsey
An online markdown blog and knowledge repository.
Project maintained by nojronatron
Hosted on GitHub Pages — Theme by mattgraham
My Notes From Class And Daily Work Week 9
Goals For This Week
- [ ] Whiteboard interviews scheduling.
- [ ] Prep for final project week.
- [ ] Code Challenges will be whiteboard-interview practices.
- [ ] Instructor resume sign-off.
- [ ] Complete CEP entrance prerequisites. Interview can be scheduled for after finals week.
- [ ] Ethics in Tech reading must be done before Thursday morning.
- [ ] Finish up lingering assignments prior to Friday.
- [ ] Final Whiteboard Exam Review.
- [ ] Final Project Preps must be completed before working on the project.
- [ ] TODO: Complete the BusinessTrip tests with TODOs for future improvements, updates.
Going Forward
Finals Week team reviews due Sunday following final presentations.
Review the core Java knowledge like:
- Name the 7 primitives.
- Object inheritance and polymorphism.
- Interfaces and abstractions.
Tuesday 12 July
Tuesday is last day of code content.
Tuesday will be GooglePlay Location.
S3 Review
Add Image Button => Image Picking Activity.
Convert to an input stream and publish to S3.
Geocoding: Referencing a place by it's name or street address, and translating that to geographical coordinates.
There are privacy concerns, both PII and App, Phone security implications.
Final Project Prep
Teams need to work on project ideas and prepare, as a team, to pitch up to 2 ideas to Alex.
Teams need to agree on what they want to do before pitching it.
Domain Modeling
It is in everything.
Relationships exist in databases, but also just about everything else!
Lab - Location
GooglePlay Services: Location Provider Client - is a newer thing. The older service required the App to manage the connection to Google API Client service.
SocketIO
- Open sockets to communicate with another server.
- Logic exists to handle interruptions, but is essentially an open, tethered internet connection.
- Resulted in lots of callbacks in App implementation.
New:
- In onCreate lifecycle, implement FusedLocationProviderClient.
- LocationServices.getFusedLocationProviderClient enables requesting various types of location updates.
Last Location:
- Minimal battery usage.
- No active network connection.
Current Location:
- Much more battery usage.
- Active network connection.
Request Location Updates:
- Enables regular updates when the Device is moving.
Before Writing Code, permissions requests must be updated:
- Go into
AndroidManifest.xml
. Multiple permissions can be edited here.
- Add
<uses=permission>
tags for one or both of ACCESS_FINE_LOCATION
and ACCESS_COARSE_LOCATION
. Don't ask for high precision unless the App really needs it.
- Run & Debug will reinstall app. Reinstalling App is required whenever permissions are changed.
- Implement a completable future
- Programmatically request permissions via requestPermissions as a new String[] that contains the
Manifest.permissions.PERMISSION_NAME_TAG
comma-delimited list.
- Call fusedLocationClient to get application context via LocationServices.getFusedLocationProviderClient
- Execute
fusedLocationClient.getLastLocation()
and chain-on .addOnSuccessListener()
- Use an if statement to determine if ActivityCompat.checkSelfPermission() returns as expected.
- Implement a listener that executes (sometime) depending on success or failure getting the location. Basically, checking what Allow Permission(s) the App has.
- Within the listener assign results from object 'location' to get Lat, Lon, Speed, Altitude, Time, and many others. Lat and Lon are of type 'Long'.
ActivityCompat.checkSelfPermission()
requires a context (this), and a Manifest.permission.TAG_OF_PERMISSION_TO_QUERY
.
Note: The live demo coding session resulted in an error situation. Basic solution required:
- Opening GoogleMaps and allowing Location Access.
- Restarting the App with the new Permissions settings.
Location Resources
Android Developers Blog New Location APIs
Android Developers Last Known Location
Android Developers Network Connections
Android Developers Declare Dependencies
Android Developers Retrieve Current Location From Play Services
Android Develoeprs Location Requests
Wednesday 13Jul22
About OSS and Contributing
Transparency is very important in development.
OSS isn't just about free, it can be licensed and sold.
Many eyes on OSS can make it better.
Proprietary software can be constricted/restrictive in ways that do not support the community.
OSS contributions can (and should) be highlighted on your resume, and definitely in your GitHub/repositories.
Some OSS repos will have guidance for new contributors. Look for a "want to contribute?" button or link, or a search filter.
Check GitHub Issue labels:
- "good first issue"
- "backlog" - indicates not enough time to work on these
- "docs" - help improve documentation
- "feature requests" - look for discussions around these to help get started
GitHub "Trending" repos: Could be a good resource, but sometimes the trend is all the possible "good first issue" items are already solved.
For the OSS Lab
Go to the FirstContributions repo - a directory of OSS projects that have potentially good first issues for new OSS contributors.
What is a good contribution?
- Small bug fix in a noteable OSS project.
- Fix/Add unit test in nateable OSS project.
- Fix an issue in a hobby project.
- Three separate small documentation contributions in separate projects OR 3 doc updates in a single LARGE project.
Do not write fluff documentation. Ever.
Root Cause Analysis
RCA -> Scientific method to analyse WHY something happened, external causal factors, and the timeline in which the problem occurs.
Troublshooting
- Documenting the problem: Log
- When did the problem occur? At what point are things fine vs when they are no longer fine. Breakpoints are a good tool in this regard.
- Distinguish between the root cause, and other external factors.
There are 5 Why's of RCA:
- WHY is this thing dead?
- WHY is what it depends on not functioning?
- WHY is what that thing depends on broken?
- WHY was the part allowed to stay in place beyond its useful life?
- WHY was the maintenance schedule not followed? This is the root cause, but cascades to the 1st WHY.
RCA Reference by Wikipedia
Final Project
Re-teaming to a single, 6+ person team.
- Not everyone needs to talk but everyone needs to contribute to the presentation (in addition to the project as a whole).
- My goal will be to step-back from doing project managing activities and instead guide others in this regard.
- We need to be prepared to talk about what we did in detail.
Everyone needs to ask themselves:
- Am I doing too little?
- Is imposter syndrome playing a part in sense of too-little or too-much?
- Look at what I have done and use that as a bar for determining what my participation level actually is.
- Be prepared to speak up, promote ideas, AND inclusively promote ideas and feedback of others.
TODOs:
-[ ] Determine what my areas of improvement are and be prepared to talk about it during the final presentation.
Whiteboard Review
Node Logic:
- What the problem domain is asking.
Advice:
- When using recusion, use a helper method!
Avoid Assumptions, instead:
- ASK the question before doing what you plan to do.
- STATE what it is you are going to do and react appropriately if the interviewer has feedback/guidance.
Breaking Down The Problem Domain
- Difficult to break it down completely on the first pass.
- Verify what needs to be returned by asking questions and making statements while jotting notes.
- Write-out method-like pseudo code in chunks that address the small components of the problem domain.
Recursive Functions:
- You cannot just "break out of the loop" when you are done, the stack must unwind itself.
- Returning values is difficult because it must percolate up the stack.
- Use global variables to manage capturing and/or updating value(s) from a recursive method.
- When a function pops-off the stack, the previous function call state will be as it was when it called the now-popped method.
- Passing items by Value might be better than passing by Reference might be necessary in recursive functions.
Suggested Execution Pattern (subject to everything, and ask questions as needed in-flight):
- Pick a traversal mode and sketch it out.
- Break down the Problem Domain to determine what processing mechanics are needed to address all of its components.
- Refactor the drawings and any problem domain brake-down jottings and write them up as plain-english Algorithm segments. Reference the Problem Domain by talking through this refactoring and algorithm writing.
- Update my questions, test cases, and edge cases. Test Approach should include JUnit, Debugging Breakpoints, happy path, null-input, failure path, and so on.
- Write pseudocode.
- Once pseudocode is done, BigO can be written. Be sure to analyze the pseudocode to justify the BigO analysis conclusions.
- Refactor any and all representations to ensure they are legible, make sense, and represent your solution.
- Write actual code.
- If there is still time clean things up and ask questions about the solution to discover if more work or additional cleanup is necessary.
Thursday 14July
Early Morning Discussion
Imposter Syndrome comments:
- Strings of failures lead to success.
- When stressed out, clear, logical thought cannot happen.
- Review past work and view substantial change that has happened since then.
Software Development is More Than Solving Coding Problems:
- You and the private company you work for are responsible for the content that is published.
- There is no easy solution to managing moral and ethical challenges in professional life.
- Sometimes the code you DO NOT WRITE is what is unethical or otherwise goes against good engineering conduct guidelines.
- Software engineers are creating and designing the applications that others use to do what they do. This includes doctors, law enforcement, governments, and construction, etc.
- Be prepared to learn from your mistakes, rapidly. Take responsibility for what you do and say.
- It can be hard to do the right thing, but it is important to do it anyway.
- What world do I want to live in? Why not push to earn it - to make it happen?
CAP Program
- [ ] Resume approval by instructor.
- [ ] Schedule a behavioral interview.
Technical Interview Advice
- Break down the problem domain into smaller parts.
- Ask the question: What datastructure could be used with the input data?
- How could the input data be traversed?
- Remember to at least mention: Testing, BigOh.
- Remember to at least code a method that at least begins to address the problem.
- No code: No points; Some code: Some points.
- No Algorithm? No BigO; Talk about BigO while visualizing and algorithm writing? Some points.
Fiday Morning Discussion
Sorting out how to manage an 8-person dev team for finals week.
Amplify: Requires a single PUSH person and a trust of IAM user password(s).
Rooms: Device-specific data, does not integrate with Amplify, S3, or Cognito, but avoids IAM complexities.
Advice:
- Make sure the data model is 100% set and understood by everyone.
- We must make sure that everyone is on the same page regarding data models.
- It is all our own individual responsibility to contribute to this project.
- Success often looks a lot like failure.
Talking About Requirements:
- Track workouts and BMI involves: user input, display.
- Track history of workouts: Data in-flow and updates.
- Inspirational Quotes: Requires research to understand it well enough to estimate the work. We could consider users making their own inspirational quotes.
- Alex needs to see a feature task take advantage of GPS, Image, and/or Gyroscope, or all three.
TODOs:
- Translate the user stories into technical requirements.
- Implement pair programming for certain.
- Mob-programming could work but is difficult via remote.
- Consider some sort of data structure to store DailyInfo, and/or an archival process or expiration date on the data (1 per day, 365 days per year, etc).
- Ensure Enums have descriptive keys so that "Low" Activity Level means something to the user.
- Ensure required data is asked for and also required in the schema.
- Sanitize inputs. Do not allow inputs, especially file uploads, that are not what you want/expect.
- Talk about flow of the app from a user perspective, e.g. new user must sign-up, then must login, then is shown their home page... then the user activity could spider-out from there.
TODOs
- [ ] Review Lambda methods in Java re: how 'context' is handled vs named methods.
- [ ] Identify who will talk about what during the final project presentation.
Return to Root Readme