alvin's blog

A Java send mail class - A simple class to simplify sending email

Here's the source code for a simple "Java send mail" class that can simplify the process of sending email messages from Java applications. I've named this class MailAgent, and I'm sharing the source code here for free. I've included a brief usage statement in the Javadoc at the top of the class. Hopefully it's all pretty straightforward, and a decent example of using the JavaMail API to send an email message.

Function Point Analysis presentations online

I've had some Function Point Analysis documents available here before, and recently finished converting those presentations into a better form for the internet. To that end I've gathered all these in a new Function Point Analysis Education Center, which contains those free documents and presentations.

These educational documents cover FPA, cost estimating, and even cost estimating for Agile software development projects.

IDC releases PC sales figures for 2nd quarter 2007

IDC released PC sales information for the 2nd quarter of 2007, and shows Apple with a 5.6% share of all new personal computers shipped in the U.S. This puts them in fourth place in U.S. sales, in a virtual tie with Gateway, and in front of Toshiba and Acer. Dell and HP are in first and second, respectively. HP, Apple, Acer and Toshiba are up, Dell and Gateway are down. Apple may gain more ground and pass Gateway, but lose position to the hard-charging Toshiba and Acer.

Linux sed command - use sed and wc to count leading blanks in a file

I use JSPs and servlets to generate a lot of the pages around here, and today I looked at how many blank spaces and blank lines are generated by the JSP's. I don't think I can do much about the blank lines (actually, I just haven't looked into it yet), but about those blanks spaces ...

Out of curiosity I decided to look at this -- how many blank spaces are there at the beginning of lines that I could delete just through formatting? Would deleting those characters help reduce my bandwidth costs (at the expense of slightly uglier JSP's)?

vi search replace - how to repeat vi commands across multiple files

Another cool feature of the vi and vim editors is that you can easily re-use some search and replace commands across files. For example, I was just editing several HTML files and needed to do the exact same thing to each file: find a certain line, and then delete that line and the line right after it. Fortunately this is very easy to do in vi.

To edit multiple files in vi I first issue this command from the Linux command prompt:

Syndicate content