Monday, June 6, 2011

Pixlshare- an image sharing app

Pixlshare is a new image-sharing webapp that I just started working on. It's intended to be a low-friction way to do simple image sharing- upload an image and instantly get a URL that you can share with others. No accounts or logins needed- just click upload and you're done.



It's built in Wicket and tiny bit of JQuery. It's fairly basic, but it has one fairly novel feature- you can add textual annotations to your uploaded images; the annotations appear as actual searchable text, rather than merely being part of the image bits.

I'm planning to add features like:

  • HTML5 drag-n-drop for uploads
  • upload multiple pictures at once to create an album
  • user comments


Tuesday, May 18, 2010

A New SlimPoints Feature: Food Diary

It's been a long time coming, but I finally updated SlimPoints to support a kind of Points Tracking, which I refer to as a Food Diary.  What's points tracking?  Briefly, you keep a running total of the number of "points" you eat during the day, and try not to exceed a daily limit.  It's very easy to follow (especially if you have a tool!)  Previously I had used an iPhone app for this, but it was riddled with so many bugs that I decided to scratch my own itch and create the diary for SlimPoints.

Supporting this feature represents a fairly big change, as it means using App Engine's Datastore for persistence and (obviously) requires an account in order to maintain the diary.  Since I run on App Engine, I chose the path of least resistance, which is to use Google's own UserService API for supporting users via Google Accounts.

Interacting directly with App Engine's Datastore is kind of painful, but Objectify made it as simple as it could be.  I highly recommend it if you need to run on App Engine.

Another challenge was that I wanted the rest of the app to remain useful for people who didn't want to take time to create an account. Sites that immediately require you to sign up are kind of a turn-off; it's helpful if your users can kick the tires a bit before deciding they want to invest the time to sign up. For this I relied heavily on GWT's history management via URL, and tabs to separate open vs "account required" features. Ray Ryan's advice to "get history management right up front" was truly gold, for this feature.

I also took the dive and started using UIBinder, and I'm damn glad I did.  UIBinder takes the best part of Wicket- the ability to lay out and style your components in HTML, and brings it into GWT.  It was totally worth the 15 minutes it took to learn it.

There are lots of changes in this release, please check it out!




Wednesday, May 5, 2010

Pause your Web History- break Google Maps

For a few days Google Maps stopped working for me. I first noticed it while trying to get directions to the airport. I use Safari, and the Maps page would just sit there with "Still loading..." forever. I thought it was a momentary glitch, but 2 days later it was still happening. I fired up Chrome on the same machine, which worked fine. Back in Safari, I tried clearing the cache, restarting the browser, etc. all to no avail.

Today I figured it out- I had paused my web history some time back. On a whim I tried unpausing it, and lo and behold, Maps now works again in Safari. Pausing it again results in the same breakage, so the problem is repeatable. Having to enable Web History to use Maps is a little unsettling, but this sounds like a bug.


Monday, March 22, 2010

A Multilingual Password Generator using GWT and Google App Engine


My fascination with GWT and Google App Engine continues. This weekend I created a
multi-lingual memorable password generator.

In order to create memorable passwords I took the Diceware approach. The idea is simple: create a list of English words, and assign a five digit number to each of them.

23542 click
23543 cliff
23544 climb
23545 clime
23546 cling
23551 clink

To build up a password, you select some number of these words and combine them (preferably with some further randomization of the case, as well as perhaps inserting some digits or symbols between the words).

To select each word, you roll a die (or fire up a pseudo-random number generator) five times. If you roll 2, 3, 5, 4 and then 3, that corresponds to the word with index 23543. In our case, that's cliff. Keep selecting words in this manner until you've built up a sufficiently long/complex password.

There are a number of password generator sites that seem to be using lots of server-side entropy for password generation, but then blithely download the generated passwords across the Internet to your browser. That doesn't seem like such a good idea. With create-a-password, it all happens right in your browser window, thanks to the magic of GWT.

On the downside, the dictionaries used for word selection are in fact downloaded (and they are well-known anyway). Despite this shortcoming, it still seems safer to me than shipping generated passwords across the network. Using a longer password (Wikipedia recommends 5 or more dice words) can help with this.

