// kittydar.js - Find the locations of all the cats in an image. // (Heather Arthur wrote this library for real) // (but she didn't use modules, because it was 2013)
exportfunctiondetectCats(canvas, options) { var kittydar = newKittydar(options); return kittydar.detectCats(canvas); }
exportclassKittydar { ... several methods doing image processing ... }
// This helper function isn't exported. functionresizeCanvas() { ... } ...
// Both these modules export something named `flip`. // To import them both, we must rename at least one. import {flip as flipOmelet} from"eggs.js"; import {flip as flipHouse} from"real-estate.js"; ...
同样,你在导出变量的时候也可以重命名它们。这在你想使用不同名字导出相同功能的时候十分方便。
1 2 3 4 5 6 7 8 9 10 11
// unlicensed_nuclear_accelerator.js - media streaming without drm // (not a real library, but maybe it should be)
functionv1() { ... } functionv2() { ... }
export { v1 as streamV1, v2 as streamV2, v2 as streamLatestVersion };
链接:对于每个新加载的模块,在实现上都会创建一个作用域,并把模块中声明的所有变量都绑定在这个作用域上,包括从其他模块导入的变量。如果你想试试import {cake} from "paleo",但是“paleo”模块没真正导出名为cake的变量,你会得到一个错误。这很糟糕,因为你离运行js并品尝蛋糕只有一步之遥。
ES6 模块系统由 Dave Herman 和 Sam Tobin-Hochstadt进行设计,他们不顾多人(包括我)的反对,多年来始终坚持模块系统是静态的。JonCoppeard正在Firefox上实现ES6的模块化功能。JavaScript Loader的相关标准的工作也正在进行中,预计在HTML中将会被添加类似<script type=module> 这样的东西。
这便是 ES6 了。
这太有趣了,我不希望现在就结束。也许我们还能再说一会。我们还能够讨论一些关于ES6规范中零零碎碎的东西,但这些又不足够写成文章。也行会有一些关于ES6未来特性的一些东西,尽请期待下周的ES6 In Depth
分布式拒绝服务(DDoS:Distributed Denial of Service)攻击指借助于客户/服务器技术,将多个计算机联合起来作为攻击平台,对一个或多个目标发动DDoS攻击,从而成倍地提高拒绝服务攻击的威力。通常,攻击者使用一个偷窃帐号将DDoS主控程序安装在一个计算机上,在一个设定的时间主控程序将与大量代理程序通讯,代理程序已经被安装在网络上的许多计算机上。代理程序收到指令时就发动攻击。利用客户/服务器技术,主控程序能在几秒钟内激活成百上千次代理程序的运行。
关于反射式DRDoS原理
DRDoS是英文“Distributed Reflection Denial of Service ”的缩写,中文意思是“分布式反射拒绝服务”。与DoS、DDoS不同,该方式靠的是发送大量带有被害者IP地址的数据包给攻击主机,然后攻击主机对IP地址源做出大量回应,形成拒绝服务攻击。
将_config.yml文件中的配置项post_asset_folder设为true后,执行命令$ hexo new post_name,在source/_posts中会生成文章post_name.md和同名文件夹post_name。将图片资源放在post_name中,文章就可以使用相对路径引用图片资源了。
"additional_ports" : {}, // only works under multi-usermode "additional_ports_only" : false, // only works under multi-usermode "timeout": 120, "udp_timeout": 60, "dns_ipv6": false, "connect_verbose_info": 0, "redirect": "", "fast_open": true }
#!/bin/sh # chkconfig: 2345 90 10 # description: Start or stop the Shadowsocks R server # ### BEGIN INIT INFO # Provides: Shadowsocks-R # Required-Start: $network $syslog # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Description: Start or stop the Shadowsocks R server ### END INIT INFO