Is there a way to detect if the browser window is currently inactive?
My JavaScript is active on a regular basis. When the user does not view the site (that is, the window or tab does not have focus), it is best not to run.
Is there a way to do this with JavaScript?
My reference point: if the window you are using is not activated, Gmail chat will play sound.
#1 building
Since the initial writing of t ...
Posted by Shifty Geezer on Wed, 08 Jan 2020 07:22:31 -0800
Deep understanding of libaio interface
Maybe everyone will use the libaio interface, but how does it interact with the kernel? What is the mechanism of the kernel? Let's follow the main process together.
Entering: system call
Dependent header file
#include <errno.h>
#include <sys/syscall.h>
#include <unistd.h>
Main functions:
/* Actual syscalls */
int io_setup(int ...
Posted by slamMan on Tue, 07 Jan 2020 06:26:34 -0800
CodeForces - 734C (thinking)
Every time I think about why I can't think of a solution. Why people's code is several lines.. (or write too little code by yourself QAQ)
When I write this question, I still wonder if I want to search or use greed. When I see the big guy's code, I realize that thinking is really strong.
Idea: first find the directly genera ...
Posted by rblais666 on Mon, 06 Jan 2020 11:20:11 -0800
Encapsulate a table with search for each column
Using the customized header of element ui, the effect is as follows:
Code:
<template>
<div class='searchtable'>
<el-table
:data="tableData"
border
@sort-change='sortColumns'
@selection-change="handleSelectionChange"
@row-click='clickRow'
ref='commontable'
:cell- ...
Posted by Cooper94 on Sun, 05 Jan 2020 21:17:20 -0800
About ionic3 Aurora push Registration ID cannot be obtained for the first time
Question:
1. The Registration ID cannot be obtained for the first time. You can use setTimeout to delay obtaining.
2. For Registration ID, the first time you open the app, you cannot get the id until you exit the app. Because the login user needs to be associated, the id must be sent to the background after login.
Edition:
...
Posted by djmc48 on Sun, 05 Jan 2020 14:14:25 -0800
Simple use of Realm database in iOS development
1. installation
Download address of realm GitHub
If you use cocoapods, the sample statement is as follows platform :ios, '8.0' target 'Simona_Realm' do pod 'Realm', '~> 3.0.0-beta.3' end
2. Create a simple model, inherit from RLMObject, and all models stored in the database need to inherit from RLMObject
Pers ...
Posted by RON_ron on Sat, 04 Jan 2020 22:59:09 -0800
IOS iframe height adapts to content
Problem: on iOS, a page is nested by iframe. An element displayed at the bottom of the page in the content page cannot be displayed. The position of this element is fixed.
Reason: because the height of Safari's iframe under iOS will adapt to the content of the page, resulting in the height of iframe is too high (that is, the h ...
Posted by mrhalloran on Sat, 04 Jan 2020 18:37:17 -0800
Flitter datastore SharedPreferences
SharedPreferences
SharedPreferences is a lightweight storage class on Android platform, which is used to save some common configurations of applications. Save settings, properties, and data as key value pairs.
There is also a SharedPreferences plug in,
Use NSUserDefaults on iOS and SharedPreferences on Android to provide per ...
Posted by PHP-Nut on Sat, 04 Jan 2020 00:07:05 -0800
Codeforces round (Div. 2) C. gambling
Title:
That is, two people each have a list, two people take turns to operate. There are two options for each operation:
One is to select a number from your own list, add it to your score, and delete this element from the total list.
The other is to delete the other element.
Maximum difference required
Analysis:
Select th ...
Posted by selenin on Fri, 03 Jan 2020 20:14:19 -0800
Use of Bootstrap tab page switch
Html code:
<!DOCTYPE html>
<html lang="en">
<head>
<base target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache,must-ridat ...
Posted by jwilliam on Fri, 03 Jan 2020 12:38:42 -0800