0%

111

cardiovascular | 心血管的
cancer | 癌症
respiratory | 呼吸的
low respiratorty infection | 低呼吸道感染
demential | 痴呆的
digestive | 消化的
diabet | 糖尿病
liver | 肝
road injuries | 道路伤害
kidney disease | 肾脏疾病
tuberculosis | 结核
HIV/AIDS | HIV爱滋病
suicide | 自杀
malaria | 疟疾
homicide | 杀人
parkison | 帕金森
drowning | 淹死
meningit | 脑膜炎
nutritional deficiencies | 营养不足
protein-energy malnutrition | 蛋白质能量营养不良
maternal disorder | 产妇疾病
alcohol use disorder | 饮酒障碍
drug | 药品
conflict | 冲突
hepatities | 肝病
fire | 火
poisoning | 中毒
heat | 热
terrorism | 恐怖主义
natural disaster | 自然灾害

Diarrheal | 腹泻
Cardiovascular | 心血管的
Dementia | 痴呆
Tuberculosis | 结核

Diarrheal | 腹泻

111

Tuberculosis | 结核

111

smoke 抽烟

111

suicide 自杀

111

homicide 谋杀

111

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<h3>type=radio 的只读问题</h3>

<form>

<div>
<div>input readonly</div>
<div>还是可以点击</div>
<label><input type="radio" name="aa" readonly >111</label>
<label><input type="radio" name="aa" readonly checked>222</label>
</div>

<div>
<div>input disabled</div>
<div>不能点击;但也不能提交</div>
<label><input type="radio" name="bb" disabled >111</label>
<label><input type="radio" name="bb" disabled checked>222</label>
</div>

<h3>我们需要的是:不能点击但要提交!</h3>

<h3>解决办法一</h3>
<div>onclick="return false</div>
<div>
<div>input onclick="return false"</div>
<div></div>
<label><input type="radio" name="cc" onclick="return false" >111</label>
<label><input type="radio" name="cc" onclick="return false" checked>222</label>
</div>

<h3>解决办法二</h3>

<div>
<div>用 css 禁止点击</div>
<label class="disabled"><input type="radio" name="dd" onclick="return false" >111</label>
<label class="disabled"><input type="radio" name="dd" onclick="return false" checked>222</label>
</div>
<button> 提交 </button>
</form>

<style type="text/css">
input[type="radio"][readonly],label.disabled {
pointer-events: none;
}
</style>

使用TagWriter制作一枚可以打开指定网站的NFC标签

nfc 标签

nfc app

iOS 13 开放了 NFC 标签读取功能,你的 iPhone 还能这么玩

具体操作

捷径 > 自动化 > 点击右上角 + 号 > 创建个人自动化;在弹出的动作选项「设置」分类下,找到「NFC」;点击「扫描」,将手机靠近 NFC 标签,建议贴紧;设备检测到 NFC 后弹出标签命名框,为标签命名,保存;选择读取 NFC 标签后的下一步操作,例如拨打电话、打开 WiFi、播放音乐等;去掉「运行前询问」的勾选,这是非常影响体验的关键步骤,如果运行前还要在手机上确认的话,NFC 标签的智能化就大打折扣了。

有,iphone6s怎么使用nfc功能教程
首先我们在手机打开桌面的——-【系统设置】功能键。

接着在常用选项栏目或全部选项下方查看,各个手机界面有所不同。
通常情况带有NFC功能的手机多见于内置在【无线网络】或WiFi的【更多。。。】子栏目下。

进入无线和网络更多。。栏目后就可以看见NFC功能的开启按钮了。
向右滑动即可打开NFC功能。

打开NFC按钮后点击进入NFC设置面页——【勾选】相应的模式即可。

开启NFC功能后,不仅能和另一部支持NFC的手机相互传送文件,还可以使用支持NFC芯片的公交卡、地铁、刷卡、支付宝读取等功能。前提是你所在的地方运营商已经支持NFC应用。

nfc功能目前只支持apple pay,苹果支付,没有其他意义

###iphone 用 NFC 标签配合快捷指令实现场景自动化

2019-09-11-nfc-1.jpg

分别是 NFC 卡片(有圆形也有矩形)、NFC 贴纸和 NFC 滴胶卡。我个人比较推荐的是后两种——贴纸和滴胶卡,它们在使用上会更灵活,贴纸可以贴在家里的任意位置2 ,滴胶卡则方便随身携带。这些 NFC 标签都非常便宜,每个在 1 块钱左右,有的还能定制外观。

