Skip to content

Namespace Collisions, NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN and GWT

So, the abstraction layer provided by GWT just leaked–well, more of a flood than a leak.

I am working on a site that is pulling in an html fragment which included some javascript code via an XML HttpRequest.  This new code will make paging the results of a search quicker, hopefully leading to happier users.  For reasons too obscure to go into, I was creating a variable named ‘r1’ which I was then adding to the DOM.  The name was completely arbitrary, and was due to laziness (hey, why type 3 characters when you can type 2?).

Fast forward to today, when we’re getting ready to launch the update.  Occasionally, but not often, code that GWT was executing was throwing an exception.  One of the other developers found it because some functionality was disabled.  Here’s what that exception looked like:

exception: (NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN): Cannot convert WrappedNative to function
QueryInterface: function QueryInterface() {
[native code]
}
result: 2153185293
filename: http://stageserver/gwt/2B17113CD349EDFD95DC846F38AB0857.cache.html
lineNumber: 4268
columnNumber: 0
inner: null
data: null
initialize: function initialize() {
[native code]
}

Now, usually, the first thing I do when I see an exception is to recompile the GWT with -style DETAILED instead of -style OBF and see where the error occurs.  However, when I did that, I didn’t see the error message any more.

OK, I added more debugging.  If I added a certain number of alert statements, the error message was nowhere to be found.  OK, go back to the previous code.  Try different pages, different browsers.  Sometimes the exception reared its head, other times it didn’t.  It appeared on some browsers and not others. Sprinkled alerts throughout the code, found the exact line where the exception was being thrown.  All that line did was create a click listener.

Nothing really clear on google; however, this post was useful in pointing to the error message being a collision between a function name and a DOM element.  Searching the GWT google group was not helpful.   I tried using the Firebug debugger, but on obfuscated source, it was not helpful to me.

These kind of bugs make me want to tear out my hair.  Hardly reproducible bugs are no fun. However, I finally found the issue (if I hadn’t, I’d still be working and wouldn’t be posting, that’s for sure).

How I finally solved it:  I was getting a line number.  I finally edited the generated GWT .cache.html file and added some newlines.  This would let me find out exactly which function was really causing the issue.

And, lo and behold, the problematic function was named ‘r1’.

Changing the name of the DOM element fixed this issue. Beware short named javascript DOM elements when working with GWT.

Hope this helps you.

Blogger adds support for pages

I’m a big believer in simple websites that users can maintain–I wrote about how to set one up in less than two hours.  Snarky comments from Ralph aside, it’s a great way to get onto the web and add that much more credibility to any business you’re doing.

Blogger and WordPress.com are the two big options for easy, free web sites.  Blogger gives you more freedom in most ways, but until recently, came with a big downside–you couldn’t create standalone pages (for contact info, ‘about us’, etc)–everything had to be a post.  That’s changed: blogger now lets you create up to 10 stand alone pages.

Awesome!

My Firefox plugins

I recently moved to a new computer, and have been rebuilding my desktop environment.  I just wanted to list my Firefox plugins for future reference.

  • The Web Developer Toolbar lets you view css, disable javascript, resize your browser precisely, outline block elements and so much more.
  • Colorzilla is invaluable for a developer like me to copy a color palate correctly.
  • S3Fox lets you manage Amazon S3 buckets and their content.
  • Firebug lets you examine web pages in detail, including network operations/
  • YSlow is an add on for Firebug that evaluates site performance based on a variety of metrics
  • Some kind of whois tool–sometimes you need to know who registered that domain name

These are my drop dead extensions for typical web development work.  What am I missing?  Do you have any to recommend?

Review of SkaDate dating software

I recently helped a client move an existing dating site from a custom ASP/MS-SQL system to an off the shelf PHP/mysql platform.

The off the shelf software we ended up choosing was SkaDate.  I haven’t really found a good review of SkaDate out there, so I asked Max Chadwick to collaborate with me on a review.  (Max provided some design, system configuration and project management, and I focused on back end system setup and data migration.)  Updated 4/2: We used SkaDate 7.5, versions 1485 and 1550.

Note that we had a challenge not present for a typical SkaDate installation: migrating ~1100 user accounts (and mail messages) from one unknown system to another.  I had to learn two very different data models and map from one to the other.  On a fixed bid project.  Whoops.

