228 karma · joined December 29, 2012
I guess where I'm going with this is, maybe change your thinking about leetcode? Don't think of it as a necessary evil in order to land a high paying job that you dread doing each night; look at it as a fun little hobby, with the nice side-effect that you're keeping your data structure knowledge, algorithms and general problem solving skills sharp.
I really wish the author included an explanation for this. What are "default headers"? What special header(s) needs to be on the request in order for a preflight request to be made?
https://www.washingtonpost.com/news/monkey-cage/wp/2018/08/2...
https://itunes.apple.com/us/app/riker/id1196920730?mt=8
https://play.google.com/store/apps/details?id=com.rikerapp.r...
Although there is also a fully functional web version of Riker, the app is preferred since it supports offline mode, provides Watch App and integrates with Apple's Health app.
Although there is also a fully functional web version of Riker, the app is preferred since it supports offline mode, provides Watch App and integrates with Apple's Health app.
Will be happy to answer any questions.
App Store link: https://itunes.apple.com/us/app/riker/id1196920730?mt=8 Web link: https://www.rikerapp.com
But yes, you're right overall - full offline mode w/syncing, etc is a big pain :)
In the app, for each relation (e.g., a "workout set"), I have 2 tables: a master and a scratchpad. When a user saves a set, a row is written to the scratchpad table. When the user syncs it with the server, a row is written to the master table and deleted from the scratchpad table. When the user wants to edit the record, I first copy it down from the master table to the scratchpad table. All local editing impacts the scratchpad row. When the user wants to sync, only if a 200 response is returned will I copy-up the scratchpad row to the master row. If the set was edited on another device and the local copy is out-of-sync, the server would have responded with a 409 (http conflict code), and the body would contain the server copy, which is then written to the master table. The user can then figure how they want to merge the scratchpad row and the master row.
Anyway...trying to do all this with CoreData would have been a pain, so I use SQLite directly, and works great.
Or to summarize, I handle offline mode, syncing and conflict detection using "updated_at" timestamp columns along with logic in my REST API to returned appropriate HTTP status codes, interpret "if-unmodified-since" headers, etc.
https://itunes.apple.com/us/app/riker/id1196920730?mt=8
Riker on Android is currently in-progress...
The GoF book predates the public release of Java. The code samples in GoF are in C++ and Smalltalk.
Correct me if I'm wrong, but Java 8 does allow functions to be passed around. E.g., if a function takes as input a Runnable, I can pass a no arg lambda expression as input.
Although there is also a fully functional web version of Riker, the app is preferred since it supports offline mode, provides Watch App and integrates with Apple's Health app.
Will be happy to answer any questions.
App Store link: https://itunes.apple.com/us/app/riker/id1196920730?mt=8
Web link: https://www.rikerapp.com