Sword finger offer question 9: Fibonacci series
Title Description
Topic 1: we all know Fibonacci series. Now you need to input an integer n. please output the nth item of Fibonacci series. N<=39
Topic 2: a frog can jump up one or two steps at a time. Find out how many ways the frog can jump to an n-level step.
Experimental platform: Niu Ke LAN
Topic 1
On niu ...
Posted by dfego on Sat, 04 Apr 2020 08:57:38 -0700
python notes: bulk send the specified attachments to the specified email address
Objectives:
Send the supplier extension list separated from the last note to the email address of different suppliers in the form of attachment. The code test sends an email every second
The code is as follows
#!/usr/bin/env python
# coding: utf-8
# In[49]:
import smtplib
from email import encoders
from email.header imp ...
Posted by nmcglennon on Sat, 04 Apr 2020 06:12:51 -0700
Technical guy: I'm going, you're still using try-catch-finally
Second Brother, the one you wrote before I'll switch The article is so interesting that after reading it, you still haven't finished. Would you like to write another one?Although using Java 13 syntax, it is not very friendly to older versions.But who can guarantee that Java won't get another major update, like Java 8, that Java 6 will be s ...
Posted by nbalog on Sat, 04 Apr 2020 01:35:39 -0700
python reads any range of pictures and returns them as a one-dimensional array
Using python for image processing, now you need to read out any area of the image and convert it into a one-dimensional array, which is convenient for subsequent convolution operation.
There are two ways to do this:
convert function
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
def ImageToMatrix( ...
Posted by summoner on Fri, 03 Apr 2020 23:32:47 -0700
The way of configuration management under Android: apk signature correlation
How to generate apk signature key file
# Build key method:
sub='/C=CN/ST=ShangHai/L=ShangHai/O=example/OU=CM/CN=example/emailAddress=buildfarm@example.com'
for key in platform shared media testkey;do
./development/tools/make_key $key "$sub"
done
How to re sign an apk
The command is as follows:
java -Xmx2048m -ja ...
Posted by SmokyBarnable on Fri, 03 Apr 2020 22:53:48 -0700
python core -- the use of decorator
Concept of decorator
Decorator is a function often used in the process of program development. If you use decorator well, the development efficiency will be enhanced
Function of decorator
Introduce the functions of log, function execution time statistics, function preparation before execution, function cleaning afte ...
Posted by tomm098 on Fri, 03 Apr 2020 22:11:53 -0700
GO learning notes (GO data type)
The second day of GO learning, today I mainly learned some data types of GO.
The common data types of go are as follows
1 int (int, int8, int16, int32, int64)
2 float (float32, float64)
3 string
4 byte
5 bool
6 array
7 slice
8 map
9 channel
10 interface
11 strcut
Common data types ...
Posted by furnissg on Fri, 03 Apr 2020 18:11:25 -0700
Introduction to matplotlib for data mining
Brief introduction
matplotlib library is one of the libraries in Python data mining, which is mainly used for 2D drawing, simple 3D drawing and data visualization.
Python data mining related extension library
Simple use
(1) Draw a straight line
Line y=x+10
Code:
def print_line_draw():
"""
//Draw straight lines
...
Posted by Pedro Sim on Fri, 03 Apr 2020 04:41:27 -0700
Python counts the number of lines in the disk code file
I heard that the resume requires 100000 lines of code experience. So I wrote a Python script to calculate the number of lines of code in the computer disk.
Main functions:
① Count the total number of lines of the specified code
② Count the individual lines of each code
③ Custom settings storage path
Design idea:
Convert t ...
Posted by paulytrick on Fri, 03 Apr 2020 00:12:18 -0700
Python thread pool / process pool memory management
concurrent.futures thread pool / process pool memory management
cause
In the past, there was a need for a crawler task. A machine with 1G memory ran a crawler and crawled the data of a website. Previously, this method was used:
futures = list()
with ThreadPool(max_workers=20) as exc:
for tr in table.selec ...
Posted by knowj on Fri, 03 Apr 2020 00:03:35 -0700