21 June, 2012

Deconstructing Yet Another Ridiculous EULA (YARE?)

Ever since I've used it on Palms, I have been a fan of Graffiti, the input method for these devices.  Briefly, it's not full handwriting recognition; it's more like a standard set of gestures, but those gestures make sense because they're usually the upper case of letters, mostly the shape of digits (except "4," where it's just the left part), and "escapes" (tap, and stroke from upper left to lower right) for punctuation.  Since tablets are larger, it's actually practical to draw a QWERTY (or other) keyboard on the screen, which is what most Android input method editors (IMEs) do.  But honestly, this is fraught with difficulties and lots of typos.  The GO Keyboard makes things arguably much better, as every key has a press-n-hold punctuation mark on it, obviating the need in most cases for hitting the numeric shift key.  Still, I missed my usually quicker and less effort Graffiti from Palm.

(A short aside here: the Graffiti 2 on my Palm T|X really sucks compared to my Palm Vx's (original) Graffiti.  The original expresses everything pretty much unambiguously, but 2 makes many glyphs double strokes...such as "K" is basically lowercase ell (a vertical, downward stroke) and less than.  Similarly, "T" is ell/dash.  This has the effect of delaying input because the device does not know whether I am meaning "L," "K," or "T," and will time out, or worse yet, if not done very precisely (such as not crossing the ell with the dash, thus interpreting it as ell-space) it is recognized wrong.  Unfortunately, I think there was some sort of IP legal problem in being able to use the original Graffiti in the T|X.)

So I have been fervently searching for Graffiti for Android for the past few days.  Unfortunately, searches for that were mired in results with various doodling or painting programs.  Switching tack from "graffiti" to "handwriting IME" was not so helpful either, as there are many, many IMEs specializing in Asian inputs (Chinese, Pinyin, Hangul, Japanese...you name it, none of which which I understand of course).  Understandably, this is much more vital, as Asian scripts are much more like drawings than Latin ones.  The search was rather disappointing...until today.

Imagine my excitement when I found there was someone who has already implemented a Graffiti-like IME for Android, ACCESS Company.  The first disappointment was the original link I found was to Play (formerly Market).  Unfortunately, my Android tablet didn't come with Play, and it is problematic to install.  (Updated 2013-Sep-30:  I have since gotten the original 16GB Nexus 7, and I have put Graffiti on there too.)  Even more unfortunately, "everyone" would rather put something on "the Market" rather than handling hosting, payments, etc. themselves, so it's really, really popular.  Also, many if not most Android devices ship "locked to" Play for support liability reasons, especially phones.  Thankfully, this Graffiti IME package was also noted as being available in the Amazon Appstore too, which I went and fetched it from there.

(Another aside: I know that Amazon are just using the same methodology and programming for paid and free apps.  But gosh dangit, if it's free, do you really have to email me about every "purchase?")

The first thing that made me go "whoa!  Hang on there, buckaroo!" about this package is its declaration of needed capabilities: "full access to the network."  Every time one activates an IME into Android in the language settings, the system warns you about the fact that IMEs could be mere keystroke loggers, sending your credentials for who-knows-what back to IME Author Central.  However, it is extremely commonplace for free apps to have Internet-served ads.  Still...I've been generally trusting with this sort of thing.  I have GO Keyboard, which has the absolutely essential inclusion of arrow keys, because precise cursor positioning with the default IME is very frustrating to say the least, especially on a resistive touchscreen.  So much of the free software is also ad supported, and the ads come from Internet connections, so many free packages will declare the need for network access.

Not surprisingly, they're a Japanese company, probably using one of the aforementioned Asian scripts in their daily lives, so they're naturally a good candidate for making a handwriting/stroke/gesture IME.  However, they seem to have some folks in the company who understand English, at least its form (but not precise meaning, as we shall see).  Many help files, manuals, and yes, sometimes end-user license agreements (EULAs) written by Asians are choppy and hard to understand...kind of like the dialog in many Jackie Chan movies.  Thankfully, this EULA is very understandable English.

Let's just start with the fact that the vast majority of EULAs are exceedingly long.  I believe this length is the primary reason people extremely rarely actually read them before agreeing to them.  That's why when I authored Tk Web Form Buddy and I wanted to host it on SourceForge, and therefore had to choose an approved open source license, I chose the shortest one I could find at the time, the MIT license.  We humans are an impatient lot.  "Let's just get to the fscking software already; I'll basically behave" most people think.  If we weren't such a litigious society, I'm sure EULAs would boil down to the ten words, "Play nice.  You basically know how.  Now go do it."  Cheerful ones would also include the imperative "Enjoy!"  But instead we are faced with pages and pages or screens and screens of mind-numbing, sleep-inducing language.  And yes, there is a certain amount of irony here in that I tend to be wordy too, and this piece is on the long side.  But basically it is for information and, particularly, entertainment.  Actually, that's why it's here on the IHeartLibertarianism blog instead of directly on Google+.

In the first paragraph, they talk about "concluding the said Agreement" with them.  "Conclude" in this context more means "terminate" or "end" in the sense of be over and no longer in effect, except I guess they mean something more like "complete."  It's subtle, but I think a poor choice of words.

Next, we have the last sentence of that paragraph:
If You do not agree with all the provisions of the License Agreement, You will not be able to use the Software.
 It's a clear confusion between ability and permission, much like people seem to confuse "can" with "may" a lot.
The Software is confidential
Huh?  It's hardly confidential.  I basically didn't have to do anything except provide an email address to Amazon; there was no vetting process per-se.  If you really wanted it to be "confidential," you'd be very careful about to whom you give the software.

Next the EULA talks about using the software on only one device.  Hmmmm...it's fine to use the software, and it's no charge, but if I had multiple tablets/phones/whatever Android devices, I can't use it on more than one?  In that paragraph, it also talks about personal, noncommercial use.  OK, so I am not entitled to use this software provided I'm using my tablet in conjunction with running a business?  I think that is kind of absurd, especially for a no-charge product.

Let's see...what other crockery do we have?  Under "prohibitions," I apparently can't copy the software, despite it being no charge and the fact that I will back up my tablet (thank you, Titanium).  We also have the usual crap about reverse engineering (decompiling, etc.), which in many jurisdictions, if I'm not mistaken, can't be prohibited.  In #4, we finally get to not including it "into a hardware product."  Again, we have usual stuff about other expropriations, modifying it to remove notices and such (which is likely illegal anyway under copyright law), and not leasing and such.

And of course, we have the usual, shouting, ALL CAPITALS paragraph or two about we're not responsible, no matter what, if your Android device happens to turn into a pile of unusable slag.  This is also pretty much untrue; if their product really does do something nasty, they deserve to make it right.  But I thoroughly understand (again, in this litigious world) they must have this "pushback."

Next we have the absurdity that since Software accesses the Internet, I am to accept some nonspecific additional terms and conditions of other Web sites (presumably their ad engine backend).  Piffle.  If I get cheesed enough, they will get iptables'ed and ip6tables'ed essentially out of existence.  I shouldn't have to agree to terms and conditions recursively without end.

If I thought I was foolish for actually taking the time to go through these things to become cognizant of what rights I have, what rights I'm giving up, and any responsibilities I may have due to my actions, I can barely imagine what these poor sots who just handwave it away by checking "I agree" and getting on with life, are in for.

Thankfully, there is an acknowledgement that they absolutely cannot limit the GPLed/FLOSS parts of their software (such as libraries linked to and such).  Prima facie, if that weren't there, I'd think that'd be grounds for invalidating large portions of the agreement anyway.  Unfortunately, I would say it looks like they're also in violation of the GPL by not including the GPL/LGPL nor links/references to it/an offer to provide it.

Next, they talk about their advertisers.  Sure, we'll stick these advertisers in your face, but we disclaim all liability in conjunction with them.  In other words, you're lazy and don't feel like vetting the ads that your software puts on my device.  And once again, they're saying I have to agree to whatever terms, conditions, privacy policies, etc. of these unspecified third (fourth?) parties.  Meh...just like mentioned before, if motivated enough, you will get firewalled.  If it somehow stops working, you gain very bad karma, and I will toss your software on the electronic trash heap.

Oddly enough, there doesn't seem to be any language in here that would prohibit me from doing such firewalling.  It's not modification of their product.  It's not subverting their copyright notices (I don't think).

Next, we have rather unnecessary inclusion of language about not complying with other laws...specifically export laws.  Duh.  It's illegal for me to do these things anyway; it's just filler to include this in your agreement.  It also seems kind of silly too to include countries by name in this document.  Those countries to which exportation would be illegal may change.

Tell me, ACCESS...why is it you have put "Agree Disagree" in the license?  You know, oddly enough, I tried for about five minutes or so to find an EULA (at least one specific to Graffiti) on your Web site, and I'd expect that text to appear on some Web form buttons, but this is text in a piece of software.  Also oddly enough, the actual buttons in this portion of the app are "I agree" and "I do not agree."

Well...despite some rather poor word choices and ridiculous statements, at least for now I'm jamming my index finger on "I agree."

P.S.-- I've been intrigued by Quikwriting too.  Maybe someday I will find and use a Quikwriting IME for Android.  Hopefully it will have less onerous and and easier to read (shorter) terms for its EULA :-) .  UPDATE: Apparently there is a Slovakian hacker  who has implemented it.  However, it's pretty much unusable because it lacks punctuation.  I couldn't find any number or punctuation "escape" gestures.  And it's not documented.  The original Perlin and friends implementation has such things.  ANOTHER UPDATE: The author wrote me an email to explain it's in there, just not documented.  It's true; if you run down where the author started (an Openmoko implementation, qwo), that project has more documentation on how punctuation and such is done.

Direct all comments to Google+, preferably under the post about this blog entry.

English is a difficult enough language to interpret correctly when its rules are followed, let alone when the speaker or writer chooses not to follow those rules.

"Jeopardy!" replies and randomcaps really suck!

Please join one of the fastest growing social networks, Google+!

15 June, 2012

A Tale of Two Stupidities

UPDATE from 21-Jun-2012 below.

Last week (on Wed., 06-Jun) I went to a regional retailer, Ollie's Bargain Outlet, for some miscellaneous items--socks, black landscaping cloth, maybe some grass seed.  This place has many "regular" items, but they sort of specialize (mostly) in buying out overstock of other retailers, and being an outlet for manufacturers' reconditioned/refurbished items.  One of the latter items is a Pandigital Nova, which they call a "Media Tablet" (and I call an Android tablet).  It's only been a week, and already it has urged me to spend insane amounts of time researching about, and hacking on, this thing.  In one instance I was up until about 0430 hours local time (Eastern Time).  But on Thursday this week I executed two stupidities.

If you recall biff(1), it "makes noise" when new mail arrives.  One myth (and it is an untrue myth) is that one Berkeley student's dog, named Biff, barked at the postal carrier.  I wrote my own to watch $MAIL because the standard biff behavior is to "bark" only once.  If I'm not around to hear it, it could be many hours before I even know I have new mail to read, let alone actually read it.  So my version checks $MAIL at (approximately) the top of every minute from 0800 to 2200 hours, and it barks every minute until the file's "last read" time is later than its "last write" time.  (There are a number of noises which could be similar to my original biff occuring at the top of some minutes, such as the top and bottom of hour markers broadcast on WBEN-AM, so it actually targets one second after.)  So this is one of the first things I usually hear in the morning, because there is usually at least one cron job which emails its results to me which ran overnight.

Previous to Thursday morning, I had set up email fetching on the tablet, and had seen it work.  So imagine my surprise when I get the tablet's swirl animation which putting "Syncing" on the screen, and up pops on the screen that the OS had to force close the app.  I tried it a few times to find out if this was some quirk, and it was insanity (doing something over and over and expecting a different result).  OK, so putting on my computer engineer's thinking cap for a second, the usual first thing to consider when something was previously working, and now is not working, is what changed.  The major change was installing the excellent (although Chinese and therefore difficult to understand at times) GO Launcher EX (available on Play, Amazon Appstore for Android, and where I got it, the Opera Mobile Store).  So recalling there are a lot of rather nasty folks overseas, I kind of felt I was duped into compromising my tablet, so I uninstalled GO Launcher EX.  That was no help.  I rebooted (powercycled) the tablet.  That wasn't any help either.  This was the first stupidity, assuming the newfangled (to me) tablet had to be at fault just because of that being the current hacking target, and its newness to me.  I even went through a factory defaulting wipe of the system, and a re-setup.  This of course, as we shall see, was no help at all either.

By now biff had barked at me about 20 or 25 times, and I was getting miffed that I could not pick up my email on the tablet, and I'd have to revert to using the SSH client on my Palm T|X.  So I pulled that out, logged in, and pulled up Mutt (my favorite ncurses-based MUA).

It turns out, as usual, the only thing waiting was the report of the spam messages cleaned up daily (retains 7 days for inspection and possible "rescue.").  But then after dismissing that, I started looking at the messages and maillog logs.  Much to my amazement, the  spawned IMAP daemons were not only exiting with SIGSEGV, but before they did exit, they were consuming all idle CPU cycles according to top(1).  And that, as we shall find out, was one of the keys to unraveling the mystery.

I thought, "that's kind of odd."  Although I didn't change anything relevant on the IMAP server side of things, and the uptime was only 7 days, I thought that every once in a blue moon things do go screwey on Linux, and so despite not wanting to lose my place on several open browser pages, I shut down and rebooted my workstation.  And that of course was no help at all.  This was the second of the two stupidities.

By this time I was a little worried that I had a fancy paperweight which also happens to be capable of playing Angry Birds intead of having an Android tablet.  One of the main reasons I got this thing is not to have to deal with basic email and such on a tiny T|X screen.

The key to solving the issue was to start dropping assumptions, and this is really plan B (and sometimes plan C) when the usual suspects in computer and general problem solving aren't getting oneself anywhere.  And admittedly, all too frequently plan B is rebooting.  That should really be plan C at soonest, and more appropriately plan D or E.

The fatal misunderstanding was that Dovecot automatically stores and subsequently retrieves a user's email "folders" rooted at the user's $HOME/Mail/.  Wrong!  That's not necessarily the case.  I had always assumed that since I had set up so many other IMAP clients before (Mutt, Thunderbird, maybe a few others) and leaving the optional server side parts at the MUAs' default that it was Dovecot doing that.  However, I think it's probably closer to the truth that at one time an MUA I used, probably ElM, set up ~/Mail and it had somehow been found ever since.  And I still don't know what the heck happend, why all the sudden the Gingerbread default "Email" app didn't work like that.

But looking at this in hindsight, I will show you my best guess at what was throwing a monkeywrench into the entire works:

20:30:04 rchandra@sal9000:~ 0> du -sk
11457296            .
20:30:14 rchandra@sal9000:~ 0> du -sh
11G          .
20:30:19 rchandra@sal9000:~ 0>

My best guess is that both the IMAP daemon and the poor, limited RAM tablet were trying to deal with 11GB of "mail" in my home directory.  They were both likely choking rather mightily on the multi-gigabyte virtual machine hard disk image which is in the QEmu subdirectory, among other reasons.

This was an extraordinarily easy fix.  I went into the tablet's incoming server settings for sal9000, specified "Mail" as "IMAP prefix path," and the IMAP client worked fine.  So take a slightly painful lesson from me, and work with fewer assumptions instead of more when computer problem solving.

UPDATE from 21-Jun-2012:  I really didn't want to do without my folders for filing away my email, and none were showing up by specifying the prefix.  So I decided I would snoop in on an IMAP session to see why imapd was chewing CPU and K-9 Mail was crashing.  Actually, I found out it's decidedly worse.

At one time, I was experimenting with delivery to maildirs.  As those in the know know, there are three subdirectories in that format: new, cur, and tmp.  I didn't want a whole new tree, so I decided to make some symlinks, all to "."  So...imapd told K-9 (in essence) "there appears to be a folder here, not with email, but with a bunch of subfolders, named 'new.'"  K-9 faithfully said, "OK, whatcha got?"  Imapd faithfully replied, "well, seems inside 'new' there are more folders, at least one of them which is named 'new.'"  And K-9 asked, "well, what's inside new/new then?" wherein imapd replied, "seems there's a new/new/new there."  And so on went the conversation, basically ending when K-9 filled up my poor tablet's RAM, and imapd probably filled up nearly 2.5GB of RAM and 1GB of swap, and probably also eventually died...but not before really messing with my computer.  Yesterday, it locked up hard, requiring not the three finger salute, but a holding of the power button.  As best as I can figure, this unusual taxing of the system was its demise.

Direct all comments to Google+, preferably under the post about this blog entry.

English is a difficult enough language to interpret correctly when its rules are followed, let alone when the speaker or writer chooses not to follow those rules.

"Jeopardy!" replies and randomcaps really suck!

Please join one of the fastest growing social networks, Google+!