james

python yaml用法

安稳与你 提交于 2019-12-14 00:18:24
YAML是一种直观的能够被电脑识别的的数据序列化格式,容易被人类阅读,并且容易和脚本语言交互。YAML类似于XML,但是语法比XML简单得多,对于转化成数组或可以hash的数据时是很简单有效的。 安装 pip install pyyaml 一、PyYaml 1、load() :返回一个对象 我们先创建一个yml文件,config.yml: name: Tom Smith age: 37 spouse: name: Jane Smith age: 25 children: - name: Jimmy Smith age: 15 - name1: Jenny Smith age1: 12 读取yml文件: import yaml f = open(r'E:\AutomaticTest\Test_Framework\config\config.yml') y = yaml.load(f) print (y) 结果: {'name': 'Tom Smith', 'age': 37, 'spouse': {'name': 'Jane Smith', 'age': 25}, 'children': [{'name': 'Jimmy Smith', 'age': 15}, {'name1': 'Jenny Smith', 'age1': 12}]} 2、load_all()生成一个迭代器

Start Apache James with jdk 1.7

喜欢而已 提交于 2019-12-12 11:07:22
问题 I have tried to run the apache-james-3.0-beta4 server on Linux Mint 64bit (Debian) with Java jdk 1.7u17, but it didn't work due to the JAXB library bug. According to the documentation different jar file should be downloaded (http://jaxb.java.net/2.1.13/JAXB2_20100510.jar) and put into the conf/lib directory. I did that, but the problem is still there. When I switched to jdk 1.6, everything started to work fine. Have anybody solved this problem? Here is a part of the stack trace: INFO 19:45:24

Can't receive emails from Apache James

三世轮回 提交于 2019-12-12 05:25:26
问题 I developed a webmail to link apache james and it works. But some user cannot receive emails from james. I set mailSession.setDebug(true) and trace two users' logs(sa can receive, the other cannot). The difference shows below: the user who can receive email successfully(user sa): [2012-11-15 14:24:12] com.csc.mail.jsh.mail.core.ReceiveMail : [INFO ] - trying to receive emails from james server... C: STAT S: +OK 2 2584 C: NOOP S: +OK C: TOP 1 0 S: +OK Message follows ... the other user receive

Open javamail folder failed

北战南征 提交于 2019-12-12 05:15:33
问题 I developed an email website using javamail and apache-james and it works well mostly. But some user got Open failed Exception and cannot receive new mail. The code of receive email: Session mailSession = Session.getInstance(System.getProperties(), null); mailSession.setDebug(false); Store store = null; Folder folder = null; //javax.mail.Folder try { store = mailSession.getStore(SParam.PROTOCOL); store.connect(Property.getPop3(), userName, password); logger.info("trying to receive emails from

Apache James gives: ClassNotFoundException: com.mysql.jdbc.Driver

可紊 提交于 2019-12-12 04:13:56
问题 I've configured Apache James as per the wiki: thufir@dur:~/apache-james-3.0-beta4$ thufir@dur:~/apache-james-3.0-beta4$ tail bin/setenv.sh # limitations under the License. # ---------------------------------------------------------------------------- # # Add every needed extra jar to this CLASSPATH_PREFIX=../conf/lib/* export CLASSPATH_PREFIX CLASSPATH_PREFIX=../conf/lib/mysql-connector-java-5.1.21-bin.jar thufir@dur:~/apache-james-3.0-beta4$ thufir@dur:~/apache-james-3.0-beta4$ ll conf/lib/

Java application to access MAILBOX using MAPI

强颜欢笑 提交于 2019-12-11 23:43:33
问题 I am trying to establish a connection between my mail server and a java program to parse the mail using protocol MAPI.. now the connection is working fine with a mock mailbox using IMAPS..but my mail server does not support MAPI..So is thr any option like JMAPI.. 回答1: It seems like Java Supports POP3 and IMAP very well out of the box. But for other protocols you can use one of the vendors found at JavaMail API - Third Party Products. I've had problems communicating with the Novell Groupwise

Problem in sending external mails in James Mail Server

*爱你&永不变心* 提交于 2019-12-07 12:12:47
问题 I am new to James Mail Server. I configured as the steps mentioned by James. I can send send mails to internal network, but I am not able to send mails to external network like gmail. Somebody please help me to resolve the issue Thanks in advance Rohith 回答1: Sorry for the late but it may help some people in the future. If you want configure JAMES to send mails to external network you must edit the file conf.xml in the ${JAMES_DIR}/apps/james/SAR-INF. Uncommented these line to define an SMTP

脑图学Java系列(1) - Java 简介

前提是你 提交于 2019-12-06 07:13:08
Java 简介 Java 是由Sun Microsystems公司于1995年5月推出的高级程序设计语言。 Java可运行于多个平台,如Windows, Mac OS,及其他多种UNIX版本的系统。 Java 分为三大体系: JavaSE(J2SE) - Java 2 Platform Standard Edition,Java平台标准版 JavaEE(J2EE) - Java 2 Platform,Enterprise Edition,Java平台企业版 JavaME(J2ME) - Java 2 Platform Micro Edition,Java平台微型版 2005年6月,JavaOne大会召开,SUN公司公开Java SE 6。此时,Java的各种版本已经更名以取消其中的数字"2":J2EE更名为Java EE, J2SE更名为Java SE,J2ME更名为Java ME。 Java 之父 Jame Gosling 毕业后到IBM工作,设计IBM第一代工作站NeWS系统,但不受重视。后来转至Sun公司。1990年,与Patrick Naughton和Mike Sheridan等人合作“绿色计划”,后来发展一套语言叫做“Oak”,后改名为Java。1994年底,James Gosling在硅谷召开的“技术、教育和设计大会”上展示Java程式。 Java 命名的由来

How to Sign Javamail with DKIM

元气小坏坏 提交于 2019-12-04 09:40:06
问题 Is there a library or a way to do this without an external library? I am using apache james as my mail server and currently send email like this: public void sendMessage(String to, String subject, String content) { MimeMessage message = new MimeMessage(session); try { message.addRecipients(Message.RecipientType.TO, to); message.setFrom(new InternetAddress(from)); message.setSubject(subject); message.setContent(content, "text/html; charset=utf-8"); Transport.send(message); } catch

Pandas文本数据处理

旧街凉风 提交于 2019-12-03 16:48:42
先初始化数据 import pandas as pd import numpy as np index = pd.Index(data=["Tom", "Bob", "Mary", "James", "Andy", "Alice"], name="name") data = { "age": [18, 30, np.nan, 40, np.nan, 30], "city": ["Bei Jing", "Shang Hai", "Guang Zhou", "Shen Zhen", np.nan, " "], "sex": [None, "male", "female", "male", np.nan, "unknown"], "birth": ["2000-02-10", "1988-10-17", None, "1978-08-08", np.nan, "1988-10-17"] } user_info = pd.DataFrame(data=data, index=index)user_info["birth"] = pd.to_datetime(user_info.birth) user_info 为什么要用str属性   文本数据也就是我们常说的字符串,Pandas 为 Series 提供了 str 属性,通过它可以方便的对每个元素进行操作。在之前已经了解过,在对