properties

java集合 之 Map集合

前提是你 提交于 2020-03-29 20:53:24
Map用于保存具有映射关系的数据,具有两组值:一组用于保存Map中的key;另一组用于保存Map中的value,形成key-value的存储形式 。 Map集合中包含的一些方法: void clear(): 删除Map集合中的所有key-value对。 boolean containsKey(object key): 查询Map集合中是否包含指定的key,如果包含,返回true。 boolean containsValue(Object value): 查询Map集合中是否包含指定的value,如果包含返回true。 set entrySet(): 返回Map中包含的key-value对所组成的Set集合,每个集合元素都是Map.Entry(Entry是Map的内部类)对象。 Object get(Object key): 返回指定的key所对应的value;如果此Map中不包括该key,则返回null。 boolean isEmpty(): 查询该Map是否为空,如果为空则返回null。 set keyset(): 返回该map中所有key所组成的集合。 Object put(Object key,Object value): 添加一个key-value对,如果当前Map中已有一个与该key相等的key-value对,则新的key-value会覆盖原来的key-value对。

Swift readonly external, readwrite internal property

寵の児 提交于 2020-03-29 07:06:11
问题 In Swift, what is the conventional way to define the common pattern where a property is to be externally readonly, but modifiable internally by the class (and subclasses) that own it. In Objective-C, there are the following options: Declare the property as readonly in the interface and use a class extension to access the property internally. This is message-based access, hence it works nicely with KVO, atomicity, etc. Declare the property as readonly in the interface, but access the backing

Java项目命名规范

烂漫一生 提交于 2020-03-25 12:19:20
一、项目名称 最好用英文,所有单词全部用小写,如testjavaproject、studentmanagement等,当然也也可以用中文,如“学生管理系统”、”进销管理系统“等。 二、Java project中相关命名 1、包名:全部小写字母,最好用域名反过来写,不会冲突。如com.cnblogs.lionestking.myutil等。 2、类名:每个单词首字母均大写,且public类应用项目同名. 3、方法名和对象名(变量名):除第一个单词首字母小写外(若只能一个单词,就全部小写),其余单词首字母均大写。方法名采用动词+名词或动词表示,如append()、getName()等。 4、属性名:和对象命名方法相同,采用名词或形容词+名词的形式表示,如name、dbClassName、dbUser、dbPassword、dbUrl等。 5、常量:均大写,可以加一些前缀,以_进行分隔。 三、属性文件.properties定义变量命名 object.a_b_c格式,全部小写,其中object是宿主,a_b_c多个单词下划线分开。 例:hibernate.cache.use_second_level_cache,hibernate.cache.provider_class,hibernate.cache.provider_configuration_file_resource_path 四

Google Kaptcha 生成图形验证码

拥有回忆 提交于 2020-03-25 06:51:09
官方的pom <dependency> <groupId>com.google.code.kaptcha</groupId> <artifactId>kaptcha</artifactId> <version>2.3.2</version> </dependency> 阿里的maven仓库pom <dependency> <groupId>com.github.penggle</groupId> <artifactId>kaptcha</artifactId> <version>2.3.2</version> </dependency> 控制验证码的图片的生成的规则的配置信息都放到了com.google.code.kaptcha.util.Config类中 package com.google.code.kaptcha.util; import java.awt.Color; import java.awt.Font; import java.util.Properties; import com.google.code.kaptcha.BackgroundProducer; import com.google.code.kaptcha.GimpyEngine; import com.google.code.kaptcha.NoiseProducer; import com

Dumb experiment - creating C#-esque properties in PHP

 ̄綄美尐妖づ 提交于 2020-03-24 13:47:17
问题 I'm trying to come up with a graceful way to create C#-esque properties in PHP Right now, I have: class Example { private $allowedProps = array('prop1', 'prop2', 'prop3'); private $data = array(); public function __set($propName, $propValue) { if (in_array($propName, $this->allowedProps)) { // set property } else { // error } } public function __get($propName) { if (array_key_exists($propName, $this->data)) { // get property } else { // error } } } In the commented out sections, for something

java属性文件读取,属性修改

