• [share] IOS development – realize the effect that uilabel displays different colors and some parts are underlined


    design sketch: @interface XSRecommendedPrivilegeViewController () @property (weak, nonatomic) IBOutlet UIButton *payButton; @property (weak, nonatomic) IBOutlet UILabel *termsLabel;// Terms of service @end @implementation XSRecommendedPrivilegeViewController -(void)viewDidLoad { [super viewDidLoad]; self.payButton.layer.masksToBounds = YES; self.payButton.layer.cornerRadius = 7; Nsstring * changestring = @ “listener package terms of service”; Nsstring * termsstring = [nsstring stringwithformat: @ “click next to agree% @, […]

  • Hive function — windowing function 1


    Windowing function First acquaintance Window: the range of datasets that the function evaluates at run timeFunction: running function! Only the following functions are supported: Windowing functions: LEAD: LEAD (scalar_ Expression [, offset] [, default]): returns the column value of the specified column of the following n rows of the current row! If not found, the […]

  • IOS development learning – uiscrollview


    1. Usage of uiscrollview: (1) Add the content to be displayed to uiscrollview(2) Set thecontentSizeProperty, which tells uiscrollview the size of all the content, that is, tells it the rolling range (how far it can roll and where it ends) 2. The solution of uiscrollview unable to scroll If uiscrollview cannot scroll, some of the […]

  • Golang slicing tool class


    package services import ( crand “crypto/rand” “errors” “fmt” “github.com/astaxie/beego/orm” “io” “math/rand” “strconv” “strings” “time” ) type UtilService struct { } //uuid func (this *UtilService) Uuid() (string, error) { uuid := make([]byte, 16) n, err := io.ReadFull(crand.Reader, uuid) if n != len(uuid) || err != nil { return “”, err } uuid[8] = uuid[8]&^0xc0 | 0x80 […]

  • Dry goods time series database partition tutorial (1)


    1. Why partition data? Partitioning the database can greatly reduce the system response delay and improve the data throughput. Specifically, zoning has the following benefits: Partitioning makes large tables easier to manage. Maintenance operations on data subsets are also more efficient because they are only for the data needed, not the entire table. A good […]

  • Regular Chinese character number case in Python


    Remove special characters and keep only Chinese, English and numbers import re String = “123I 123456abcdefgabcvdff? /,.:;: ‘;’] {} () ()” print(string) 123I 123456abcdefgabcvdff? /,.:; “‘;”‘ [] {} () () sub_str = re.sub(u”([^\u4e00-\u9fa5\u0030-\u0039\u0041-\u005a\u0061-\u007a])”,””,string) print(sub_str) result: 123I 123456abcdefgabcvdff function explain sub(pattern,repl,string) Replace all the matching expressions in the string with repl [^**] Indicates that it does […]

  • [C language programming] buy a hundred chickens for a hundred dollars (a hundred chickens for a hundred dollars, a hundred chicken problems)!


    Zhang Qiujian, an ancient Chinese mathematician, put forward a famous “one hundred dollars for one hundred chickens” question in his Suan Jing. He asked the following questions: Chicken Weng 1, worth five, chicken mother 1, worth three, chicken chick 3, worth one, hundred dollars for one hundred chickens, how many are Weng, mother and chick? […]

  • Bidirectional sliding selector (interval selector) on the side of small program


    Development found that there is no more convenient and smooth two-way selector on the small program side, so a simple plug-in is encapsulated <view class=’sliderView’ id=”slider” > <movable-area class=”slider_warp”> <view class=”slider_line”></view> <view class=”slider_line_top” style=”left:{{_sliderLineLeft}}px;width:{{_sliderLineWidth}}px” ></view> <movable-view class=”left” direction=”horizontal” x=”{{_sliderMinLeft}}” animation=”{{!enAnimation}}” bindchange=”sliderChange” data-type=”min” ></movable-view> <movable-view class=”right” direction=”horizontal” x=”{{_sliderMaxLeft}}” animation=”{{!enAnimation}}” bindchange=”sliderChange” data-type=”max” ></movable-view> </movable-area> </view> js Component({ […]

  • Drawing charts in wechat applet (Part2)


    Outline of this issue 1. Determine the range of ordinate and draw 2. Draw broken line according to real data Related reading:Drawing chart in wechat applet (Part1)Drawing charts in wechat applet (Part3) Follow megithubProject view full code. Determine the range of ordinate and draw In order to avoid decimals in the scale of the ordinate, […]

  • High performance mysql (version 3)_ Selection of data type_ Integer type


    Integer type in MySQL integer type in MySQL Tinyint, smallint, mediumint, int, bigint (corresponding size: XS, x, m, l, XL), which each occupies 8, 16, 24, 32, 64 bit storage space, the storage range is: – 2 (n-1) ~ 2 (n-1) – 1, tinyint range is – 127 ~ 128. The unsigned property Unsigned attribute: […]

  • Notes on C / C + + Programming: what should we do when the C + + data type exceeds the valid range?


    First, let’s consider the following procedure. 1) The program shows what happens when we cross the ‘char’ range:   Will this code print “a” until it becomes 226? The answer is an indefinite loop, because the “a” here is declared as a character and its valid range is – 128 to + 127. When “a” […]

  • Data type of MySQL


    value type Integer type of MySQL type Storage space occupied (unit) The value range without sign There is a consistent range of values definition TINYINT 1 0 ~ 2⁸-1 -2⁷ ~ 2⁷-1 A very small integer SMALLINT 2 0 ~ 2¹⁶-1 -2¹⁶ ~ 2¹⁶-1 Small integer MEDIUMINT 3 0 ~ 2²⁴-1 -2²⁴ ~ 2²⁴-1 Medium […]