August 27, 2010

Issues & Concerns w/Google Web Toolkit 2.0

If you’re considering using GWT to do web development, here are some of the issues we’ve encountered – sufficiently difficult and frustrating that the organization has decided to abandon GWT and return back to Spring MVC as the web tier.

  1. Difficult to integrate into SEO – I didn’t see this directly (because I am not focused on SEO) but apparently all that javascript makes indexing the pages much, much harder
  2. Unit Testing – the design of GWT widgets makes it very difficult to write unit tests using anything other than the “built-in” GWTUnitTest, which isn’t helpful for our situation (we need the output in a particular format for tracking purposes).    So essentially we didn’t unit test our GWT widgets much at all
  3. Which means our code coverage was very low, and it requires a lot of “jumping through hoops” to get the code coverage to even modest (40%) levels.
  4. Most people can’t seem to get used to the programmatic paradigm – horizontalPanel.add( verticalPanel3 );    It’s very hard to debug programmatic panel creation, and it’s easy to get something wrong, and not realize it until you’ve compiled and built everything.   I know they’ve added some XML-based visual building recently, but unfortunately we’re working with legacy code
  5. Compilation time – it seems to take a _long_ time to build all the locals and browser variants, and going in and restricting the list of locals and browsers made it harder to track down bugs

This was a large organization, with a lot of resources and fairly smart people, and GWT just simply defeated them – they could not figure out a way to get it to behave in a way that their organization could absorb.    I’m sure all the GWT experts are sneering at our “pathetic lack of skillz” and that’s fine (whatever!), but for me, I don’t plan on recommending GWT to any of my clients.

July 22, 2010

JavaScript Native Interface & History Repeating

I’ve only recently started to look at the Google Web Toolkit.   I haven’t gotten far enough into the implementation and usage of it to make a firm decision, but I do like the philosophical concepts (which I will get into later).  Yeah, I’m probably late to the game on GWT, but I was early to the game on a bunch of other things, so it balances out, I think.

One thing that I was surprised by (pleasantly) is the “JSNI” – the way that the GWT allows the user to “drop in” javascript in situations where the GWT widgets just won’t do.

Here’s the first blog post I found about JSNI .  I love the first comment.

JavaScript is king in the browser and GWT is for cowards.

Hee hee.  Go back 20 years or so, and you’d see the exact same argument, only with different names:

Assembly is king in graphics, and C is for cowards

Pretty much the same situation – a certain group of people have made their living from being experts at something cryptic and difficult.  Along comes something (in the older case, DirectX) that attempts to simplify that difficult thing, and those experts begin flinging poo at it.

This was back in 07, of course, I wonder if those people still hate GWT and the leaky abstractions it represents.

July 21, 2010

Using Hadoop for Data Mining

I wrote a whitepaper on Hadoop, and how you can use it to perform Business Intelligence on data that’s too expensive to analyze using existing solutions, either because the data is too messy, too voluminous, or both.

There are other uses for Hadoop, but I think this is one of the most strategic.

Let me know  your thoughts!

What is Hadoop

My recent post on Hadoop may leave people wondering “WTH is Hadoop?”.

Well first, if anything in the world can be called “Cloud Computing”, Hadoop can.

Hadoop is an open source software system that creates two things:

1) A highly scalable, fault-tolerant distributed file system (loosely based on the Google File System)

2) A highly scalable implementation of Google’s MapReduce algorithm

And it’s open source, and free, and has been in use at Facebook and Yahoo for several years now.

Your next question may be “What is MapReduce?”

MapReduce is an algorithm that splits a large amount of data into smaller chunks, and allows the data to be sorted and aggregated in various ways.   It’s one of the cornerstones of Google’s massive software infrastructure – a system that lets Google process all the data that comes in about who is linking to who, and which tags and text are being used, etc.

Essentially, Hadoop is a cloud-based data analysis tool – something that can scale very cost-effectively, and can chew through terabytes and/or petabytes of data using off-the-shelf computers with off-the-shelf operating systems and hardware.

Latest Strategic Hadoop News

Momentum continues to grow for Hadoop – the ability to use Hadoop to cost-effectively perform large scale data mining and data cleansing is considerable.

June 21, 2010

My theory on software problems

We seem to be rapidly converging on three types of problems in the software domain:

A) Problems that can’t be solved easily by humans, but are trivial for computers, even at large scale

B) Problems that can’t be solved easily by humans or computers (primarily because of scale)

C) Problems that are easily solved by humans, but nigh-impossible for computers

Over time, we continue to see set (B) shrink and set (A) increase.    But we see very little improvement in (C).

Examples of (C) include:

  • Voice recognition
  • Establishing connections between pieces of data, based on semantics
  • Natural Language Processing
  • Monster AI (in games)
  • Forecasting & Predictions
  • Troubleshooting and Debugging
  • Developing Software

