DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
  • submit to reddit
//Load EML and Save to MSG and MHTML

public static void ConvertFromEML()
{
    // Base folder for reading and writing files
    String  strBaseFolder  = Environment.getExternalStorageDirectory().getPath();
    strBaseFolder = strBaseFolder + "/";

    //Initialize and Load an existing EML file by specifying the MessageFormat
    MailMessage msg = MailMessage.load(strBaseFolder + "AnEmail.eml", MessageFormat.getEml());

    //Save the Email message to disk by specifying the MSG and MHT MailMessageSaveType
    msg.save(strBaseFolder + "message.msg", MailMessageSaveType.getOutlookMessageFormat());
    msg.save(strBaseFolder + "message.mhtml", MailMessageSaveType.getMHtmlFormat());
}

//Load MSG and Save to EML and MHTML

public static void ConvertFromMSG()
{
    // Base folder for reading and writing files
    String  strBaseFolder  = Environment.getExternalStorageDirectory().getPath();
    strBaseFolder = strBaseFolder + "/";

    //Initialize and Load an existing MSG file by specifying the MessageFormat
    MailMessage msg = MailMessage.load(strBaseFolder + "AnEmail.msg", MessageFormat.getMsg());

    //Save the Email message to disk by specifying the EML and MHT MailMessageSaveType
    msg.save(strBaseFolder + "message.eml", MailMessageSaveType.getEmlFormat());
    msg.save(strBaseFolder + "message.mhtml", MailMessageSaveType.getMHtmlFormat());
}

//Load MHTML and Save as EML and MSG

public static void ConvertFromMHTML()
{
    // Base folder for reading and writing files
    String  strBaseFolder  = Environment.getExternalStorageDirectory().getPath();
    strBaseFolder = strBaseFolder + "/";

        //Initialize and Load an existing MHT file by specifying the MessageFormat
    MailMessage msg = MailMessage.load(strBaseFolder + "AnEmail.mhtml", MessageFormat.getMht());

    //Save the Email message to disk by specifying the EML and MSG MailMessageSaveType
    msg.save(strBaseFolder + "message.eml", MailMessageSaveType.getEmlFormat());
    msg.save(strBaseFolder + "message.msg", MailMessageSaveType.getOutlookMessageFormat());
}
Alec Noller08/27/14
14142 views
0 replies

Dev of the Week: Trisha Gee

Every week, we feature a new developer/blogger from the DZone community to catch up and find out what he or she is working on now and what's coming next. This week we're talking to Trisha Gee, developer at 10gen, expert in high performance Java systems, and leader in the London Java Community.

Bill Bejeck08/27/14
6758 views
0 replies

I/O With Files That Aren't Files

Using named pipes enabled me to decrypt and search of 300+ files in roughly 1.5 hours. I also avoided the space issue by never having to land a file on disk. While named pipes aren’t needed every day, they are a useful tool to have in your arsenal.

Alec Noller08/27/14
9023 views
0 replies

The Best of Dzone: August 20 - 27

If you missed anything on DZone this week, now's your chance to catch up! This week's best include JPA Hibernate alternatives, an explanation of the Hadoop ecosystem, why you shouldn't waste time on code reviews, new features coming in Java 9, a rejection of Google's programming tests, and more.

Mark Needham08/27/14
4538 views
0 replies

R: Rook - Hello world example - 'Cannot find a suitable app in file'

I’ve been playing around with the Rook library and struggled a bit getting a basic Hello World application up and running so I thought I should document it.

Mikio Braun08/27/14
4675 views
0 replies

Big Data & Machine Learning Convergence

As these two fields converge, work has to be done to provide the right set of mechanisms and abstractions. Right now I still think there is a considerable gap which we need to close over the next few years.

Mike Cottmeyer08/27/14
4027 views
0 replies

Why Iterative Planning?

Planning and elaboration go hand in hand as items move from unknown problem -unknown solution to known problem-unknown solution to known problem – known solution.

Venkatesh Kris...08/27/14
2511 views
0 replies

Measuring Business Value in Agile Projects

During backlog creation, user stories need to be compared and contrasted in order to promote maximum value delivery. The product owner might need to use different techniques, such as T-shirt sizing, in order to better prioritize the project’s stories.

Arthur Charpentier08/27/14
3982 views
0 replies

Computational Actuarial Science, with R

A collection of datasets, originally for the book ‘Computational Actuarial Science with R’ edited by Arthur Charpentier (CAS with R). Now, the package contains a large variety of actuarial datasets.

Dave Rooney08/27/14
3953 views
0 replies

"How Thin is Thin?" An Example of Effective Story Slicing

Like the graphene example at the beginning of the post, thin stories have remarkable properties far beyond the fact that they are just "thin". The value gained by learning how to split Stories effectively is enormous owing to the flexibility it provides by deferring decisions as long as possible and the removal of the need to estimate at a granular level.

Mahboob Hussain08/26/14
10158 views
11 replies

Thoughts on Hibernate

The way data are laid out in the columns of tables and the way they are used in the application as the class / instance variables there is. However, this mismatch or "impedance" does not come in the way of software development that it requires a framework that abstracts away all the database-related code.

Saurabh Chhajed08/26/14
5597 views
4 replies

How to configure Swagger to generate Restful API Doc for your Spring Boot Web Application

The goal of Swagger is to enable client and documentation systems to update at the same pace as the server. The documentation of methods, parameters, and models are tightly integrated into the server code, allowing APIs to always stay in sync.

Saurabh Chhajed08/26/14
5473 views
3 replies

How to Setup Realtime Analytics over Logs with ELK Stack

The ELK stack is ElasticSearch, Logstash and Kibana. These three provide a fully working real-time data analytics tool for getting wonderful information sitting on your data.

Dharshan Rangegowda08/26/14
3644 views
0 replies

Understanding durability & write safety in MongoDB

Durability is the "D" in the "ACID" properties popularized by traditional RDBMS. Durability is the guarantee that written data has been saved and will survive permanently. NoSQL databases like MongoDB give developers fine grained control over the durability of their write calls.

Rob Galanakis08/25/14
7813 views
1 replies

The low status of software engineers

Bill had two very different experiences interviewing for two different positions at two different companies: one as a software engineer, and one as a VP-level manager.

Bob Hartman08/25/14
5338 views
0 replies

Scrum Basics: When Should We Schedule Sprint Transitions?

For a one week sprint, it’s possible to do Review, Retrospective, and Planning all on Wednesday morning.

Ian Mitchell08/25/14
4445 views
0 replies

Counting Chickens: Undone Work in Scrum

By definition, any work that has not been completed to the satisfaction of the DoD remains undone. Taking work off a Product Backlog just because it is on a Sprint Backlog is therefore precocious and a mistake.

Curtis Lassam08/23/14
2335 views
0 replies

Cube Drone #2: Nyan

From software developer Curtis Lassam (who writes about comics and code) comes a comic series called Cube Drone. This is Cube Drone #2: Nyan.

Kin Lane08/22/14
34267 views
36 replies

Sorry Google, Your Programming Test Is Not A Valid Measurement Of My Skills

I understand that you have to qualify large number of folks, at your very algorithmic-centric company, but when it comes to measuring what I do, a programming test isn’t a thing.

Giuseppe Vettigli08/22/14
5668 views
0 replies

Quick HDF5 with Pandas

HDF5 is a format designed to store large numerical arrays of homogenous type. It cames particularly handy when you need to organize your data models in a hierarchical fashion and you also need a fast way to retrieve the data. Pandas implements a quick and intuitive interface for this format and in this post will shortly introduce how it works.