option

【前端之BOM和DOM】

☆樱花仙子☆ 提交于 2019-11-27 20:45:03
" 目录 #. window对象介绍 #. window子对象 1. 浏览器对象 navigator 2. 屏幕对象 screen 3. 历史 history 4. 地址(URL) location 5. 弹出框 /. 警告框 alert /. 确认框 confirm /. 提示框 prompt 6. 计时相关 /. 一次性 setTimeout() /. 周期性 setInterval() #. DOM 1. 查找标签 document /. 直接查找 /. 间接查找 2. 节点操作 /. 创建节点 /. 添加节点 /. 删除节点 /. 替换节点 /. 属性节点 /. attribute 操作 3. 获取值操作 4. class 操作 5. 指定CSS属性 #. 事件 #. window对象介绍 JavaScript分为: ECMAScript 、DOM、BOM. BOM(Browser Object Model)是指浏览器对象模型,它使JavaScript有能力与浏览器进行"对话". DOM(Document Object Model)是指文档对象模型,通过它可以访问HTML文档的所有元素. window对象是客户端的JavaScript最高层对象之一,由于window对象是其它大部分对象的共同祖先,在调用window对象的方法和属性时,可以省略window对象的引用 。例

Scala: convert string to Int or None

爱⌒轻易说出口 提交于 2019-11-27 19:37:39
I am trying to get a number out of an xml field ... <Quantity>12</Quantity> ... via Some((recipe \ "Main" \ "Quantity").text.toInt) Sometimes there may not be a value in the xml, though. The text will be "" and this throws an java.lang.NumberFormatException. What is a clean way to get either an Int or a None? Régis Jean-Gilles scala> import scala.util.Try import scala.util.Try scala> def tryToInt( s: String ) = Try(s.toInt).toOption tryToInt: (s: String)Option[Int] scala> tryToInt("123") res0: Option[Int] = Some(123) scala> tryToInt("") res1: Option[Int] = None More of a side note on usage

Why Some(null) isn't considered None?

為{幸葍}努か 提交于 2019-11-27 14:20:33
问题 I am curious: scala> Some(null) == None res10: Boolean = false Why isn't Some(null) transformed to None ? 回答1: You should use Option(null) to reach the desired effect and return None . Some(null) just creates a new Option with a defined value (hence Some ) which is actually null , and there are few valid reasons to ever create one like this in real code. 回答2: Unfortunately, null is a valid value for any AnyRef type -- a consequence of Scala's interoperability with Java. So a method that takes

【前端之BOM和DOM】 -- 2019-08-17 00:47:52

妖精的绣舞 提交于 2019-11-27 14:14:08
原文: http://blog.gqylpy.com/gqy/239 " 目录 #. window对象介绍 #. window子对象 1. 浏览器对象 navigator 2. 屏幕对象 screen 3. 历史 history 4. 地址(URL) location 5. 弹出框 /. 警告框 alert /. 确认框 confirm /. 提示框 prompt 6. 计时相关 /. 一次性 setTimeout() /. 周期性 setInterval() #. DOM 1. 查找标签 document /. 直接查找 /. 间接查找 2. 节点操作 /. 创建节点 /. 添加节点 /. 删除节点 /. 替换节点 /. 属性节点 /. attribute 操作 3. 获取值操作 4. class 操作 5. 指定CSS属性 #. 事件 #. window对象介绍 JavaScript分为: ECMAScript 、DOM、BOM. BOM(Browser Object Model)是指浏览器对象模型,它使JavaScript有能力与浏览器进行"对话". DOM(Document Object Model)是指文档对象模型,通过它可以访问HTML文档的所有元素. window对象是客户端的JavaScript最高层对象之一,由于window对象是其它大部分对象的共同祖先

DHCP配置

♀尐吖头ヾ 提交于 2019-11-27 13:29:01
DHCP服务器IP:192.168.1.10 一,安装dhcp [root@localhost ~]# yum install dhcp Loaded plugins: product-id, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. cdrom | 4.1 kB 00:00:00 Resolving Dependencies --> Running transaction check ---> Package dhcp.x86_64 12:4.2.5-27.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ============================================================================================= Package Arch Version Repository Size ==============================================

