python basic (sequence) + string + format

sequence Sequence contains: string, tuple, list What can be done Index and slice s='hello' print(s[0])#h print(s[1:3])#el print(s[:])#hello print(s[-5:0])#hello print(s[-5:-1])#hello Functions supported by sequences s1="abc" s2="abd" s3="das" s4=[1,2,3] print(len(s1))# String length print(ma ...

Posted on Sat, 15 Feb 2020 22:06:07 -0800 by jmandas

The advanced function of python

01. Functions of function parameters and return values Functions can be combined with each other according to whether they have parameters and return values. There are four combinations in total No parameter, no return value No parameter, return value With parameters, no return value With parameters ...

Posted on Mon, 10 Feb 2020 01:20:55 -0800 by thomas2

Winter training of Blue Bridge Cup

The sound of the cello is like a river. The left bank is my unforgettable memory. The right bank is my bright time to hold. The flowing in the middle is my slight sadness every year.                                                      Li Bai drinks Li Bai, the great poet, is a good drinker all ...

Posted on Tue, 21 Jan 2020 22:45:06 -0800 by kitcorsa

Python Programming: from introduction to practice

function 1, Defining functions Use the def keyword to tell Python that you want to define a function. def greet_user(): print("Hello") greet_user() Output: Hello Passing information to a function Add the username in the parentheses of the function definition def greet ou user1(). By adding ...

Posted on Sun, 19 Jan 2020 04:32:42 -0800 by Gorf

Websocket breaks the longest connection

In order to test the maximum number of long connections, a js script is written, which needs to be executed with node var WebSocketClient = require('websocket').client; var size = 8000; var index = 0; setInterval(function () { if (index < size) { init(); index++; } }, 10); console.log('begin...'); init = function () ...

Posted on Mon, 23 Dec 2019 11:09:38 -0800 by joe1986

Undo the working copy modification of a file in Git?

After the last submission, I modified a bunch of files in my working copy, but I want to undo changes to one of these files, such as resetting it to the same state as the latest submission. However, I only want to undo the changes to the working copy of one file without any other action. What do I do? #1st floor I use SHA ID to rest ...

Posted on Tue, 10 Dec 2019 19:06:34 -0800 by aurigus

ES6 moduel default name and non default name

export default The essence of default is to assign the following variable (value) to default, and then output with the name of default.   import When getting the default variable, it is written outside the brace, and the name can be customized. Variable writing //a.js export let b = 4; export default 8; <script type="module" ...

Posted on Sat, 07 Dec 2019 04:16:05 -0800 by skippence

Spring Boot implements AOP with annotations

Step 1: add dependency      <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency> Step 2: define the tangent class package com.zdst.scs.web.controller.interact.aop; import org.aspectj.lang.Joi ...

Posted on Mon, 02 Dec 2019 00:00:21 -0800 by adders

Groovy Core: String, Set, Operator Overload

Groovy is the only scripting language that enhances the Java platform; scripting languages have better representation and provide a higher level of abstraction than Java.Groovy Language Features: Groovy is an object-oriented scripting language and everything involved is an object, unlike the Java language Groovy is binary compatible with Java, ...

Posted on Thu, 21 Nov 2019 22:35:35 -0800 by Volitics

Java encrypts string and returns asterisk ※

 If you don't look back, you'll never know I waiting for you behind you.   Java encrypts string and returns asterisk ※ PasswordUtils, the encryption tool class, was found in the source code of Ranger project. It is a security management framework, and its encryption tool class should be used for ordinary encryption requirements; First of al ...

Posted on Thu, 21 Nov 2019 08:54:38 -0800 by davo666