RxJava's Observable class has plenty of methods that can be used to transform the stream of emitted items to the kind of data that you need. Those methods are at the very core of RxJava and form a big part of it's attraction. But there are other methods, that do not change the stream of items in any way - I call those methods side effect methods.
As a brief note to self, when you need to debug a chain of RxJava Observable method calls, you can use the
doOnNext method to log the current values or print them to STDOUT or STDERR with
println. Here’s an example from RxJava For Android Developers, where the debug output is logged with the Android
As a brief note to self, when you need to change Play Framework logging, such as to change it to more of a debug mode, edit the logback.xml file and add/change entries like these:
I was just reminded of Rubber Duck Debugging. From this Wikipedia link, “The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck.” For me, my rubber duck is Albert Einstein.
Android FAQ: When is the Android Fragment
onCreateOptionsMenu method called?
I was just working through a problem with an Android Menu and MenuItem, and added some debug code to the methods in my Android Fragment, and found that the
onCreateOptionsMenu method is called after
onStart. I didn’t put Log/debug code in every activity lifecycle method, but for the ones I did add logging code to, the specific order of the fragment method calls looked like this:
As a brief note, today I tried to list the files in my Android application, which was running on a physical Android device — a Nexus 9 — with this
adb shell command:
adb shell com.alvinalexander.mybrowser ls /data/data/com.alvinalexander.mybrowser
When I did that, I got an Android/ADB “permission denied” error.
The short story is that a solution to this problem is to run the same command, but with the
run-as argument, like this:
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.13, “Setting the SBT Log Level.”
You’re having a problem compiling, running, or packaging your project with SBT, and need to adjust the SBT logging level to debug the problem. (Or, you’re interested in learning about how SBT works.)
Set the SBT logging level in your build.sbt file with this setting:
I was just trying to modify one of my Drupal 8 template files — node.html.twig — and I couldn’t find any good documentation for what variables/values/fields are in the Drupal 8
Node class, so I dumped some output to my browser, and saw that these are the
Twig debugging in Drupal 8 is great — really great — when you need it as you’re developing a new Drupal 8 theme. But when you don’t need it, it generates a lot of extra output in your HTML that gets in the way of working on your theme development.
So, as a quick note to self, to disable (turn off) Drupal 8 Twig debugging, follow these steps: