pass

What Are High-Pass and Low-Pass Filters?

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Graphics and audio editing and processing software often contain functions called "High-Pass Filter" and "Low-Pass Filter". Exactly what do these do, and what are the algorithms for implementing them? 回答1: Wikipedia: High-pass filter Low-pass filter Band-pass filter These "high", "low", and "band" terms refer to frequencies . In high-pass, you try to remove low frequencies. In low-pass, you try to remove high. In band pass, you only allow a continuous frequency range to remain. Choosing the cut-off frequency depends upon your application.

Getting request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to send an Ajax request to a Tomcat server from my application, but I am getting this error (my web app is running on Chrome): Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 403. I have tried using 'Access-Control-Allow-Origin' : 'http://localhost:8080/app', but it didn't work. My Ajax code: var arr = [1]; $.ajax({ url: 'http://localhost:8080/app', type:

Test case execution order in pytest

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using pytest. I have two files in a directory. In one of the files there is a long running test case that generates some output. In the other file there is a test case that reads that output. How can I ensure the proper execution order of the two test cases? Is there any alternative other than puting the test cases in the same file in the proper order? 回答1: In general you can configure the behavior of basically any part of pytest using its well-specified hooks . In your case, you want the "pytest_collection_modifyitems" hook,

Laravel 5.1 : Passing Data to View Composer

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using view composers in Laravel 5.1: nice. But how can I pass parameters to a view composer ? In my case I send week info (previous, current, next week, including the dates) to my view with de view composer. The current week is variable, not only from an url, but also from the controller. public function compose(View $view) { // I need a parameter here (integers) } 回答1: If you have to pass parameters from a controller to a view composer, you can create a wrapper class for the composer and pass data to it whenever needed. Then, when you

PHP different one way hashes for password security

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was wondering to hash the password in PHP using different methods available and the combination of them for more and more security. I was wondering if this would work..? $pass = "***"; $salt = "!@)#%%@(#&@_!R151"; $pass = sha1($pass.$salt); $pass = md5($pass); 回答1: Rather than that, you can use a stronger hashing algorithm like sha512 with combination of a strong salt and UserID : Do it like this: echo hash('sha512', 'MyPassword' . $StrongSalt . $UserID); SHA512 is actually SHA-2 for which there are no collisions found. See at wikipedia .

How can I pass secret data to a container

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My Tomcat Container needs data that has to be well protected, i.e. passwords for database access and certificates and keys for Single Sign On to other systems. -e or -env-file to pass secret data to a container but this can be discovered with docker inspect ( -env-file also shows all the properties of the file in docker inspect). Another approach is to link a data container mount the secret data into my containers . This would work nicely with test- and production servers having different secrets. But it creates a dependency of the

How do I use bind to pass a member function as a function pointer?

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to pass a member function as a function pointer so that I don't need to rely on singletons or global functions to handle Qt messages in Qt 5. As far as I can tell my std::function is of the correct type, it has the correct signature, and bind should be allowing me to jam in the implicit this pointer, essentially passing off a member function as a global/un-owned function. void ProgramMessageHandler::setAsMessageHandlerForProgram() { std::function<void(QtMsgType, const QMessageLogContext &, const QString &)> funcPtr; funcPtr = std:

Encrypt password before storing in database?

匿名 (未验证) 提交于 2019-12-03 02:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a password being passed from my iPhone app to the database via a php script, user.php. The variable $pass is populated by the following: $pass = str_replace("'", "", $_REQUEST['pass']); How can I encrypt this before it's inserted into my database? I've read a little about the different techniques, but looking for the best way to manage this. Thanks to everyone. 回答1: If you don't care about retrieving the actual password's value (from the database encrypted value), you can run a one-way hash algorithm on it (such as sha1: http://php

How can I pass a parameter into a view in iOS?

匿名 (未验证) 提交于 2019-12-03 02:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: UIViewController *theController = [[HelpViewController alloc] initWithNibName:@"HelpView" bundle:nil]; [self.navigationController presentModalViewController:theController animated:TRUE]; Here's my code for showing my view. I know I can use app delegate variables, but it would be neater is I could pass a parameter in somehow, ideally using an enum. Is this possible? 回答1: Just create a new init method for your HelpViewController and then call its super init method from there... In HelpViewController.h typedef enum { PAGE1, PAGE2, PAGE3 }

一些 bypass WAF 技巧

∥☆過路亽.° 提交于 2019-12-03 02:56:33
也是之前讲课写的,现在搬运过来 --- WAF所处的位置 * 云WAF * 硬件WAF * 软件WAF * 代码级WAF WAF的绕过 1 架构层 1 对于云WAF,寻找真实ip 1 在子域名的ip段中找 2 信息泄漏 3 穷举ip 2 对于云WAF,利用同网段 3 WAF可能会进行两次URL解码 对输入进行两次url编码 4 编码问题 mysql默认的字符集是latin,因此在php代码里面设置的字符集为 utf-8,这只是客户端的字符集,因此存在字符集装换的问题utf-8—>latin,若传进来的字符集不是完整的字符,则会导致不完整的字符自动会忽略的问题,比如username=admin%c2 , 由于%c2不是一个完整的utf-8字符 因此传到Mysql 里面 自动忽略了,导致查出的是admin用户的数据,可以利用这个特性绕过。 为了便利性 牺牲安全性。(select * from admin where user=“Admin” 可以执行, mysql为了 使用的便利性 会允许一些 ‘错误’,比如 select * from admin where user=“Àdmin” 依然可移执行 2 资源限制角度 1 http请求body太大,WAF可能只检测前几k字节 3 协议层 1 协议未覆盖绕过 1 WAF没有实现对某种http协议的解析 2 文件包含,绝对路径绕过