Skip to content

Instantly share code, notes, and snippets.

View murano500k's full-sized avatar

Artem Radchenko murano500k

View GitHub Profile
@murano500k
murano500k / App.java
Created November 10, 2016 12:34
Timber config
public class App extends Application {
@Override
public void onTerminate() {
super.onTerminate();
}
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.DEBUG) {
@murano500k
murano500k / Android.mk
Last active November 21, 2016 13:15
create flashable ota package from img aosp
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src) \
src/training/gl/android/com/mysytemapp/IMyService.aidl
LOCAL_PACKAGE_NAME := ToastApk
@murano500k
murano500k / bootargs
Created November 22, 2016 13:12
small display bootargs
video=HDMI-A-1:640x480-32@60
@murano500k
murano500k / prv.diff
Created December 7, 2016 17:24
irp diff
diff --git a/app/src/main/java/com/stc/radio/player/model/MusicProvider.java b/app/src/main/java/com/stc/radio/player/model/MusicProvider.java
index 766ffc9..c8b9d76 100644
--- a/app/src/main/java/com/stc/radio/player/model/MusicProvider.java
+++ b/app/src/main/java/com/stc/radio/player/model/MusicProvider.java
@@ -1,38 +1,21 @@
-/*
- * Copyright (C) 2014 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.
A difference between WeakReference and SoftReference in Java? (answer)
Though both WeakReference and SoftReference helps garbage collector and memory efficient, WeakReference becomes eligible for garbage collection as soon as last strong reference is lost but SoftReference even thought it can not prevent GC, it can delay it until JVM absolutely need memory.
How do WeakHashMap works? (answer)
WeakHashMap works like a normal HashMap but uses WeakReference for keys, which means if the key object doesn't have any reference then both key/value mapping will become eligible for garbage collection.
@murano500k
murano500k / LTP_Test_Descriptions.txt
Created December 21, 2016 09:38
LTP Test Descriptions
LTP Test Descriptions
Tests are listed alphabetically by test name.
accept01
Verify that accept() returns the proper errno for various failure cases
access01
Basic test for access(2) using F_OK, R_OK, W_OK, and X_OK arguments.
@murano500k
murano500k / memtest.txt
Last active December 27, 2016 13:08
memtest u-boot
setenv memfil_5a 'mw.b 59000000 5a 23C34600;'
setenv memcmp 'cmp.b 59000000 6AE1A300 11E1A300;'
setenv memtest 'run memfil_5a; run memcmp;'
setenv bootcmd 'run memtest;'
setenv bootdelay 1
saveenv
reset
##################
start1 = 59000000
@murano500k
murano500k / 1r_cmp.S
Last active December 28, 2016 10:07
u-boot mem compare function diff
.Lquad_loop_s:
NOP;
R0 = [P0++];
R1 = [I0++];
CC = R0 == R1;
IF !CC JUMP .Lquad_different;
@murano500k
murano500k / MapHelp.java
Last active February 2, 2017 16:26
mapbox help
//center map to area
LatLngBounds latLngBounds = new LatLngBounds.Builder()
.include(new LatLng(36.532128, -93.489121)) // Northeast
.include(new LatLng(25.837058, -106.646234)) // Southwest
.build();
mapboxMap.easeCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, 50), 5000);
//Title - areaName
@murano500k
murano500k / BaseMapActivityUnfinished.java
Created February 3, 2017 13:13
BaseMapActivityUnfinished
package com.murano500k.cropio.task;
import android.location.Location;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.ProgressBar;
import android.widget.Toast;