Skip to content

Instantly share code, notes, and snippets.

View aftabsikander's full-sized avatar

Aftab aftabsikander

  • Karachi,Pakistan
View GitHub Profile
@aftabsikander
aftabsikander / material_design_guidelines_dimens.xml
Created April 12, 2017 20:03 — forked from aeroechelon/material_design_guidelines_dimens.xml
Recommended Material Design Dimensions for Android
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
# Material Design Dimensions
These dimensions are provided as per Material Design Guidelines
to adhere to a 8 dp baseline grid. (With the exception of the
toolbar and notification bar.).
## References
import os
import struct
import numpy as np
"""
Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py
which is GPL licensed.
"""
def read(dataset = "training", path = "."):
@aftabsikander
aftabsikander / mnist-to-jpg.py
Created April 18, 2017 14:55 — forked from ischlag/mnist-to-jpg.py
Simple python script which takes the mnist data from tensorflow and builds a data set based on jpg files and text files containing the image paths and labels. Parts of it are from the mnist tensorflow example.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import sys
import time
from six.moves import urllib
import numpy
import random
from numpy import arange
#from classification import *
from sklearn import metrics
from sklearn.datasets import fetch_mldata
from sklearn.ensemble import RandomForestClassifier
from sklearn.utils import shuffle
import time
@aftabsikander
aftabsikander / generateClassifier.py
Last active April 20, 2017 20:48
Generate Classifier for Mnist handwritting digits
import struct
import os
from array import array as pyarray
from sklearn.externals import joblib
from numpy import *
from pylab import *
from sklearn import svm
DATASET_PATH='/media/afali/Project/Projects/Projects/Python-workspace/hello-scikitlearn/Dataset/'
@aftabsikander
aftabsikander / androidmanifest.xml
Created May 3, 2017 13:59 — forked from josh-burton/androidmanifest.xml
Prevent TouchWiz from surrounding your app icon in a frame
<!-- Prevents TouchWiz from surrounding your app icon in a frame -->
<!-- Add to your manifest inside the application tag -->
<meta-data
android:name="com.samsung.android.icon_container.has_icon_container"
android:value="true"/>
@aftabsikander
aftabsikander / ExtendedEditText.java
Created May 23, 2017 19:03 — forked from kennydude/ExtendedEditText.java
Ever wanted a prefix and suffix on your EditText? Yes, well this ExtendedEditText class will do it for you!
package me.kennydude.spending.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.*;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.text.Editable;
import android.text.TextPaint;
import android.text.TextWatcher;
@aftabsikander
aftabsikander / PrefixedEditText.java
Created May 23, 2017 19:04 — forked from alexfu/PrefixedEditText.java
EditText with support for prefixes.
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.EditText;
/**
@aftabsikander
aftabsikander / KeyStoreHelper.java
Created June 30, 2017 08:09 — forked from alphamu/KeyStoreHelper.java
Using Android KeyStore to generate a password. The code create a public/private key pair and uses the base64 encoded form of the certificate to as the password. The code modified the KeystoreHelper class from AOSP demo projects.
/*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@aftabsikander
aftabsikander / KeyboardUtil.java
Created August 10, 2017 14:56
This class implements a hack to change the layout padding on bottom if the keyboard is shown to allow long lists with editTextViews Basic idea for this solution found here: http://stackoverflow.com/a/9108219/325479
import android.app.Activity;
import android.graphics.Rect;
import android.os.Build;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.inputmethod.InputMethodManager;
/**
* This class implements a hack to change the layout padding on bottom if the keyboard is shown
* to allow long lists with editTextViews