喜夏-厌秋 提交于 2020-03-24 12:46:31
/** * 属性文件读取 * @author bestmata * */ public class CommUtil { private static Logger logger=Logger.getLogger(CommUtil.class); private Properties getAttionReplyPro(){ try { InputStream in=CommUtil.class.getResourceAsStream("attionReply.properties"); Properties p=new Properties(); p.load(in); in.close(); return p; } catch (Exception e) { logger.error(e); } return null; } //获取关注的标示 public String getAttionFlag(){ Properties p=getAttionReplyPro(); String attionFlag=p.getProperty("attionFlag"); return attionFlag; } //设置attionFlag的值 public void setAttionFlag(String flag){ try { Properties p

JeePlus:项目部署

会有一股神秘感。 提交于 2020-03-21 23:35:49
ylbtech-JeePlus:项目部署 1. 返回顶部 1、 项目部署 1 开发工具:idea/eclipse/myeclipse+ mysql/oracle+tomcat6/7/8。 下面以eclipse为例,讲述jeeplus的部署,其他工具类似。 1.1 开发环境:Eclipse 1.1.1 配置redis环境 启动redis 1.1.2 导入maven项目 在Eclipse中,选择File->Import;接着如下图所示 点击 Browse,选择项目所在的文件夹,然后Finish即将项目添加进来。 1.1.3 修改数据库链接 打开resource/properties/jeeplus.properties 1.1.4 使用maven命令启动 启动成功画面 1.1.5 输入license。 登录系统,打开表单配置,可以看见机器码,使用 序列号获取license ,打开/resources/properties/license.properties, 输入productID和license 就可以正常使用代码生成器功能了。 2、 2. 返回顶部 3. 返回顶部 4. 返回顶部 5. 返回顶部 0、 http://wiki.jeeplus.org/docs/show/5 1、 6. 返回顶部 作者: ylbtech 出处: http://ylbtech.cnblogs.com/

javascript: best way of checking if object has a certain element or property?

荒凉一梦 提交于 2020-03-21 17:58:34
问题 Suppose I have this: var person = { "name": "John Doe", "email": "john.doe@example.com" }; This object only has two elements called name and email . Some persons also have an element age , but this particular person doesn't. What's the best way to check this? if (person.age) { ... } if (person.age != undefined) { ... } if (person.age !== undefined) { ... } if (typeof(person.age) != 'undefined') { ... } if (person.hasOwnProperty('age')) { ... } I know all these don't do the same, e.g. if

Could not resolve placeholder

£可爱£侵袭症+ 提交于 2020-03-21 07:43:48
使用spring的<context:property-placeholder location="/WEB-INF/redis.properties"/>读取properties配置文件报错 Could not resolve placeholder 项目结构 配置 启动报错 顺着这个错误向上找发现.properties文件没有全部加载, log4j.properties在web.xml中配置加载, jdbc.properties和redis.properties文件都配置在application.xml文件中, 从控制台上可以发现redis.properties文件并没有被加载 INFO: Set web app root system property: 'webapp.root' = [D:\soft\MyEclipse Professional2013workspace\.metadata\.me_tcat\webapps\zjx-springmvc\] 七月 24, 2016 12:16:29 上午 org.apache.catalina.core.ApplicationContext log INFO: Initializing log4j from [D:\soft\MyEclipse Professional2013workspace\.metadata\.me

Android读写properties配置文件

余生颓废 提交于 2020-03-20 08:54:02
写这篇文章之前可以成功运行,文章后就各种找不到文件.所以并没有采用此种方式,后期完善.详见下篇解决方案. 配置文件读取很容易,修改需要注意权限,比如 assets目录下就不允许修改 . 配置文件的创建: New --- File 命名后选择properties方式打开 配置文件设置 contrastIP = 192.166.1.65:8011 assets目录创建 在main目录下,与java res 目录同级创建. New --- Folder --- Assets Folder assets目录详解: http://blog.csdn.net/chuntiandejiaobu10/article/details/52352128 权限配置 在 AndroidManifest.xml 中添加: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> 其实我去掉后测试也可以成功运行.还是加上.预防万一. 先读配置: 方法一 读取assets目录下的配置 Properties props = new Properties();