Solution to problem 18 of leetcode (python analysis)

leetcode brush inscription -- > 18 problem solving method (python analysis) Definition of title Solving problems 1. Use dichotomy 2. Optimization by dichotomy 3. Use recursive thinking 4. Continue to optimize the dichotomy Realization Definition of title Given a n array of N integers nums a ...

Posted by freephoneid on Sat, 18 Jan 2020 18:46:15 +0100

Two week self-made scripting language - day 5 design of parser

Day 5 design parser 5.1 syntax of stone Listing 5.1 syntax definition of stone primary : "(" expr ")" | NUMBER | IDENTIFIER | STRING factor : "-" primary | primary expr : factor { OP factor } block : "{" [ statement ] { (";" | EOL) [ statement ] } "}" ...

Posted by bostonmacosx on Fri, 17 Jan 2020 15:44:27 +0100

An example of using Websocket developed by Python

I learned how to implement web development in java. Today I want to try to implement it in python, so I found the code on the Internet 2.1. Effect 1 (a client connects to the service and sends a message) 2.2. Effect 2 (another client connects to the service and sends a message) 2.3. Effect 3 (the servic ...

Posted by starmikky on Fri, 17 Jan 2020 15:14:10 +0100

Pandas basic introduction pandas string and index reconstruction

Learning summary: Click here. String function Pandas provides a set of string functions to operate on string data conveniently. Most importantly, these functions ignore (or exclude) missing / NaN values. Almost all of these methods use Python string functions (see: Here ) Therefore, convert the Ser ...

Posted by English Fire on Fri, 17 Jan 2020 13:47:50 +0100

Spark Big Data-Spark+Kafka Build Real-Time Analysis Dashboard

Spark+Kafka Build Real-Time Analysis Dashboard I. Framework Spark+Kafka is used to analyze the number of male and female students shopping per second in real time, Spark Streaming is used to process the user shopping log in real time, then websocket is used to push the data to the browser in real ti ...

Posted by t31os on Fri, 17 Jan 2020 03:40:05 +0100

python implements tail-f function

This article was originally written because there was an interview in the reboot group, and the written examination question had this question. I don't know how to do it, what kind of thinking, so I sent it to everyone in the group for discussion I've thought about it for a moment. Let's briefly talk about my idea. Of course, there is also a ve ...

Posted by markstrange on Thu, 16 Jan 2020 19:30:52 +0100

Reading yaml file with linux shell

1, Installing python3.7.0 on Linux centos 6 / 7, the default installation of centos system is python2. X (in fact, I'm centos 6.5, and centos default installation of python2.6.6). Version x is different according to different versions of the system. You can view the python version of the system throug ...

Posted by techcone on Thu, 16 Jan 2020 06:30:04 +0100

[Python3 Crawler] Crawl records of JS-encrypted data at once

1. Preface This is a record of cracking JS encrypted data on a website at: https://www.qimingpian.cn/finosda/event/einvestment To get the investment event information on this page, you can first confirm that the data is transmitted through AJax, not written directly in the source code of the web page.   2. Steps 1. Grab a bag Open the develop ...

Posted by k4pil on Thu, 16 Jan 2020 03:39:27 +0100

Python Crash Course Reading Notes - Chapter 6: DICTIONARIES

A dictionary in Python is a collection of key:value pair s.Similar to Map or lookup table s in other languages. The key must be a string, and the value can be any object. Both key and value can use variables. Simple Dictionary student = {'name': 'tony', 'age': 14} print(student ['name']) print(studen ...

Posted by Mortier on Thu, 16 Jan 2020 02:10:34 +0100

Connect raspberry pie to Microsoft cloud Azure IoT Hub in 30 minutes and show the data as a visual chart

Raspberry pie is a necessary toy for many hands-on people. In this section, let's take out raspberry pie, connect it to Microsoft cloud Azure's IoT Hub in 30 minutes, and then visualize the temperature and humidity curve. More content, please pay attention to the public number "cloud computing actual combat". For the complete operat ...

Posted by hakhaimo on Wed, 15 Jan 2020 05:36:38 +0100