Digital currency JSP
warm tips:
1. The above information is for reference only, without any suggestions
2. It is risky to enter the market and investment should be cautious. Before making any investment, you should make sure that you fully understand the nature of the investment and the risks involved in the proct. After a detailed understanding and careful evaluation of the proct, you can judge whether to participate in the transaction
response time: January 4, 2021. Please refer to the official website of Ping An Bank for the latest business changes
[Ping An Bank I know] want to know more? Come and see "Ping An Bank I know" ~
https://b.pingan.com.cn/paim/iknow/index.html
Yesterday, I went to the electronic reading room. Not long after I plugged in the USB flash drive, the teacher suddenly asked everyone to unplug the USB flash drive. Some students found that all the files in the USB flash drive could not be opened, and there were two more documents asking for money
so everyone rushed to check, as long as the U disk inserted in the school computer were poisoned, large-scale computer poisoning occurred in the evening
a lot of people's information and graation thesis are in the computer. I really feel that hacker's behavior is disgusting. For the sake of money, regardless of the future of students, teachers' lifelong scientific research achievements...
hope to catch criminals as soon as possible and give them severe punishment by law
this virus will scan windows devices with open 445 file sharing port. As long as the user's device is on the Internet, hackers can implant blackmail software, remote control Trojan horse, virtual currency mining machine and other malicious programs in computers and servers
some security researchers point out that this large-scale network attack seems to be deployed through a worm application, and wannacry can spread among computers. What's more terrible is that unlike most malicious programs, this program can replicate and spread on its own in the network, and most of the current viruses still need to rely on the successful users to spread by cheating them to click the attachment with the attack code
the attack has affected 99 countries and as many as 75000 computers, but because the virus uses anonymous network and bitcoin anonymous transaction to obtain ransom, it is very difficult to track and locate the originator of the virus
EOS is a public chain system at the bottom of blockchain developed by block. One, which is specially designed to support decentralized application of Commerce, and its code is open source
bitcoin is called blockchain 1.0 because it opens up the world of digital cryptocurrency and takes a decisive step from 0 to 1
Ethereum is known as blockchain 2.0, because it provides Turing complete virtual machine that can run smart contracts, bringing unlimited possibilities
and EOS is called blockchain 3.0, why? Two words: performance
The positioning of EOS is the slogan of its home page:English: the most powerful infrastructure for decentralized applications
Chinese: the most powerful decentralized application infrastructure
EOS expects to be an enhanced version of Ethereum, a high-throughput intelligent contract platform
although Ethereum has complete functions, it is limited by its design choice. Due to the block output speed of 15 seconds, the transaction throughput is far from large-scale practical level, which is only about 30 ~ 40tps (transaction / s). EOS, on the other hand, has chosen a different technology route, with the goal of achieving a considerable million TPS, which is quite attractive considering visa's actual processing speed of 1700tps
consensus mechanism of EOS
the reason why the throughput of bitcoin and Ethereum is so low is that they are constrained by the application scenario they envision and the consensus mechanism they choose for the scenario - both of them assume that the environment in which the system runs is totally untrustworthy, so they both adopt the consensus mechanism of proof of work
consensus, as the name suggests, is to reach a unified understanding of something - for blockchain, something refers to the confirmation of the transaction - any node to submit a transaction needs everyone's approval
the pow mechanism currently adopted by bitcoin and Ethereum is the design of the legendary Nakamoto Tsung. Under this mechanism, in order to obtain the bookkeeping right and digital currency reward, miners need to constantly dig for the compliant hash value, and confirm and package the transaction data through the consensus of hash value. POW has no access threshold, and any node has equal rights to participate in bookkeeping. Of course, the probability of winning is related to computing power:
the price of ram is based on Bancor algorithm, that is, it is regulated by market supply and demand: if the supply of ram exceeds the demand, more EOS certificates are needed to buy ram, At this time, more EOS certificates can be obtained by selling ram
memory is a consuming resource, which cannot be redeemed and can only be bought and sold. Take the issue of currency on EOS as an example. At present, the issue of currency requires 20m of memory. An EOS can buy 20KB. According to the current storage price, issuing a currency will consume 1000 EOS. This is the source of EOS memory consumption
Course Overview
this course is for friends who are interested in the development of EOS decentralized application. The course covers the core concepts of EOS DAPP development, the development and deployment of smart contracts, and how the front page interacts with EOS blockchain. Finally, a complete DAPP development based on react and EOS is completed
Chapter 1: enter the world of EOS
to understand the core concepts of EOS, such as positioning and characteristics, consensus mechanism, payment computing model, etc
Chapter 2: Hi EOS
understand the overall framework of EOS node software and the functions of node server, wallet server and command-line tools, learn how to configure and start EOS node server and wallet server, and preliminarily understand the use of command-line tools
Chapter 3: wallet, key and account
understand the three core concepts related to personal identity in EOS: wallet, key and account, and learn how to use command-line tools to create wallet, key and account
Chapter 4: development and interaction of smart contracts
understand the concept and function of smart contracts, learn how to write and compile EOS smart contracts, and learn how to deploy and interact with contracts using command-line tools
understand the persistence mechanism of state in EOS smart contract, and learn to use multi index table to save contract state
Chapter 5: issue your own tokens
learn the principle and implementation mechanism of issuing tokens on EOS, and master how to use command-line tools to issue, transfer and view the balance of tokens through practical operation
Chapter 6: use code to interact with smart contract
understand the principle of interaction between application and EOS blockchain, and learn to use JSON RPC interface and eosjs encapsulation library to access EOS blockchain
Chapter 7: DAPP development of practical notes
comprehensively use EOS knowledge, use react to complete a decentralized application of EOS notes, and learn the complete process from requirement analysis to code implementation
The above course address is as follows: EOS tutorialAccording to the functions provided by JSTL tag, it can be divided into five categories. Core tag format tag SQL tag XML tag JSTL function JSTL library installation
Apache Tomcat installation steps of JSTL library are as follows: Download binary package (Jakarta taglibs standard current. Zip) from Apache standard tag library. Download address: http://archive.apache.org/dist/jakarta/taglibs/standard/binaries/ Download and unzip the package of jakarta-taglibs-standard-1.1.1.zip, and the two jar files: standard.jar and jstl.jar under / WEB-INF / lib /. To use any library, you must include & lt; in the header of each JSP file; taglib> Label
core tag
core tag is the most commonly used JSTL tag. The syntax for referencing the core tag library is as follows:
& lt;%@ taglib prefix=c uri= http://java.sun.com/jsp/jstl/core %>
label
description
& lt; c:out >
used to display data in JSP, just like & lt;% =& gt;< br />< c:set >
used to save data
& lt; c:remove >
used to delete data
& lt; c:catch>
it is used to deal with the abnormal conditions that generate errors and store the error information
& lt; c:if>
the same as if we use in general programs
& lt; c:choose>
as & lt; c:when> And & lt; c:otherwise> The parent tag of
& lt; c:when>< br />< c:choose> To judge whether the condition is true
& lt; c:otherwise >< br />< c:choose> Sub tags of the & lt; c:when> When & lt; c:when> When the tag is judged as false,
& lt; c:import>
retrieve an absolute or relative URL, and then expose its content to the page
& lt; c:forEach >
Basic iteration tag, which accepts multiple set types
& lt; c:forTokens>
separate the content according to the specified separator and output iteratively
& lt; c:param>
used to pass parameters to included or redirected pages
& lt; c:redirect >
redirect to a new URL.
& lt; c:url>
create a URL with optional query parameters
format tag
JSTL format tag is used to format and output text, date, time and number. The syntax for referencing a formatted tag library is as follows:
& lt;%@ taglib prefix=fmt uri= http://java.sun.com/jsp/jstl/fmt %>
label
description
& lt; fmt:formatNumber>
formats numbers with the specified format or precision
& lt; fmt:parseNumber>
parse a string representing a number, currency or percentage
& lt; fmt:formatDate>
formats the date and time with the specified style or pattern
& lt; fmt:parseDate>
parse a string representing the date or time
& lt; fmt:bundle>
bind resources
& lt; fmt:setLocale>
designated area
& lt; fmt:setBundle>
bind resources
& lt; fmt:timeZone>
specify time zone
& lt; fmt:setTimeZone>
specify time zone
& lt; fmt:message>
display resource profile information
& lt; fmt:requestEncoding>
set the character encoding of request
sql tag
JSTL SQL tag library provides tags for interacting with relational databases (Oracle, mysql, SQL server, etc.). The syntax for referencing SQL tag library is as follows:
& lt;%@ taglib prefix=sql uri= http://java.sun.com/jsp/jstl/sql %>
label
description
& lt; sql:setDataSource>
specify data source
& lt; sql:query>
Run SQL query
& lt; sql:update>
Run SQL UPDATE statement
& lt; sql:param>
set the parameters in the SQL statement to the specified value
& lt; sql:dateParam>
set the date parameter in the SQL statement to the specified Java. Util. Date object value
& lt; sql:transaction >
nested database behavior elements are provided in the shared database connection, and all statements are run in the form of a transaction
XML tag
JSTL XML tag library provides tags for creating and operating XML documents. The syntax of referencing XML tag library is as follows:
& lt;%@ taglib prefix=x uri= http://java.sun.com/jsp/jstl/xml %>
before using XML tags, you must XML and XPath related packages to your & lt; Tomcat installation directory & gt Under lib: xercesimpl.jar: xalan.jar: tag description
& lt; x:out>
and & lt;% =& gt;, Similar, but only for XPath expressions
& lt; x:parse>
parsing XML data
& lt; x:set >
set XPath expression
& lt; x:if >
judge the XPath expression, if it is true, execute the content in the ontology, otherwise skip the ontology
& lt; x:forEach>
iterate nodes in XML documents
& lt; x:choose>< br />< x:when> And & lt; x:otherwise> The parent tag of
& lt; x:when >< br />< x:choose> To judge the condition
& lt; x:otherwise >< br />< x:choose> When & lt; x:when> If it is judged as false,
& lt; x:transform >
apply XSL transformation to XML documents
& lt; x:param >
and & lt; x:transform> The
JSTL function contains a series of standard functions, most of which are general string processing functions. The syntax for referencing JSTL function library is as follows:
& lt;%@ taglib prefix=fn uri= http://java.sun.com/jsp/jstl/functions %>
function
description
FN: contains()
tests whether the input string contains the specified substring
FN: containsignorecase()
tests whether the input string contains the specified substring, Case insensitive
FN: endswith()
tests whether the input string ends with the specified suffix
FN: escapexml()
skips the characters that can be used as XML tags
FN: indexof()
returns the position of the specified string in the input string
FN: join()
synthesizes the elements in the array into a string and outputs
FN: length()
returns the word String length
FN: replace()
replaces the specified position in the input string with the specified string, and then returns
FN: split()
separates the string with the specified separator, and then forms an array of substrings and returns
FN: startswith()
tests whether the input string starts with the specified prefix
FN: substring()
returns a subset of the string
/>FN: substringafter()
returns the subset of the string after the specified substring
FN: substringbefore()
returns the subset of the string before the specified substring
FN: tolowercase()
converts the characters in the string to lowercase
FN: touppercase()
converts the characters in the string to uppercase
FN: trim()
removes the first white space
{RRR}
Double
num
=
new
Double(" 123456789012.3456");< br />整数带千符显示:
< fmt:formatNumber
value="${ in}"< br />type=" number"/& gt;< br />整数显示:
< fmt:formatNumber
value="${ in}"< br />pattern="#& quot;< br />type=" number"/& gt;< br />两位[UNK]数舍[UNK]显示:
< fmt:formatNumber
value="${ in}"< br />pattern="#.##& quot;< br />type=" number"/& gt;< br /> fmt:formatNumber
value="${ in}"< br />pattern="#. 00"< br />type=" number"/& gt;< br />货币显示:([UNK]number类[UNK]扩展pattern)
< fmt:formatNumber
value="${ in}"< br />type=" currency"/& gt;< br />百[UNK]数显示:([UNK]number类[UNK]扩展pattern)
< fmt:formatNumber
value="${ in}"< br />type=" percent"/& gt;< br />http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http http .35
JSTL tag library can be divided into five categories: JSTL core tag library, JSTL function tag library, database tag library, I18N formatted tag library and XML tag library
the core tag library of JSTL mainly includes expression operation, process control, iteration operation and URL operation. The following are the common usages of JSTL Tags:
1. Expression operation
1, & lt; c:out>
function: used to display the content of data
syntax 1: no ontology content
& lt; c:out value=" value" [ escapeXml="{ true|false}"] [ default=" defaultValue"] /& gt;
syntax 2: ontology content
& lt; c:out value=" value" [ escapeXml="{ true|false}"]& gt;< br /> default value
</ c:out>
attribute description:
value: the value to be displayed
Default: if the value of value is null, the value specified by default will be displayed
escapexml: whether to convert special characters. The default value is true. By default, the& gt;、’、” And & to & lt& gt;、 039;、 034 and & amp. If set to false, no conversion is performed< br /> 2、< c:set>
function: used to store the value of variable in JSP scope or JavaBean attribute
syntax 1: store the value of value in Varname variable with scope
& lt; c:set value=" value" var=" varName" [ scope="{ page|request|session|application}"] /& gt;
syntax 2: store the data of ontology content in Varname variable with scope
& lt; c:set var=" varName" [ scope="{ page|request|session|application}"] & gt;
... Ontology content
& lt/ c:set>
syntax 3: store the value of value in the property attribute of the target object
& lt; c:set value=" value" target=" target" property=" propertyName" /& gt;
syntax 4: store the data of ontology content in the property attribute of target object
& lt; c:set target=" target" property=" propertyName"& gt;
... Ontology content
& lt/ c:set>
attribute description:
value: the value to be stored
var: the name of the variable to be saved
scope: JSP scope of VaR variable. The default is page range
target: a JavaBean or map object
If "target" is a map, "property" specifies a key of the map; If "target" is a bean, "property" specifies a member field of the bean
if the "target" expression is null, the container will throw an exception
if the "target" expression is not a map or bean, the container will throw an exception
if the "target" expression is a bean, but the bean does not have a member field matching "property", the container will throw an exception
Property: the property of the specified target object< br /> 3、< c:remove>
function: remove variables
syntax: & lt; c:remove var=" varName" [ scope="{ page|request|session|application}"] /& gt;
attribute description:
var: the variable to be removed
scope: the JSP scope of the VaR variable. The default is the page scope< br /> 4、< c:catch>
function: it is used to deal with the exception of error and store the error information
syntax: & lt; c:catch [var=" varName"] & gt;
... To grab the wrong part
& lt/ c:catch>
attribute description:
var: stores the error information in the specified variable, through which the error information can be obtained< Second, process control; c:if>
function: similar to if judgment statement, used for expression judgment
syntax 1: no ontology content
& lt; c:if test=" testCondition" var=" varName" [ scope="{ page|request|session|application}"] /& gt;
syntax 2: ontology content
& lt; c:if test=" testCondition" [ var=" varName"] [ scope="{ page|request|session|application}"] /& gt;
... Ontology content
& lt/ c:if>
attribute description:
test: if the result of the expression operation in the attribute is true, the ontology content will be executed; if it is false, it will not be executed. The tag must have the test attribute
var: stores the operation result of test, which is true or false
scope: JSP scope of VaR variable< br /> 2、< c:choose>、& lt; c:when>、& lt; c:otherwise>
function: these three tags must be used in combination for process control
example:
& lt; c:choose> < br />< c:when test="${ condition1}"& gt;
condition1 is true
& lt/ c:when> < br />< c:when test="${ condition2}"& gt;
condition2 is true
& lt/ c:when> < br />< c:otherwise>
both condition1 and condition2 are false
& lt/ c:otherwise>< br /></ c:choose>
example description: "condition1 is true" will be displayed when condition1 is true; When condition1 is false and condition2 is true, "condition2 is true" will be displayed. If both are false, "condition1 and condition2 are both false" will be displayed
note: if the operation results of condition1 and condition2 are both true, only & quot; Condition1 is true & quot
restrictions:
A, & lt; c:when> And & lt; c:otherwise> Label must be in & lt; c:choose> And & lt/ c:choose> Use between
B. in the same & lt; c:choose> Medium, & lt; c:otherwise> Must be the last tag and can only have one & lt; c:otherwise> Label& lt; c:when> There can be multiple
C. in the same & lt; c:choose> When all & lt; c:when> Only execute & lt; c:otherwise> The content of ontology
3. Iterative operation
1; c:forEach>
function: for loop control, it can browse the members in the collection step by step. The operation mode is that when the conditions are met, it will continue to be repeated & lt; c:forEach> The content of ontology
syntax 1: iterate all members in a set object
& lt; c:forEach items=" collection" [ var=" varName"] [ varStatus=" varStatusName"] [ begin=" begin"] [ end=" end"] [ step=" step"] /& gt;
... Ontology content
& lt/ c:forEach>
syntax 2: specify the number of iterations
& lt; c:forEach [var=" varName"] [ varStatus=" varStatusName"] begin=" begin" end=" end" [ step=" step"]& gt;
... Ontology content
& lt/ c:forEach>
attribute description:
items: iterated collection object
var: stores the members in the current collection object
varstatus: stores the relevant information of the currently pointed member Index: the index of the current member; Count: the current total number of members; First: whether the current member is the first member; Last: whether the current member is the last member)
begin: the start position of the iteration, which is 0 by default
end: the end position of the iteration, which is the last by default
step: the interval number of each iteration, which is 1 by default
example:
& lt;%< br />int atts[] = {1,2,3,4,5,6,7,8,9,10}; < br />request.setAttribute(" atts", atts); < br />%> < br />< c:forEach items="${ atts}" var=" item" begin=" 0" end=" 9" step=" 1" & gt; < br />${item}</ br> < br /></ c:forEach>
this tag can also be used for normal loop control, just like for loop. For example:
& lt; c:forEach begin=" 1" end=" 10" var=" item" & gt; < br />${item}</ br> < br /></ c:forEach> < br /> 2、< c:forTokens>
function: use the specified separator to separate a string and iterate the separated array
syntax: & lt; c:forTokens items=" stringOfTokens" delims=" delimiters" [ var=" varName"] [ varStatus=" varStatusName"] [ begin=" begin"] [ end=" end"] [ step=" step"] & gt;
ontology content
& lt/ c:forTokens>
attribute description:
items: separated and iterated strings
delims: characters used to separate strings
var: stores the currently pointed member
varstatus: stores the relevant information of the currently pointed member Index: the index of the current member; Count: the current total number of members; First: whether the current member is the first member; Last: whether the current member is the last member)
begin: the start position of the iteration, which is 0 by default
end: the end position of the iteration, which is the last by default
step: the interval number of each iteration, which is 1 by default
example 1:
& lt; c:forTokens items=" A,B,C,D,E" delims=",& quot; var=" item" & gt; < br />${item}
</ c:forTokens>
separate strings with "," and iterate to output the separated string array, and the output result is "ABCDE"
example 2:
& lt; c:forTokens items=" A,B; C-D,E" delims=",;-& quot; var=" item" & gt; < br />${item}
</ c:forTokens>
three separators ","; "are specified in delims And "", which shows that we can set all the characters that we want to use as separation strings at one time. The output is still "ABCDE"
4. URL operation
1; c:import>
function: to include other static or dynamic files into your own JSP Web page. It can not only contain files from the same web application, but also files from other web applications or websites
syntax:
& lt; c:import url=" url" [ var=" varName"] [ scope="{ page|request|session|application}"] & gt;< br /> [< c:param name=" paramName" value=" paramValue"/& gt;]< br /> </ c:import>< Property Description:
URL: the URL of other files to be included in the JSP Web page. Required
var: store other included files in the specified variable in the form of string. The scope of action of
scope: VAR variable can be selected. Optional
& lt; c:param>: An optional sub tag is used to pass parameters to other included web page files
example:
& lt; c:import url=" http://java.sun.com" & gt; < br />< c:param name=" test" value=" 1234" /& gt; < br /></ c:import>
note: when & lt; c:import> When the VaR variable is not specified in the tag, the contents of other web page files will be displayed directly. If the VaR variable is specified, the contents will be stored in the VaR variable and will not be displayed< br />2、< c:url>
function: generate a URL
syntax:
& lt; c:url value=" url" [ context=" expression"] [ var=&q
JSP page display special symbols, we need to pay attention to the following issues:
-
whether the page uses UTF-8 encoding, some symbols can not be displayed under other encoding
-
use tags to display special symbols& lt; fmt:formatNumber> , You can display symbols such as numbers, percentages, currencies, etc& lt; fmt:formatDate> For date string display, for example & lt; fmt:formatDate value=" ${ xx.createDate}" pattern=" yyyy-MM-dd HH:mm:ss"/& gt;
-
some special symbols can be replaced by corresponding codes, such as & lt=& amp; lt;
/ *
purpose: check whether the input string conforms to the positive integer format
Input:
s: String
Return:
if true is returned through verification, otherwise false
* /
function isnumber (s) {
var regu = & quot^[ 0-9]+$";< br />var re = new RegExp(regu);< br />if (s.search(re) != - 1) {
return true;< br />} else {
return false;
}
}
you can judge whether it is an integer or not.