Oh well, live and learn.

Skadate pluses:

  • Price: this is a big one.  You get a lot of features for only $350.
  • Technology: it is built on the LAMP stack, so there are a lot of developers out there who can help you extend the platform.
  • Support: they have a client site with some useful PDF documentation.
  • Had a defined and documented upgrade procedure (even though it was a hassle).
  • Changing look and feel was relatively easy; we went with one of the many predefined templates and only had to hack a little bit of CSS and a couple of images.
  • Caching: SkaDate caches of php files and css.  Performance was reasonably snappy on a shared hosting account.
  • You get the source code.
  • Version control support: it wasn’t hard to find out which files/directories to pull into version control.
  • Support for 5-6 languages out of the box.  We didn’t use this, though.
  • Geographic features: SkaDate knows a lot about cities and where they are located, around the world.

SkaDate Minuses:

  • Support: they charged $90/hour $95/month for support; I didn’t end up asking them for much help, but the times I did, they immediately wanted ssh access to the server (which tweaked me out).  I’m guessing that SkaDate might be a loss leader for ‘support services’.
  • In general the administrative interface was unintuitive and could use some work.
  • Intricate object and data model: lots of indirection, and because it is PHP, no IDE to help you unravel it.  I discovered this when asked to turn off a particular feature (that didn’t have an admin setting)–I’d have to hunt through 3-4 files to find out where a UI element was set up.
  • Secretive nature: they don’t really give you any documentation until you pay for it; however, they do provide a demo and when I emailed them and explained the situation (“I’m a developer and want enough information to do a bid for a project”) they responded with some of the documentation.
  • They had a new release midway through the project, and then a user found several of the php files had been hacked.  Not exactly confidence inspiring.
  • Initial configuration of the site was complicated: all the site features were turned on and the site was pre-configured with specific payment/membership options. The tricky part was not just turning off features, but figuring out that not only did the feature need to be turned off, but that the navigation needed to be disabled for that same feature on another section of the admin area.
  • Setting up custom dating fields was cumbersome partly because of the poor interface but also because there were a number of dating fields already set up that needed to be removed.
  • The software uses dollar signs ($) in some of the automated directories.  This caused an issue with mod_security on one of the hosts we tried to use; go with one of their suggested hosting providers.

I think SkaDate is a good choice for a basic dating site; if you need just the features in the demo and you’re willing to spend some time unraveling the administration UI and you are on a tight budget. Expect some bugs and frustrations, but hey, you only paid $350!
I would hesitate to use it as a platform for a more fully featured dating site until I’d reviewed the alternatives.

Final grade: B-

[tags]skadate review,dating site software[/tags]

BrowserMob: Load test your applications using the cloud

Via this tweet from Matt Raible, I learned of BrowserMob.  This service allows you to easily load test your web application.

I set it up in about 2 minutes to do a simple load test of a client’s site (though 5 pages).  They make it free to ‘test drive’ their service (though the free not enough to actually stress your site).  It is extremely easy to test a path through a publicly facing system.

The report was good enough; you get screen captures of pages that have failures, and they do a good job of making some of the performance data pretty and intelligible.  Again, I didn’t really load test anything, so I didn’t examine the report as closely as I would have in a real world scenario.  The service is built using Selenium, and I believe they allow you to upload full featured selenium tests (if you have already invested in this technology, but don’t want to build out a cloud network).

This service is of particular interest to me because last year I was part of a project that built a selenium grid on Amazon EC2, using these instructions.

If we’d known about BrowserMob, I’m not sure we would have used them, as I don’t know what our budget was, but it would have been nice to have that in the evaluation mix.

[tags]browsermob, cloud services,load testing[/tags]

How to get IE to accept third party cookies

Third party cookies are most often used by ad serving companies, because they are set by an image or other resource that can be pulled from a different domain, they are one way of tracking behavior across websites.

A short example: If I visit site A (www.foo.com) and site B (www.bar.com) and they both pull an image from site C (www.baz.com), it can set cookies for the site C domain (.baz.com), with a value of siteA or siteB.  Then when I visit site C, it ‘knows’ that I’ve been to sites A and B.

