【高级程序设计】Week2-4Week3-1 JavaScript

一、Javascript

1. What is JS

定义A scripting language used for client-side web development.
作用

an implementation of the ECMAScript standard

defines the syntax/characteristics of the language and a basic set of commonly used objects such as Number, Date

supported in browsers supports additional objects(Window, Frame, Form, DOM object)

One Java

Script?

Different brands and/or different versions of browsers may support different implementations of JavaScript.

– They are not fully compatible.

– JScript is the Microsoft version of JavaScript.

2. What can we do with JS

Create an interactive user interface in a webpage (eg. menu, pop-up alerts, windows)

Manipulate web content dynamically

Change the content and style of an element

Replace images on a page without page reload

Hide/Show contents

Generate HTML contents on the fly

Form validation

3. The lanuage and features

ValidationValidating forms before sending to server.
Dynamic writingClient-side language to manipulate all areas of the browser’s display, whereas servlets and PHPs run on server side.
Dynamic typingInterpreted language (interpreter in browser): dynamic typing.
Event-handlingEvent‐Driven Programming Model: event handlers.
Scope and FunctionsHeavyweight regular expression capability
Arrays and ObjectsFunctional object‐oriented language with prototypical inheritance (class free), which includes concepts of objects, arrays, prototypes

4. Interpreting JS

Commands are interpreted where they are found

– start with tag, then functions in <head> or in separate .js file

static JavaScript is run before is loaded

– output placed in HTML page

        • [document.write() ... dynamic scripting]

        • <SCRIPT> tags inside <BODY>

二、 Validation

<HTML><HEAD><SCRIPT><!--验证表单数据-->function validate(){if (document.forms[0].elements[0].value==“”) {alert(“please enter your email”);<!--alert弹出一个警告框,提示用户输入他们的电子邮件地址-->return false;}return true;}</SCRIPT></HEAD><!--FORM定义了一个表单--><!--method="get":使用GET方法来发送表单数据,将数据附加到URL的查询字符串中--><!--action="someURL":表单数据发送到的目标URL--><!--onSubmit="return validate()":在提交表单时调用函数"validate()"进行验证--><!--如果验证函数返回false,则表单不会被提交--><BODY><FORM method=“get” action=“someURL” onSubmit=“return validate()”><!--文本输入框使用<input>标签创建--><!--type="text":输入框的类型为文本,这个名称将在提交表单时用于标识输入框的值-->       <!--name="email":输入框的名称为"email"--><!--placeholder="":显示在输入框内的占位符文本,提示用户输入电子邮件地址--><input type=text name=“email”>enter your email<br><!--提交按钮使用<input>标签创建--><!--type="submit":指定按钮的类型为提交按钮-->       <!--value="send":按钮上显示的文本为"send"--><!--用户在文本输入框中输入完电子邮件地址并点击提交按钮时,表单将被提交,并调用函数"validate()"进行验证--><input type=submit value=“send”></FORM></BODY>
</HTML><html><head><script>var greeting=“Hello”;</script></head><body><script><!-- document.write()将带有 magenta 颜色的 "Hello" 和 "world!" 输出到页面中--><!--向页面写入一个 <font> 标签,并设置字体颜色为 magenta-->document.write(“<FONT COLOR=‘magenta’>”);<!--输出换行符 <br> 和文字 "world!"。通过 </FONT> 关闭之前打开的 <font> 标签-->document.write(greeting);document.write(“<br>world!</FONT>”);</script></body>
</html><HTML><HEAD>
<!--type="text/javascript"是 <script> 属性之一,指定嵌入的脚本语言类型,此处为 JavaScript--><SCRIPT type="text/javascript">function updateOrder() {const cakePrice = 1;var noCakes = document.getElementById("cake").value;document.getElementById("total").value = "£" + cakePrice*noCakes;}function placeOrder(form){ form.submit(); }</SCRIPT></HEAD><BODY><FORM method="get" action="someURL"><H3>Cakes Cost £1 each</H3><input type=text name="cakeNo" id="cake"onchange="updateOrder()">enter no. cakes<br><input type=text name="total" id="total">Total Price<br><input type=button value="send" onClick="placeOrder(this.form)"></FORM></BODY>
</HTML>