iPhone 支持扫描多种 NFC 标签,包括比较流行的 NTAG、MIFARE、ICODE 等。我购买的是 NTAG 系列的标签,在淘宝等电商平台上也比较好购买。其中 NTAG 标签有 213、215、216 等型号,主要区别是储存容量的大小,一般买最小的 213 就足够使用。

Open browser on scan of NFC tag in Android

Open browser on scan of NFC tag in Android

That is because you are writing a text record with the text “http://www.google.com" to the tag. NFC devices usually do not know how to interpret text on tags (though they could just display that text – and some devices do exactly that).

What you want to do is create a record based on the NFC Forum’s URI Record Type Definition. The createRecord method could look like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
private NdefRecord createRecord(String uri) throws UnsupportedEncodingException {
byte[] uriBytes = uri.getBytes("UTF-8");
byte[] payload = new byte[1 + uriBytes.length];

// set prefix byte (see URI RTD for possibile values, we just use 0 indicating no prefix for now)
payload[0] = 0;

// copy uriBytes into payload
System.arraycopy(uriBytes, 0, payload, 1, uriBytes.length);

return new NdefRecord(NdefRecord.TNF_WELL_KNOWN,
NdefRecord.RTD_URI,
null,
payload);
}

Or you could just use Android’s built-in method:

record = NdefRecord.createUri(“http://www.google.com");

Regarding the detection on other devices: Using a MIFARE Classic tag on the S3 should work. The S4 (and any other device based on Broadcom’s NFC chipset) does not support MIFARE Classic at all, so you would need to switch to another tag technology to support those devices.


NFC标签上的URL与NFC标签上的纯文本消息不同。它们具有不同的消息类型。您的清单中列出了2个用于纯文本消息的意图过滤器(实际上不会触发最后一个过滤器,TAG_DISCOVERED意图将永远不会包含来自标记的任何数据)。
要匹配示例网址,请尝试:

1
2
3
4
5
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<data android:scheme="http" android:host="www.google.com" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

height: 100vh = 100% of the viewport height

height: 100% = 100% of the parent’s element height

That is why you need to add height: 100% on html and body, as they don’t have a size by default

Something you have to know : if you use % for vertical margin or padding, % will be calculated on the width of the parent element, not the height.

Tip : try using vh and vw units for font size :) I like this one (not supported in some browsers I know) : font-size: calc(.5vh + .5vw); (for example)

Generator

function* 这种声明方式(function关键字后跟一个星号)会定义一个生成器函数 (generator function),它返回一个 Generator 对象。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function* g(i) {
yield i;
yield i + i;
}

let a = g(3);
// console.log(a)

console.log(a.next().value);
console.log(a.next().value);
console.log(8888);

function *foo() {
yield 1;
yield 2;
yield 3;
return;
}
for(let v of foo()) {
console.log(v);
}

yield

yield关键字使生成器函数执行暂停,yield关键字后面的表达式的值返回给生成器的调用者。它可以被认为是一个基于生成器的版本的return关键字。

yield关键字实际返回一个IteratorResult对象,它有两个属性,value和done。value属性是对yield表达式求值的结果,而done是false,表示生成器函数尚未完全完成。

一旦遇到 yield 表达式,生成器的代码将被暂停运行,直到生成器的 next() 方法被调用。每次调用生成器的next()方法时,生成器都会恢复执行,直到达到以下某个值:

1
2
3
4
5
6
7
8
9
10
11
12
13
function* dd(n){
var index = 0;
while(index < n)
yield index++;
}

let a = dd(2);

console.log(a.next());
console.log(a.next());
console.log(a.next());
console.log(a.next());
console.log(a.next());

iterator js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var c = console;

function arrayIterator(array){
var i = 0;
var obj = {
next: function(){
return i < array.length ?
{value: array[i++], done: false} :
{value: undefined, done: true};
}
}
return obj;
}

var ai = arrayIterator(['x', 'y', 'z']);

c.log(ai.next()); // { value: "x", done: false }
c.log(ai.next()); // { value: "y", done: false }
c.log(ai.next()); // { value: "z", done: false }
c.log(ai.next()); // { value: undefined, done: true }

yield “协程”(coroutine)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
var fs = require('fs');
var gen;

function run(generator) {
gen = generator();
gen.next();
}

function read(file) {
fs.readFile(file, function(err, data) {
if (!err) console.log('read %s success!', file);
gen.next(data);
});
}

function write(file, data) {
fs.writeFile(file, data, function(err) {
if (!err) console.log('write %s success!', file);
gen.next();
});
}

run(function* () {
var text = yield read('yieldFile.js');
yield write('yieldFile.bak', text);
});