This can be sinister (see the wikipedia link above for privacy concerns).  However, if you have multiple web properties, then you may want to tie user behavior together across properties.  Third party tools like Google Analytics offer one way to do this, but if you want custom application behavior, then third party cookies are probably the way to go.

Firefox (at least my version of firefox, without any add ons or options changes) treats third party cookies much the same as first party cookies; that is, they just work.  However, IE requires a bit more hoop jumping, as they check the p3p compact policy.  A compact policy is basically a header you set which looks like this: P3P: CP="CAO PSA CONi OTR OUR DEM ONL".  I looked around for an easy explanation of what the various values are and how to set them in a coherent manner, but didn’t run into anything very useful.  However, I finally stumbled on this tutorial, which points you to this IBM software, which you can use to create a compact policy.  The tutorial also walks you how to use that software, which is not entirely intuitive.

As far as I can tell, IE doesn’t actually check for the existence of the corresponding policy file, nor does it care if the site does what the p3p header says it does, but it does require a valid compact policy.

After you’ve added that header, IE (versions 6-8) will accept your third party cookies.

[tags]third party cookies, compact policy, howto[/tags]

Online Tools for Enriching an Offline Community, CSA edition

I had a meeting yesterday with a Anne Cure, a farmer, and her web specialist.  She grows food that I buy via my CSA (community supported agriculture) share–I have a list of Colorado CSAs if you’re looking.  Anne, and the rest of the farmers she works with, has created a great offline community as part of the CSA.  There are multiple events at the farm, including an end-of-year pig roast.  As a CSA member, you get great veggies, you are part of a community and you support a local farm.  It’s win-win-win.

I asked Anne to meet with me because I felt that, while there was some member to member interaction, it wasn’t as prevalent as it could be.  Often, at CSA pickup, I wouldn’t talk to anyone except for Anne, or one of the other farm workers.  And I rarely observed any of the other members having any interactions either.

Being a web guy, I thought that bringing the community online might help.  Of course, there are always challenges around that–it takes work to maintain an online community too!

Here’s a list of all the ideas I thought of to leverage the offline community Cure Organic Farm has built, as well as some we discussed during the meeting.

Some of these ideas take little effort, some take a lot.  Some bring in revenue, some don’t.  Some put all the effort onto existing staff, others leverage excited community members.  Some had been done already, some they had never heard of.

Hopefully anyone else who has created an offline community can pick and choose useful tools and ideas, from below, to enhance that community online.  If you have additional suggestions, please feel free post them in the comments.

  • Use posterous to create a dead simple blog.  Leverage its auto posting capabilities to push content into other social networks (twitter, Facebook, etc, etc).  Use twitter/FB to drive traffic to their farmstand.  Cure Organic Farm does already have a Facebook page.
  • Use email list management software, like MailChimp, and look at the reports to see if email is a useful (aka ‘read’) means of communication.
  • Promote carpooling to pick up CSAs–save gas and promote interaction between members.  Consider using a tool like Divide the Ride.
  • Add a page of ‘Cookbooks Anne Uses’ (they already have a links page of various recipe sites).  Have that link to Amazon and you could possibly make latte money from it.
  • Cure Organic Farm puts out a great weekly newsletter during the CSA season, full of quotes and recipes.  However, searching it is an issue (I suggested Google Custom Search).
  • Also, making those recipes available in some kind of ingredient specific manner would be useful.  Even if the recipes aren’t broken out, just knowing that I can find a recipe for garlic scape pesto in newsletter #5 from 2008 is useful.  This could be done with a simple database or even plain HTML.
  • Forums, of course, are great community building tools.  They also are great for spam.  I imagined forums being used for sharing food knowledge (recipes, ‘how do I use 3 lbs of beets?’), though you could also share community events and even barter goods.  The issue with forums, as ever, is moderation–how to make sure that people are not abusing the forum (or each other).  This qualifies as a high input/high possible return tool.
  • An online calendar.  Both for specific events, such as the aforementioned pig roast, and informal knowledge, like when tomatoes are expected to be ripe, would be great to have on a calendar.
  • Online registration for CSA membership and other event payment.  They do online registration already (if the shares haven’t already sold out).  They currently use paypal, and the fees can really eat into the farm’s profits, so they don’t see a bigger effort into this area being useful.
  • Classifieds.  Kinda like the forums but for money or free.  Same model as craigslist, but aimed at a self selected group of people.  Again, moderation and ensuring appropriate use are challenges.
  • Using a ready-setup community building site like ning could help accelerate online community building.  I also pointed them to the great Transition Colorado Ning site, so they could see what a related organization was doing.
  • Use wufoo (or email) to let users submit newsletter content.  Just sharing what other businesses and professions other CSA members are in can help knit the community tighter.
  • Advertising on the site.  They weren’t too keen on this, but I think that the correct type of advertising would be useful.  Again, possibly too high effort to be possible.
  • List of links to local resources.  They are already doing this, but should make it easier for people to request addition.
  • Write a blog.  This is a higher input version of the posterous suggestion, but I think it would be fascinating.

