Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Mohammed Audhil Audhil

🎯
Focusing
Block or report user

Report or block Audhil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c9529a8615805c4c5dd3fb3447b8e556
Calendar cal = Calendar.getInstance();
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", cal.getTimeInMillis());
intent.putExtra("allDay", false);
intent.putExtra("rrule", "FREQ=DAILY");
intent.putExtra("endTime", cal.getTimeInMillis()+60*60*1000);
intent.putExtra("title", "A Test Event from android app");
startActivity(intent);
View gist:f4b8ff8c16a1876fcee3ac24b53d1848
// copying
public static Object copy(Object orig) {
Object obj = null;
try {
// Write the object out to a byte array
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(bos);
out.writeObject(orig);
out.flush();
out.close();
@Audhil
Audhil / one.py
Created Oct 3, 2017
what is __name__ in python?
View one.py
print ('top level in one.py')
def matter():
print ('this is matter() in one.py')
if __name__ == '__main__':
print("one.py is being run directly and __name__ is : ", __name__)
matter()
View gist:d1f8b5997aa196b4d987a6b012054b94
// Java code
BufferedReader br = null;
br = new BufferedReader(new InputStreamReader(assetManager.open(actualFilename)));
String line;
ArrayList<String> labels = new ArrayList<String>();
while ((line = br.readLine()) != null) {
labels.add(line);
}
br.close();
@Audhil
Audhil / gist:a1aaefeb52293a92c6e6588a15fe200b
Last active Oct 17, 2017
Hands dirty with Python Numpy arrays- just for future references
View gist:a1aaefeb52293a92c6e6588a15fe200b
Hands dirty with Python Numpy arrays
@Audhil
Audhil / gist:f8d37633ca45ec11c4485f7ed1fead0c
Created Oct 20, 2017
TensorFlow Hacks - shape, size, reshape blah blah blah
View gist:f8d37633ca45ec11c4485f7ed1fead0c
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
shape(t) ==> [2, 2, 3]
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]]
size(t) ==> 12
# 't' is [[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]]]
# shape of tensor 't' is [2, 2, 3]
rank(t) ==> 3
Note: The rank of a tensor is not the same as the rank of a matrix.
View gist:fb5f8278de0c9dc679cf1eeaa56d6fd7
##Big O notations - of algorithms
Big O describes the worst case scenario, can be used to define execution time or space used (e.g. in memory or on disk) by an algorithm.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
O(1)
executes in same time or space regardless of size of the input data
vals = [None,'jack','and','jill']
View gist:ce7299f0888ae8363f66c927603f0d12
package com.example.demo
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import kotlinx.coroutines.experimental.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@Audhil
Audhil / msg_labels_file.txt
Last active Nov 21, 2017
Gist to copy data from csv to .txt
View msg_labels_file.txt
"""
It read files from csv file and separates "labels" and "texts" from it.
"""
import pandas as pd
import os
import numpy as np
import string
def run():
@Audhil
Audhil / app(build.gradle)
Created Nov 26, 2017
Dependencies of DL4J & ND4J for Android App
View app(build.gradle)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
You can’t perform that action at this time.