Fix : /bin/bash ./config.sub failed

checking build system type... Invalid configuration 4': machine4' not recognized
configure: error: /bin/bash ./config.sub 4 failed

solution:
autoreconf --install
then configure again.

fix error: wl_display@1.error(wl_display@1, 1, "invalid arguments for wl_surface@6.attach")

wl_display@1.error(wl_display@1, 1, "invalid arguments for wl_surface@6.attach")

root cause:
wl_surface_attach(wl_surface* surface, wl_buffer* buffer, int, int);
((wl_proxy*)surface)->display != ((wl_proxy*)buffer)->display
surface's display and buffer's display were not matched.
wayland server can't find the buffer object in surface's client connection.

solution:
correct source code, let wl_surface and wl_buffer use the same display.
By the way, each time you call wl_display_get(NULL).
you will get a new display.

react-native : Progress component

Progress

React component that indicate that the app is loading or there is some activity in the app.
Support iOS and Android

Props

  • animating
    Whether to show the Progress (true, the default) or hide it (false).
  • color
    Color of the progress bar.
  • bgcolor
    Background color of the progress bar.
  • progress
    The progress value (between 0 and 1).
  • inverse
    Whether to inverse the Progress (true) or not (false, the default)
  • vertical
    Whether to show a vertical Progress (true) or show a horizontal one (false, the default)

Usage

Import Progress from './Progress'

render() {
  return (
    <View style={styles.container}>
           <Progress progress={this.state.progress}/>
        </View>
  )
}

Example

Progress

View source on GitHub

Report your AdMob earnings via Only One Single XMLHttpRequest

Send XMLHttpRequest

function reqListener () {
  console.log(this.responseText);
}
function admobReport() {
var url = 'https://content.googleapis.com/adsense/v1.4/accounts/';
var accountId = 'pub-xxx'; // change to your own accountId
url += accountId;  
url += '/reports?dimension=APP_ID';
url += '&filter=AD_CLIENT_ID==ca-app-' + accountId;
url += '&metric=EARNINGS'
url += '&startDate=2018-02-01';  // change start date
url += '&endDate=2018-02-24'; // change end date
var oReq = new XMLHttpRequest();
oReq.addEventListener("load", reqListener);
oReq.open("GET", url);
var AuthorizationToken = 'xxx';  // The way to get it is in this post
oReq.setRequestHeader('Authorization', 'AuthorizationToken');
oReq.send();
}
admobReport();

Response

{
 "kind": "adsense#report",
 "totalMatchedRows": "1",
 "headers": [
  {
   "name": "APP_ID",
   "type": "DIMENSION"
  },
  {
   "name": "EARNINGS",
   "type": "METRIC_CURRENCY",
   "currency": "USD"
  }
 ],
 "rows": [
  [
   "2:com.westminstershortercatechismqa",
   "0.89"
  ]
 ],
 "totals": [
  "",
  "0.89"
 ],
 "averages": [
  "",
  "0.89"
 ],
 "startDate": "2018-02-01",
 "endDate": "2018-02-24"
}
 
We can get the total earnings are 0.89$.

accountId

Just login into your AdSense home page, you will found it.
accountId

AuthorizationToken

Generate Authorization Header at first.
You have to login your AdSense account and grant authorization access.
auth
Press F12 to open developer tool in your browser.
Press "EXECUTE" button again.
Then you will find the Authorization Header.
AuthToken
Remember this Header value and keep it secrect.
Replace the value to the JS code at the begining.
Then you can get your AdMob earnings via just one HTTP get API in any place.

Refers

AdSense Management API
AdMob Reporting
AdSense Management API Get Started

Privacy Policy

Your privacy is critically important to us. At errong.win, we do not collect and transmit any user data.

fixed: embedded-redis: Unable to run on macOS Sonoma

Issue you might see below error while trying to run embedded-redis for your testing on your macOS after you upgrade to Sonoma. java.la...