使用jquery制作计算器

Previously, I showed you how to use CSS border-radius property to create the following calculator. Now I will show you how to use jQuery to implement the functionality of the calculator.

之前,我向您展示了如何使用CSS border-radius属性创建以下计算器 。 现在,我将向您展示如何使用jQuery来实现计算器的功能。

添加jQuery (Adding jQuery)

We will be using jQuery in this project to respond to events when a user clicks on a button. We need to add the jQuery library to our application. I will use the cdnjs CDN library to add jQuery.

我们将在该项目中使用jQuery来响应用户单击按钮时的事件。 我们需要将jQuery库添加到我们的应用程序中。 我将使用cdnjs CDN库添加jQuery。

At the bottom of my index.html file, I will add the following script tag:

在index.html文件的底部,我将添加以下脚本标记:

<script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

处理运算符与数字按钮 (Handling operator vs number buttons)

Before writing my code, I decided to brainstorm how I would handle the functionality behind the calculator. I divide the buttons on the calculator into two groups: operator and number.

在编写代码之前,我决定集思广益,如何处理计算器背后的功能。 我将计算器上的按钮分为两组: 运算符数字

A number button would correspond to the numbers 0–9. All other buttons are operators.

一个数字按钮将对应于数字0–9。 所有其他按钮均为运算符。

我们运营的全局变量 (Global variables for our operation)

The next step is to determine how may global variables we will need. The global variables will hold the functionality of our calculator. For example, a user can enter the following sequence:

下一步是确定我们将如何需要全局变量。 全局变量将保留我们计算器的功能。 例如,用户可以输入以下顺序:

2 + 3 = 5

Likewise, a user can enter this much longer sequence:

同样,用户可以输入更长的序列:

2 + 3 * 4 / 5 - 6 = -2

When considering global variables initially, we might consider creating a new variable every time the user presses a key. This would not be very efficient. We would have to keep track of who knows how many variables as the user presses keys.

最初考虑全局变量时,我们可能会考虑在用户每次按键时创建一个新变量。 这将不是很有效。 我们必须跟踪谁知道用户按下按键时有多少个变量。

To improve on this, we can simplify things to only need four global variables:

为了对此进行改进,我们可以简化事情,只需要四个全局变量:

  • num1

    num1
  • num2

    num2
  • operator

    算子
  • total

Let me show you how this works. The first number the user presses is stored in variable num1. The operator (i.e. +, — , *, / or enter) is stored in the operator. The next number entered is stored in variable 2. Once the second operator is entered, the total is calculated. The total is stored in the variable total.

让我告诉你这是如何工作的。 用户按下的第一个数字存储在变量num1中。 运算符(即+,-,*,/或enter)存储在运算符中。 输入的下一个数字存储在变量2中。输入第二个运算符后,将计算总数。 总数存储在变量总数中。

A logical question would be what do you do with the third or fourth number that a user enters? The simple answer is that we reuse num1 and num2.

一个合理的问题是您将如何处理用户输入的第三个或第四个数字? 简单的答案是我们重用num1和num2。

Once the total has been calculated, we can replace the value in num1 with the total. We would then need to empty out the operator and num2 variables. Let’s walk through this with our second example from above:

一旦计算出总数,我们就可以将num1中的值替换为总数。 然后,我们需要清空运算符和num2变量。 让我们从上面的第二个示例开始学习:

2 + 3 * 4 / 5 - 6 = -2// num1 is assigned value of 2// operator is assigned value of +// num2 is assigned value of 3// total is assigned the value of 5// num1 is assigned the value of 5// num2 and operator are cleared// operator is assigned value of *// num2 is assigned value of 4// total is assigned value of 20// num1 is assigned value of 20// num2 and operator are cleared// operator is stored value of /// num2 is assigned value of 5// total is assigned value of 4// num1 is assigned value of 4// num2 and operator are cleared// operator is assigned value of -// num2 is assigned value of 6// total is assigned value of -2// num1 is assigned value of -2// num2 and operator are cleared// operator is assigned value of =

