Skip to content

Instantly share code, notes, and snippets.

View amirbakhtiari's full-sized avatar

amir bakhtiari amirbakhtiari

View GitHub Profile
@amirbakhtiari
amirbakhtiari / CustomView.java
Created May 26, 2019 07:45 — forked from arriolac/CustomView.java
Saving state on configuration changes for a custom view.
package com.operator.android;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;
/**
* A custom {@link View} that demonstrates how to save/restore instance state.
*/
import sys
import time
s = time.time()
N = int(sys.argv[1])
prime = [True]*N
prime[0] = False
prime[1] = False