Auto-increase Build number in Xcode

There are lots of tutorials online showing how to implement automatic Build number increase in Xcode.

The simplest one is adding a new Run Script Phase to Project Build Phases and inserting agvtool bump. Unfortunately, I found that this causes a strange issue when the project build randomly stops at the very end and just shows Build Cancelled without any explanation or error. While this happens only some of the time, the project Archiving process fails with the same outcome pretty much every time.

1040 auto increase build number 0

Read more: Auto-increase Build number in Xcode

Arduino - Calculate Person's Age in Years, Months, Days

Here is code I recently used to calculate persons age in Years, Months, and Days on Arduino:


#include "RTClib.h"
RTC_DS3231 rtc; // Using DS3231 Real Time Clock
DateTime now = rtc.now(); // Current Date and Time
DateTime dob = DateTime(1984,8,16,0,0,0); // Date of Birth (1984.08.16 00:00:00)

int t0 = dob.year() * 12 + dob.month() - 1;
int t = now.year() * 12 + now.month() - 1;
int dm = t - t0;
int Y;
int M;
int D;

//Calculate age in Y/M/D
if(now.day() >= dob.day()){
Y = floor(dm/12);
M = dm % 12;
D = now.day() - dob.day();
}
else {
dm--;
t--;
Y = floor(dm/12);
M = dm % 12;
DateTime tmp = DateTime(floor(t/12),(t%12)+1,dob.day(),0,0,0);
D = (now.unixtime() - tmp.unixtime())/60/60/24;
}

 

Read more: Arduino - Calculate Person's Age in Years, Months, Days

The WIFI_SERVICE must be looked up on the Application context...

Issue

Generating signed APK in Android Studio 2.3 fails with following error:

Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing  to .getApplicationContext()  [WifiManagerLeak]

Read more: The WIFI_SERVICE must be looked up on the Application context...