Now you see that we can handle every possible combination of buttons pressed by the user by using these 4 variables.

现在,您看到我们可以使用这4个变量来处理用户按下的按钮的所有可能组合。

获取用户按下的键 (Getting the key the user pressed)

Now that we have walked through our logic, we need to start the process of handling the key the user pressed. At the bottom of my index.html file, I will create a script tag that will hold my code.

现在我们已经遍历了逻辑,我们需要开始处理用户按下的键的过程。 在index.html文件的底部,我将创建一个脚本标记,该标记将保存我的代码。

The first step is to get the key that a user pressed. Here is a snippet of my index.html file that shows all the buttons on one row of the calculator:

第一步是获取用户按下的键。 这是我的index.html文件的片段,其中显示了计算器的一行上的所有按钮:

<div class="flex-row">    <button class="calc-btn">1</button>    <button class="calc-btn">2</button>    <button class="calc-btn">3</button>    <button class="calc-btn">+</button></div>

Every button, whether it is a number or an operator, is defined using a <button><;/button> element. We can use this to catch when a user clicks on a button.

每个按钮(无论是数字还是运算符)均使用<button>< ; / button>元素定义。 我们可以使用它来捕获用户单击按钮时的情况。

In jQuery, you can have a button click function. When a button is clicked, the function is passed an event object. The event.target will contain the button that was clicked. I can get the value of the button by using the innerHTML property.

在jQuery中,您可以具有按钮单击功能。 单击按钮时,该函数将传递一个事件对象。 event.target将包含已单击的按钮。 我可以通过使用innerHTML属性来获取按钮的值。

Here is the code that will console.log the button that a user clicks.

这是将控制台记录用户单击按钮的代码。

<script>$(document).ready(function() {    $('button').on('click', function(e) {        console.log('e', e.target.innerHTML);    });});</script>

Now if you test the code, you will see the value of the key that you press. This works for every button in the calculator.

现在,如果您测试代码,您将看到您按下的键的值。 这适用于计算器中的每个按钮。

创建我们的全局变量 (Creating our global variables)

Now that we have the ability to determine what key was pressed, we need to start storing them in our global variables. I am going to create my four global variables:

现在我们可以确定按下了什么键,我们需要开始将它们存储在全局变量中。 我将创建四个全局变量:

let num1 = '';let num2 = '';let operator = '';let total = '';

单击时的处理按钮 (Handling button when clicked)

When a user clicks a button, they will be clicking on a number or an operator. For that reason I am going to create two functions:

当用户单击一个按钮时,他们将单击一个数字或一个运算符。 因此,我将创建两个函数:

