Skip to content

Instantly share code, notes, and snippets.

Jeff McKnight JeffMcKnight

Block or report user

Report or block JeffMcKnight

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JeffMcKnight
JeffMcKnight / ViewUtil.java
Created Jul 2, 2019
Static method to return the Tag attribute of an Android View, or, if that is missing, return the name of the ID attribute
View ViewUtil.java
public class ViewUtil {
public static String getTagOrIdName(View view) {
if (view != null) {
if (view.getTag() != null) {
return view.getTag().toString();
} else {
return view.getResources().getResourceEntryName(view.getId());
}
} else {
@JeffMcKnight
JeffMcKnight / ArrayIterator.java
Created May 31, 2019
Iterator backed by an array of integers which it interprets as a set of pairs, where the first item of the pair indicates how many values should be returned, and the second item of the pair indicates the value to be returned.
View ArrayIterator.java
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* Iterator backed by an array of integers which it interprets as a set of pairs, where the
* first item of the pair indicates how many values should be returned, and the second
* item of the pair indicates the value to be returned. So, for example, when we iterate over the
* array <b>{3, 11, 0, 22, 2, 33}</b>, an ArrayIterator should return: <b><i>11, 11, 11, 33, 33</i></b>.
* <br>
* <br>
View keybase.md

Keybase proof

I hereby claim:

  • I am jeffmcknight on github.
  • I am jeffmcknight (https://keybase.io/jeffmcknight) on keybase.
  • I have a public key ASCWuYLby__d_yqoLpV3pBV0erYatf0GO1Z4nzM6ysIN9Ao

To claim this, I am signing this object:

You can’t perform that action at this time.