Over the last 20 years (or so), I have seen people predict confidently that any one of these problems would be easily solved in the next few years, and, without exception, they have been wrong.  Not a little wrong.  Not slightly wrong – spectacularly and utterly wrong.

I know this, because I remember the frustration associated with arguing with the “visionaries” about these problems – they would posit “X” – “We will see computers automatically connect semantic markup”.  I would object that this was a far more complicated problem than they thought, and they would sniff at me, and roll their eyes – I “just didn’t get it”.     Or they would predict that no-one would be writing software in 10 years, or that IT would disappear, etc, etc, etc.

Well, I’m tired of this disdain for the real world, and here’s the graph to show exactly how right I was.

The fact is – set (C) above is the set of things that require human-level AI to solve.   But once we have human-level AI, all of these problems become trivial at the same time.  (This is analogous to the NP-complete problem)

We chip away at the AI problem a little every year – computers get faster, algorithms get smarter, things that were essentially impossible become simply difficult, etc.   But until we get a near-complete AI model working reliably, I submit that we will not see the problems at the top of this post go away.

Think about it – each of these problems requires a rich understanding of human context.  Of judgement, of positing alternate universes in one’s head, in order to determine if alternate paths lead to success or failure.   And until a piece of software has the ability to do those things, it will not solve these problems.

So from now on, my answer to all pretenders to this throne will be:  ”The problem you describe requires human-level AI to solve.  If you want to make progress on your problem, go solve the human-AI problem first.”

/rant off

April 27, 2010

I see your meta and meta it!

Apple says that you must write apps for the iPhone in C, C++ or Objective C.

Surely the clever folks at Adobe could produce a flash compiler that produces C code, not executable object code.   Then, the developer could take said generated C code and compile it legitimately  using approved compilers.

April 20, 2010

Google vs. Bing – round 2

I have been struggling for the last 24 hours or so to launch a child thread in my Spring/Hibernate/Struts2 J2EE application.    The challenge was that the child thread needed to be able to read/write the database and access services, etc.

I used Google, asked a bunch of questions, tried a bunch of different things, but was still stuck.

So in desperation, I turned to Bing, and asked one of the questions again.  And one of the first results on Bing was a clue that led me to the last piece of the puzzle, and success.

Having said that, most of the solution was described properly by Google, there was just one bit of information I hadn’t picked up.

So I’d say Google gets 80% of the credit, Bing gets 20%.    But that’s about 19% more than I would have credited Bing before.

March 26, 2010

Tufte vs Kittens

And every time I exceed my column width, I get the urge to tinker with my stylesheet.

March 25, 2010

Models

This is true:

…says that models have made predictions that were successfully compared to observations. Except that this is not enough for the models to be reliable. For them to be reliable, it would have to be the case that the models have produced no predictions that were inconsistent with the observations – because one wrong prediction is enough to falsify a model

Regardless of context.

March 24, 2010

gmail trick

in the search box, type


in:inbox is:unread

And you’ll get just your unread emails in your inbox. Since I keep my unread emails at zero as a general rule, this helps me a lot

You can also bookmark the resulting url and use it as your main gmail link

January 7, 2010

the Akinator

It took three tries, but it finally guessed “Bobby Shaftoe”.

офис столовеhttp://uk.akinator.com/

However, it was not able to guess Lord Alexander Chung-Sik Finkle-McGraw

October 30, 2009

Postgres, Rails & a Snow Leopard walk into a bar

And the bartender says “Get out, you guys are incompatible!”

The Internet whips out this tutorial for getting Postgres and the Postgres Rails Gem to run under Snow Leopard, and the bartender serves them all Rum and Cokes.

October 21, 2009

RSpec have_text vs include_text

The tutorial docs I’ve looked at don’t mention this, but there is a handy new test utility for your response objects.

response.should include_text("blah blah")

which tests to see if “blah blah” is anywhere on the page.

This compares favorably to

response.should have_text("blah blah")

which tests if the entire text of the page == “blah blah”

September 21, 2009

adventures in soap4r

I am trying out Soap4R, and I’ve discovered (as usual) a few hangups along the way.   I played with the self-generating WSDL, but it was difficult to see what was going on, so I used wsdl2ruby.rb to build my classes.

First – I started with a test, that’s one of the ways I like to learn a new service.  I ran into the following problem:

OpenSSL::SSL::SSLError: certificate verify failed

To get around that, in my environment.rb (near the top), and also in my test class I add:

require "rubygems"
gem "soap4r"
require "soap/mapping"

I continue to have certificate errors, but I’m not surprised, because I’m using HTTPS against an unsigned certificate. So after I create my driver, I do:

  driver = IDStore.new
  driver.options["protocol.http.ssl_config.verify_mode"] = "OpenSSL::SSL::VERIFY_NONE"

