Technical background
On the one hand, this paper starts with the printing of quantum circuits , Introduced a simple python Quantum circuit engineering . And based on this simple little project , By the way, we introduced python Of API Automatic document generation tool Sphinx The basic use method .
Background knowledge of quantum circuits
In previous blogs , There was an introduction to Using the open source quantum computing programming framework ProjectQ Drawing quantum circuits , It will output us a tex Format of the circuit diagram , It can be used directly in the article . About quantum circuits and quantum logic gate operations , In this article Blog There is a relatively preliminary introduction to . And the project created in this article , Is directly in cmd Print out the quantum circuit in the form of string in the window , alike , In quantum computing resource estimation and Quantum Circuit Engineering , Can have a certain effect .
Automated document generation solutions
For a more elegant python For open source projects , A brief document is essential . Generally one python The project documentation consists of two parts : Part of it is with markdown Written instruction document , Its purpose is to outline the key content of the whole project , And maybe a few examples of usage . This part of the document can be used first markdown Write , And then through some open source tools , Such as mkdocs And so on read_the_docs The format of the document .read_the_docs The format of the document is shown in the figure below , You can also refer to it directly Official documents . The second part of the document is specific to each function 、 Interface documentation for each class . In the development stage , Let's first write the annotation document according to the format requirements , And then through open source tools Sphinx It can be generated automatically API Interface document .
install sphinx
Here we use it directly python Package management tools pip To install Sphinx And one. read_the_docs
Format python library . If you don't need to use read_the_docs
Format can also be installed without the latter , It's just that the latter is python It's also the most commonly used document format in open source projects , And can cooperate with read_the_docs Website API Document hosting , Therefore, it is recommended to use .
[dechin@dechin-manjaro circuit]$ python3 -m pip install sphinx
Requirement already satisfied: sphinx in /home/dechin/anaconda3/lib/python3.8/site-packages (3.4.3)
Requirement already satisfied: sphinxcontrib-htmlhelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.0.3)
Requirement already satisfied: docutils>=0.12 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (0.16)
Requirement already satisfied: sphinxcontrib-devhelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.0.2)
Requirement already satisfied: sphinxcontrib-serializinghtml in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.1.4)
Requirement already satisfied: sphinxcontrib-jsmath in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.0.1)
Requirement already satisfied: alabaster<0.8,>=0.7 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (0.7.12)
Requirement already satisfied: Pygments>=2.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (2.7.2)
Requirement already satisfied: requests>=2.5.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (2.24.0)
Requirement already satisfied: babel>=1.3 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (2.8.1)
Requirement already satisfied: sphinxcontrib-applehelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.0.2)
Requirement already satisfied: Jinja2>=2.3 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (2.11.2)
Requirement already satisfied: snowballstemmer>=1.1 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (2.0.0)
Requirement already satisfied: setuptools in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (50.3.1.post20201107)
Requirement already satisfied: sphinxcontrib-qthelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.0.3)
Requirement already satisfied: packaging in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (20.4)
Requirement already satisfied: imagesize in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx) (1.2.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx) (1.25.11)
Requirement already satisfied: certifi>=2017.4.17 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx) (2.10)
Requirement already satisfied: pytz>=2015.7 in /home/dechin/anaconda3/lib/python3.8/site-packages (from babel>=1.3->sphinx) (2020.1)
Requirement already satisfied: MarkupSafe>=0.23 in /home/dechin/anaconda3/lib/python3.8/site-packages (from Jinja2>=2.3->sphinx) (1.1.1)
Requirement already satisfied: six in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->sphinx) (1.15.0)
Requirement already satisfied: pyparsing>=2.0.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->sphinx) (2.4.7)
[dechin@dechin-manjaro circuit]$ python3 -m pip install sphinx-rtd-theme
Collecting sphinx-rtd-theme
Downloading sphinx_rtd_theme-0.5.1-py2.py3-none-any.whl (2.8 MB)
|████████████████████████████████| 2.8 MB 74 kB/s
Requirement already satisfied: sphinx in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx-rtd-theme) (3.5.1)
Requirement already satisfied: sphinxcontrib-jsmath in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.0.1)
Requirement already satisfied: snowballstemmer>=1.1 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (2.0.0)
Requirement already satisfied: sphinxcontrib-serializinghtml in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.1.4)
Requirement already satisfied: imagesize in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.2.0)
Requirement already satisfied: alabaster<0.8,>=0.7 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (0.7.12)
Requirement already satisfied: requests>=2.5.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (2.24.0)
Requirement already satisfied: docutils>=0.12 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (0.16)
Requirement already satisfied: setuptools in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (50.3.1.post20201107)
Requirement already satisfied: Pygments>=2.0 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (2.7.2)
Requirement already satisfied: packaging in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (20.4)
Requirement already satisfied: sphinxcontrib-devhelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.0.2)
Requirement already satisfied: sphinxcontrib-applehelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.0.2)
Requirement already satisfied: sphinxcontrib-qthelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.0.3)
Requirement already satisfied: sphinxcontrib-htmlhelp in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (1.0.3)
Requirement already satisfied: babel>=1.3 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (2.8.1)
Requirement already satisfied: Jinja2>=2.3 in /home/dechin/anaconda3/lib/python3.8/site-packages (from sphinx->sphinx-rtd-theme) (2.11.2)
Requirement already satisfied: idna<3,>=2.5 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx->sphinx-rtd-theme) (2.10)
Requirement already satisfied: chardet<4,>=3.0.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx->sphinx-rtd-theme) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx->sphinx-rtd-theme) (2020.6.20)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/dechin/anaconda3/lib/python3.8/site-packages (from requests>=2.5.0->sphinx->sphinx-rtd-theme) (1.25.11)
Requirement already satisfied: pyparsing>=2.0.2 in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->sphinx->sphinx-rtd-theme) (2.4.7)
Requirement already satisfied: six in /home/dechin/anaconda3/lib/python3.8/site-packages (from packaging->sphinx->sphinx-rtd-theme) (1.15.0)
Requirement already satisfied: pytz>=2015.7 in /home/dechin/anaconda3/lib/python3.8/site-packages (from babel>=1.3->sphinx->sphinx-rtd-theme) (2020.1)
Requirement already satisfied: MarkupSafe>=0.23 in /home/dechin/anaconda3/lib/python3.8/site-packages (from Jinja2>=2.3->sphinx->sphinx-rtd-theme) (1.1.1)
Installing collected packages: sphinx-rtd-theme
Successfully installed sphinx-rtd-theme-0.5.1
be based on python Quantum circuits print small projects
Let's take a look at the method and effect , Let's go back to the principle of code implementation :
if __name__ == '__main__':
qc = QuantumCircuit(3)
qc.apply(0, 0)
qc.apply(1, (1,0))
qc.apply(1, (2,1))
qc.apply(1, (2,0))
qc.apply(2)
print (qc)
The output is as follows ( Pay attention to the font with equal width ):
|0> |0> |0>
| | |
| | h
| | |
| x ----- c
| | |
x ----- c |
| | |
x ----- | ----- c
| | |
m m m
Here we can learn , The core function of this project is to construct a quantum circuit object , And the quantum gate operation is applied to this object one by one , You can output the corresponding quantum circuit string . Next, let's look at the source code implementation :
# qcprinter.py
"""
The module used for print a quantum circuit in string format.
"""
class QuantumCircuit:
"""The class of quantum circuit from input quantum logical gates.
Parameters
----------
qubits : int
Totcal number of qubits used in this quantum circuit.
Returns
-------
str
The string format of quantum circuit.
How to use?
-------
>>> qc = QuantumCircuit(3)
>>> qc.apply(0, 0)
>>> qc.apply(1, (1,0))
>>> qc.apply(1, (2,1))
>>> qc.apply(1, (2,0))
>>> qc.apply(2)
>>> print (qc)
Example output
-------
>>> |0> |0> |0>
>>> | | |
>>> | | h
>>> | | |
>>> | x ----- c
>>> | | |
>>> x ----- c |
>>> | | |
>>> x ----- | ----- c
>>> | | |
>>> m m m
"""
def __init__(self, qubits=0):
self.qubits = qubits
self.str_circuit = ' |0>\t' * self.qubits + ' \n'
def __str__(self):
return self.str_circuit
def apply(self, gate_type, qubit_index=0):
"""The function used to apply quantum logical gates on quantum state.
Parameters
----------
gate_type : int
An index number represents for different type of quantum logical gates. 0 for h gate,
1 for cx gate and 2 for measure gate.
qubit_index: int, tuple, none
The qubit index quantum logical gates allpied on. If the gate_type is h, the qubit_index
would be int format. If the gate_type is cx, the qubit_index should be a tuple. If the
gate_type is m, that means do measurement to all qubits, thus you do not need to set
the value of qubit_index.
Returns
-------
str
The string format of quantum circuit.
"""
if gate_type == 0:
self.str_circuit += ' | \t' * self.qubits + '\n'
self.str_circuit += ' | \t' * (self.qubits - qubit_index - 1) + ' h \t' + ' | \t' * (qubit_index) + '\n'
elif gate_type == 1:
self.str_circuit += ' | \t' * self.qubits + '\n'
self.str_circuit += ' | \t' * (self.qubits - qubit_index[0] - 1) + ' x'
for i in range(qubit_index[0] - qubit_index[1] - 1):
self.str_circuit += ' ' + '-' * 5 + ' |'
self.str_circuit += ' ' + '-' * 5 + ' c \t'
self.str_circuit += ' | \t' * (qubit_index[1]) + '\n'
elif gate_type == 2:
self.str_circuit += ' | \t' * self.qubits + '\n'
self.str_circuit += ' m \t' * self.qubits + '\n'
else:
pass
In this simple code implementation , We mainly set up a magic function for the class of quantum circuit __str__
, Take the string of quantum circuit we need as the string return value of the whole object ( About python The use of magic function can refer to the previous article Blog Introduce ). The core function of this string class is realized through string splicing , We're just going to go on and on . Here for convenience , We use integer numbers instead of quantum logic gate operations :0
representative \(H\) door ,1
representative \(CNOT\) door ,2
Represents the global quantum measurement operation . meanwhile , For display API The process of making documents , Here we have written part of the sample comment code in the class and function , In the next chapter, I'll introduce the effect of the document .
sphinx Document generation and effect list
use first sphinx-quickstart
To generate some configuration files :
[dechin@dechin-manjaro circuit]$ sphinx-quickstart
Welcome to use Sphinx 3.5.1 Quick configuration tools .
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).
Selected root path: .
You have two options for placing the build directory for Sphinx output.
Either, you use a directory "_build" within the root path, or you separate
"source" and "build" directories within the root path.
> Independent source files and build directories (y/n) [n]: y
The project name will occur in several places in the built documentation.
> Project name : qcprinter
> Author's name : DechinPhy
> Project release []: 1.0
If the documents are to be written in a language other than English,
you can select a language here by its language code. Sphinx will then
translate text that it generates into that language.
For a list of supported codes, see
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-language.
> Project language [en]: en
create a file /home/dechin/projects/2021-quantum/circuit/source/conf.py.
create a file /home/dechin/projects/2021-quantum/circuit/source/index.rst.
create a file /home/dechin/projects/2021-quantum/circuit/Makefile.
create a file /home/dechin/projects/2021-quantum/circuit/make.bat.
complete : Created initial directory structure .
You should now populate your master file /home/dechin/projects/2021-quantum/circuit/source/index.rst and create other documentation
source files. Use the Makefile to build the docs, like so:
make builder
where "builder" is one of the supported builders, e.g. html, latex or linkcheck.
After this series of configurations , Several new files will be generated in the current directory ( Because we chose build and source The pattern of separation , So there will be 2 A catalog ):
[dechin@dechin-manjaro circuit]$ ll
Total usage 52
drwxr-xr-x 2 dechin dechin 4096 2 month 23 00:04 build
-rw-r--r-- 1 dechin dechin 799 2 month 23 00:04 make.bat
-rw-r--r-- 1 dechin dechin 638 2 month 23 00:04 Makefile
-rw-r--r-- 1 dechin dechin 3055 2 month 22 23:26 qcprinter.py
drwxr-xr-x 4 dechin dechin 4096 2 month 23 00:04 source
stay source Some configuration files will be generated in the directory , Here we need to modify one of the conf.py
file :
[dechin@dechin-manjaro circuit]$ cd source/
[dechin@dechin-manjaro source]$ ll
Total usage 16
-rw-r--r-- 1 dechin dechin 1884 2 month 23 00:04 conf.py
-rw-r--r-- 1 dechin dechin 443 2 month 23 00:04 index.rst
drwxr-xr-x 2 dechin dechin 4096 2 month 23 00:04 _static
drwxr-xr-x 2 dechin dechin 4096 2 month 23 00:04 _templates
You can refer to the configuration plan of the building owner , Here we mainly configure the theme to rtd
The format of , At the same time opened autodoc
And through sys
Configured index directory ( If the index directory is not configured , It is possible that the module cannot be found , So it can't be generated normally API Interface document ):
[dechin@dechin-20n2s01200 circuit]$ cat source/conf.py
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
project = 'qcprinter'
copyright = '2021, DechinPhy'
author = 'DechinPhy'
# The full version, including alpha/beta/rc tags
release = '1.0'
# -- General configuration ---------------------------------------------------
import sphinx_rtd_theme
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx_rtd_theme", "sphinx.ext.autodoc", "sphinx.ext.autosummary"
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
perform sphinx-build
Instructions will be source Medium rst The document is compiled into html file , And output to the build Under the table of contents :
[dechin@dechin-manjaro circuit]$ sphinx-build source/ build/
Running Sphinx v3.5.1
load pickled Environmental Science ... complete
structure [mo]: 0 individual po The target file for the file has expired
structure [html]: 0 Target files for source files are out of date
Update the environment : Have been added 0,1 Has been changed ,0 Removed
Reading source ... [100%] qcprinter
/home/dechin/projects/2021-quantum/circuit/qcprinter.py:docstring of qcprinter.QuantumCircuit:4: WARNING: Unexpected section title or transition.
----------
/home/dechin/projects/2021-quantum/circuit/qcprinter.py:docstring of qcprinter.QuantumCircuit:9: WARNING: Unexpected section title or transition.
-------
/home/dechin/projects/2021-quantum/circuit/qcprinter.py:docstring of qcprinter.QuantumCircuit:14: WARNING: Unexpected section title or transition.
-------
/home/dechin/projects/2021-quantum/circuit/qcprinter.py:docstring of qcprinter.QuantumCircuit:24: WARNING: Unexpected section title or transition.
-------
/home/dechin/projects/2021-quantum/circuit/qcprinter.py:docstring of qcprinter.QuantumCircuit.apply:4: WARNING: Unexpected section title or transition.
----------
/home/dechin/projects/2021-quantum/circuit/qcprinter.py:docstring of qcprinter.QuantumCircuit.apply:15: WARNING: Unexpected section title or transition.
-------
Find files that are currently out of date ... Can't find
pickling Environmental Science ... complete
Check consistency ... /home/dechin/projects/2021-quantum/circuit/source/modules.rst: WARNING: The document is not added to any tree
complete
Ready to file ... complete
Write output ... [ 33%] index Write output ... [ 66%] modules Write output ... [100%] qcprinter
generating indices... genindex py-modindex complete
writing additional pages... search complete
copying static files... complete
copying extra files... complete
dumping search index in English (code: en)... complete
dumping object inventory... complete
build success , 7 warnings.
HTML The page is saved in build Catalog .
In the process of this execution , Some of the alerts are related to annotation specifications , In fact, it doesn't matter if you don't have to deal with it . Next you can open build Catalog , View the generated html file , First of all, we can open index.html, It's a common index of home page , The general content is shown in the figure below :
Let's click here first index and module Look at the content , They are shown in the following two figures :
Finally, in the index list, we click to enter qcprinter
In this class , To see the detailed class documentation :
The corresponding function annotation content will also be reflected in the interface document :
It should be noted that , If the related class or function is a protected type , So in sphinx It will not be displayed in the generated document ( Automatically ignored during construction ).
Summary
In this article , We print it mainly through a quantum circuit python Project introduction , By the way sphinx take python Automatic generation of project annotation documents API Interface document , Completed a brief analysis of project development and document output process , Master more ways to use tools in actual combat .
Copyright notice
The first link to this article is :https://www.cnblogs.com/dechinphy/p/qcprinter.html
author ID:DechinPhy
For more original articles, please refer to :https://www.cnblogs.com/dechinphy/
Use python Write a simple project for quantum circuit printing , And use Sphinx Automatic generation API More articles related to documentation
- utilize sphinx by python Project generation API file
sphinx According to python Generate comments that you can find api file , A simple record of the next steps 1: install pip install -U Sphinx 2: When you need to generate a document .py File directory sphinx-apido ...
- Use sphinx Fast for you python Annotation generation API file
sphinx brief introduction sphinx It's based on Python Document tools for , It makes it easy to write clear and beautiful documents , from Georg Brandl stay BSD Develop under license . New version of the Python3 Documents are created by sphinx Generated , ...
- Application swagger To write api file
One . What is? swagger With the development of Internet technology , Front end and back-end technologies go further and further on their respective paths , The only connection between them became api Interface ,api The interface document programs the link between the front end and the back end , and swagger It's writing api A framework for documentation ...
- python A quick way to generate annotated documents
python A quick way to generate annotated documents Today, I will tell you a simple little detail that you just need to pay attention to , You can easily generate annotation documents , You can also check whether the reference name of the class method we wrote is duplicate or not . When I look at the documents written by other people's professional experts, I admire them , Don't worry ...
- Java Generate Word Document and Print Solutions
Users need to generate standard word file , To be able to print , And it doesn't deform , A lot of solutions have been used before , Under the strict requirements of customers, the sacrifice is extremely tragic . POI read word Document is OK , I'm not flattered to write a document , Complex styles are hard to control, not to mention , Imagine a ...
- Python sphinx-build stay Windows Generated in the system Html file
See the post of former colleagues “Markdown/reST Document publishing pipeline ” be based on TFS.Docker.Azure And other tools and platforms for document publishing , I have to give a thumbs up in my heart . This model , Realize the version management after document writing . Hair ...
- Python Handle Excel Generate CSV file
Python It's an interpretive . Dynamic data type . Object oriented high level programming language . It has rich data processing and text class library , And because it's an interpretive language , In program modification and function expansion , It's easy to do large-scale adjustments . Comprehensive consideration Pyt ...
- How to write good development technical documents for programmers How to write quality API Documentation work
Write technical documentation , Is one of the tasks that many developers fear . It's a time-consuming and laborious job in itself . But most of the time , People always want to take a shortcut , The result is often very regrettable , Because high quality technical documentation is the key to determine whether your project attracts people's attention ...
- Use sphinx Quickly generate Python API file
One Brief introduction Open source or closed source , Documents are very important . In theory, of course , The best documentation is the code itself , But it's too hard for everyone to read your code . So we're going to document . Most of the time , We don't want to maintain a piece of code plus a piece of documentation , ...
- Django Framework insight _05 (Django Cache in 、Django Solve cross domain processes ( It's not a simple request , A simple request )、 Automatically generate interface documentation )
One .Django Cache in : Foreplay : In dynamic websites , All user requests , The server will go to the database for corresponding increment , Delete , check , Change , Apply colours to a drawing template , Execute business logic , Finally, generate the page that the user sees . When a website has a large number of users , each ...
Random recommendation
- Start VS 2012 in LightSwitch Series No 2 part : Feel the love —— Define data relationships
[ The original address ] Beginning LightSwitch in VS 2012 Part 2: Feel the Love - Defining Data Relationships [ The original text is published ...
- 【linux】wc command
Linux In the system wc(Word Count) The function of the command is to count the number of bytes in the specified file . Number of words . Row number , And display the statistical results . 1. Command format : wc [ Options ][ file ] 2. Command parameter : -c char Count the number of bytes . ...
- libevent brief introduction constitute
libevent brief introduction libevent It's an event driven network library , Cross-platform support , Such as Linux, *BSD, MacOS X, Solaris, Windows. Support I/O Multiplexing ,epoll.poll./d ...
- hdu 5124
bc Topics on , Very water , There are many ways to do it , The meaning of the question is to give you the number of votes , Then let you find the subscript with the most votes ...... I used to use two for The loop is written separately , One is reading in , And then judgment , Submit on wa, Later, I read other people's , It just can't be divided ...
- StackExchange.Redis Learning notes ( 5、 ... and ) Publish and subscribe
Redis In the command Pub/Sub Redis stay 2.0 Later versions Realized Event push Publish subscription order Here are Redis About the related commands provided by publish and subscribe SUBSCRIBE channel [channe ...
- The etheric fang RPC Mechanism and API example
The last article introduced the basics of Ethereum , We get it web3.js The way to call is through Ethereum RPC technology , The purpose of this article is to study how to develop . compile . Running and using Ethereum RPC Interface . keyword : The etheric fang ,RPC,JSON-RPC,cl ...
- Spark Environment building ( Next )——Spark install
1. download Spark 1.1 Download from the official website Spark http://spark.apache.org/downloads.html Open the above link , Go to the picture below , Click the red box to download Spark-2.2.0-bin-h ...
- MySQL Aggregate functions Control flow function
Common aggregate functions 1. AVG() averaging mysql> AVG([DISTINCT] expr) -- return expr Average value mysql> select AVG(age) from ...
- C# Stream summary
Preface This article is a brief summary of C# Some streams often used in programming . for instance FileStream.MemoryStream. BufferedStream. NetWorkStream. StreamReader/ ...
- Commonly used Iview Style layout
type Layout mode , Optional value is flex Flow layout or not , It works in modern browsers flex Vertical alignment under layout ,align Optional value is top.middle.bottom flex The horizontal arrangement under the layout ,justi ...