最近,我的银行发给我这个小设备,它生成一个必须在执行在线交易时使用的唯一代码,当我按下一个特定的白色按钮时,所有设备都会生成这个唯一的代码,它看起来不像是连接到一个远程服务器或其他任何东西.
我做了一些研究,最后在密码学中使用了一种称为Hash函数的东西,但我仍然没有得到它.
我的问题
hash cryptography hmac one-time-password two-factor-authentication
我正在使用MaterialDrawer库为我的应用程序创建一个简单的抽屉,库中的一些类实例需要在调用时传递给它们的字符串.一个例子是这个IProfile
类:
IProfile profile = new ProfileDrawerItem().withName("John Doe");
其中withName()
方法接受的字符串.
我已经创建了一个类MyObservable.java
(扩展Observable)类,我打算用它来获取要在我MainActivity
实现MaterialDrawer库的数据.在这个类中,我有一个方法implementData()
,它可以从我的firebase数据库中获取我需要的内容.
这就是它的样子:
public class MyObservable extends Observable {
// Attach our firebase reference...
Firebase userRef = new Firebase("https://myApp.firebaseio.com/users");
AuthData authData;
public String username = "";
public String email = "";
public void changeUsername(String username) {
this.username = username;
setChanged();
notifyObservers(username);
}
public void implementData(){
// Get the authentication data of our user from the reference.
authData = userRef.getAuth();
// This …
Run Code Online (Sandbox Code Playgroud) 我有一个设置,其中Apache在端口80上的Varnish 4后面监听端口8080,但是我的客户端需要ssl在网站上工作,因此我使用本指南在端口443上设置Nginx用于SSL终止.
一切都在http上工作正常,但是在尝试在https上加载网站时,网站所需的脚本将无法加载,所以我决定将网站网址更改为Settings > General
https网址,保存更改后,我获得了重定向Chrome中的循环错误.
我无法访问该网站的wordpress仪表板来更改网址,所以我必须通过phpmyadmin这样做.但是现在当通过https访问该站点时,站点中断导致呈现内容所需的脚本未经过身份验证.
如何https
在Chrome中没有重定向循环的情况下启用该网站?
我目前正在为Apollo客户端使用vue-apollo包,并为我的GraphQl API使用带有django和graphene-python的VueJs堆栈。
我在下面用vue-apollo进行了简单的设置:
import Vue from 'vue'
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
import VueApollo from 'vue-apollo'
import Cookies from 'js-cookie'
const httpLink = new HttpLink({
credentials: 'same-origin',
uri: 'http://localhost:8000/api/',
})
// Create the apollo client
const apolloClient = new ApolloClient({
link: httpLink,
cache: new InMemoryCache(),
connectToDevTools: true,
})
export const apolloProvider = new VueApollo({
defaultClient: apolloClient,
})
// Install the vue plugin
Vue.use(VueApollo)
Run Code Online (Sandbox Code Playgroud)
我还settings.py …
我已经编写了下面的代码来计算大于或等于1的数字的阶乘.
Public Class FactorialApp
Private Function FactorialChecker(myNumber As Integer)
myNumber = Val(FactorialTextBox.Text)
If myNumber < 1 Then
FactorialChecker = 1
Else
FactorialChecker = myNumber * FactorialChecker(myNumber - 1)
End If
End Function
Public Sub ResultButton_Click(sender As Object, e As EventArgs) Handles ResultButton.Click
End Sub
End Class
Run Code Online (Sandbox Code Playgroud)
我希望在一个button_click
事件中有一个消息框,其中有一个类似于5的阶乘是点击时应该是5的120myNumber
和120的FactorialChecker()
函数,但是我不知道如何在VB的MsgBox
命令中返回值,我只是习惯了C#的.
我尝试了代码片段
MsgBox("The Factorial of + myNumber "is" + FactorialChecker() "")
Run Code Online (Sandbox Code Playgroud)
但是我被visual studio中的语法错误所困,还有一个错误,即我的myNumber
变量未在程序中声明.我该怎么办才能解决这些错误?