ICode9

精准搜索请尝试: 精确搜索
  • .NET CORE3.1使用内置IOC自动注入2020-12-14 20:02:09

    在.NET CORE中注入时需要在Startup的ConfigureServices中写 services.AddScoped<IServices, Services>(); 项目如果比较大,每次写起来就会很麻烦,所以需要让程序可以自动注入 首先新建两个接口 IDenpendency,IDenpendcySingleton,或者使用特性也可以。 /// <summary> /// 使

  • 【LeetCode】217. Contains Duplicate 存在重复元素(Easy)(JAVA)每日一题2020-12-13 10:01:23

    【LeetCode】217. Contains Duplicate 存在重复元素(Easy)(JAVA) 题目地址: https://leetcode.com/problems/contains-duplicate/ 题目描述: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at

  • 算法-Contains Duplicate-存在重复元素2020-12-13 09:04:05

    1、题目描述 给定一个整数数组,判断是否存在重复元素。 如果任意一值在数组中出现至少两次,函数返回 true 。如果数组中每个元素都不相同,则返回 false 。 示例 1: 输入: [1,2,3,1] 输出: true 2、问题分析 用字典模拟哈希整数范围太大了,直接使用HashSetboolean put(Object va

  • 220. Contains Duplicate III(核心:set数组有序/桶排序)2020-12-06 12:03:00

    Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference between i and j is at most k.   Example

  • JAVA-获取内存和系统类型2020-12-05 18:05:05

    protected long getMemory() { OperatingSystemMXBean osmxb = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); return osmxb.getTotalPhysicalMemorySize(); }    protected String getOsType() { String osName

  • indexOf()与contains()的区别2020-12-01 17:01:23

    Java重拾基础1——包含——indexOf()与contains()的区别 2020/12/01 1、indexOf()相关语法: public int indexOf(int i): 返回指定字符在字符串中第一次出现处的索引,如果此字符串中没有这样的字符,则返回 -1。 public int indexOf(int i, int fromIndex): 返回从 fromIndex 位

  • Java期中测试6-2 数群2020-11-28 11:01:12

    请设计如下相关接口和类: 1) 接口IntegerGroup表示以某种方式定义的一组整数,称为数群,它可以为空,也可以包含一到多个整数。该接口包含唯一的函数boolean contains(int),返回某个整数参数是否在这个IntegerGroup对象里。如group1是IntegerGroup类型的一个对象,包含两个数字-5和3,那

  • Java判断是Android请求还是ios端请求2020-11-26 10:57:16

    在项目开发中,时常会碰到需要判断客户端请求来源是android机还是苹果机,或者是判断浏览器型号等。 那么在后台我们可以通过request对象获取我们想要的这些信息: public void toDownloadApp(HttpServletRequest request, HttpServletResponse response)throws Exception { Stri

  • 705. 设计哈希集合2020-11-19 14:33:42

    不使用任何内建的哈希表库设计一个哈希集合 具体地说,你的设计应该包含以下的功能 add(value):向哈希集合中插入一个值。contains(value) :返回哈希集合中是否存在这个值。remove(value):将给定值从哈希集合中删除。如果哈希集合中没有这个值,什么也不做。 示例: MyHashSet hashSet = n

  • xpath 定位2020-11-13 11:33:47

    1.绝对定位    以/开头 2.相对定位 以//开头     //标签名称[@属性名称=值] 3.逻辑运算符  and  or  //标签名称[@属性名称=值 and @属性名称=值]    //div[@class='ant-select-selection-selected-value’and @title='全部' and contains(@style,"display: block")]

  • 解决error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(dept2020-11-07 06:31:28

    参考: https://github.com/llSourcell/Object_Detection_demo_LIVE/issues/6 https://stackoverflow.com/questions/52739143/opencv-error-215assertion-failed-vscncontainsscn-vdcncontainsdcn 错误发生于opencv颜色空间转换时: im_lab = cv2.cvtColor(im_bgr, cv2.COLOR_BGR2L

  • LeetCode #217 Contains Duplicate2020-11-02 11:02:50

    题目 217. Contains Duplicate 解题方法 创建一个集合numset用来存放已经访问过的数,如果当前访问数已在numset中,返回True,遍历结束返回False。 时间复杂度:O(n) 空间复杂度:O(n) 代码 class Solution: def containsDuplicate(self, nums: List[int]) -> bool: numset =

  • Hive 报错Class path contains multiple SLF4J bindings.2020-10-31 05:00:41

    进入hive报错信息如下 SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/program/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/program/

  • Pandas Series.str.contains2020-10-25 21:01:30

      Series.str可用于以字符串形式访问系列的值并对其应用几种方法。Pandas Series.str.contains()函数用于测试序列或索引的字符串中是否包含模式或正则表达式。函数根据给定的模式或正则表达式是否包含在Series或Index的字符串中,返回boolean Series或Index。 语法: Series.str.

  • JAVA判断URL地址是否非法2020-09-27 18:31:38

          /** * 判断请求url是否非法 * @param url * @return */ public static boolean isValidRequestUri(String url) { if (StringUtils.isNotEmpty(url)) { if (hasSpecialChar(url)) { return true;

  • XPath2020-09-18 18:00:56

    starts-with 顾名思义,匹配一个属性开始位置的关键字 contains 匹配一个属性值中包含的字符串 text() 匹配的是显示文本信息,此处也可以用来做定位用 eg //input[starts-with(@name,'name1')] 查找name属性中开始位置包含'name1'关键字的页面元素 //input[contains(@name,'na')]

  • Solution of CF911G Mass Change Queries2020-09-10 20:31:20

    Summary of the question: You are given an array \(a\) consisting of \(n\) integers. You have to process \(q\) queries to this array; each query is given as four numbers \(l,r,x\) and \(y\), denoting that for every \(i\) such that \(l<=i&

  • 0705. Design HashSet (E)2020-08-03 08:01:18

    Design HashSet (E) 题目 Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a value into the HashSet. contains(value) : Return whether the value exists in the Hash

  • 705. Design HashSet2020-08-03 05:31:15

    Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a value into the HashSet.  contains(value) : Return whether the value exists in the HashSet or not. remove(va

  • wireshark常用过滤规则2020-05-31 10:02:15

    wireshark作为一款常用的抓包工具,对程序员调试非常重要,因此理出一些常用的过滤规则。 1.过滤IP,如来源IP或者目标IP等于某个IP 例子: ip.src eq 192.168.1.107 or ip.dst eq 192.168.1.107 或者 ip.addr eq 192.168.1.107 // 都能显示来源IP和目标IP src表示发送方,dst表

  • Qt开源作品16-通用无边框拖动拉伸2020-05-22 14:02:35

    一、前言 相信各位CS结构开发的程序员,多多少少都遇到过需要美化界面的事情,一般都不会采用系统的标题栏,这样就需要无边框标题栏窗体,默认的话无边框的标题栏都不支持拉伸和拖动的,毕竟去掉了标题栏则意味着失去了系统的窗体的属性,拉伸和拖动都需要自己写代码去实现,网上有很多类

  • selenium常见元素定位方式-Xpath2020-05-19 17:01:46

    这次讲怎么使用Xpath定位元素 1. 绝对定位(不推荐)   使用copy就能实现元素绝对定位:/html/body/div/blockquote/div[2]/div[1]/div[1]/div/button[1]/i   2. 相对定位(推荐)            1. 标签名 //form   2. 标签名+属性名+属性值 (要点:属性名前+@)  //div[@class="la

  • pandas 实现模糊检索2020-05-10 17:09:05

      1  生成一个dataframe >>> import pandas as pd   >>> df = pd.read_excel('students.xlsx', index_col='ID')  >>> df    name class

  • python selenium模块 xpath定位2020-04-22 16:55:39

    ''' 附w3xpath语法地址 https://www.w3school.com.cn/xpath/xpath_syntax.asp 总结: 返回匹配到所有符合条件的第一个节点,对象是 <class 'selenium.webdriver.remote.webelement.WebElement'> find_element_by_xpath 返回匹配到所有符合条件的所有节点,对象是个li

  • 查询表中最新一期资产负债率 ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contain2020-04-18 11:05:47

    mysql> select ts_code, max(end_date), debt_to_assets from tushare.fina_indicator group by ts_code; ERROR 1055 (42000): Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'tushare.fina_indicator.ann_date'

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有