我有这种一级树情况:
<select ng-model="tipost"
ng-options="tip.DESC group by tip.TIPIS for tip in tipall"><br>
</select>
Run Code Online (Sandbox Code Playgroud)
json在哪里:
[
{"ID":"1", "IDPARENT":"0", "TIPIS":"", "DESC":"GroupName1"},
{"ID":"2", "IDPARENT":"1", "TIPIS":"GroupName1", "DESC":"CHILDNAME1"},
{"ID":"3", "IDPARENT":"0", "TIPIS":"", "DESC":"GroupName2"}
]
Run Code Online (Sandbox Code Playgroud)
问题是,这会创建带有子项的optgroups,但也重复根:
- GroupName1
- GroupName2
[ GroupName1 ]
- CHILDNAME1
[ GroupName2 ]
Run Code Online (Sandbox Code Playgroud)
我想生产:
[ GroupName1 ]
- CHILDNAME1
[ GroupName2 ]
Run Code Online (Sandbox Code Playgroud)
这是一款赛狗游戏,有视频和玩家选择获胜者.根据他们的赌注,算法选择适当的视频以保持每个销售点的返回百分比,达到其指定的金额.
像这样的东西:
% Returning Specific Return Configuration, range: 50%~90%:
POS1: 65%
POS2: 78%
POS3: 50%
...
...
POSN: XX%
Run Code Online (Sandbox Code Playgroud)
每个POS都有不同的收入,应根据其配置返回:
Ex: [pos] [cashes] [should return] [returns] [step]
-------------------------------------------------------
POS1 100 65 60 44
POS2 100 78 50 45
POS3 500 250 150 45
Run Code Online (Sandbox Code Playgroud)
基于某些组合发生的回报较低,因此剩余被视为债务.这是因为每个商店都在销售如下数字:
POS1: [Cashes] ["Winners" Number] [Possible Return]
50 12 150
50 13 60
Run Code Online (Sandbox Code Playgroud)
所以该算法试图在有限的可能性中找到最接近的组合,返回该值+累计月债,基于每个步骤,如:
sum([should return]) of step 45
+ lowest not returned part of the month ([should return]-[returns])
of the stores present at that step (45) …Run Code Online (Sandbox Code Playgroud) 我试图在选项中使用添加按钮,但问题是ng-click触发但未选中该选项.
<ui-select ng-model="datactrl.newservice.selected" theme="selectize" ng-disabled="disabled" style="width: 100%;">
<ui-select-match placeholder="...">
<span ng-bind-html="$select.selected.name"></span>
</ui-select-match>
<ui-select-choices repeat="service in data.base_services | filter: $select.search">
<span ng-bind-html="service.name | highlight: $select.search"></span>
<!-- HERE NOT -->
<a href="" class="pull-right" ng-click="setnewservice()">
<i class="glyphicon glyphicon-plus-sign"></i>
</a>
<!-- ### -->
</ui-select-choices>
</ui-select>
<!-- here obviously works -->
<a href="" class="pull-right" ng-click="setnewservice()">
<i class="glyphicon glyphicon-plus-sign"></i>
</a>
Run Code Online (Sandbox Code Playgroud)
我可以向函数发送一些参数并处理这种情况,甚至选择该项目索引的点击链接,以便模型采用正确的值,或者像上面的工作样本中那样把它带到外面...
但是我怎样才能正确处理这个,停止事件,选择选项而不发送对象或它的一些属性,然后做其余的事情?
$scope.setnewservice = function ($event) {
$event.stopPropagation();
// ??
}
Run Code Online (Sandbox Code Playgroud) 我有一个应用程序 siteA.com,它加载到 siteB.com 内的 iframe 中。直接加载 siteA.com 时没有警告,但在 siteB.com 的 iframe 内时出现无法识别的内容安全策略指令“frame-ancestors” ;这仅在 Safari 中。
所有这些更改均在 siteA.com 中进行
元标记没有运气
<meta http-equiv="Content-Security-Policy" content="frame-ancestors siteB.com">
Run Code Online (Sandbox Code Playgroud)
我应该向 siteA.com 添加哪些标头以允许 Content-Security-Policy 指令框架祖先?
然后我尝试在主index.php中添加头部:
header("Content-Security-Policy: frame-ancestors 'self' siteB.com;");
Run Code Online (Sandbox Code Playgroud)
但仍然可以在 siteA 中工作,但不能在 siteB 中工作。
还添加到*.htaccess*
Header set Content-Security-Policy "frame-ancestors: siteB.com"
Run Code Online (Sandbox Code Playgroud)
但什么也没有。由于问题在 Safari 中出现,因此也尝试过
header("X-Frame-Options: ALLOW-FROM siteB.com");
Run Code Online (Sandbox Code Playgroud)
但这甚至会给出错误。
好的一点是,如果框架祖先 url 不正确,它根本不会在任何其他测试的浏览器中加载。
我究竟做错了什么?
我正在使用dotnetzip创建一些带有一些AES密码的zip文件,例如:
using (ZipFile zip = new ZipFile())
{
zip.Password = PASS;
zip.Encryption = EncryptionAlgorithm.WinZipAes256;
zip.AddFile("test.txt");
zip.Save("test.zip");
}
Run Code Online (Sandbox Code Playgroud)
在此之后,我注意到在没有指定算法的情况下读取文件没有问题
using (ZipFile zip = ZipFile.Read("test.zip")
{
zip.Password = PASS;
// zip.Encryption = EncryptionAlgorithm.WinZipAes256;
foreach (ZipEntry e in zip)
{
e.Extract(@"C:\tmp\");
}
}
Run Code Online (Sandbox Code Playgroud)
然后有些情况下提取产生了一些不可读的文件,但并非总是如此; 大部分时间都是完全可读的,没有指定算法.
现在基于他们的维基:
创建使用WinZip兼容的AES加密的Zip存档.由于担心
所有zip工具支持的标准密码保护功能都很薄弱,WinZip扩展了ZIP规范并添加了一种使用AES加密来保护Zip文件中条目的方法.
但不明白这是否真的是AES 256加密.
无论如何指定算法它只会提取可读文件,所以文件肯定是可读的,现在我关心的是安全性.
编辑 确保在解压缩之前指定密码算法,否则文件将无法读取!