javascript export default (str) = { // 建立数据结构,堆栈,保存数据 let r = [] // 给定任意子输入都返回第一个符合条件的子串 let match = (str) = { let j = str.match(/^(0+|1+)/)[0] let o ...
分类:
其他好文 时间:
2020-01-26 11:45:58
阅读次数:
80
具体错误日志如下:The resulting error log is as followsTraceback (most recent call last): File "train.py", line 441, in train() # train normally File "train.py... ...
分类:
其他好文 时间:
2020-01-25 10:19:41
阅读次数:
313
let str = `"foo" and "bar" and "baz"` //方法一 function select (regExp, str) { const matches = [] while (true) { const match = regExp.exec(str) if(match ...
分类:
其他好文 时间:
2020-01-24 15:49:45
阅读次数:
118
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo ...
分类:
其他好文 时间:
2020-01-24 09:22:44
阅读次数:
62
//先行断言:先遇到一个条件,判断后面的条件是否满足 let test = 'hello world' console.log(test.match(/hello(?=\sworld)/)) //后行断言 //判断world的前面是不是hello console.log(test.match(/(? ...
分类:
其他好文 时间:
2020-01-24 00:28:40
阅读次数:
108
1 # Author:Winter Liu is coming! 2 import cv2 as cv 3 import numpy as np 4 import matplotlib.pyplot as plt 5 6 7 def match_demo(src1, src2): 8 res = c ...
分类:
其他好文 时间:
2020-01-23 22:41:59
阅读次数:
100
常用属性,界面跳转,按钮学习,按压颜色的变换,图片的插入学习等 工程目录: MainActivity.java: package com.example.revrse; import androidx.appcompat.app.AppCompatActivity; import android.c ...
分类:
其他好文 时间:
2020-01-23 16:48:44
阅读次数:
88
Android开发 UI布局一、线性布局LinearLayout 什么是线性布局? 其实呢,线性布局就是把所有的孩子摆在同一条线上 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.a ...
分类:
移动开发 时间:
2020-01-22 21:36:50
阅读次数:
91
一、前言 暴力匹配(Brute Force Match) 是字符串匹配算法里最基础的算法,虽然效率比较低,但胜在方便理解,在小规模数据或对时间无严格要求的情况下可以考虑。 二、代码 C include include int bf(char l,char s); int main(void) { c ...
分类:
编程语言 时间:
2020-01-22 16:39:56
阅读次数:
143
def is_number(num): ''' 判断是否为数字 :param num: :return: ''' pattern = re.compile(r'^[-+]?[-0-9]\d*\.\d*|[-+]?\.?[0-9]\d*$') result = pattern.match(str(nu ...
分类:
编程语言 时间:
2020-01-22 16:23:51
阅读次数:
81