Skip to content

Instantly share code, notes, and snippets.

View ola0x's full-sized avatar
🏠
Working from home

Olanrewaju Ola ola0x

🏠
Working from home
View GitHub Profile
class Timer {
fun printDifferenceDateForHours() {
val currentTime = Calendar.getInstance().time
val endDateDay = "03/02/2020 21:00:00"
val format1 = SimpleDateFormat("dd/MM/yyyy hh:mm:ss",Locale.getDefault())
val endDate = format1.parse(endDateDay)
//milliseconds
override fun onModalOptionSelected(tag: String?, option: Option) {
when(option.id){
R.id.action_share -> findNavController().navigate(R.id.action_favoriteFragment_to_shareFragment)
R.id.action_edit -> findNavController().navigate(R.id.action_favoriteFragment_to_editFragment)
}
}
Consider this Url
www.app.net/api/searchtypes/862189/filters?Type=6&SearchText=School
Now this is the call
@GET("/api/searchtypes/{Id}/filters")
Call<FilterResponse> getFilterList(
@Path("Id") long customerId,
@Query("Type") String responseType,
@Query("SearchText") String searchText
Some am starting this Amdroid project tonight 18th August, 2020
I will be calling this endpoint === https://nigerianbanks.xyz/
data class = name, slug, code, ussd, logo
Things to implement
1. Use cardView for the Main screen
2. BottomSheet for when any bank item is click
3. When the ussd is clicked it shoud open the dialing pad
public Result(final String id, final String title, final Float confidence) {
this.id = id;
this.title = title;
this.confidence = confidence;
}
public String getId() {
return id;
}
titles
"gender"
contents
"Gender is a socially constructed definition of women and men. It is not the same as sex (biological characteristics of women and men) and it is not the same as women. Gender is determined by the conception of tasks, functions and roles attributed to women and men in society and in public and private life."
questions
"What is gender?"
"gender is not what?"
"Gender is not determined by?"
titles
"City of Monrovia"
contents
" Monrovia was named after James Monroe, who was president of the United States in 1822.In that year a group of freed U.S. slaves, sponsored by a U.S. society, started a new settlementon the continent of their ancestors. As more settlers arrived from the United States and fromthe Caribbean area, the area they controlled grew larger. In 1847 Monrovia became the capitalof the new country of Liberia."
questions
"Who was president of the United States in 1822?"
"When was James Monroe president of the United States?"
"Who was Monrovia named after?"
@ola0x
ola0x / plot_confusion_matrix_tfmodel_maker.py
Created January 17, 2021 00:24
How to plot confusion matrix using Tensor Flow model maker
%matplotlib inline
from sklearn.metrics import confusion_matrix
import itertools
import matplotlib.pyplot as plt
import tensorflow as tf
assert tf.__version__.startswith('2')
from tflite_model_maker import image_classifier
predicts = model.predict_top_k(test_data)
y_pred = []
@ola0x
ola0x / s3_trigger_lambda_func.py
Created October 9, 2021 02:56
This is a Lambda function that's get triggers when a file is uploaded to an s3 bucket. I wrote it in such a way that if an image or a json file is uploaded to the s3 bucket the lambda func is able to process it.
import json
import urllib.parse
import boto3
print('Loading function')
s3 = boto3.client('s3')
def lambda_handler(event, context):