Diceware dictionaries are available in several languages, so it was pretty straightforward to go ahead and use GWT's i18n to make this program available in a few different languages. Hopefully I haven't butchered the Spanish too badly.

I was a little disappointed to learn that GWT doesn't seem to support automatically recognizing the user's browser locale. I expected to be able to automatically detect this, and then offer localized content, but that doesn't seem to be the case. I ended up having to embed a property into each of my localized html pages:

<meta name='gwt:property' content='locale=fr'/>

Another approach is to use a JSP. Despite this, I think it turned out pretty well.

Monday, March 15, 2010

The Weekend Hack: 13-14 March, 2010

Inspired by this recent post over at Hacker News, I was itching for a fun weekend project.  My criteria for the project were the following:
  • be small & well-defined- doable in a weekend
  • produce something useful for someone
  • give my rusty Google App Engine and GWT skills a workout
I use Wicket for my livelihood these days, but GWT is my true love. I miss working with it. 

So I decided to create a searchable database of Weight Watchers "food points" values.  Last year, the company that I was working for held weekly WW meetings in our lunch room.  For about 6 months it was all but impossible to avoid hearing "how many points for X?" type questions several times daily.

There are a lot of existing sites for this kind of thing, but I found the interfaces somewhat lacking (are we really still producing sites with MIDI soundtracks in 2010?)

Thus was born this weekend's project. At least until WW decides to shut it down. Here's the breakdown of where the time went:
  • 2 hours brainstorming
  • 4 hours getting Intellij, GWT and Google App Engine to all play nicely (this was the most painful part, really)
  • 3 hours basic coding, page layout, getting the tabs to work
  • 45 minutes with an Emacs macro converting HTML tables with food point values into a nice, CSV-style GWT properties file
  • 2 hours playing around with font sizes and colors.  I'm still not 100% happy with this, but the project was time-limited by definition.
  • 1/2 hour enabling AdSense, getting things to look relatively nice
A grand total of 260 lines of code.  GWT's SuggestBox made autocomplete so much easier than Wicket Extensions' AutoCompleteTextField, which I had to use recently.

The project is "done" in the sense that I am happy with it, and would feel content if I never spent another hour of time on it; that was part of my criteria for something doable in a weekend.  But that doesn't mean I'll never revisit it.

One potential idea is to make an iPhone-friendlier version of it, with some big calculator-style buttons right on the page to facilitate data entry.  I might come back to this idea in the future if the site analytics tell me it's worthwhile.  (As a side note, compared to the time and effort required to get an iPhone app of equivalent complexity published, this was a piece of cake.)

So, what fun projects are you working on?

Sunday, March 14, 2010

How to Disable "Top Sites" in Safari



Although it might be pretty eye-candy, I do not find the Top Sites feature in Safari4 to be terribly useful for anything. You open a new tab or window, and Safari sits there spinning while loading a bunch of web sites you may or may not be interested in going to. I find Safari to be a whole lot faster with the feature turned off.

It's simple.  Open Preferences, and tweak the settings for "New windows open with" and "New tabs open with" to be either an Empty Page, or whatever Home Page you prefer.








Sunday, March 7, 2010

Why no "Here" Documents for Java?

Many languages support the notion of  "here documents".  This is a handy way of embedded string literals that would normally have to be escaped right into your program text.  

#!/bin/sh
cat << "EOF"
Here is some text, embedded

  "right in the middle"

of my Bourne shell script.
EOF
Having been a standard feature in the Unix shells for decades, this language structure is supported in many newer languages, such as Ruby. Python, PHP and Perl.  But not Java.  In Java, this program would look like:
System.out.println("Here is some text, embedded\n" +
"    \"right in the middle\"\n" +
"of my Java program.\n");
As you can see, the quoting and escaping required to reproduce this text is pretty ugly.


Wouldn't it be nice if we could do this kind of thing in Java too?  It would be great for things like XML and Unit Tests.   How did we get to 2010 without having this as a standard language feature?  Has it ever come up in a JSR?   I haven't had much luck in digging up any information (the term "here document" is remarkably hard to search on.) If you know something about this, please leave a comment.