And now the errors I get seem to be more-or-less related to the task at hand

September 12, 2009

Grails PSA – Hibernate Exception w/a _backRef

Let’s say you have two domain objects/models – Feet and Toes.

Obviously, in general a Foot hasMany toes

and obviously (at least we hope) a toe belongsTo a foot.

So given this, if you, say, changed the color of the toenail on a toe, you would expect to then do a toe.save(), right?

WRONG!   You get this crazy _backRef exception and you’re dead in the water.

Instead, what you have to do is save the Foot, and it cascades down and saves the toe.

*boggle*

http://jira.codehaus.org/browse/GRAILS-3783

September 2, 2009

Rails PSA

Never ever use @template to refer to a model or object in your project !!!!!

Rails uses this name internally to track the ERb &| HAML templates, and it gets horribly confused. You get errors like:

undefined method `view_paths' for #

and

undefined method `render' for #

Save yourself some time and listen to me :)

September 1, 2009

Rails config.gem ‘pdf-writer’ doesn’t work

If you’re trying to set up pdf-writer as a config.gem instruction, the obvious approach doesn’t work, at all. instead, do this


config.gem "pdf-writer", :lib => "pdf/writer", :version => "1.1.8"

hat tip

August 14, 2009

Nifty Rails tricks

Two new things I’ve learned today (not that these are news to the cognoscenti, but I am always looking for new ideas to write down so I can remember them)

  • in_place_editor_field
  • {:onchange => "#{remote_function(:url  => {:action => "update_degree_and_major_based_on_mods"}, :with => "'mods='+value")}"}

in_place_editor_field

  • Basically, it sets up your form fields with Javascript so you can click on them, edit them and have the edits saved back to the database.  Pretty nifty!
    • Looking at the javascript source, there’s some serious mojo going on underneath the covers – new Ajax.InPlaceEditor( field_to_edit, controller_method_to_call_with_object_id, mysterious_callback_function)
      • The callback function is the part that I am confused about, but that’s a topic for another day.

remote_function

  • Two parts - the invocation and the controller
  • The invocation is straightforward enough to follow:
    • onchange="new Ajax.Request('/applications/update_degree_and_major_based_on_mods', {asynchronous:true, evalScripts:true, parameters:'mods='+value + '&authenticity_token=' + encodeURIComponent('token')})
      • make an Ajax request to the specified controller, asynchronously, and with a particular parameter to drive the change
  • The controller is clever


mods = Modus.find_by_mods(params[:mods])
@captain = Captain.find(mods.captain_id)
@dinghy = Dinghy.find(mods.dinghy_id)
render :update do |page|
page.replace_html 'dinghy_info', :partial => 'dinghies/dinghy', :o bjects => @dinghy
page.replace_html 'captain_info', :partial => 'captains/captain', :o bjects => @captain
end

This looks up the object from the parameter, finds associated objects, and then calls this page.replace_html function, which replaces the contents of a <div> with a completely different div, as described by the appropriate partial template.

July 15, 2009

Zed Shaw and the BSD Dichotomy

Zed wonders why the BSD license folks are so inconsistent.

As a student of evolution and behavior, I think I can safely answer this:

1. We are all still cavemen at heart – Evolution has not had time to remove the small-group-power-dynamic genes from our pool.

2. Companies are big and powerful tribes

3. GPLed apps are small and puny tribes

Given those definitions, it’s easy to see what’s going on.  The BSD-advocates love it when big companies use their BSD-licensed source code because it makes you feel all special and important.  The chief noticed me!  He nodded in my direction and acknowledged my existence.  By extrapolation, I am now more important that someone else in the tribe!  It is, in the end, all about status, even for (most) geeks.

On the other hand, GPL, being weak and puny, is actually insulting a BSD-advocate by interacting with them.  This is like the sickly man throwing himself down in front of the Chief and showering him with praise.  It actually makes the Chief look weak when someone puny praises them (why would a powerful Chief need praise from someone so low-status?)   how dare low-status GPL apps try to use our powerful BSD source?   We are powerful and control much of the Internet.   Big Companies acknowledge our existence and use our services! (for free, but that’s beside the point)

Thnk about it – no one would really quibble if Linux pulled some BSD code into the core.  Because Linux is so high status, the acknowledgement of BSD by Linux is a net gain in status for BSD.

But Zed Shaw, alas, is not as high-status as Linux.  And until he is, the BSD people will feel uncomfortable when this low-status individual uses their resources for his own gain.  How dare he???

Having said all this, people who are sufficiently anti-social (Aspergers, Autistics, deep introverts, etc) don’t care about social niceties, and are able to point out the logical contradictions and the general irrationality of status-seeking.