三、 Dynamic Typing

1. Type is defined by literal value you assign to it

2. Implicit conversion between types

"string1"+"string2" = "string1string2"   //string的拼接

10 + "string2"="10string2"                   //将int类型的10,转换成string

true + "string2" = "truestring2"             //将Boolean类型转换为string

.123 + "string2" = ".123string2"           //将float类型转换为string


10 + .123 = 10.123                             //将int转换为float,进行数值加减

true + .123 = 1.123                             //将Boolean类型转换为float,进行数值加减

false + 10 = 10                                   //将Boolean类型转换为int,进行数值加减

false + true = 1                                   //进行逻辑运算


a = 1; b = “20”;

c = a + b;//"120"

c = b + a;//"201"

// prefers numeric conversion with minus (and prefers string conversion with +).

c = a + (b-0);//21

// The empty string, forcing conversion into a string

c = a + “”;//"1"


x = 7; y = 4;

sum = x + y;//11

document.writeln(“x + y = ” + sum + “”);        //11

document.writeln(“x + y = ” + x+y + “”);         //74

document.writeln(“x + y = ” + (x+y) + “”);       //括号中的表达式被当作数值相加运算,11

3. Quotes within strings&writeln

Quotes within stringsdocument.write(“He said, \"That’s mine\" ”); 
document.write(‘She said, "No it\'s not" ');
• Beware of splitting over lines

writeln()-new lines

(avoid-not expected)

writeln: adds a return character after the text string
<br>:get a line break on the page
using headers:document.write(“<H1>Top level header”<H1>);
document.write(‘<br>’): get a line break

4. Comparison Operators

== and != doperform type conversion before comparison “5”==5 is true
=== and !== do not perform type conversion “5”===5 is false

const cakePrice = 1;        const bunPrice = 0.5;
var noCakes = document.getElementById("cake").value;
var noBuns = document.getElementById("bun").value; 
document.getElementById("count").value = noCakes + noBuns; document.getElementById("total").value = "£" + cakePrice*noCakes + bunPrice*noBuns;

5. Explicit Conversion Functions

eval()takes a string parameter and evaluates it

x = eval(“123.35*67”);        //123.35*67

eval(“x=1; y=2; x+y”);        //1+2

parseInt()
 
returns the first integer in a string; if no integer returns NaN.

parseInt(“xyz”)         //returns NaN

parseInt(“123xyz”)   //returns 123 as an integer

parseFloat()

parseFloat(“123.45xyz”) returns 123.45

isNaN()

returns true if input is not a number

isNaN(“4”)        //returns false

isNaN(4)          //returns false

isNaN(parseInt(“4”))         //returns false

isNaN(parseInt(“four”))     //returns true

Concatenation

issue with using +: implicit string conversion

parseInt(“99”)        //99

parseInt(99)          //99

parseInt(“99 red balloons”)        //99

字符串以 "0" 开头且后面紧跟着数字字符,则被假定为八进制。字符串"099"以 "0" 开头,因此parseInt()函数会将基数视为八进制。然而,数字 9 在八进制中是无效的,因此解析过程会停止,并返回十进制的结果,即99。

– This may affect code where trying to, e.g. parse dates and times.

<HTML><HEAD><SCRIPT type="text/javascript">function updateOrder() {const cakePrice = 1;const bunPrice = 0.5;var noCakes = document.getElementById("cake").value;var noBuns = document.getElementById("bun").value;document.getElementById("count").value = parseInt(noCakes, 10)+parseInt(noBuns, 10);document.getElementById("total").value = "£" + (cakePrice*noCakes + bunPrice*noBuns);}function placeOrder(form) { form.submit(); }</SCRIPT></HEAD><BODY><FORM method="get" action="someURL"><H3>Cakes Cost £1 each; Buns 50p each</H3><input type=text name="cakeNo" id="cake" onchange="updateOrder()">enter no. cakes<br><input type=text name="bunNo" id="bun" onchange="updateOrder()">enter no. buns<br><input type=text name="count" id="count">number of units<br><input type=text name="total" id="total">Total Price<br><input type=button value="send" onClick="placeOrder(this.form)"></FORM></BODY>
</HTML>

四、Event-handling

1. Event-Diven Programming

Event-Diven ProgrammingWeb browser generates an event whenever anything ‘interesting’ occurs.
registers an event handler
event handlers <input type=text name=“phone” ___>enter phone no.
focus event … onfocus event handler
blur event … onblur event handler
change event … onchange event handler
user types a char … onkeyup event handler
event handlers 
as HTML element attributes

<input type=“button” value=“push” onclick=validate()>

– Calls validate() function defined in <head> .
– Case insensitive (HTML): onClick=validate() .
– Can then force form to submit , e.g. document.forms[0].submit();

Main version used in course examples:

<form action=“someURL” onSubmit=“return validate()”> // textboxes

<input type=“submit” value=“send”> //  If onSubmit=validate() [ omit ‘ return ’], this will still send the user input to the server side even if it fails the validation.

2. Feedback (Forms and JavaScript, Event Handling)

write the HTML:

user guidance, 2 textboxes, button (not ‘submit’)

– name the elements
<form name = “form1”>
       Name <input type = “text” name = “usrname”/><br>
      Email <input type = “text” name = “usremail”/><br>
       <input type = “button” value = “Send”/>
</form>
getting the button

<input type = “submit” value = “Send”/>

Where and How to write JavaScript functions
function validate() {
   if (window.document.forms[0].usrname.value =="")
           window.alert(“Please enter name:”);
}
Global window object
<SCRIPT type="text/javascript" src="bun_validator.js">
</SCRIPT>

3. Dynamic Writing

Document Object Model & Empty String
• API for HTML and XML documents:
-Provides structural representation of a document , so its content and visual presentation can be modified.
-Connects web pages to scripts or programming languages.
• Navigating to elements and accessing user input: textboxes , textareas ...
<form name = “form1”>
        Name <input type=“text” name=“usrname”/> <br>
        Email <input type=“text” name=“usremail”/> <br>
        <input type=“buttononClick=“validate()” value=“Send”/>
</form>
focus() and  modifying the value
document.getElementById(“usrname").focus();
d = document.getElementById(“usrname");
if (d.value == “”)         d.value = “Please input!”;
Modifying the HTML page to notify
Name <input type=“text” name=“usrname”/> <br>
<p id=“name”></p> <font colour=“red”>
function validate() {
  var d = window.document.forms[0];
  if (d.usrname.value == “”)
     window.document.getElementById(“name”).innerHTML = “Enter”;
}

<html><head><script type=“text/javascript”>function validate() {if (document.forms[0].usrname.value==“”) {alert(“please enter name”);document.forms[0].usrname.focus();document.forms[0].usrname.value=“please enter name”;document.getElementById(“a”).innerHTML=“please enter name above”;} }</script></head><body><font face=“arial”><h1>Please enter details</h1><form>Name   <input type=“text” name=“usrname”> <br><font color=“red”> <p id="a"> </p></font><font face=“arial”>Email   <input type=“text” name=“email”> <br><br><input type=“button” value=“Send” onclick=“validate()”></form></body>
</html>

五、 Arrays and Objects

1. Strings & Intervals

Useful string functions for validation
if (ph.charAt(i)>=‘A’ && ph.charAt(i) <= ‘Z’)  // character at index i of this variable
if (ph.length < 9) // the length of this variable
if (ph.substring(0, 1) == ‘,’) // substring,  could first iterate through user input to extract all non-digits, then use substring to extract area code.
if (ph.indexOf('@') == 0) //  index of character (charAt ) ,  emails never start with @
setInterval()
<HTML>
        <HEAD>
                <TITLE>DHTML Event Model - ONLOAD</TITLE>
        <SCRIPT>
                var seconds = 0;
                function startTimer() { window.setInterval(“updateTime()”, 1000 ); }
                function updateTime() {
                        seconds++;
                        soFar.innerText = seconds;
                }
        </SCRIPT>
        </HEAD>
        <BODY ONLOAD = "startTimer()">
                <P>Seconds you have spent viewing this page so far:
                <A ID = “soFar” STYLE = “font-weight: bold”> 0 </A></P>//文本连接
         </BODY>
</HTML>
Handling DelayssetTimeout()delay before execution
setInterval()interval between execution
clearInterval()
clearTimeout()
setTimeout(myFunc(), 1) delay 1 ms
setTimeout(myFunc(),1000)delay 1 second
myVar = setInterval(myFunc(), 1000)
myVar = setInterval(myFunc(), 1000)

2. JavaScript and Functions

JavaScript functions are objectscan be stored in objects, arrays and variables
can be passed as arguments or provided as return values
can have methods (= function stored as property of an object)
can be invoked
call a function(Local call) directly: var x = square(4);
(Callback) in response to something happening: called by the browser, not by developer’s code: events; page update function in Ajax

3. Arrays and Objects

Array Literal
list = [“K”, “J”, “S”];
var list = [“K”, 4, “S”]; // mixed array
var emptyList = [];
var myArray = new Array(length);
// array constructor
employee = new Array(3);
employee[0] = “K”; employee[1] = “J”;
employee[2] = “S”;
document.write(employee[0]);
new Object() / /A new blank object with no properties or methods.
employee = new Object();
employee[0] = “K”;
var a = new Array();
new Array(value0, value1, ...);
employee = new Array(“K”, “J”, “S”);
document.write(employee[0]);
Sparse Arrays
new Array();  // Length is 0 initially; automatically extends when new elements are initialised.
employee = new Array();
employee[5] = “J”; // length:  6
employee[100] = “R”; //l ength :  101
length is found as employee.length
No array bounds errors.
Associative array or object
A = new Object();
A["red"] = 127;
A["green"] = 255;
A["blue"] = 64;
A = new Object();
A.red = 127;
A.green = 255;
A.blue = 64;

<html> <body>
   <script>
  var a = [];//object
  var b = new Array();//object
  var c = new Object();//object
  document.write(typeof(a) + " a<br>");
  document.write(typeof(b) + " b<br>");
  document.write(typeof(c) + " c");
   </script>
</body> </html>

4. Scope and local functions

html><head><title>Functions </title>
<script>y = 6;function square(x) {var y = x*x; // if didn’t include var, then y is the global yreturn y;}
</script></head>
<body>
<script>document.write(“The square of ” + y + “ is ”);//36document.write(square(y));document.write(“<P>y is ” + y);//6
</script>
</body></html>
JavaScript and ScopeClike languages have block scope:declare at first point of use
JavaScript has function scope:variables defined within a function are visible everywhere in the function
declare at the start/top of the function body.
Inner functions can access actual parameters and variables (not copies) of their outer functions.

六、Cookies

作用
allow you to store information between browser sessions, and
you can set their expiry date
默认browser session
包含A name-value pair containing the actual data.
An expiry date after which it is no longer valid.
The domain and path of the server it should be sent to.
Storing a cookie in a JavaScript program
document.cookie = “version=” + 4;
document.cookie = “version=” + encodeURIComponent(document.lastModified);
• Stores the name-value pair for the browser session.
• A cookie name cannot include semicolons,commas, or whitespace
– Hence the use of encodeURIComponent(value) .
– Must remember to decodeURIComponent() when reading the saved cookie.
document.cookie = "version=" + encodeURIComponent(document.lastModified) +
" ; max-age=" + (60*60*24*365);
only the name-value pair is stored in the name-value list associated with  document.cookie .
• Attributes are stored by the system.
//A Cookie to remember the number of visits
<html><head><title>How many times have you been here before?</title><script type="text/javascript">expireDate = new Date();expireDate.setMonth(expireDate.getMonth()+6);hitCt = parseInt(cookieVal("pageHit"));hitCt++;document.cookie= "pageHit=" + hitCt + ";expires=" + expireDate.toGMTString();function cookieVal(cookieName) {thisCookie = document.cookie.split("; ");for (i=0; i<thisCookie.length; i++) {if (cookieName == thisCookie[i].split("=")[0])return thisCookie[i].split("=")[1];}return 0;}</script></head><body bgcolor="#FFFFFF"><h2><script language="Javascript" type="text/javascript">document.write("You have visited this page " + hitCt + " times.");</script></h2></body>
</html>

七、PROBLEMS WITH USER INPUT

1. A Cautionary Tale: SQL Statements

Enter phone number to retrieve address
– ' ||'a'='a
– No validation
Name=value pair, PhoneNumber=‘||’a’=‘a, passed to serverServer side: access/update database information using SQL statements.
SELECT * FROM table_name WHERE phone=‘parameter

SELECT * FROM table_name WHERE phone=‘02078825555

SELECT * FROM table_name WHERE phone=‘asdsdaEN3

SELECT * FROM table_name WHERE phone=‘ ’||’a’=‘a
• i.e. SELECT * FROM table_name WHERE phone=‘’ OR ‘a’=‘a’

2. Further Examples of Event Handling

Buttonssubmitting to, e.g. CGI: <INPUT TYPE=“submit” value=“Send”>
onClick: <INPUT TYPE=“button” onClick=“doFunc()”>
Text Boxes<INPUT TYPE=“text” onFocus=“typeText()” onBlur=“typeNothing()”>
When the document is first loaded
<BODY οnlοad=doSomething()> or
(inside <script> tags): window.οnlοad=“doSomething”
//First set up array containing help text 
<HTML>
<HEAD><TITLE>Forms</TITLE><SCRIPT>var helpArray = [“Enter your name in this input box.”,“Enter your email address in this input box, \in the format user@domain.”,“Check this box if you liked our site.”,“In this box, enter any comments you would \like us to read.”,“This button submits the form to the \server-side script”,“This button clears the form”,“This TEXTAREA provides context-sensitive help. \Click on any input field or use the TAB key to \get more information about the input field.”];function helpText(messageNum) {document.myForm.helpBox.value = helpArray[messageNum];}function formSubmit() {window.event.returnValue = false;if (confirm(“Are you sure you want to submit?”))window.event.returnValue = true;// so in this case it now performs the action}function formReset() {window.event.returnValue = false;if (confirm(“Are you sure you want to reset?”))window.event.returnValue = true;}</SCRIPT>
</HEAD>
<BODY><FORM NAME = “myForm” ONSUBMIT = “formSubmit()”ACTION=http://localhost/cgi-bin/mycgi ONRESET = “return formReset()”>Name: <INPUT TYPE = “text” NAME = “name” ONFOCUS = “helpText(0)” ONBLUR = “helpText(6)”><BR>Email: <INPUT TYPE = “text” NAME = “email” ONFOCUS = “helpText(1)” ONBLUR = “helpText(6)”><BR>Click here if you like this site<INPUT TYPE = “checkbox” NAME = “like” ONFOCUS = “helpText(2)” ONBLUR = “helpText(6)”><BR>Any comments?<BR><TEXTAREA NAME = “comments” ROWS = 5 COLS = 45 ONFOCUS = “helpText(3)” ONBLUR = “helpText(6)”></TEXTAREA><BR><INPUT TYPE = “submit” VALUE = “Submit” ONFOCUS = “helpText(4)” ONBLUR = “helpText(6)”><INPUT TYPE = “reset” VALUE = “Reset” ONFOCUS = “helpText(5)” ONBLUR = “helpText(6)”><TEXTAREA NAME = “helpBox” STYLE = “position: absolute; right:0; top: 0” ROWS = 4 COLS = 45>This TEXTAREA provides context-sensitive help. Click on any input field or use the TAB key to get more information about the input field.</TEXTAREA></FORM>
</BODY>
</HTML>

//Element objects & ONLOAD
<HTML>
<HEAD><TITLE>Object Model</TITLE><SCRIPT>function start() {alert(pText.innerText);pText.innerText = “Thanks for coming.”;}</SCRIPT>
</HEAD>
<BODY ONLOAD = “start()”><P ID = “pText”>Welcome to our Web page!</P>//Changes when alert box is clicked.//pText.innerText or document.getElementById(“pText”).innerHTML
</BODY>
</HTML>//More inner text – from Microsoft (Altering Text)
<P ID=oPara>Here's the text that will change.</P>
<BUTTON onclick=“oPara.innerText=‘WOW! It changed!’”>Change text</BUTTON>
<BUTTON onclick=“oPara.innerText=‘And back again’”>Reset</BUTTON>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/151442.shtml

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

相关文章

Kotlin学习之函数

原文链接 Understanding Kotlin Functions 函数对于编程语言来说是极其重要的一个组成部分&#xff0c;函数可以视为是程序的执行&#xff0c;是真正活的代码&#xff0c;为啥呢&#xff1f;因为运行的时候你必须要执行一个函数&#xff0c;一般从主函数入口&#xff0c;开始一…

vue3学习记录之内置组件TransitionGroup基于状态变化的过渡和动画

文章目录 前言说明进入 / 离开动画移动动画渐进延迟列表动画和 <Transition> 的区别 前言 本文参考vue3 Vue 提供了两个内置组件&#xff0c;可以帮助我们制作基于状态变化的过渡和动画 <Transition > 会在一个元素或组件进入和离开 DOM 时应用动画。 <Transit…

设计模式-13-职责链(责任链)模式

经典的设计模式有23种&#xff0c;但是常用的设计模式一般情况下不会到一半&#xff0c;我们就针对一些常用的设计模式进行一些详细的讲解和分析&#xff0c;方便大家更加容易理解和使用设计模式。 1-原理和实现 职责链模式的英文翻译是Chain Of Responsibility Design Patter…

网络运维与网络安全 学习笔记2023.11.20

网络运维与网络安全 学习笔记 第二十一天 今日目标 交换网路径选择、Eth-Trunk原理、动态Eth-Trunk配置 Eth-Trunk案例实践、MUX VLAN原理、MUX VLAN配置 交换网路径选择 STP的作用 在交换网络中提供冗余/备份路径 提供冗余路径的同时&#xff0c;防止环路的产生 影响同网…

大数据基础设施搭建 - ZooKeeper

文章目录 一、上传压缩包二、解压压缩包三、本机安装3.1 修改配置文件3.1.1 创建ZooKeeper数据存储目录3.1.2 修改配置文件名3.1.2 修改配置文件内容 3.3 启动/停止服务端3.4 测试&#xff08;1&#xff09;启动客户端&#xff08;2&#xff09;测试客户端操作 四、集群安装4.1…

【C#】字符串拼接相关

目录 1.字符串拼接方式1 用号进行字符串拼接 复合运算符 2.字符串拼接方式2 3.控制台打印拼 4.例子 1.字符串拼接方式1 之前的算数运算符 只是用来数值类型变量进行数学运算的而 string 不存在算数运算符 不能计算 但是可以通过号来进行字符串拼接 用号进行字符串拼接 …

链表:C++实现

引言&#xff1a; 链表是一种常见的数据结构&#xff0c;它由一系列节点组成&#xff0c;每个节点包含一个数据元素和一个指向下一个节点的指针。相比于数组&#xff0c;链表具有动态性和灵活性&#xff0c;可以高效地进行插入和删除操作&#xff0c;但是查找操作的时间复杂度较…

Docker中的RabbitMQ已经启动运行,但是管理界面打不开

文章目录 前言一、解决方法方法一方法二 总结 前言 肯定有好多小伙伴在学习RabbitMQ的过程中&#xff0c;发现镜像运行&#xff0c;但是我的管理界面怎么进不去&#xff0c;或者说我第一天可以进去&#xff0c;怎么第二天进不去了&#xff0c;为什么每次重新打开虚拟机都进不去…

C#访问修饰符

C#中的访问修饰符用于控制类型成员&#xff08;如字段、属性、方法等&#xff09;的访问级别。以下是C#中常用的访问修饰符&#xff1a; public&#xff1a;公共访问级别&#xff0c;没有任何访问限制。在任何其他类或程序集中都可以访问标记为 public 的成员。 private&#…

应试教育导致学生迷信标准答案惯性导致思维僵化-移动机器人

移动机器人课程群实践创新的困境与突围 一、引言 随着科技的快速发展&#xff0c;工程教育变得越来越重要。然而&#xff0c;传统的应试教育模式往往侧重于理论知识的传授&#xff0c;忽视了学生的实践能力和创新精神的培养。这在移动机器人课程群的教学中表现得尤为明显。本文…

JavaScript的学习,就这一篇就OK了!(超详细)

目录 Day27 JavaScript(1) 1、JS的引入方式 2、ECMAScript基本语法 3、ECMAScript 基本数据类型​编辑 3.1 数字类型 3.2 字符串 3.3 布尔值 3.4 空值&#xff08;Undefined和Null&#xff09; 3.5 类型转换 3.6 原始值和引用值 4、运算符 5、流程控制语句 5.1 分…

INFINI Labs 产品更新 | 发布 Easysearch Java 客户端,Console 支持 SQL 查询等功能

近年来&#xff0c;日志管理平台越来越流行。使用日志管理平台可以实时地、统一地、方便地管理和查看日志&#xff0c;挖掘日志数据价值&#xff0c;驱动运维、运营&#xff0c;提升服务管理效率。 方案架构 Beats 是轻量级采集器&#xff0c;包括 Filebeat、Metricbeat 等。E…

给大伙讲个笑话:阿里云服务器开了安全组防火墙还是无法访问到服务

铺垫&#xff1a; 某天我在阿里云上买了一个服务器&#xff0c;买完我就通过MobaXterm进行了ssh&#xff08;这个软件是会保存登录信息的&#xff09; 故事开始&#xff1a; 过了n天之后我想用这个服务器来部署流媒体服务&#xff0c;咔咔两下就部署好了流媒体服务器&#x…

基于SSM的供电公司安全生产考试系统设计与实现

末尾获取源码 开发语言&#xff1a;Java Java开发工具&#xff1a;JDK1.8 后端框架&#xff1a;SSM 前端&#xff1a;Vue 数据库&#xff1a;MySQL5.7和Navicat管理工具结合 服务器&#xff1a;Tomcat8.5 开发软件&#xff1a;IDEA / Eclipse 是否Maven项目&#xff1a;是 目录…

云桌面 node_modules 切换艰辛历程记录 rebuild失败记录

拿到node_modules后更换 执行npm rebuild 重新构建 报错 node版本不一致 nvm切换 版本 不成功 换个窗口又变回原来版本号了 设置默认版本 nvm alias default 14.16.1 发现下面还有一个stable的还指向原来版本 nvm alias stable 14.16.1 rebuild 还是失败 逐个rebuild 每个依赖单…

2.FastRunner定时任务Celery+RabbitMQ

注意&#xff1a;celery版本和Python冲突问题 不能用高版本Python 用3.5以下&#xff0c;因为项目的celery用的django-celery 3.2.2 python3.7 async关键字 冲突版本 celery3.x方案一&#xff1a; celery3.xpython3.6方案二 &#xff1a; celery4.xpython3.7 解决celery执…

Python---PyCharm调试技巧--Step over(F8)、Step into(F7)

Step over&#xff08;F8&#xff09;&#xff1a;代码一步一步向下执行&#xff0c;但是遇到了函数以后&#xff0c;不进入函数体内部&#xff0c;直接返回函数的最终的执行结果。------------遇到函数跳过&#xff0c;直接执行最后的结果。 Step into&#xff08;F7&#xf…

UDP网络套接字编程

先来说说数据在网络上的传输过程吧&#xff0c;我们知道系统其实终究是根据冯诺依曼来构成的&#xff0c;而网络数据是怎么发的呢&#xff1f; 其实很简单&#xff0c;网络有五层。如下&#xff1a; 如上图&#xff0c;我们知道的是&#xff0c;每层对应的操作系统中的那些地方…

ESP32-BLE基础知识

一、存储模式 两种存储模式&#xff1a; 大端存储&#xff1a;低地址存高字节&#xff0c;如将0x1234存成[0x12,0x34]。小端存储&#xff1a;低地址存低字节&#xff0c;如将0x1234存成[0x34,0x12]。 一般来说&#xff0c;我们看到的一些字符串形式的数字都是大端存储形式&a…

龙芯 Loongson 架构 UOS 系统编译 Qt 5.15.2 源码

背景 需要在龙芯&#xff08;Loongson&#xff09;CPU&#xff0c;UOS 系统下&#xff0c;进行国产化项目适配&#xff0c;UOS 自带 Qt 5.11&#xff0c;但是版本过老&#xff0c;与目前基于 Qt 5.15.2 项目存在不兼容情况&#xff0c;故需要自行编译 Qt 5.15.2开发环境。 软…