Cure Organic Farm is a niche producer of vegetables, with a fiercely loyal CSA membership (shares almost always sell out within days of being open to the public) and proximity to Boulder, so their toolset will necessarily differ from another organization (imagine a farm just starting off, further out, with less reputation).  Hopefully some of these ideas and tools will be helpful to others thinking about strengthening offline community using online resources.

[tags]community supported agriculture, online tools, offline community, pig roast[/tags]

The future of the web browser…

… from the perspective of people building platforms for add-ons (or plugins or extensions or what-have-you): this collection of videos from the keynote of the Add-on-Con covers a variety of interesting topics regarding browser development, the security model and how extensions fit, ad blockers and what they mean, and more.

Of the major browsers, Chrome, Opera and Firefox are represented–the Microsoft/IE representative was sick, and Apple/Safari was MIA.  It’s about 30 minutes of video, unfortunately split into 5 separate segments.  Well worth a view.
[tags]video killed the radio star[/tags]

Whitespace and tables in IE

I was using the excellent displaytag library recently, and had written a table decorator to append some information about each row for a GWT widget to read and use.  The table ended up looking like this:

<table>
<tr>
<td>data</td>

</tr>
<script type=”text/javascript”>var …</script><span id=’uniqid’ style=’display:none’>gwt config data</span>
<tr>
<td>data</td>

</tr>
<script type=”text/javascript”>var …</script><span id=’uniqid’ style=’display:none’>gwt config data</span>

</table>

This worked fine in Firefox and Safari, but IE (versions 6, 7 and 8 ) were displaying whitespace above the table.  I couldn’t figure out why, until I commented out the table and the whitespace went away.  Then I re-enabled the table, and commented out the finishRow method; the whitespace was still gone.

The answer, of course, is that IE doesn’t like stuff outside of the <tr> tags.  Once I wrapped the span tag in <tr><td> tags, the whitespace went away for all browsers:

<table>
<tr>
<td>data</td>

</tr>
<tr><td><script type=”text/javascript”>var …</script><span id=’uniqid’ style=’display:none’>gwt config data</span></td></tr>
<tr>
<td>data</td>

</tr>
<tr><td><script type=”text/javascript”>var …</script><span id=’uniqid’ style=’display:none’>gwt config data</span></td></tr>

</table>

[tags]ie html quirks[/tags]

December 2009 BDNT writeup

I went to the Boulder Denver New Tech Meetup last night, and as always, had a good time.  I ran into Brett Borders, and had a good discussion with him about why BDNT is worth going to.  I only go every couple of quarters, but I always learn something, and meet some interesting people (last night, including Marty Frary), and get jazzed about technology again.  This particular episode was packed–standing room only.  In addition, in the spirit of the season, there was a food drive, which was a nice touch, and a giveaway.  One additional change was that the twitter stream was off during presentations, though available during the q&a period (here’s a twitterstream horror story from the presenter’s point of view).

Brad Bernthal gave an overview of Silicon Flatirons (and asked for $ support).  This is a center focused on tech, law and entrepeneurship, which puts on a number of programs supporting the Boulder tech scene (I attended and reviewed one a while back: IP Crash Course for Entrepeneurs).  Which raises the question–where is the CU CS department?  Why is the Law school hosting BDNT and other users’ groups?  The CS department does host Colloquia (I attend about one a year), but I don’t think those compare to BDNT, et al.

