Tuesday, October 7, 2008

Sometimes I just don't learn

I created this blog for the specific purpose of saving me from my own terrible memory. Again and again I get myself into deja vu situations where I can distinctly remember getting into this problem before, but I can't remember hoow I solved it. The number of times that has happened has dropped precipitously since I started blogging my most annoying problems here. But, despite that fact, I managed to forget how really important it is to my learning process to write these things here.

Yesterday, my maemo development scratchbox and I had a little disagreement regarding available packages and repositories. In the end, I solved the problem, but only in the i386 target. Today I cant get the armel target to work and I have no idea what the fix was yesterday. This is a serious pain.

Not to worry, I was better than the problem yesterday, and after wasting a bit more time, I shall beat it again. When I do, I'll be sure to blog the solution here.

Thursday, October 2, 2008

Thoughts on MID's

MID stands for Mobile Internet Device.

These devices are small tablet computers, some with and some without a physical keyboard, that allow you to connect to the Internet and run a number of applications in miniature versions. Some smart phones are basically MID's that happen to also be phones. I'd put the iphone into that category, as well as any phone with a screen that size and equivalent functionality. So, in my book, the Nokia N80 doesn't count (too small of a screen for comfortable web-browsing) but the HTC Android phone does count. My broad description, including phones, is not necessarily canonical. I do think that it's logical, however.

These devices generally have a browser, some sort of IM/chat facility, some sort of office document reader and sometimes document editors, a music and/or video player, and games. Some MID's run a version of Windows Vista. Others run a version of Linux. Of course, if you know me at all, you know that I want Linux on my MID, because I want freedom (as in speech) with my software as much as is possible. The good news is that it's possible to run a version of Linux on nearly all MID's today thanks to the work of groups like Moblin.org. So, knowing that, what's really important in an MID?

There are a few harware things that I think are vital. A usable keyboard is way up there, in my estimation, although a really good *handwriting recognition interface would satisfy me just as well. A **screen size that allows for easy reading is important, too. A camera is nice, but not vital, since my main digital camera is generally on my cell phone.

Software-wise, I don't want to be hobbled. I don't want the system to lock me out of the terminal window, or force me into contortions of geekish heroics just to install non-approved software. I don't want Big Brother telling me what I can and cannot run on my MID. It's mine, gosh darn it. If I bought it, I want to use it however I choose. Can you imagine buying a refrigerator and being told that your warranty would be void if you chose to refrigerate any non-food items? What if you choose to refrigerate photographic film? Or pre-cool glasses so that you can have a proper cold one?

The Samsung Q1 is my favorite device in terms of screen size and heft. I feel like I could get WORK done on that thing, as well as play, read RSS feeds on the way to work and otherwise do most of the tasks that make up most of my non-programming computing life. What I don't like about it is the keyboard. Actually, the keyboard is ALMOST right. The placement under the user's thumbs at the top of the screen is fantastic, but it's just too hard to do shifting and number typing. Fix that, and the Samsung Q1 running an imaginary version of Moblin would be first choice all around.

I've played pretty extensively with the Lenovo ideapad U8, and I'd really *like* to like that device, too, but it just doesn't cut it for me. If I spoke and wrote Chinese as my primary language, my opinion would probably be a bit different. The stroke-based keypad on the telephone dial pad is probably a comfortable way to type Chinese. If you've done much smsing, though, you already know what a pain that kind of keypad is for extensive entry in most other writing systems. The fact that the midinux software on the device is super hobbled is also a pain. In early versions of the device you couldn't even get a terminal window unless you know the "cheat code", so to speak. (Ctrl-alt-backspace and then F2) In later versions, at least you'll have an x-terminal available by default. Still, the packaging system is wonky, and the GUI is funky and uncomfortable.

You may have noticed that when I was talking about the Samsung Q1 I wanted an imaginary version of Moblin. Well, that's a thing, see? Moblin just isn't what it could be, yet. I'm personally not all that thrilled about the fact that they've just changed from a debianish system to a red hattish system, either, but that's beside the point. The problem with Moblin on the devices that I've tried it with has been far more basic than that. The applications just aren't quite there yet. They, almost without exception, get things wrong when converting their interface into the smaller space. Buttons don't show up right. Text inputs get messed up. Scroll bars are in the wrong places or not there at all.

One of the biggest problems across the board with Moblin apps and system controls is that they are unaware of whether the screen keyboard is being used. That means that they hide important dialogs and even buttons under that keyboard in the screen real estate, and you simply can't DO anything. The only solution is to plug in an external keyboard to get some tasks done.

