Sunday, August 21, 2011

Smart Caffeine

In taking a quick WebMD quiz about caffeine ( Quiz: Myths and Facts About Caffeine ), I read in the 2nd question that 200 mg to 300 mg of Caffeine is considered safe for most adults.

Green Tea has health benefits and a little caffeine (about 26 mg for 180 ml aka 6 fl 0z) .   Compare that caffeine to a cup of coffee (about 145 mg of caffeine).

So, green tea is on my radar and I will switch to it soon.

My current favorite drink has about 108 mg per 24 oz. So, I can have about 2 1/2 bottles of that safely.

If I switch to green tea, I can drink how many cups?  It's about the same. 24 oz of brewed green tea is about 104 mg of caffeine.  :)

If I want to push the limits of safe, I can have 400mg of caffeine according to an ABC News webpage.

Raise your glass and let's drink to good health and productivity!

Friday, July 29, 2011

Hirability Capital and ROI

When people asked James Carr what he thought the road to career success was his answer was that there are at least three things which help a person increase their marketable capital or what I call Hirability Capital:
  1. Contributing to Open Source
  2. Writing
  3. Presentations
In regards to the item that gives you the biggest ROI (Return On Investment), he thought contributing to Open Source was the biggest deal because it makes you go out and seek others who have the answers you need in order to contribute to an open source project. He reminds us that small contributions can be made if you don't have time to do big ones.

Ray Myers was there too. As a fellow Open Source contributor, he had this to say:
The large and varied software community allows you to pick a niche and potentially make big waves in that domain. For instance, only a few people might be known in the overall Java programming community, but making a name in the Spring MVC Templating area isn't so difficult. As always the key is identifying pain points and removing them. Experience in multiple software cultures helps here, because one group may have solved a problem that still plaugues another
All people seemed to agree that personal fulfillment is important. Being well known and marketable, but feeling empty is not a great way to live. Staying marketable and contributing to a great cause is wonderful!

Sunday, June 12, 2011

Step One of Coding in the Cloud For Fun

One of my key desires is to create code that I quickly push out, use myself, learn from, and enhance. Deploying to the Cloud lets me do just that. In short, the Cloud gets administration related items out of my way so I can focus on writing code that I can use myself and get feedback on quickly.

I have investigated many different cloud-ish solutions such as google's appengine,  Heroku, and now finally the Cloud Foundry.

Since my goal is to get quick feedback, get away from distracting administration, and focus on coding, I decided to try using grails (groovy and Java), a cloud plugin, and follow the article titled One-step deployment with Grails and Cloud Foundry

The grails article points one to where he or she can register with the Cloud Foundry, how to install the command line interface (CLI), where to get the grails plugin, and more. Note: if you have not registered for your username / password with the Cloud Foundary, do so now. There can be a line of people wanting to try this out and thus a waiting period. (Tip: Remember the username must be an email address.)

Currently, I am at the point where I have registered and created a hello world application on the Cloud Foundry. Using the plugin, the grails command of cf-info worked great!

It helped that I already had Ruby installed. What does Ruby have to do with a VMware Cloud Foundry?

As the Deploying Applications With the VMware Cloud Foundry CLI article points out, one needs to gem install vmc to get the CLI. You will want the CLI so you can change the password they give you right away.

Has my time been well spent or am I yak shaving? The time has been well spent. Now that I see all the pieces and have gotten the upfront work done, I look forward to doing the rest of the One-step deployment with Grails and Cloud Foundry article.

I hope laying out what I have done so far in this blog entry has helped you as well!


Sunday, May 22, 2011

Chrome vs clueTip AJAX (jQuery Tooltip Plugin)

The jQuery plugin clueTip looked like a promising jQuery plugin for showing advanced tooltips via AJAX. However, it has an issue when run in the Google Chrome browser (build: 11.0.696.68).

This was discovered when I tried out the basic ajax option at the clueTip Demo.

Example of the issue is at: where I get a 404 error.

Another example is when I try it locally with the same code and I get a: Origin null is not allowed by Access-Control-Allow-Origin.

Some Good News:
It works as expected in Firefox and IE 8. Perhaps that is sufficient for what you may need. 

I look forward to when this Chrome specific issue is fixed in later versions of clueTip! The plugin is neat!

Monday, January 17, 2011

"as Whatever" is Essential When Doing Groovy Map Coercion

It's helpful to always use the "as" operator when using Map Coercion in Grails (which uses Groovy).
To understand Map Coercion, one should read an article such as

While creating unit tests and mocking, one needs to be careful to always use the "as" operator. Example:
Here's a test (located at )

class SomethingTests extends GrailsUnitTestCase {

    void testSomething() {
        Something thing = new Something()
        // thing.someService = [ get : { a -> throw new Throwable() } ]  as SomeService // works
        thing.someService = [ get : { a -> throw new Throwable() } ] // need the "as" operator!

        assert thing.methodWeAreTesting()

For completeness, here's the system under test,, and the simple service,

If you do not use the "as" operator, you end up with a service that is a java.util.LinkedHashMap as opposed to a groovy proxy object (SomeService_groovyProxy). When the code calls 'get', it does not execute the mock "get" code that was set up! Instead you get back a value or null.

So remember to use the "as" operator such as " as SomeService "

Happy coding!