After Brad, we moved on to jobs and events.  I was glad to see a number of jobs pop up.  Over the last year, at BDNT there were always some developer jobs available, but this time there was also a marketing job.  Hope it’s a sign that the Boulder tech job market is thawing (for folks other than developers).  There were 8 job announcements, though one of them was equity only.  About half of the presenting companies said they were looking to hire as well.  As far as events, KGNU is having a fundraiser called ‘Beers With Brad’Ignite Boulder 7 is only a week away (here’s an interesting post on how to organize Ignites).

On to presentations…

  • The Blog Frog presented on their platform to turn blogs into communities.  This is an interesting space–you can see competitors in Ning, MyBlogLog and Google Friend Connect, though they all approach the issue from a different angle.  The Blog Frog is aimed at automating community creation, and have focused on mommy bloggers (as a large, valuable group).  We did not get a demo from them, and I haven’t signed up for their service for any of my blogs, but they definitely have a cool value proposition–helping niche content providers build their communities and reach advertisers and interested people.  You can see a presentation from them 7 months ago; it sounds like their business model has evolved significantly.
  • The Unreasonable Institute presented next.  They bill themselves as ‘Techstars for social entrepeneurs’, but they have a few differences.  Instead of picking applicants and providing them money, they want applicants to fundraise to provide a fee and idea validation.  After applicants are selected, they do get funds throughout the 10 week program, as well as mentoring, chance to pitch, etc, etc. The presentor said that the applications already received were split equally between the for-profit, non-profit and hybrid models.  So, the funding pitches would include VCs/angels as well as foundations–an interesting twist and a great way to increase connections between those communities.  They are accepting applications for the 2010 summer until Dec 15th.
  • Letitia Pleis, from Metro State College of Denver, gave a great talk on the tax implications of equity as payment.  She covered three scenarios.  Unrestricted (‘here’s 10% of the company, please write software!’) which is taxed as income at the time of the grant and also implies a great deal of trust in the payee.  Restricted (‘here’s 10% of the company, it vests in 3 years’) which is taxed as income at the time the grant is vested, possibly leading to a massive increase in taxes due, unless you perform an section 83(b) election within 30 days of the grant (one person spoke up and said they’d be bitten by this).  Unrestricted profits interest gives the grantee claim on a percentage of future profits.  She was at the end of her time, so we didn’t hear as much about this option as I would have liked.
  • Next up was a gadget review.  I’m not a gadget head, so I didn’t take notes on this, but they did give away a Sonos system.  Well, the winner earned it by knowing what the original cost of a Apple I system was ($666.66).
  • Public Earth presented next.  They are a wiki of places; the presentor said just like Netflix lets you collect your favorite movies, Public Earth will let you collect your favorite places.  (And they hope to have scale like wikipedia–he said that they plan to move beyond the ‘where’s the nearest restaurant’ level.  I looked for ‘slot canyons’ in UT, for example, and they had some.  I think they need to work on their linking, because I couldn’t get a link for my query to post.  But, on the upside, they don’t support IE6!)  They have 5M points in their database already, and just went live.  The wiki aspect is very interesting to me; I wonder whether they’ll get a critical mass of users to do spam policing.  It’s an interesting contrast to Google My Maps–PE has a slicker interface and more sharing features.
  • Last was RTP, with their sick iphone app, Real Ski.  This is an augmented reality application that helps you locate points of interest (bathroom, particular runs) when you’re out skiing.  They obviously couldn’t demo it at BDNT, but they had a video demo, and it looked killer.  It should be on the App Store soon–5 area maps free, 99 cents for every other ski area map.  They also asked for advice from the community about selling a B2C app; RTP apparently is a B2B company.  Pricing, scale, and accuracy were mentioned, but nothing really profound.  This question might be a better asked on twitter, or in some forum that allows more interaction.  (I searched, and was interested to see that no one had posted advice for them on twitter.)

The only complaint I had with this BDNT was that there were no demos (apart from the gadgets).  Several pseudo-demos (aka powerpoint slides/videos), and interesting and relevant presentations, but I think that live demos really add a lot and are in the spirit of the meetup.