function handleNumber(num) {    // code goes here}
function handleOperator(oper) {    // code goes here}

In my button click function earlier, I can replace the console.log with a call to the appropriate function. To determine whether a button or operator was clicked, I can compare e.target.innerHTML to see if it is between 0 and 9. If it is, the user clicked a number. If not, the user clicked an operator.

在前面的按钮单击功能中,我可以使用对适当功能的调用来替换console.log。 要确定是否单击了按钮或操作符,我可以比较e.target.innerHTML以查看它是否在0到9之间。如果是,则用户单击一个数字。 如果不是,则用户单击一个运算符。

Here is my initial step to test to make sure I can tell which button was clicked:

这是我测试的第一步,以确保我可以知道单击了哪个按钮:

$(document).ready(function() {    $('button').on('click', function(e) {        let btn = e.target.innerHTML;        if (btn >= '0' && btn <= '9') {            console.log('number');        } else {            console.log('operator');        }    });});

Once I am satisfied that I am identifying each button clicked, I can replace the console.log with a call to the appropriate function:

一旦确定要确定单击的每个按钮,就可以用对适当函数的调用替换console.log:

$(document).ready(function() {    $('button').on('click', function(e) {        let btn = e.target.innerHTML;        if (btn >= '0' && btn <= '9') {            handleNumber(btn);        } else {            handleOperator(btn);        }    });});

处理数字按钮 (Handling number buttons)

When a user presses a number, it will be assigned to either num1 or num2 variable. num1 is assigned value of ''. We can use this to determine what variable to assign the number. If num1 is empty then we assign the number to it. Otherwise, we assign it to num2.

当用户按下数字时,它将被分配给num1或num2变量。 num1被赋值为'' 。 我们可以使用它来确定要分配数字的变量。 如果num1为空,则我们为其分配编号。 否则,我们将其分配给num2。

Here is what my handleNumber function looks like:

这是我的handleNumber函数的样子:

function handleNumber(num) {    if (num1 === '') {        num1 = num;    } else {        num2 = num;    }}

处理操作员按钮 (Handling operator buttons)

Our function to handle when an operator button is pressed is very simple. All we need to do is to assign the value to our operator variable.

我们在按下操作员按钮时的功能非常简单。 我们要做的就是将值分配给我们的运算符变量。

Here is what my handleOperator function looks like:

这是我的handleOperator函数的样子:

function handleOperator(oper) {    operator = oper;}

显示按钮 (Displaying Buttons)

The next step is to actually display the button pressed to the user. If you check out the functionality of the calculator on your phone, you will notice it only displays numbers. If a user presses the + key, it is not displayed.

下一步是实际显示按下给用户的按钮。 如果您在手机上签出计算器的功能,您会发现它仅显示数字。 如果用户按+键,则不会显示。

In our index.html file, we have a div with a class of 'calc-result-input' that displays our input. We will use this to display numbers to our users.

在我们的index.html文件中,我们有一个div,其中包含'calc-result-input' ,用于显示我们的输入。 我们将使用它来向我们的用户显示数字。

Since we have separated out our calculator activity into functions, we will create a function to display the button.

由于我们已将计算器活动划分为函数,因此我们将创建一个函数来显示按钮。

Here is what my displayButton function looks like:

这是我的displayButton函数的样子:

function displayButton(btn) {    $('.calc-result-input').text(btn);}

Since we only update the display when the user presses a number, we can call the displayButton function from within the handleNumber function.

因为我们仅在用户按下数字时更新显示,所以我们可以从displayButton函数中调用handleNumber函数。

Here is what my handleNumber function looks like now:

这是我的handleNumber函数现在的样子:

function handleNumber(num) {    if (num1 === '') {        num1 = num;    } else {        num2 = num;    }    displayButton(num);}

处理总计 (Handling totals)

The next step is to calculate a total. A total is only calculated after a user presses an operator after having a value assigned to num1 and num2.

下一步是计算总数。 只有在用户将值分配给num1 num2之后按下操作员之后,才计算总计。

For example, if the user enters:

例如,如果用户输入:

2 + 3 =

We want to sum num1 and num2 and display the total.

我们要对num1和num2求和并显示总数。

If the user enters:

如果用户输入:

2 - 1 =

We want to subtract num2 from num1 and display the total.

我们要从num1中减去num2并显示总数。

We create a handleTotal function to handle this. This function will create a total based on the operator pressed. Since there are multiple operators that can be pressed, we will use a case statement to handle them.

我们创建一个handleTotal函数来处理此问题。 此功能将根据所按下的操作员创建总计。 由于可以按下多个运算符,因此我们将使用case语句来处理它们。

For simplicity’s sake, I am only going to show the code to handle when the user clicks the + operator button.

为简单起见,我将仅显示当用户单击+操作符按钮时要处理的代码。

Here is the handleTotal function:

这是handleTotal函数:

function handleTotal() {    switch (operator) {        case '+':            total = +num1 + +num2;            displayButton(total);            break;    }}

将字符串转换为数字进行计算 (Converting String to Number for calculation)

When we get the innerHTML of the button that is pressed, we get a string value. To sum two variables, they need to be converted to a number. There is a shorthand notation in JavaScript that will convert a string to a number by prefixing the variable with a + sign. You can see where I am doing this conversion on this line:

当我们获得按下的按钮的innerHTML时,我们得到一个字符串值。 要对两个变量求和,需要将它们转换为数字。 JavaScript中有一种简写的表示法,它将通过在变量前面加上+号来将字符串转换为数字。 您可以在此行上看​​到我在哪里进行此转换:

total = +num1 + +num2;

何时调用handleTotal函数 (When to call handleTotal function)

Now that we have a function to calculate the total, we need to call it at the appropriate time. We only calculate total after a user enters their second operator.

现在我们有了一个计算总数的函数,我们需要在适当的时候调用它。 我们仅在用户输入第二个运算符之后才计算总计。

To handle this we will need to make a change to our existing handleOperator function. Previously, we were assigning the operator variable the value of the operator button the user clicked. Now we need to know if this is the first operator the user has clicked or not. We don’t calculate a total when the user clicks on the first operator.

为了解决这个问题,我们需要对现有的handleOperator函数进行更改。 以前,我们为操作员变量分配了用户单击的操作员按钮的值。 现在,我们需要知道这是否是用户单击的第一个操作员。 用户单击第一个运算符时,我们不计算总数。

To account for this, we can check to see if the operator variable has a value of ''. If so, this is the first operator. If operator has a value, then we will want to calculate a total.

为了解决这个问题,我们可以检查,看看是否操作变量的值'' 。 如果是这样,这是第一个运算符。 如果运算符具有值,那么我们将要计算总数。

Here is what the handleOperator() function looks like now:

这是handleOperator()函数现在的样子:

function handleOperator(oper) {    if (operator === '') {        operator = oper;    } else {        handleTotal();        operator = oper;    }             }

将脚本移至app.js文件 (Moving Script to app.js file)

Currently our HTML and JavaScript code are all contained in the index.html file. We want to split out the logic into a separate file. I create a new file called app.js.

当前,我们HTML和JavaScript代码都包含在index.html文件中。 我们想将逻辑拆分成一个单独的文件。 我创建一个名为app.js的新文件。

I copy the entire contents of the <script> tag into this file. I delete the opening &lt;script> tag and closing </script> tag in my index.html file.

我将<scri pt>标记的全部内容复制到此文件中。 我删除了index.html文件中的优化ening &l script>标签and closi </ script>标签。

The last thing we need to do is to tell our index.html file where our scripts are. We do this by adding this line below the <script> tag that loads jQuery at the bottom of the index.html file:

我们需要做的最后一件事是告诉我们的index.html文件我们的脚本在哪里。 为此,我们在<scri pt>标签下面添加了以下行,该标签将jQuery加载到index.html文件的底部:

<script src="app.js"></script>

最终文件 (Final Files)

I now have these three files:

我现在有以下三个文件:

  • index.html

    index.html
  • app.js

    app.js
  • style.css

    style.css

The index.html file is used to display the calculator to the user on the web page.

index.html文件用于在网页上向用户显示计算器。

The style.css is used to style my calculator. Please review my previous article that talks about using the CSS border-radius property to style the calculator.

style.css用于为计算器设置样式。 请查看我以前的文章,该文章讨论如何使用CSS border-radius属性设置计算器的样式。

The app.js file contains the logic behind the calculator.

app.js文件包含计算器背后的逻辑。

Here is what my app.js file looks like:

这是我的app.js文件的样子:

let num1 = '';let num2 = '';let operator = '';let total = '';
$(document).ready(function() {    $('button').on('click', function(e) {        let btn = e.target.innerHTML;        if (btn >= '0' && btn <= '9') {            handleNumber(btn);        } else {            handleOperator(btn);        }    });});
function handleNumber(num) {    if (num1 === '') {        num1 = num;    } else {        num2 = num;    }    displayButton(num);}
function handleOperator(oper) {    if (operator === '') {        operator = oper;    } else {        handleTotal();        operator = oper;    }}
function handleTotal() {    switch (operator) {        case '+':            total = +num1 + +num2;            displayButton(total);            break;        case '-':            total = +num1 - +num2;            displayButton(total);            break;        case '/':            total = +num1 / +num2;            displayButton(total);            break;        case 'X':            total = +num1 * +num2;            displayButton(total);            break;    }    updateVariables();}
function displayButton(btn) {    $('.calc-result-input').text(btn);}
function updateVariables() {    num1 = total;    num2 = '';}

摘要 (Summary)

Our calculator works, but only if the user clicks the + operator. You can add to the functionality in the handleTotal function to account for all operators. I have all the functionality in my repo which you can find here.

我们的计算器可以工作,但前提是用户单击+运算符。 您可以在handleTotal函数中添加功能以说明所有运算符。 我的仓库中有所有功能,您可以在此处找到 。

进一步阅读 (Further Readings)

Breadth First Search in JavaScript — The two most common methods of searching a graph or a tree are depth first search and breadth first search. This story shows you how to use a breadth first search of a graph or a tree.

JavaScript中的广度优先搜索 -搜索图形或树的两种最常见的方法是深度优先搜索和广度优先搜索。 这个故事向您展示如何使用图形或树的广度优先搜索。

Instantiation Patterns in JavaScript — Instantiation patterns are ways to create something in JavaScript. JavaScript provides four different methods to create objects. Learn how to create all four in this article.

JavaScript中的实例化模式-实例化模式是在JavaScript中创建内容的方法。 JavaScript提供了四种创建对象的不同方法。 在本文中学习如何创建所有四个。

Using Node.js & Express.js to save data to MongoDB Database — The MEAN stack is used to describe development using MongoDB, Express.js, Angular.jS and Node.js. In this tutorial I will show you how to use Express.js, Node.js and MongoDB.js. We will be creating a very simple Node application, that will allow users to input data that they want to store in a MongoDB database.

使用Node.js和Express.js将数据保存到MongoDB数据库中 -MEAN堆栈用于描述使用MongoDB,Express.js,Angular.jS和Node.js的开发。 在本教程中,我将向您展示如何使用Express.js,Node.js和MongoDB.js。 我们将创建一个非常简单的Node应用程序,该应用程序将允许用户输入要存储在MongoDB数据库中的数据。

翻译自: https://www.freecodecamp.org/news/programming-a-calculator-8263966a8019/

使用jquery制作计算器

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. ping计算机名获取IP

    如何ping别人的计算机名来获取IP? 获取别人的IP,是作为骇客或是黑客必要的步骤。那么,怎么来获取IP呢? 今天想试着用arp命令干点坏事来陶冶一下情操,当我ping电脑名查询IP时,发现返回的是[fe80::64ca:cb99:2e4d:bd27%13]32位字节数据。于是我百度了几小时,终于找…...

    2024/4/28 1:04:37
  2. 割双眼皮一年疤痕图片大全

    ...

    2024/4/28 13:49:41
  3. 南宁双眼皮梦想整形前沿

    ...

    2024/4/21 13:38:34
  4. 张娇娇定制双眼皮怎么样

    ...

    2024/4/21 13:38:33
  5. 全切双眼皮特别痛吗

    ...

    2024/4/28 13:40:30
  6. 韩式三点双眼皮怎么护理

    ...

    2024/4/28 21:32:36
  7. js预览本地资源

    浏览器中的JavaScript不能直接直接访问本地资源&#xff08;例如文件系统&#xff0c;摄像头&#xff0c;麦克风等&#xff09;&#xff0c;除非事先得到了用户的允许。浏览器之所以进行该限制也是很有必要的&#xff0c;试想一下&#xff0c;如果JavaScript能够肆无忌惮的访问…...

    2024/4/21 13:38:30
  8. ionic开发-使用ngCordova增强设备调用能力

    什么是ngCordova ngCordova是在Cordova Api基础上封装的一系列开源的AngularJs服务和扩展&#xff0c;让开发者可以方便的在HybridApp开发中调用设备能力&#xff0c;即可以在AngularJs代码中访问设备能力Api。ngCordova是结合cordova和angular包装了许多插件&#xff0c;诸如访…...

    2024/4/21 13:38:29
  9. 2.Ionic 环境搭建(ios创建环境运行)

    前言的前言&#xff1a; 昨天折腾了一天&#xff0c;主要是公司网络不给力&#xff0c;Xcode下了一天啊&#xff01;&#xff01;&#xff01;晚上背着电脑回家继续搞&#xff0c;才把ios环境运行出来。所以今天就乘热打铁&#xff0c;把昨天的血泪史记下来&#xff0c;以此祭…...

    2024/4/21 13:38:29
  10. ionic3+cordova使用qr扫描仪

    1.下载好qrcode的cordova插件&#xff1a;ionic cordova plugin add codova-plugin-qrscanner 2.下载好npm install --save ionic-native/qr-scanner 3.创建一个扫描仪页面&#xff0c;整个页面都是拿来作扫描的界面&#xff0c;这个界面在调用qrscanner对象的scan方法&#xf…...

    2024/4/21 13:38:28
  11. .NET in Browser - Blazor

    什么是BlazorBlazor 是一个实验性的. NET web 框架, 使用 C# 和 HTML 在任何浏览器中不需要插件即可运行 WebAssembly 程序集。什么是WebAssemblyWebAssembly是一种新的适合于编译到Web的&#xff0c;可移植的&#xff0c;大小和加载时间高效的格式&#xff0c;是一种新的字节码…...

    2024/4/21 13:38:26
  12. NO.14 关于ROS2的第一个程序

    零蚀 这应该也会很困扰一些没有过ros开发&#xff0c;又想直接ros2开始的人吧 开启第一个ros2程序 从环境搭建开始 如果没有经历过ros的开发&#xff0c;在macos上开发ros2你可能会很凌乱&#xff0c;这些都是啥&#xff0c;到底该怎么开发&#xff0c;用什么ide&#xff0c;怎…...

    2024/4/21 13:38:25
  13. cordova调用摄像机,并上传文件

    1.什么是cordova 1.cordova是一个能够提供设备服务器的组件&#xff0c;比如摄像头&#xff0c;网络连接&#xff0c;文件传输等等。 2.下面我要说明的demo案例是。ionicangularcorodova调用摄像头实现的文件上传至本地和远程服务端。 3.首先要说明的一个对象时cordova里面的…...

    2024/4/21 13:38:24
  14. 双眼皮7个月竖线

    ...

    2024/4/21 13:38:23
  15. web前端之HTML5 在桌面端实现拍照功能一 video (typescript)

    前言 关于在桌面端通过调用摄像头拍照的需求&#xff0c;可能没有那么主流&#xff0c;因为现在大多数都通过移动端&#xff08;手机&#xff0c;平板&#xff09;完成&#xff0c;但是如果有需求就要想办法实现&#xff0c;通过查阅资料了解到目前浏览器摄像头拍照有几种实现…...

    2024/4/21 13:38:22
  16. ping 加上时间信息

    如果要实现 ping 加时间信息,然后还要实时保存到一个文件中,那么就与awk结合1、只用ping信息 [root@zhang pingbackage]# ping 115.239.211.112 PING 115.239.211.112 (115.239.211.112) 56(84) bytes of data. 64 bytes from 115.239.211.112: icmp_seq=1 ttl=53 time=27.1 …...

    2024/4/21 13:38:21
  17. JetBrains IDE在OSX 10.14以上版本无法获取麦克风、摄像头以及权限解决办法

    前言 由于最近公司的大部分用户的mac系统都覆盖到了10.14以上&#xff0c;而且最近开发从QTCreator 迁移到了Clion上&#xff08;不得不说Clion确实强大&#xff09;&#xff0c;结果遇到了Clion 调试遇到麦克风/摄像头权限时无法获取权限&#xff0c;导致调试的程序被OSX系统…...

    2024/4/20 15:52:45
  18. ionic3 实现扫码功能

    ionic3 通过插件 phonegap-plugin-barcodescanner&#xff0c;调用机器硬件摄像头实现扫码功能。首先当然先了解下 phonegap-plugin-barcodescanner&#xff0c;这个插件。支持的平台 Android的iOS版Windows&#xff08;Windows / Windows Phone 8.1和Windows 10&#xff09;…...

    2024/4/20 15:52:43
  19. 割完双眼皮后要冰敷多久

    ...

    2024/4/20 15:52:45
  20. 双眼皮内双眼皮区别

    ...

    2024/4/20 15:52:41

最新文章

  1. 命令执行漏洞【2】vulhub远程命令执行漏洞复现

    1.vulhub安装启动靶场环境 &#xff08;1&#xff09;s2-061开启靶场 &#xff08;2&#xff09;s2-059开启靶场 2.漏洞复现 &#xff08;1&#xff09;s2-061漏洞复现 github获取漏洞利用工具 开始利用 &#xff08;2&#xff09;s2-059漏洞复现 在linux特有临时目录/tmp下…...

    2024/4/28 23:08:50
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 关于ansible的模块 ③

    转载说明&#xff1a;如果您喜欢这篇文章并打算转载它&#xff0c;请私信作者取得授权。感谢您喜爱本文&#xff0c;请文明转载&#xff0c;谢谢。 接《关于Ansible的模块①》和《关于Ansible的模块②》&#xff0c;继续学习ansible的user模块。 user模块可以增、删、改linux远…...

    2024/4/18 10:52:09
  4. WPS二次开发专题:如何获取应用签名SHA256值

    作者持续关注WPS二次开发专题系列&#xff0c;持续为大家带来更多有价值的WPS开发技术细节&#xff0c;如果能够帮助到您&#xff0c;请帮忙来个一键三连&#xff0c;更多问题请联系我&#xff08;QQ:250325397&#xff09; 在申请WPS SDK授权版时候需要开发者提供应用包名和签…...

    2024/4/23 6:15:54
  5. 利用Spark将Kafka数据流写入HDFS

    利用Spark将Kafka数据流写入HDFS 在当今的大数据时代&#xff0c;实时数据处理和分析变得越来越重要。Apache Kafka作为一个分布式流处理平台&#xff0c;已经成为处理实时数据的事实标准。而Apache Spark则是一个强大的大数据处理框架&#xff0c;它提供了对数据进行复杂处理…...

    2024/4/28 10:02:59
  6. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/4/28 13:52:11
  7. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/4/28 3:28:32
  8. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/4/26 23:05:52
  9. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/4/28 13:51:37
  10. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/4/27 17:58:04
  11. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/4/27 14:22:49
  12. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/4/28 1:28:33
  13. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/4/28 15:57:13
  14. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/4/27 17:59:30
  15. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/4/25 18:39:16
  16. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/4/28 1:34:08
  17. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/4/26 19:03:37
  18. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/4/28 1:22:35
  19. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/4/25 18:39:14
  20. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/4/26 23:04:58
  21. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/4/27 23:24:42
  22. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/4/28 5:48:52
  23. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/4/26 19:46:12
  24. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/4/27 11:43:08
  25. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/4/27 8:32:30
  26. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  27. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  28. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  29. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  30. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  31. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  32. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  33. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  34. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  35. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  36. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  37. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  38. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  39. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  40. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  41. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  42. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  43. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  44. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  45. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57