Skip to content

Instantly share code, notes, and snippets.

import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.widget.Toast;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
public class IncomingNotification extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
timeSchedule(this);
}
private void timeSchedule(final Context context) {
final Timer timer = new Timer();
timer.schedule(new TimerTask() {
@yihongyuelan
yihongyuelan / rating_analysis.py
Created July 13, 2018 03:27 — forked from athurg/rating_analysis.py
Coursera《用Python玩转数据》编程作业《男女电影评分差异分析编程》代码
# Cousera课程《用Python玩转数据 Data Processing Using Python》第4.2章编程作业《男女电影评分差异分析编程》
#
#分析数据集,找出男性女性用户评分的标准差,并输出两位小数部分
#提示:先分别计算每个人电影评分的平均分,再按性别求标准差
#使用方法:
# python work.py > result.txt
import pandas
@yihongyuelan
yihongyuelan / CellSignalStrength.java
Last active September 25, 2018 03:16
Check the validity of the SIM card for Android
public abstract class CellSignalStrength {
public static final int SIGNAL_STRENGTH_NONE_OR_UNKNOWN = 0;
public static final int SIGNAL_STRENGTH_POOR = 1;
public static final int SIGNAL_STRENGTH_MODERATE = 2;
public static final int SIGNAL_STRENGTH_GOOD = 3;