pssh

最后都变了- 提交于 2019-11-27 13:28:25
1、pssh 简介   PSSH提供OpenSSH和相关工具的并行版本。包括pssh,pscp,prsync,pnuke和pslurp。该项目包括psshlib,可以在自定义应用程序中使用。 pssh是python编写,可以并发在多台机器上批量执行命令的工具,用法可以媲美ansible的一些简单用法,执行起来速度比ansible快,支持文件并行复制,远程命令。 2、pssh安装 3、pssh包的命令介绍 pssh 在多个主机上并行运行命令 pscp 把文件并行复制到多个主机上 prsync 通过rsync协议把文件高效并行复制到多个主机上 pslurp 把文件并行地从多个远程主机复制到中心主机上 pnuke 并行地在多个远程主机上杀死进程 4、pssh包的命令参数说明及使用   为命令执行使用先准备一个主机列表文件,用于连接对应主机执行远程命令   内容可以是主机名,也可以直接填写IP, 格式"host[:port] [user]"   如:cat /home/pssh/pssh_hosts   192.168.1.122   xxx.xxx.xxx.xxx 1)pssh命令参数及使用:在多个主机上并行运行命令   pssh命令参数:  pssh Usage: pssh [OPTIONS] -h hosts.txt prog [arg0] .. -h --hosts 主机文件列表

vue使用echarts

筅森魡賤 提交于 2019-11-27 13:18:26
1.安装echarts npm install echarts -S 2.在main.js中引用echarts import echarts from 'echarts' Vue.prototype.$echarts = echarts 3.封装chart组件 在components中新建chart.vue <template> <div class="chart"> <div class="chart" :id="id" :option="option"></div> </div> </template> <script> export default { props: { id: { type: String }, option: { type: Object } }, mounted () { this.$echarts.init(document.getElementById(this.id)).setOption(this.option) } } </script> <style scoped> </style> 4.其他组件调用图表组件 <template> <div class="hello"> <Chart :id="id" :option="pieOption"></Chart> </div> </template> <script> import Chart

Asp.net core 2.2 Cookie验证

我与影子孤独终老i 提交于 2019-11-27 12:56:37
一、注册服务。 services.AddAuthentication(option => { option.DefaultScheme = "Cookie"; option.DefaultChallengeScheme = "Cookie"; option.DefaultAuthenticateScheme = "Cookie"; option.DefaultForbidScheme = "Cookie"; option.DefaultSignInScheme = "Cookie"; option.DefaultSignOutScheme = "Cookie"; }).AddCookie("Cookie",option=> { option.LoginPath = "/login"; option.AccessDeniedPath = "/forbidden"; }); 二、登录 注意:需要using Microsoft.AspNetCore.Authentication; 才能使用 HttpContext.SignInAsync var claims = new List<Claim> { new Claim("user","admin"), new Claim("role","1,2,3,4,5"), new Claim("id","1") }; await

android: changing option menu items programmatically

社会主义新天地 提交于 2019-11-27 11:04:20
Is it possible to change the option menu items programmatically? Can anyone provide me with an example please? Also, I want to disable certain items, so that they don't listen to the clicks, is it possible? For anyone needs to change the options of the menu dynamically: private Menu menu; // ... @Override public boolean onCreateOptionsMenu(Menu menu) { this.menu = menu; getMenuInflater().inflate(R.menu.options, menu); return true; } // ... private void hideOption(int id) { MenuItem item = menu.findItem(id); item.setVisible(false); } private void showOption(int id) { MenuItem item = menu

What's the difference between GNU99 and C99 (Clang)?

点点圈 提交于 2019-11-27 09:39:57
问题 I have saw the compiler option GNU99 and C99. What's the difference of them? Any detail documentation? (Clang, Xcode, Mac OS X) 回答1: Differences between various standard modes clang supports the -std option, which changes what language mode clang uses. The supported modes for C are c89, gnu89, c94, c99, gnu99 and various aliases for those modes. If no -std option is specified, clang defaults to gnu99 mode. Differences between all c* and gnu* modes: c* modes define __STRICT_ANSI__ . Target