info

Java集合框架之Map实例解析

為{幸葍}努か 提交于 2019-12-03 09:35:56
1、Map概述 1.1 什么是Map Map是将 键映射到值( key-value ) 的对象。一个映射 不能包含重复的键 ;每个键最多只能映射到一个值。Map 接口提供三种collection 视图,允许以 键集 (keySet())、 值集 (values())或 键-值映射关系集 (entrySet())的形式查看某个映射的内容( 即获取键值对的内容 )。 映射顺序定义为迭代器在映射的 collection 视图上返回其元素的顺序,即 可以映射得到键、值和键-值的Set集合 ,元素的顺序是由得到的Set集合所决定的。某些映射实现可明确保证其顺序,如 TreeMap 类;另一些映射实现则不保证顺序,如 HashMap 类 。 1.2 Map与Collection的区别 1.Map 存储的是键值对形式的元素,键唯一,值可以重复。 2.Collection 存储的是单列元素,子接口Set元素唯一,子接口List元素可重复。 3.Map集合的数据结构值针对键有效,跟值无关,Collection集合的数据结构是针对元素有效 关于Collection可以戳这里 java集合框架之Collection实例解析 2、Map继承体系 下面列出了常见Map集合的继承体系与他们的特点 ---Map 键唯一 |------HashMap 基于哈希表的 Map 接口的实现。此实现提供所有可选的映射操作

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quick

谁说我不能喝 提交于 2019-12-03 09:30:34
很久用eclipse了,创建maven的quickstart项目时出现错误“Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quick……” emmm,网上看到的方法是下载一个maven-archetype-quickstart-1.1.jar文件,之后执行安装,刚好我本地有一个这样的文件,就将其复制到maven安装目录下的lib目录中,并执行如下的命令 mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-quickstart-1.1.jar 忽然想为啥会出现这个问题?明明之前使用eclipse的时候都没什么事。 看到执行上述mvn时出现的INFO如下 [INFO] Scanning for projects... [INFO] [INFO] ------------------< org.apache.maven:standalone-pom >------------------- [INFO] Building Maven

外卖管理系统

久未见 提交于 2019-12-03 09:18:42
import sys menu = ''' 1)店铺信息 2)派送员信息 3)客服人员信息 4)订单信息 5)配送信息 ''' # print(menu). class Shop(object): ''' 店铺信息 ''' def __init__(self): self.shop_info = {'肯德基': {'菜品': ['全家桶', '炸鸡', '鸡肉卷']}, '金桥美食广场': {'菜品': ['麻辣烫', '麻辣香锅', '烤肉拌饭']}} # 查看店铺 def show(self): print(self.shop_info) # 添加店铺 def add(self): self.add_name = input('请添加店铺名称:') self.food = input('请添加菜品名称:') self.shop_info[self.add_name] = {'菜品': [self.food]} # 删除店铺 def delete(self): self.del_name = input('请输入你要删除的店铺:') self.shop_info.pop(self.del_name) print('已开除:{}'.format(self.del_name)) class Courier(object): ''' 派送员信息 ''' def __init__

Get Specific Info From SQL Error Message 547

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do I correctly extract specific info from an sql error message number 547? Info Required: Table Name Constraint Name Column Name Code: Try .... Catch ex As System.Data.SqlClient.SqlException If ex.Number = 547 Then End If End Try Sample message: UPDATE statement conflicted with COLUMN CHECK constraint 'CK_Birthdate'. The conflict occurred in database 'Northwind', table 'Employees', column 'BirthDate'. 回答1: There is no straight forward way of getting these pieces of information separately. It all gets concatenated into the error message.

Spark Shell Listens on localhost instead of configured IP address

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to run a simple spark job via spark-shell and it looks like BlockManager for the spark-shell listens on localhost instead of configured IP address which causes the spark job to fail. The exception thrown is " Failed to connect to localhost " . Here is the my configuration: Machine 1(ubunt64): Spark master [192.168.253.136] Machine 2(ubuntu64server): Spark Slave [192.168.253.137] Machine 3(ubuntu64server2): Spark Shell Client[192.168.253.138] Spark Version: spark-1.3.0-bin-hadoop2.4 Environment: Ubuntu 14.04 Source Code to be

Cant get RTSP stream - nonmatching

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using Raspberry Pi3 and I`m trying to get a RTSP stream through my wireless IP camera, but I'm getting this error: pi@raspberrypi:~ $ alprd -f INFO - Running OpenALPR daemon in the foreground. INFO - Using: /etc/openalpr/alprd.conf for daemon configuration Missing config value for company_id Missing config value for pattern INFO - Using: /home/pi/Database/pictures for storing valid plate images INFO - country: br -- config file: /etc/openalpr/openalpr.conf INFO - pattern: INFO - Stream 1: rtsp://192.168.1.230:554/onvif1 INFO - Starting

PowerShell script doesn&#039;t work correctly from Windows Task Scheduler

匿名 (未验证) 提交于 2019-12-03 09:14:57
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Overview: I have a script I am using to query new application requests within SCCM via WMI. The script works perfectly when launched manually within a PowerShell console (either elevated or not, doesn't matter). I need to run the script through Task Scheduler. Currently set up to run with admin credentials and the checkbox for 'Run with highest privileges' is checked. The Issue: Won't run correctly from Task Scheduler within Windows Server 2008 R2. No errors are reported (task scheduler returns error code of 0) but it doesn't seem to proceed

Spring Boot AngularJs Application: angular-bootstrap.css generation using wro4j-maven-plugin Fails

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am following the part 1 of this tutorial . I have reached this section " Loading a Dynamic Resource from Angular ". As per the tutorial instructions, when I build the aplication using maven mvn clean package , the wro4j-maven-plugin fails to generate the angular-bootstrap.css but the angular-bootstrap.js is generated successfully. I am getting the following warnings in the mvn console $ mvn clean package [ INFO ] Scanning for projects ... [ INFO ] [ INFO ] ------------------------------------------------------------------------ [

How to configure a Jenkins Pipeline for SonarQube scan

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to configure a jenkins pipeline for my project, but there is something missing here, if anyone could direct on what I am doing wrong: Below is the pipeline script: node { stage('SonarQube analysis') { // requires SonarQube Scanner 2.8+ def scannerHome = tool 'sonarScanner'; withSonarQubeEnv('SonarQube 6.2') { bat "${scannerHome}/bin/sonar-runner.bat" } } } Below is the Jenkins Sonar Plugin related configurations: Under Manage Jenkins > Configure System : Under Manage Jenkins > Global Tool Configuration Below is the error that I

Need help getting info across a UI thread and another thread in C#

匿名 (未验证) 提交于 2019-12-03 09:05:37
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a server application that receives information over a network and processes it. The server is multi-threaded and handles multiple sockets at time, and threads are created without my control through BeginInvoke and EndInvoke style methods, which are chained by corresponding callback functions. I'm trying to create a form, in addition to the main GUI, that displays a ListBox item populated by items describing the currently connected sockets. So, what I'm basically trying to do is add an item to the ListBox using its Add() function, from