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: http://c9.io/finneycanhelp/html5fun2/workspace/MouseOverQTipAjax.html 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 http://docs.codehaus.org/display/GROOVY/Groovy+Mocks

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

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, https://gist.github.com/783412, and the simple service, https://gist.github.com/783419.

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!

Saturday, November 20, 2010

Systems Analyst and Business Analyst Positions Combine!

I read an article called A twist on skills jolts job picture. This article says that companies are combining Systems Analyst and Business Analyst positions!

That can be good news if you are one of the people who have absorbed both skill sets. I think this demands further exploration.

The first step is to explore your own skill-set and your mind-set. Are you willing to work outside of your current job description?

As the article defines it, are you a "purple squirrel"?

Sunday, November 7, 2010

Setting Up Objective-C on Windows

In seeking to learn more Objective-C and use my Windows OS (Vista), I learned there is set up work to do and figuring out the final compilation command.

First, I installed using the directions at http://wwwmain.gnustep.org/experience/Windows.html It was straightforward.

With Justin Voss' help, we landed on the following command to compile a test.m file that we created together:
gcc `gnustep-config --objc-flags` -L /usr/GNUstep/System/Library/Libraries/ test.m -lgnustep-base -lobjc

I am grateful to Justin and those who created GNUStep.

Sunday, November 29, 2009

People Who Care And Share


Thankful*
Originally uploaded by zenera

It's wonderful that people care enough to share. People care about the gifts they have and share the fruits of their gift with the world.

From the software world, this can lead to books such as Clean Code by Uncle Bob Martin. From Flickr, it can be zenera who posts wonderful photos and shares them freely.

Thank you all. I am grateful.

Saturday, September 19, 2009

Be Privileged And Skip JavaScript's Prototype

Reading Pro JavaScript's second chapter "Object-Oriented JavaScript" reminded me that I do not use the prototype property to add public methods to a JavaScript object. I use "Privileged Methods" (pg 36) instead.

In the book, John refers to Douglas Crockford's JavaScript site and the Privileged technique described in the web page titled Private Members in JavaScript. I quote from the web page:
"A privileged method is able to access the private variables and methods, and is itself accessible to the public methods and the outside."

If you are looking for more code examples beyond what Douglas Crockford provides, Quizzpot shows more code examples at Private and privileged methods in JavaScript

Using Privileged Methods is a great technique when coding JavaScript objects. Have fun doing it.

Sunday, August 16, 2009

JavaScript, TDD, JQuery

In the area of Ajax and JavaScript, the rate of change has increased where I work. I believe this is reflective of the industry in general.

Since there is so much for one to look at, people will want to focus on those things which are essential.

Items of immediate interest are (in no particular order):
James Carr and I had fun integrating Hudson with JsTestDriver. It's a good step towards TDDing JavaScript.

Here's to the future
:)