Scala, Java, Unix, MacOS tutorials (page 405)

I just solved a problem with a Java web service client I've been working on. I've been trying to read a Java web service that was created with Apache Axis2, and it has methods that can return an array or List of User objects. I couldn't find any examples on the Axis2 web site that showed how to get an array or List from a web service client, but I finally find the solution by digging around a little.

In this post I'll provide some sample Java source code that shows what I did to solve this problem.

Web service testing FAQ: How can I test a web service from a browser?

There was a time in my life when all I did was write and test web services, and here are a few notes I learned about hitting one of my web services from a browser.

Looking at the WSDL for a web service from a browser

To view the WSDL document for a web service I created named UserService, I just went to the following URL in my browser:

How do I show the free memory on a Linux system?

You can show free memory on a Linux system with the free command, like this:

free

That command returns results like this:

            total       used       free     shared    buffers     cached
Mem:       8145044    8097552      47492          0      74252    1189464
-/+ buffers/cache:    6833836    1311208
Swap:     12578884    6205424    6373460

If you prefer to see information in MB you can use the -m parameter, like this:

Wow, I was totally blown away earlier this week when I started listening to a book on CD titled "The Mystical Kabbalah". If you haven't heard of the Kabbalah before, it is the "mystical aspect of Judaism".

Summary: A Sample Cobertura Ant build script.

I still haven't gotten around to writing a Cobertura code-coverage tutorial, but in lieu of that, I thought I'd include an ant build script here that does a lot of powerful things, including a task that generates Cobertura code-coverage reports.

It has taken me a little while to get used to the new Java for loop (foreach loop) syntax, but I've gotten a lot better with it by trying to read my for loops aloud. For instance, I would read the Java for loop below as "For each Pizza in the list of pizzas":

Java directory FAQ: "How do I delete a directory tree in Java?"

Java delete directory - discussion

The delete method of the File class won't delete a directory tree, meaning that in the old days you had to write your own recursive method to do this.

Java directory FAQ: How do I walk a directory tree and do something with the files and directories I find?

I've done this recently by extending the DirectoryWalker class of the Jakarta Commons IO project.

I can never remember the command-line syntax to access a remote CVS repository via anayonymous CVS access, so just as a reminder to myself, here are the commands I used recently to access an OpenBSD CVS repository:

April, 2008: Here's a good quote from the book Rich Dad, Poor Dad regarding the differences in cash flow between people who have corporations and people who work for corporations:

The rich with corporations:

  • Earn money
  • Spend money
  • Pay taxes

People who work for corporations:

  • Earn money
  • Pay taxes
  • Spend money

Discussion

This really is powerful stuff. Imagine that I pay a contractor $20,000 per year, and he has his own business. He can take that $20K, deduct all legitimate business expenses, including rent, utilities, healthcare, hardware and software purchases, take a SEP IRA deduction (up to 25% of his salary), and then pay himself out of whatever is left. His business rent and utilities (a portion of his overall rent and utilities), and healthcare costs alone are currently $700/month, or $8,400 per year, so deducting just those costs from the $20K leaves $11,600 in net income. (And don't forget all the other deductions you can take.)

That's just amazing to me, but it's all perfectly legal, and besides understanding cash flow and assets, it's one of the elements Mr. Kiyosaki emphasizes in his book.

I got the following MySQL error ("1005 error") earlier today when trying to create a table with a foreign key relationship:

I started using a tool named Cobertura to generate code coverage reports lately, and I have to say that I've been very happy with the results. If you are a believer in test driven development, or TDD, the next step in the process is code coverage.

Continuous integration is a key to a quality build process for any multi-developer software development project. I can't say it much better than the way Martin Fowler describes it, so I'll just include a portion of his summary here:

Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day.

A friend of mine was at a search engine strategies conference last week, and sent me these employment numbers, which are really staggering:

  1. Skype has 200 employees
  2. YouTube has 60 employees
  3. Craigslist has 20 employees

(I think those numbers came from Nicholas Carr, but I'm not positive.)

I would have guessed at numbers much higher than those. Hopefully that makes everyone at YouTube a billionaire, or at least a millionaire.

Here's a quick example of using Ruby ActiveRecord outside of Rails. In this case I'm saving a new record to an employees table in a MySQL database.

Here's my favorite quote from the recent Giants-Patriots Super Bowl game:

“Everybody has a plan until they get punched in the face.”

That's from Michael Strahan of the Giants, who said he was quoting Mike Tyson.

For a little while yesterday I sat at a book store and flipped through several books on Ruby and Rails. I'm not the most passionate Ruby developer in the world, but I really do like the language, and prefer it at every opportunity.

January 28, 2008, and I've got to think that Apple is in a bit of trouble. No, not because their stock has fallen from $200/share to $130, but because of their product line.

While they have released the iPhone, iPod Touch, Leopard, the new AppleTV, and MacBook Air in the last 12 months, Leopard is the only product from that group that seems to have any momentum right now. (Okay, maybe the iPod Touch has something going too, but that doesn't interest me.)

This morning I started wondering why off-the-shelf computers (Mac or Windows) don't include the hardware and software necessary to receive local AM and FM radio, as well as local television signals? I don't know the technicals hurdles behind this -- and that might be the problem -- but it seems like in our media-saturated age these would be standard computer features. (Hmm, after a little research it looks like this can be done, it just isn't.)