This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class PendingUpdater<T> { | |
| private final Action<T> updateAction; | |
| private boolean pendingUpdate; | |
| private T value; | |
| public PendingUpdater(Action<T> updateAction) { | |
| this.updateAction = updateAction; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FindTwoMissingNumbersInArray { | |
| public static void main(String args[]) { | |
| int[] arrInput = new int[]{7, 0, 1, 2, 5, 3, 4, 6}; | |
| System.out.println("For input array: " + Arrays.toString(arrInput)); | |
| int maxVal = arrInput.length + 1; | |
| int sumMiss = getReqSum(maxVal) - getRealSum(arrInput, maxVal); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class InvertSingleLinkedList { | |
| public static void main(String[] args) { | |
| SingleLinkedList list = new SingleLinkedList(); | |
| list.add(1); | |
| list.add(2); | |
| list.add(3); | |
| list.add(4); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Notification; | |
| import android.app.PendingIntent; | |
| import android.content.Intent; | |
| import android.graphics.BitmapFactory; | |
| import android.media.RingtoneManager; | |
| import android.support.v4.app.NotificationManagerCompat; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.support.v7.app.NotificationCompat; | |
| import android.view.View; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.media.AudioManager; | |
| import android.media.MediaPlayer; | |
| import android.os.AsyncTask; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.CompoundButton; | |
| import android.widget.Toast; | |
| import android.widget.ToggleButton; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Intent; | |
| import android.graphics.Color; | |
| import android.net.Uri; | |
| import android.os.PersistableBundle; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.webkit.CookieManager; | |
| import android.webkit.WebChromeClient; | |
| import android.webkit.WebResourceRequest; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.Intent; | |
| import android.speech.tts.TextToSpeech; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.Toast; | |
| public class SampleTextToSpeechActivity extends AppCompatActivity implements TextToSpeech.OnInitListener { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.graphics.Canvas; | |
| import android.graphics.Movie; | |
| import android.os.Handler; | |
| import android.service.wallpaper.WallpaperService; | |
| import android.util.Log; | |
| import android.view.SurfaceHolder; | |
| import java.io.IOException; | |
| public class SampleGIFWallpaperService extends WallpaperService { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.content.SharedPreferences; | |
| import android.os.StrictMode; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.TextView; | |
| import android.widget.Toast; | |
| import org.apache.http.HttpEntity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static String integerToRomanConvert(int input){ | |
| if(input < 1 || input > 10000){ | |
| return "Invalid Input"; | |
| } | |
| String s =""; | |
| while(input >= 1000){ | |
| s+="M"; | |
| input -= 1000; | |
| } | |
| while(input >= 900){ |
NewerOlder