This file contains 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
country | population | |
---|---|---|
China | 1415046 | |
India | 1354052 | |
United States | 326767 | |
Indonesia | 266795 | |
Brazil | 210868 | |
Pakistan | 200814 | |
Nigeria | 195875 | |
Bangladesh | 166368 | |
Russia | 143965 |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
def derivative(x, step): | |
return (sigmoid(x+step) - sigmoid(x)) / step | |
x = np.linspace(-10, 10, 1000) |
This file contains 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
from matplotlib import pyplot | |
def rectified(x): | |
return max(0.0, x) | |
series_in = [x for x in range(-100, 101)] | |
series_out = [rectified(x) for x in series_in] | |
pyplot.plot(series_in, series_out) | |
pyplot.show() |
This file contains 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 fiftyone as fo | |
import os | |
import xml.etree.ElementTree as ET | |
import cv2 | |
name = "headsegmentation_dataset_ccncsa" | |
dataset_dir = "/home/priyansh-kedia/Documents/Datasets/headsegmentation_dataset_ccncsa/" | |
dataset = fo.Dataset() |
This file contains 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
suspend fun getImages(count: Int, start: Int): Three<MutableList<Three<Uri?, String?, Date>>, Boolean, Int> { | |
val imagesList = mutableListOf<Three<Uri?, String?, Date>>() | |
var index = start | |
return withContext(Dispatchers.IO) { | |
while (imageCursor?.moveToPosition(i) == true) { | |
val id = imageIdColumn?.let { imageCursor.getLong(it) } | |
val dateModified = Date(TimeUnit.SECONDS.toMillis(imageCursor.getLong(imageDateModifiedColumn ?: 0))) | |
val displayName = imageDisplayNameColumn?.let { imageCursor.getString(it) } |
This file contains 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
private val _imagesLiveData = MutableLiveData<MutableList<Three<Uri?, String?, Date>>>() | |
val imagesLiveData: LiveData<MutableList<Three<Uri?, String?, Date>>> | |
get() = _imagesLiveData | |
private var start = 0 | |
private var areAllLoaded = false | |
fun getImages(count: Int) { | |
if (areAllLoaded) | |
return |
This file contains 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
mediaRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() { | |
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { | |
if ((gridLayoutManager.findLastVisibleItemPosition() == localDocumentsAdapter.itemCount - DOCUMENT_BUFFER) && dy > 0) { | |
documentViewModel.getImages(DOCUMENTS_COUNT) | |
} | |
} | |
}) |
This file contains 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
object EMOJIS { | |
private const val GRINNING_FACE = "😀" | |
private const val BEAMING_FACE_WITH_SMILING_EYES = "😁" | |
private const val GRINNING_SQUINTING_FACE = "😆" | |
private const val GRINNING_FACE_WITH_SWEAT = "😅" | |
const val FACE_WITH_TEARS_OF_JOY = "😂" | |
private const val ROLLING_ON_THE_FLOOR_LAUGHING = "🤣" | |
private const val SLIGHTLY_SMILING_FACE = "🙂" | |
private const val UPSIDE_DOWN_FACE = "🙃" |
This file contains 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
// Aws SDK | |
implementation 'com.amazonaws:aws-android-sdk-core:2.6.+' | |
implementation 'com.amazonaws:aws-android-sdk-cognito:2.2.+' | |
implementation 'com.amazonaws:aws-android-sdk-s3:2.6.+' | |
implementation 'com.amazonaws:aws-android-sdk-ddb:2.2.+' | |
// RxJava | |
implementation "io.reactivex.rxjava3:rxjava:3.0.4" | |
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0' |
This file contains 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
sealed class UploadFileStatus{ | |
data class FileStatus(val status: Int): UploadFileStatus() | |
data class Error(val exception: Throwable): UploadFileStatus() | |
data class Complete(val s3Url: String): UploadFileStatus() | |
data class Start(val start: Boolean): UploadFileStatus() | |
} |
OlderNewer