Python 3-asyncio Learning Notes 1 -- call_soon

Recently, I have been studying asyncio of Python 3. I will record my learning notes here. Let's start with a simple example: import asyncio def hello_world(loop):     print('Hello World')     loop.stop() loop = asyncio.get_event_loop() # Schedule a call to hello_world() loop.call_soon(hello_world, loop) # Blocking call interrupted by loop ...

Posted on Thu, 14 Feb 2019 16:51:18 -0800 by stick_figure

Installation of cx_Oracle in MAC El Capitan version above

In fact, the installation steps are very simple, according to the installation of other blogs: http://thelaziestprogrammer.com/sharrington/databases/oracle/install-cx_oracle-mac You can finish it quickly. But my version is MacOs Sierra, no matter how installed it is: Traceback (most recent call last): File "<string>", line 1, in &l ...

Posted on Thu, 14 Feb 2019 02:06:18 -0800 by AstroTeg

Caffe Learning Notes (4): Use pycaffe to generate train.prototxt, test.prototxt files

For reprinting, please indicate the author and source: http://blog.csdn.net/c406495762 Python version: Python 2.7 Operating platform: Ubuntu 14.04 I. Preface Knowing the content of the last note, you can try to write your own python program to generate prototxt files, of course, you can also create files directl ...

Posted on Wed, 13 Feb 2019 02:15:20 -0800 by Frederick

2017-07-27 DBA Diary, using Python to interpret MySQL 5.6 slow query.log

Objective (Why) In mysql 5.6 environment, improve the readability of slow_query.log and locate slow query SQL quicklyUsers (Who)MySql DBAWhat1. Data acquisition: open mysql slow query log, the method is as follows:set global slow_query_log='ON'set global slow_query_log_file='/u01/log/slow_query.log'set global slow_launch_time=22. ETL: Using py ...

Posted on Wed, 13 Feb 2019 00:09:20 -0800 by auteejay

review what i studied `date` - 2017-4-10

Writing scripts will usecurl -o /dev/null -s -w %{http_code} http://localhost 200 #Return site status codezabbix visualization: A Graph corresponds to an Itemsimple checkTo put it bluntly, it's to do some simple operations manually, such as ping nmap port sweep, etc.Everything is automatically operated by zabb ...

Posted on Tue, 12 Feb 2019 12:12:19 -0800 by tams

Dual-embedded LSTM for QA match: Double embedding LSTM Chat Matching Model

Firstly, the structure diagram of the model is presented. In the case of LSTM model, one of rnn's usages is encoding, which is basically used as a sequence model. There are a lot of paper s about LSTM that Google by themselves. The following model is my own experiment, the effect is good, can be used for in-depth learning training of chat robot ...

Posted on Tue, 12 Feb 2019 01:39:18 -0800 by fenway

You cannot create a database with db.create_all() under flask_script

Recently, when we were building a new project, we encountered such a problem. flask_sqlalchemy could not create tables of database by using factory function to build the project. It had been a long time to query, and now we finally found the problem. Project Structure Tree CMDB/ ├─app/ │ ├─auth/ │ ├─main/ │ ├─static/ │ ├─templates/ │ ├ ...

Posted on Mon, 11 Feb 2019 19:00:17 -0800 by markjohnson

[This code is very Pythonic] Built-in functions in Python

Preface In the standard library chapters of Python official documents, the first section is a brief introduction, and the second section is Built_in Functions. It can be seen that built-in functions are an important part of Python standard library, but there are many built-in functions that we seldom use or don't know that there are such good f ...

Posted on Mon, 11 Feb 2019 11:18:19 -0800 by dt_gry

openfalcon adds http remote monitoring (for status code and for content match)

Make a small falcon script, first, can you monitor the return of http, if 2xx or 3xx is right, otherwise 111; second, monitor whether the content contains, if it contains that is right, otherwise return 111 Code directly #!/usr/bin/env python #coding: utf-8 import os, sys, re import json import requests import time import urllib2, base64 fr ...

Posted on Mon, 11 Feb 2019 10:51:18 -0800 by fastfingertips

C++ && Python Implementation of Eight Sorting Algorithms - Direct Insertion Sorting

Algorithmic ideas: The idea of direct insertion sort is to start with the first element of the sequence to be sorted and compare the two adjacent elements in turn. If the latter is smaller than the former (from small to large), the latter is inserted into the correct position of the sequence as a sentry. So the question arises. How can we ...

Posted on Sun, 10 Feb 2019 19:48:17 -0800 by amjohnno