Tag:python

  • 7.ORM and SQLAlchemy (3) – flask-migrate database migration

    Time:2019-10-23

    In the previous article, we added two modelsQuestionsandCommentsAnd for theUsersincreasedavatar_pathThis field is then updated to the database with this code: with app.test_request_context(): db.drop_all() db.create_all() Because when useddb.create_all()After that, use it directly againdb.create_all(), the changes to the model will not be updated to the databasedb.drop_all()Delete all the tables in the database first, thendb.create_all()At a time. Sounds […]

  • Build React Native Android development environment under Windows & build project

    Time:2019-10-23

    Description: Build React Native Android development environment and basic React Native project under Windows Environment variable add control panel -> system and security -> system -> advanced system Settings -> advanced -> environment variable -> new The project is built and debugged by real machine. If necessary, Android emulator is used Reference documentation https://reactnative.cn/docs/g… I. […]

  • Programmer picks: TensorFlow and ML top 5 courses

    Time:2019-10-23

    Abstract:How can you learn machine learning without these resources? (TFboy discipline) If you’re curious about artificial intelligence, data science, and machine learning, I’m sure you’ve heard of Google’s machine learning API, TensorFlow, which they’ve used to develop their Rank Brain algorithm for Google search. TensorFlow is one of the most popular machine learning apis that […]

  • Read the coroutine code in Tornado again

    Time:2019-10-23

    More than a year ago the http://segmentfault.com/a/1190000000426460 to read this article, plus some jscoGive me the knowledge, have a deeper understanding. Front Knowledge yield and generator will be the front knowledge of this article. And you should also have some sense of epoll/kqueue and callback style. Let’s enjoy the source code of the implement of […]

  • Why is linear or problem inseparable

    Time:2019-10-23

    Why is the xor problem linearly indivisible? When you read the textbook, it’s often said that perceptrons (single layer neural networks) can’t solve the xor problemWhy??? because Perceptrons deal with linear problems An xor problem is a nonlinear problem What is linearly separable? Whether an n-dimensional binary dataset is linearly separable depends on whether there […]

  • An integrated neural network, GoogLeNet

    Time:2019-10-23

    1. Introduction We’ve already talked about AlexNet, so let’s look at GoogLeNet. GoogLeNet won the first prize in the 2014 ImageNet challenge (ILSVRC14). So how does GoogLeNet improve network performance?Generally speaking, the most direct way to improve the network performance is to increase the depth and width of the network. Depth refers to the number […]

  • 10 lines of Python code, batch compression of 500 pictures, is too powerful

    Time:2019-10-23

    This article is original and first published on the public account [Python is a cat, without authorization, do not reprint.The original address: https://mp.weixin.qq.com/s/5hpFDgjCpfb0O1Jg-ycACw Readers familiar with “Python cat” should know that all of my posts use highly distinctive illustrations — cat for the original article and dog for the reproduced article, with rare exceptions. These […]

  • Python3 web crawler practice –1, request library installation: Requests, Selenium, ChromeDriver

    Time:2019-10-23

    Python3 web crawler actual practice –2, request library installation: GeckoDriver, PhantomJS, Aiohttp Crawlers can be simply divided into several steps: grab the page, analyze the page, store data. In the process of fetching the page in the first step, we need to simulate the browser to make a request to the server, so we need […]

  • 2019 write up

    Time:2019-10-21

    Preface Liver a day, finally hit the third, record.It’s really a good dish~~~~ Reverse baby_reverse The encryption function is as follows int __fastcall encode(const char *a1, __int64 a2) { char v3[32]; // [rsp+10h] [rbp-70h] char v4[32]; // [rsp+30h] [rbp-50h] char v5[36]; // [rsp+50h] [rbp-30h] int v6; // [rsp+74h] [rbp-Ch] int v7; // [rsp+78h] [rbp-8h] int […]

  • Chapter 4, Section 1 of algorithm diagram

    Time:2019-10-21

    4.1 write the code for the sum function. def diy_sum(arr): if not arr: return 0 elif len(arr) == 1: return arr[0] else: return arr.pop(0) + diy_sum(arr) arr = [1, 2, 3] print(diy_sum(arr)) 4.2 write a recursive function to calculate the number of elements in the list. def count_elements(list): if not list: return None elif len(list) […]

  • Linux view all users of a user group (Python Implementation)

    Time:2019-10-21

    code # encoding: utf-8 # author: walker # date: 2017-07-31 #Summary: Linux view all users of a user group # filename: group_users.py import sys #Print all members of a group def ShowGroupUsers(group_name): group_id = ‘err’ users = ” with open(‘/etc/group’) as f: for line in f: line = line.strip() vec = line.split(‘:’) if vec[0] == […]

  • Django building personal blog: logging

    Time:2019-10-21

    In the last chapter, I learned about automated testing, which is very good. Now we can work hard to write a comprehensive test to ensure that the code is always healthy. That said, as an independent developerIt’s hard to write really comprehensive test code。 This is because users will not follow the rules when using […]