Tag:Easy to use

  • 10 recommended Python code habits


    In daily work, we need to write many scripts and small projects, share some experience and code habits, be subjective, take care of ourselves, and seek common ground while reserving differences. Use tqdm package to check the processing progress. Complex situations can be consideredfastprogress There are too many parameters and you want the terminal to […]

  • Uibutton disable highlighting


    reference resources: https://www.itranslater.com/qa/details/2129903136516080640 Method 1: setting the highlight is the same as that of selected (if there is title, image, etc., it should also be set in this way, which is not recommended) button.adjustsImageWhenHighlighted = NO; [button setBackgroundImage:[UIImage imageNamed:@”switch_close”] forState:UIControlStateNormal]; [button setBackgroundImage:[UIImage imageNamed:@”switch_open”] forState:UIControlStateSelected]; [button setBackgroundImage:[UIImage imageNamed:@”switch_open”] forState:UIControlStateSelected | UIControlStateHighlighted]; Method 2: uicontroleventalltouchevents (recommended) [button […]

  • Nginx reverse proxy configuration of Jenkins


    Sometimes, in order to facilitate use and not expose too many ports, we need to reverse proxy some services of the server For the nginx reverse proxy configuration of Jenkins, please refer to the following contents location / { proxy_pass; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; […]

  • [go] project from scratch – create restful style API based on gin framework


    The package structure of the code is to create three directories bin SRC PKG in the gopath environment variable directory If the code is placed in GitHub, create a new GitHub in the SRC directory COM / user name / warehouse name} this directory for development     The gin framework has now been updated […]

  • Several ways for Python to read test data


    1、 By creating Ini or Conf file read 1. Create a config Ini or Conf file. This method is to read the INI file, as follows [api] url = www.taobao.com method = get [mysql] db=hello port=3306 2. Use Python’s configparser library to read, and the code is as follows from configparser import ConfigParser import os […]

  • Installation and use of NRM


    1、installnodejs, download address,http://nodejs.cn/download/,Click Next directly during installation After installationcmdinputnpm -v View currently installednpmVersion of,As shown in the following figure, the installation is successful.   2、View currentnpmConfiguration of CMD enter NPM config list or NPM config LS   metrics-registry = “https://registry.npm.taobao.org/” Represents the currentnpmMirror source forurl 3、nrmintroduce nrmThe function of is to facilitate user switchingnpmThe source address […]

  • Django | requestcontext and context


    edition django 1.8.3 sketch Usually we are practicingdjangoWhen rendering, you need to usecontextTo parse the rendering template.Usually,contextyesdjango.template.ContextAn instance of, but incontextThere is also a special subclass in,django.template.RequestContext, this andcontextA little different.RequestContextBy default, in the templatecontextAdd some variables to the Use context from django.template import Context c = Context({ ‘foo’: ‘bar’, }) Using requestcontext RequestContextuseHttpRequestAs the […]

  • Alibaba cloud SMS sending SDK


    Code encapsulation sms.proto syntax = “proto3”; package sms; //Send SMS parameters message SmsRequest { string mobile = 1; // cell-phone number string template = 2; // Template number string payload = 3; // Additional parameters } SDK initialization parametersoptions.go /** * Author: [email protected] * Date: 2020/1/16 * Time: 15:42 * Software: GoLand */ package sms […]

  • Microsoft open source rust / winrt, easy to use rust to build Windows Applications


    A series of articles: awesome rust Mongodb officially released mongodb rust driver Rust organization on GitHub Learn rust through examples Rust implementation of common algorithms Lightweight Windows GUI tool library based on Rust Chinese English comparison of rust language terms Official weekly diary of rust Small and fast rust asynchronous runtime SMOL Microsoft open source […]

  • Turning STM32 bluepilot into a debugger (daplink)


    In order to tune an arm M0 kernel board, the official demo board is used. The daplink debugger is integrated on the board. In order to make it easy to use, I cut off the target board from the daplink, and then connected the daplink with the target board with DuPont cable. However, Keil could […]

  • Co source code interpretation


    /** *Extracting slice() function is convenient to use */ var slice = Array.prototype.slice; /** *Exposure ` co ‘ */ module.exports = co[‘default’] = co.co = co; /** *Wrap the generator function ‘FN’ and return promise * This is a separate function so that * every `co()` call doesn’t create a new, * unnecessary closure. * […]

  • Django — Web Framework (based on wsgiref)


    1Web Framework Web framework is based on more than ten lines of code, there are many simple and convenient methods, greatly improve the efficiency of development 2Write a web framework based on wsgiref      models.py ”’ Linked database return dictionary format: cursor=pymysql.cursors.DictCursor ”’ import pymysql #Connect to database conn = pymysql.connect (host =’ ‘, […]