So far, the best all around experience I've had has been with the Nokia N810 running the new maemo version, 4.1.1 Diablo. It was easy to find and get software. It was easy to get into a terminal window and easy to do things there. The pull down keyboard was comfortable in my hands and I was able to type fairly quickly with it. The touch screen worked well, and the applications were lovely. I didn't see any of the problems that I've encountered with Moblin apps, which makes me wonder why there maemo apps aren't being ported to Moblin instead of desktop apps getting Moblinized.

I've got this fantasy of a cell phone/MID device that will be bigger than the Nokia N810 but smaller than the Samsung Q1, have enough storage to make it useful as a multimedia device, run on Intel ATOM architecture or an equivalent for power and speed, have a usable keyboard AND handwriting recognition, a camera on the back (they are so useful for things like barcode reading!) and bluetooth so that I can connect an earpiece. Of course it will have wifi and 3G, because let's face it, there's no reason I should have to carry BOTH a telephone and this little baby, when I can have it all in one. Seriously, with a bluetooth earpiece it doesn't matter how big the device running the 3G connection is, and you really shouldn't be talking with the phone up to your face anyway! This device would either run maemo, which I think is an absolutely lovely OS, or else Android, which makes me all weak in the knees and giddy with excitement at the thought.

When this device is born I will love it, take good care of it, and write software for it. It'll come with me on the bus and on the plane and in doctor's and vet's waiting rooms. It will sit with me in coffee shops, and hang out with me on the couch in my living room. I think I've been dreaming of this device since I was a kid, while sitting in front of the tv, watching endless Star Trek reruns. I'm wondering when I'm going to get to adopt buy one.

*Am I the only one on the planet who misses the Palm Graffiti?

**I think I'm killing my eyes reading RSS feeds on my way to work on the tiny N80 screen.

Wednesday, August 27, 2008

Mozilla is Ubiquitous

If you are subscribe to my Google Reader share, are one of my Twitter friends, or are connected to me on FriendFeed, then you might be sick of this topic already, since I've been kinda blabbing and sharing and tweeting ever since I found out about this when I came into work this morning, but... DUDE! Ubiquity is AWESOME!!!!

In case you, like me, have never heard of the Ubiquity project from Mozilla Labs before, let me enlighten you with this here little video:


Ubiquity for Firefox from Aza Raskin on Vimeo.

The reason that this tool is so cool is that it brings together the speed of command line work with the user friendliness of the graphical interface. With a few key strokes you can do the work of tons of mouse moves and clicks. What's more, the key strokes are completely intuitive. There's no memorizing a huge list of things just to make it work. I don't have to memorize the word "Twitter", I use it all the time, and if I start typing "Twitter" in the Ubiquity command box it guesses at what I'm trying to tell it before I'm even done. So, two letters in, I'm done with the "Twitter" part of the command and I can start telling it what I want it to tweet.

The interface for Weather is another great example of how easy to use this interface is. I called up the Ubiquity command box and started to type "we" and it knew I wanted weather. Then I typed Oakland (where the bestest daughter in the whole wide world is right now), and it immediately gave me the weather for Oakland, California. I decided to see about Oakland, New Jersey, though, just for a twist. *Poof* the weather info changed as I added in the state. Very nice.

There are lots of commonly used tools built into the application already. On the downside, non-programmers find themselves stuck with the options that someone else picked when they wrote the command. On the upside, however, with just a little bit of work you can learn how to edit existing commands or write your own, so you can make commands go to the sites that YOU want.

The first thing I plan to do with this? Create a command for mapping here in Israel using http://mapa.co.il, since Google Maps are less than useless in Israel. (Apparently, in Israel we have no streets.) I shall post code and a general review of the coding experience here when I'm done.

Oh, oh, oh, you know what else would be nice? A command to blog things just like you can email things in Ubiquity. Yeah, that would be awesome. Who wants to write that one?

Tuesday, July 22, 2008

mySQL query solution

I had been trying very hard to avoid having to do a nested query, but in the end, I really couldn't figure out a way around it. This is the query that gets the job done:


mysql> select tnid from fr_strings where sid NOT IN (SELECT sid from fr_tr_by_uid where uid = 1 and language = 'es');


If you have a non-nested solution for this problem, I'd still love to see it!

Monday, July 21, 2008

mySQL query trouble

I'm having a hellish time with a sql statement. I need to get nodes ("tnid" here) where a given user (uid = 1) has not translated a given language (language = "he", or rather, != as you'll see)

fr_strings has sid and tnid (those are the only ones important to us now, anyway)
fr_tr_by_uid has sid, uid and language

When someone translates a string, it pops in their user id, the string id and the language that they translated the string to. So, say, if I am translating into es or he (spanish or hebrew) I should no longer see the string pop up for translation in es if I've already done that translation, but the request for the string translation would still pop up when I'm working on the he translation. Get it? OK.

