- Auto Start permissions by OEMs
- Doze
- App Standby Buckets
- App Hibernation by Android after 8 days of non-interactivity
- Summary of all the restrictions imposed over the years
- Don’t kill my app! | Hey Android vendors, don’t kill my app!
- How to protect AdGuard from being disabled by the system | AdGuard Knowledgebase
// Adapted from: http://bateru.com/news/2011/11/improved-code-for-javascript-decimal-to-fraction/ | |
function gcd(a, b) { | |
return (b) ? gcd(b, a % b) : a; | |
} | |
var decimalToFraction = function (_decimal) { | |
var top = _decimal.toString().replace(/\d+[.]/, ''); | |
var bottom = Math.pow(10, top.length); | |
if (_decimal > 1) { |
/* | |
* Converts Decimals to Fractions | |
* | |
*/ | |
package simpleai; | |
/** | |
* | |
* @author sarabeth | |
*/ |
// All values/comments are valid with ATmega8 running at Fosc = 4.000MHz | |
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
// TIMER0 with prescaler clkI/O/1024 | |
#define TIMER0_PRESCALER (1 << CS02) | (1 << CS00) | |
void main() |
package au.com.qantas.qantas.common.presentation; | |
import android.content.Context; | |
import android.support.design.widget.AppBarLayout; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
public class AppbarSwipeRefreshLayout extends SwipeRefreshLayout implements | |
AppBarLayout.OnOffsetChangedListener { |
import android.os.Bundle; | |
import android.support.design.widget.AppBarLayout; | |
import android.support.design.widget.TabLayout; | |
import android.support.v4.widget.SwipeRefreshLayout; | |
import android.support.v7.app.AppCompatActivity; | |
import android.support.v7.widget.GridLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import com.blackcj.designsupportexample.adapters.RecyclerViewAdapter; |
#include "xc.h" | |
#include "config.h" | |
#define _XTAL_FREQ 4000000 | |
unsigned short pot = 0; | |
void interrupt isr() { | |
// Disable GIE (best practice?) |
The .ino
files of Arduino sketches are compiled as C++ after a little bit of preprocessing. If you want to use C functions in C++, you need to wrap their declarations in:
extern "C" {}
There are a couple ways you can do this:
In the sketch:
The technique I normally use is to prefix the data with a 4-byte rolling sequence number where the largest number represents the lastest / current value. In the case of storing 2 bytes of actual data that would give 6 bytes total and then I form into a circular queue arrangement so for 128 bytes of EEPROM it would contain 21 entries and increase endurance 21 times.
Then when booting the largest sequence number can be used to determine both the next sequence number to be used and the current tail of the queue. The following C pseudo-code demonstrates, this assumes that upon initial programming the EEPROM area has been erased to values of 0xFF so I ignore a sequence number of 0xFFFF:
struct
{
uint32_t sequence_no;
uint16_t my_data;
} QUEUE_ENTRY;
import 'dart:async'; | |
import 'dart:isolate'; | |
class CountdownTimer { | |
final receivePort = ReceivePort(); | |
late Isolate _isolate; | |
void stop() { | |
receivePort.close(); | |
_isolate.kill(priority: Isolate.immediate); |