contains common code snippets.
val stack = ArrayDeque<Int>()
stack.addFirst(10) // push to top
val topElement = stack.first() // peek top
{ | |
"nodes": [ | |
{ "country": "East Timor", "code": "tl" }, | |
{ "country": "Canada", "code": "ca" }, | |
{ "country": "Turkmenistan", "code": "tm" }, | |
{ "country": "United States of America", "code": "us" }, | |
{ "country": "Lithuania", "code": "lt" }, | |
{ "country": "Cambodia", "code": "kh" }, | |
{ "country": "Ethiopia", "code": "et" }, | |
{ "country": "Swaziland", "code": "sz" }, |
/* | |
* @author : Nilesh Deokar/ @nieldeokar | |
* instructions : | |
* 1. compile using 'gcc -Wall -o apache Apache_Server.c' | |
* 2. run ./apache | |
*/ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <string.h> |
python -m SimpleHTTPServer 8080 |
/* | |
* Created by Nilesh Deokar<[email protected]> on 18/4/19 2:43 PM | |
*/ | |
package me.umoove.busCounterApp.models; | |
import android.media.MediaRecorder; | |
import android.os.Build; | |
import android.os.Environment; | |
import android.util.Log; |
package droidninja.filepicker | |
import android.content.ContentResolver | |
import android.provider.MediaStore | |
import android.util.Log | |
/* | |
~ Nilesh Deokar @nieldeokar on 03/06/19 9:57 AM | |
*/ |
package com.nieldeokar.whatsappaudiorecorder.recorder; | |
import android.media.AudioFormat; | |
import android.media.AudioRecord; | |
import android.media.MediaCodec; | |
import android.media.MediaCodecInfo; | |
import android.media.MediaFormat; | |
import android.media.MediaRecorder; | |
import android.os.Build; | |
import android.util.Log; |
int myOriginalValue = 0b0010; | |
// STEP 1 : 0b0001 << 3 = 0b1000; | |
// STEP 2 : OR 0b0010; originalValue | |
// -------------- | |
// RESULT : 0b1010; // 3rd bit is set to true | |
// Formula for setting a bit : | |
// myOriginalValue = myOriginalValue | (1 << position); |
public class GetAppUpdateAvailable { | |
private int mUpdateValue = 0b0010; | |
private static final int UPDATE_AVAILABLE = 1; | |
private static final int UPDATE_COMPULSORY = 2; | |
public void getUpdateAvailable(){ | |
boolean result = false; | |
result = (mUpdateValue & (1 << UPDATE_AVAILABLE)) != 0; |
public class SetAppUpdateAvailable { | |
private int mUpdateValue = 0; | |
private static final int UPDATE_AVAILABLE = 1; | |
private static final int UPDATE_COMPULSORY = 2; | |
public void setUpdateAvailable(){ | |
mUpdateValue = mUpdateValue | (1 << UPDATE_AVAILABLE); | |