1
2
3
4
5
6
7
8
async function asynctest() {
console.log('start');
await call();
await normalFunction();
await new Promise(resolve=>{ console.log('wait result'); resolve()});
console.log('end');
}
asynctest();
  • command + shift + p 命令行
  • View > Appearance > Toggle Zen Mode (View > Appearance > Toggle Centered Layout)
  • 在 Preferences > Settings - 插件 中打开 emmet.triggerExpansionOnTab

更多 emmet 技巧

  1. 推荐在循环对象属性的时候,使用for…in,在遍历数组的时候的时候使用for…of。
  2. for…in循环出的是key,for…of循环出的是value
  3. 注意,for…of是ES6新引入的特性。修复了ES5引入的for…in的不足
  4. for…of不能循环普通的对象,需要通过和Object.keys()搭配使用

via https://segmentfault.com/q/1010000006658882

1
2
3
4
5
6
7
8
let aArray = ['a',123,{a:'1',b:'2'}]
for(let index in aArray){
console.log(`${aArray[index]}`);
}

for(var value of aArray){
console.log(value);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
var student={
name:'wujunchuan',
age:22,
locate:{
country:'china',
city:'xiamen',
school:'XMUT'
}
}
for(var key of Object.keys(student)){
//使用Object.keys()方法获取对象key的数组
console.log(key+": "+student[key]);
}

需要带参数的 Chrome Canary

1
/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --remote-debugging-port=9222

还要放在 dock

方法 1

Use Automator to create an application that in effect launches Chrome with command line arguments.

Start Automator and select to create an Application. Double-click Run Shell Script in the Library/Utilities folder and replace the text content — cat — with the following:

1
open -a "Google Chrome.app" --args -pinned-tab-count=4

keep the .app suffix or will break with Parallels

Save anywhere you like.

更换图标

To replace this application’s icon, Get Info on your real Google Chrome, click on the icon on the top left, press Cmd-C, Get Info on your Chrome Automator app, click the icon, and press Cmd-V.

Since it’s a different application, the Dock will display two Chrome applications when it’s running: Chrome, and your Chrome launcher.

方法 2

直接修改默认的启动项目

Edit your application bundle to launch a script instead. This script will start the actual application, adding the command line argument.

Right-click Google Chrome.app and select Show Package Contents. Go to Contents/ and open Info.plist in Property List Editor/Xcode (Apple’s developer tools), or a third party plist editor.

Look for the entry CFBundleExecutable or Executable File. Remember its value (e.g. firefox-bin for Firefox). Replace it with parameterized-app.sh.

Open Terminal and enter the following:

touch /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh
open /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh
An editor for the .sh file will open. Set the contents of the file to:

1
2
#!/usr/bin/env bash
exec /Applications/Firefox.app/Contents/MacOS/firefox-bin -ProfileManager

(using the actual executable’s name you removed from Info.plist, adding the desired command-line arguments)

Save and close. In Terminal, enter the following:

chmod +x /Applications/Firefox.app/Contents/MacOS/parameterized-app.sh
Now, close Terminal and move your application (which must not be running right now) to a different folder and back again. This will update Launch Services, otherwise your changes will be ignored and irritate you immensely.

Now, when you open your application, it will actually execute the .sh file, which will in turn launch the actual executable file, sending the command line args along.

It will look and behave like you expect it to, but you will need to repeat this whenever you update your application, as this will generally replace the application bundle and all the changes you made.

Cross-Origin Resource Sharing

Apache

In the folders where your JavaScript files will be served from, create an .htaccess file with the following contents:

1
Header add Access-Control-Allow-Origin "*"

Nginx

Add the add_header directive to the location block that serves your JavaScript files:

1
2
3
location ~ ^/assets/ {
add_header Access-Control-Allow-Origin *;
}

js bind

1
2
3
4
5
6
7
8
9
10
11
window.name = 'gswin'
var geeks = {
name : "ABC",
printFunc: function(){
console.log(this.name,this);}
}

var printFunc2= geeks.printFunc;
printFunc2();
```

window.name = ‘gswin’
var geeks = {
name : “ABC”,
printFunc: function(){
console.log(this.name,this);}
}

var printFunc2= geeks.printFunc.bind(geeks);
printFunc2();
```

I have a file with function like a func.js like below

1
2
3
4
5
export const func = {
functionName: (data) => {
return something
}
}

In main.js

1
2
import {func} from './func.js'
Vue.prototype.$func = func

and you can use from all components if in script tag like below

1
this.$func.functionName(somedata)

or if template tag like

1
$func.functionName(somedata)

dom ready

1
2
3
4
5
document.addEventListener('readystatechange', function() {
if (document.readyState === "complete") {
init();
}
});