So, I want to select the tnid's where uid != 1 and language != 'he'. Something like that. Let's look at some queries and responses:


mysql> select distinct * from fr_strings as st natural left join fr_tr_by_uid as ui where sid > 279;
+-----+------+------+----------+
| sid | tnid | uid | language |
+-----+------+------+----------+
| 280 | 870 | 2 | es |
| 280 | 870 | 1 | es |
| 281 | 871 | 1 | es |
| 283 | 873 | NULL | NULL |
+-----+------+------+----------+


What I want out of this bunch here is tnid 283. That's all. That's the ONLY one I want. But if I try this:


mysql> select distinct tnid from fr_strings as st natural left join fr_tr_by_uid as ui where sid > 279 AND uid != 1;
+------+
| tnid |
+------+
| 870 |
+------+

That's clearly not what I wanted.

How about This:

mysql> select distinct tnid from fr_strings as st natural left join fr_tr_by_uid as ui where sid > 279 AND uid != 1 OR uid is null;
+------+
| tnid |
+------+
| 870 |
| 873 |
+------+


Still not there. As you can see, since the tnid shows up once in the table under a different uid, I still get that tnid back, even though one record with that tnid does have the uid=1.

I'm sure that this is something really stupid. (I'm always sure when I can't figure something out that the solution is something really stupid.) But, I can't shake the answer out of my head. Any of you know what I'm doing wrong?

*edit* I got a message suggesting that I ought to just do uid is null and ignore the uid != 1 part. But here is why that doesn't work for me...

Let's say that I want user 2 to get all the strings that she hasn't translated into Spanish yet.


mysql> select distinct tnid from fr_strings as st natural left join fr_tr_by_uid as ui where sid > 279 AND (uid is null OR language != "es");
+------+
| tnid |
+------+
| 872 |
| 873 |
+------+


This doesn't work. You see, uid 2 DID translate 870 into Spanish, but not 871 (see the first results table). I need her to get 871 for translation still, but this query won't give it to her. I'm still stuck.

Wednesday, July 2, 2008

Finding a host I couldn't see

Last week I finally broke down and asked IT if they would mind if I switched over to a Linux desktop for my daily development work. Functioning in Windows was driving me absolutely bonkers. He wasn't so sure about it at first. He suggested that I run Windows and then have Linux running in virtualization. That just seemed like a waste of resources to me, though. So, I suggested that I set the computer up for dual boot, and if things went badly I could always go back to Windows.

The IT guy's concern was that, while I might be able to do my programming in Linux, I might not have access to all the company shares, the exchange server for mail, and all that other Windows-based stuff sitting on the company network. And he was right to be concerned. In the past, all those things have been a major pain in the backside to fix.

The good news is that Samba, the tool that lets you hook up Linux or Unix machines to a Windows network, has come a very long way, and the whole thing turned out to be pathetically easy. Not only that, but Evolution for mail kicks the proverbial butt, and I was able to get mail, tasks, contacts, and calendar from exchange working perfectly with the Exchange server with just a few button clicks and no sweat at all.

But, then I need to look something up on the company wiki, and that's when I hit trouble. Firefox turned my http://companywiki/ url into http://www.companywiki.com. Woops! I tried a couple of times before it sunk in to my thick skull that the problem was that my computer wasn't recognizing the internal domain names. Clearly I need another Domain Name Server in my list, but the problem is that I don't want to go back to that IT guy just now. He may just tell me it's all Linux's fault, and that I have to switch back. I don't want that. So, I have a work around.

I checked in Windows what the ip address for companywiki is supposed to be, and then, back in Linux, I edited my hosts file to point the name companywiki to that address. Poof! I have normal access to the wiki using the domain name now. Easy peasy.

There are other uses for the hosts file, too. For instance, if I have server settings in a Web application that I'm working on, I can tell my hosts file that those server names are really my computer. My computer will look where the hosts file tells it to look before asking the Domain Name Server for information, so I can test the application without having to change those server name variables in the code.

Linux is not the only system with a hosts file that can let you find servers by a certain name, either. You can find a list of where to find the hosts file on different operating systems at Wikipedia.

Friday, June 20, 2008

A bit of fring development trivia

So, if you are a developer of things webbish or things mobile phone-ish, you may already know that the company I work for, fring released an API for creating various applications and mashups inside our software platform. The name of our special XML-based language is FAXL, pronounced "Fah-zel". The server that runs the fring applications is called the FIS. One of the FIS servers we used for development was named "inigomontoya".

In the last few days leading up to launch, there was a bastardized quote that rang through the air at seemingly random times, "My name is Inigo Montoya. You killed my FAXL. Prepare to die!"

Yeah, software development deadlines are not conducive to mental stability. Need I say more?