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.

Technorati Tags:


Hibernate Boolean/Integer ClassCastException

I ran into an issue the other day with Hibernate configuration.

I have a bean that maps to a table in the database.  It has a column, featured, that only has values of 0 or 1.  For legacy reasons, we map that to an integer (turning it into a boolean is on the List Of Things To Do).

I ran into an issue, and was getting this error in the logs:

Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
at org.hibernate.type.IntegerType.set(IntegerType.java:41)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:136)
at org.hibernate.type.NullableType.nullSafeSet(NullableType.java:116)
at org.hibernate.loader.Loader.bindPositionalParameters(Loader.java:1698)
at org.hibernate.loader.Loader.bindParameterValues(Loader.java:1669)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1554)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)

Here's the relevant section of the mapping file:

<property name="featured" type="integer" columnn="featured" />

I tried explicitly laying out the type of the SQL column:

<property name="featured" type="integer">
<column sql-type="INTEGER" name="featured" />
</property>

But neither of these worked; I received the same error.

I took a step back and looked at the bean.

Integer featured;

public Integer getFeatured() {
return featured;
}
public void setFeatured(Integer featured) {
this.featured = featured;
}

...

and realized that I had added a convenience method that was confusing the Hibernate code:

public boolean isFeatured() {
return ...
}

When I changed the signature of the convenience method to:

public boolean isFeaturedListing() {
return ...
}

the exception went away.  Thought I'd share for anyone searching for this stacktrace.

Technorati 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>

Technorati Tags:



What to do when you get 504 and 500 errors from your Google Mini

I have a client who uses a Google Mini (a search appliance created by Google) as a key part of their business.  The appliance worked fine, gave great search results, and was happily humming along until very recently.  At some point over the last couple of months, the number of 504 errors visible to the users using the mini increased drastically.

At one point, no matter what term you searched on, you would see this error message:

Error: Unknown XML result type.

View page source to see the offending XML.

504

When I took a look at this to try to troubleshoot, the results were very arbitrary--some search terms would show this message, some would not.  However, when a search term did show the error message, it would do so consistently, at least for 5-10 minutes.  Perhaps that had to do with caching?

The benefit of the mini is that you get great google like search results.  The detriment is that it is a black box--you don't even get a login to the box, etc.  And when your support contract runs out, you're left with very few options.

So, we troubleshot with one hand tied behind our back.  We:

  • tried rebooting the box a couple of times (via the web interface)
  • considered rolling back the index, but we only had about 36 hours of index history
  • generated and analyzed the search logs
  • searched the Google Groups for mini support.  All that turned up was this post which was not exactly helpful, since we no longer had support

Finally, the client suggested resetting the index, as it was conceivable that the mini index had been somehow corrupted.  This was an option for the client because their documents are re-crawled every day.  If that wasn't the case, it would have been a harder decision.

Resetting the index solved the problem.  Some numbers:

  • a few months ago, 0.5% of search requests were returning either 500 or 504 errors.
  • just before the index was reset, 40.2% of the requests were either 500 or 504 errors.
  • now, 0% of requests are either 500 or 504 errors.

FYI, this post is applicable to the Google Mini version 4.6.4--I'm not sure how more current versions of software work/break.

Technorati Tags: , ,



In source your EC2 instances

If you have built a killer application on Amazon Web Services, you may reach a point where you don’t want to continue to use them.  I can think of any number of reasons you may want to migrate your servers.

It may be because you’ve reached the 20 server instance, or because you want more control, or because you want to buy your own machines and spend money on a system administrator instead of paying Amazon, or because there’s something that you need customized that’s ‘behind the curtain’ of AWS.

For whatever reason, if you decide to move off Amazon’s elastic compute cloud,  you probably should take a look at Eucalyptus (thanks to George Fairbanks for pointing this out to me!).  From the overview, this is a AWS compatible environment, so you can continue to use the same tools (capistrano!) to manage your instances.  You also gain the same abilities to spin up or spin down servers easily.

What you don’t get is AMI compatibility.  That is, you can’t transfer your AMI to a eucalyptus server farm and expect it to run.  They have a FAQ about AMIs (for 1.5, which is an older version of the software) that points to some forum posts about turning an AMI into an EMI (Eucalyptus Machine Image), but it doesn’t look like a trivial or easy operation.  It does seem possible, though.
However, it’s good to know that it is possible, and that a company can have a migration path off AWS if need be.

Technorati 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.


Hadoop logging case study

Here’s a fascinating case study of the evolution of a (large!) log analysis toolset. It follows Rackspace as they strive to allow searching logfiles from an ever growing number of servers, starting from manual ssh/grep, through various incarnations of a MySQL database, and ending up using Hadoop/Lucene/Solr.  There’s (some) more info on the rackspace blog.  Cool stuff.

Via George Fairbanks.

Technorati Tags: , , ,



© Moore Consulting, 2003-2017 +