What do you want to save?
Add Code snippet
New code examples
-
Other 2021-09-08 10:45:02
private void checkAnswer(boolean userPressedTrue) { ... mQuestionsAnswered[mCurrentIndex] = true; mTrueButton.setEnabled(false); mFalseButton.setEnabled(false); ... }
if (savedInstanceState != null) { // Save Current Index of question mCurrentIndex = savedInstanceState.getInt(KEY_INDEX, 0); // Save whether question has been answered. Do not let user answer again. int[] mQuestionAnsw... Add solution -
Javascript 2021-09-08 09:02:01
mongodb findandmodify
const READ_DOCUMENTATION ; https://docs.mongodb.com/manual/reference/command/findAndModify/#lasterrorobject The lastErrorObject embedded document contains the following fields: updatedExisting boolean true if an update operation modified an existing d... Add solution -
Java 2021-09-08 06:59:02
how to validate information against the database in java
public boolean regFamily(FamilyAccount myFam, Customer myCust) throws Exception { int fid = 0; try { String selectStatement2 = "SELECT * from familyok.user where nric = ? and familyid is NOT NULL "; PreparedStatement p... Add solution -
Java 2021-09-08 06:45:04
fibonacci sequence java using recursion
/* Author: Jeffrey Huang This finds the fibonacci number using a term provided by a user A recursive method is used. b) 9 calls are made to the fibonacci sequence in order to compute the 5th term. */ import java.io.*; public class Fibonacci_JeffreyHuang... Add solution -
Other 2021-09-08 05:10:02
how to check if a binary tree is a binary search tree
class BTNode { constructor(value) { this.value = value; this.left = null; this.right = null; } } /** * * @param {BTNode} tree * @returns {Boolean} */ const isBinarySearchTree = (tree) => { if (tree) { if ( tree.left &am... Add solution -
Java 2021-09-08 04:04:04
Java program to remove consonants from a string
// Java program to remove consonants from a string import java.util.Arrays; import java.util.List; public class RemoveConsonantsFromString { public static void main(String[] args) { String str = "hello world core java"; System... Add solution -
Python 2021-09-07 12:04:01
py fhir
# Import the relevant classes from fhir.model from fhir.model import Patient, HumanName, Identifier, CodeableConcept, Coding, uri # Create a new Patient object. Resource attributes can be passed in the constructor. Note # that 'id' is the logical id of t... Add solution