【高级程序设计】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.rhkb.cn/news/199019.html

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

相关文章

Kotlin学习之函数

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

ES6中实现继承

本篇文章主要说明在ES6中如何实现继承&#xff0c;学过java的小伙伴&#xff0c;对class这个关键字应该不陌生&#xff0c;ES6中也提供了class这个关键字作为实现类的语法糖&#xff0c;咱们一起实现下ES6中的继承。 实现思路 首先直接通过class来声明一个Teacther类&#xff…

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

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

笔记55:长短期记忆网络 LSTM

本地笔记地址&#xff1a;D:\work_file\DeepLearning_Learning\03_个人笔记\3.循环神经网络\第9章&#xff1a;动手学深度学习~现代循环神经网络 a a a a a a a a a

使用Jupyter Notebook调试PySpark程序错误总结

项目场景&#xff1a; 在Ubuntu16.04 hadoop2.6.0 spark2.3.1环境下 简单调试一个PySpark程序&#xff0c;中间遇到的错误总结&#xff08;发现版对应和基础配置很重要&#xff09; 注意&#xff1a;在前提安装配置好 hadoop hive anaconda jupyternotebook spark zo…

开源与闭源:创新与安全的平衡

目录 一、开源和闭源的优劣势比较 一、开源软件的优劣势 优势 劣势 二、闭源软件的优劣势 优势 劣势 二、开源和闭源对大模型技术发展的影响 一、机器学习领域 二、自然语言处理领域 三、数据共享、算法创新与业务拓展的差异 三、开源与闭源的商业模式比较 一、盈…

使用npm发布自己的组件库

在日常开发中&#xff0c;我们习惯性的会封装一些个性化的组件以适配各种业务场景&#xff0c;突发奇想能不能建一个自己的组件库&#xff0c;今后在各种业务里可以自由下载安装自己的组件。 一. 项目搭建 首先直接使用vue-cli创建一个vue2版本的项目&#xff0c;并下载好ele…

【数据结构】前言

数据结构是在计算机中维护数据的方式。 数据结构是OI重要的一部分。 同的数据结构各有优劣&#xff0c;能够处理的问题各不相同&#xff0c;而根据具体问题选取合适的数据结构&#xff0c;可以大大提升程序的效率。 所以&#xff0c;学习各种各样的数据结构是很有必要的。 数据…

使用 VPN ,一定要知道的几个真相!

你们好&#xff0c;我的网工朋友。 今天想和你聊聊VPN。在VPN出现之前&#xff0c;企业分支之间的数据传输只能依靠现有物理网络&#xff08;例如Internet&#xff09;。 但由于Internet中存在多种不安全因素&#xff0c;报文容易被网络中的黑客窃取或篡改&#xff0c;最终造…

精密云工程:智能激活业务速率 ——华为云11.11联合大促倒计时 仅剩3日

现新客3.96元起&#xff0c;下单有机会抽HUAWEI P60 Art&#xff0c;福利仅限双十一&#xff0c;机会唾手可得&#xff0c;立即行动&#xff01; 双十一购物节来临倒计时&#xff0c;华为云备上多款增值产品&#xff0c;以最优品质迸发冬日技术热浪&#xff0c;满足行业技术应用…

一篇博客读懂双向链表

目录 一、双向带头循环链表的格式 二、链表的初始化和销毁 2.1链表的初始化 2.2链表的销毁 三、链表的检查与准备 3.1链表的打印 3.2创建新结点 四、链表增删查改 4.1尾插 4.2尾删 4.3头插 4.4头删 4.5查找 4.6任意位置前插入 4.7删除任意位置 一、双向带…

Android跨进程通信,IPC,RPC,Binder系统,C语言应用层调用

文章目录 Android跨进程通信&#xff0c;IPC&#xff0c;RPC&#xff0c;Binder系统&#xff0c;C语言应用层调用&#xff08;&#xff09;1.概念2.流程3.bctest.c3.1 注册服务&#xff0c;打开binder驱动3.2 获取服务 4.binder_call Android跨进程通信&#xff0c;IPC&#xf…

【日常】爬虫技巧进阶:textarea的value修改与提交问题(以智谱清言为例)

序言 记录一个近期困扰了一些时间的问题。 我很喜欢在爬虫中遇到问题&#xff0c;因为这意味着在这个看似简单的事情里还是有很多值得去探索的新东西。其实本身爬虫也是随着前后端技术的不断更新在进步的。 文章目录 序言Preliminary1 问题缘起1.1 Selenium长文本输入阻塞1.2…

解决 requests 2.28.x 版本 SSL 错误

最近&#xff0c;在使用requests 2.28.1版本进行HTTP post传输时&#xff0c;您可能遇到了一个问题&#xff0c;即SSL验证失败并显示错误消息(Caused by SSLError(SSLCertVerificationError(1, [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get loc…

深度学习OCR中文识别 - opencv python 计算机竞赛

文章目录 0 前言1 课题背景2 实现效果3 文本区域检测网络-CTPN4 文本识别网络-CRNN5 最后 0 前言 &#x1f525; 优质竞赛项目系列&#xff0c;今天要分享的是 &#x1f6a9; **基于深度学习OCR中文识别系统 ** 该项目较为新颖&#xff0c;适合作为竞赛课题方向&#xff0c;…

本地私域线上线下 线上和线下的小程序

私域商城是一种新型的零售模式&#xff0c;它将传统的线下实体店与线上渠道相结合&#xff0c;通过会员、营销、效率等方式&#xff0c;为消费者提供更加便利和高效的购物体验。私域商城的发展趋势表明&#xff0c;它将成为未来零售业的重要模式&#xff0c;引领零售业的创新和…

使用cli批量下载GitHub仓库中所有的release

文章目录 1\. 引言2\. 工具官网3\. 官方教程4\. 测试用的网址5\. 安装5.1. 使用winget安装5.2. 查看gh是否安装成功了 6\. 使用6.1. 进行GitHub授权6.1.1. 授权6.1.2. 授权成功6.2 查看指定仓库中的所有版本的release6.2.1. 默认的30个版本6.2.2. 自定义的100个版本6.3 下载特定…

.babyk勒索病毒解析:恶意更新如何威胁您的数据安全

导言&#xff1a; 在数字时代&#xff0c;威胁不断进化&#xff0c;其中之一就是.babyk勒索病毒。这种病毒采用高级加密算法&#xff0c;将用户文件锁定&#xff0c;并要求支付赎金以获取解密密钥。本文91数据恢复将深入介绍.babyk勒索病毒的特点、如何应对被加密的数据&#…

[C/C++]数据结构 链表(单向链表,双向链表)

前言: 上一文中我们介绍了顺序表的特点及实现,但是顺序表由于每次扩容都是呈二倍增长(扩容大小是自己定义的),可能会造成空间的大量浪费,但是链表却可以解决这个问题. 概念及结构: 链表是一种物理存储结构上非连续、非顺序的存储结构,数据元素的逻辑顺序是通过链表中的指针链接…

vue3之echarts区域折线图

vue3之echarts区域折线图 效果&#xff1a; 核心代码&#xff1a; <template><div class"abnormal"><div class"per">单位&#xff1a;{{ obj.data?.unit }}</div><div class"chart" ref"chartsRef"&g…