Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am nwagu on github.
  • I am nwagu ( on keybase.
  • I have a public key ASD8_Wp_R2DCET_8WuG5Oj8JoQFK0X_L7MGq_UYYDL5nVgo

To claim this, I am signing this object:

View module_shadowing
sourceSets {
main {
java {
srcDir '../side-app/src/main/java'
assets {
srcDir '../side-app/src/main/assets'
res {
srcDirs '../side-app/src/main/res'
nwagu / DigitSwapCompare.kt
Last active May 30, 2020
A simple Kotlin function to check if a two-digit number is larger than its digit swap.
View DigitSwapCompare.kt
import org.junit.Assert.assertEquals
import org.junit.Test
class DigitSwapCompare {
fun testFunction() {
assertEquals(isLargerOfDigitSwap(14), false)
assertEquals(isLargerOfDigitSwap(53), true)
assertEquals(isLargerOfDigitSwap(99), true)
nwagu /
Created May 6, 2019
How do I set OnClick Listener inside recycler adapter when using unknown ViewDatabinding instead of ItemDatabinding?
public class ExampleListAdapter extends MyBaseAdapter {
private Context context;
private List<Example> exampleList;
public ExampleListAdapter(Context context, List<Example> exampleList) {
this.context = context;
this.exampleList = exampleList;
nwagu /
Created Apr 2, 2019
Program prints the 92 solutions to the Eight Queens puzzle using brute force and recursion.
//This program prints the 92 solutions to the 8 Queens puzzle
//Brute force and Recursion
//Updated 7/11/2017 by Chukwuemeka Nwagu
public class EightQueens {
private static int[][] board;
private static int[][] solution = new int[8][4]; //this will contain the row and column numbers for cleared solutions
public static void main(String[] args) {