Author: Matt Croydon

  • Maemo blows me away again

    Nokia N810 Internet Tablet

    My wife and I just bought a house and I’ve realized that there isn’t any room in the budget for major gadget purposes, so I’ve been trying not to get too excited about things coming down the road. It’s not suprising that I’ve been following the recently announced Nokia N810 Internet Tablet in a much more detached manner than usual.

    That is until I saw Ari Jaaksi holding a prototype in his hand. Holy crap that thing is significantly smaller than the N800 and packs quite a punch. The slide-out keyboard is killer, GPS is a no-brainer these days and is included, the browser is Mozilla-based, the UI got a refresh… I could go on for days.

    The other thing I really like about the new tablet is that the Maemo platform is moving to be even more open than it was before (which was about as open as the lawyers at Nokia would allow). The quite good but closed source Opera web browser has been replaced by one that is Mozilla-based. This is yet another major component that is now open instead of closed. The major closed-source components (if I’m remembering correctly) are now limited to the DSP, various binary drivers that Nokia licenses directly, and the handwriting recognition software. That’s definitely a smaller list than it was before, and I applaud Nokia’s efforts in opening up as much as possible. It’s also worth noting that the Ubuntu Mobile project is basing a lot of its work on the work that Nokia has done with Maemo (most notable Matchbox and the Hildon UI).

    So yeah, I’m now paying much closer attention to this new device that I was doing my best to ignore. Job well done.

  • You had me until I saw the stylus

    I got pretty excited when Rafe posted a video about S60 touch on allaboutsymbian. I’ve been using S60 since the 3650 days and continue to love it, despite its quirks and shortcomings. There have been rumours of touch capabilities for S60 for years now, long before the announcement and shipping of the iPhone. I’m also pretty sure that Nokia have been working on S60 touch capabilities for some time now (pre-iPhone) too.

    Everything was going great: the video showed a nice N-Series-style phone with a big touchable screen doing things that you’d expect an N-Series phone with a big touchable screen to do. And then about two minutes in they lost me. That’s when they showed the S60 touch interface being used with a stylus.

    Come on Symbian. It’s not the 90’s anymore. My Palm III rocked because of its stylus and glorious grey screen, but that was almost a decade ago. Now that the iPhone has launched, there’s a certain expectation level for new mobile UIs.

    Touch is one of those expectations. Having to use a stylus is not.

    It’s also interesting to see this latest battle in the one-handed vs. two-handed war play itself out. It has always struck me that there is a split between these two factions within Nokia (and by extension within Symbian) but the public rarely sees it. I tend to lean toward the one-handed side myself but do see the merits that some two-handed devices have to offer from time to tim. I have both a 9290 and an N800 but the bulk of my mobile purchases have been one-handed devices.

    I also think that S60’s one-handedness is one of the reasons that S60-based devices have been so successful. Nokia sold approximately 1.5 million N95’s in Q2 2007. Compare those numbers with a flagship device like a high end two-handed UIQ phone and I’ll bet that the two-handed numbers are significantly lower. Once you start including the entire one-handed range of Symbian devices, you have a force to be reckoned with.

    I’m hoping that showing the stylus was meant to demonstrate that Symbian can support a stylus, not that most or many devices will. I’m encouraged a bit since S60 has recently taken on QWERTY capabilities and it makes sense to tout its versatility from single-handed to touch to stylus to QWERTY.

    We’re still at the press release stage not the technical documentation stage, so there’s a lot of room for change. Lots of things mentioned in the press release strike me as good things: tactile feedback, backwards compatibility, in-browser flash support and a continuation of S60’s various sensor mechanisms.

    But Symbian, here’s a bit of advice for you: downplay that stylus! Nobody wants to see it and it totally kills the mood when you use it on an otherwise sleek and sexy device.

  • Goodbye Business 2.0

    Goodbye, friend.

    I got my last issue of Business 2.0 in the mail today.

    As predicted they’ve offered to send me one month of Fortune for every two months of my remaining subscription. I’ve been offered “equivalent” subscriptions for cancelled publications in the past, but never at a 1:2 ratio.

    I might grab a copy of Fortune from the newstand to see if it’s worth it, but I feel like I get enough standard business news from Marketplace and various sources in my feed aggregator. Unless Fortune knocks my socks off I’ll be asking for a refund. It doesn’t help that I’m already unhappy with Fortune/CNN Money for killing my beloved publication.

    Goodbye b2. You will be missed.

  • Newton 2.0?

    Every time I refresh my feed reader and see a new slick third-party app for the iPhone, I wonder to myself if a few years down the road we’re going to be talking about pre-1.1.1 iPhones like we talk about Newton’s today. Third party apps and unlocked iPhones are essentially a dead end street unless someone figures out how to work around it.

    Of course 1.1.1 might have also started a cold war battle between Apple and hackers that sounds almost exactly like the moves that Sony pulled on the PSP. The latest move is very different than the Laissez-faire attitude Apple has taken toward hacking the Apple TV and the early iPhone. I never thought I’d see the day that Apple cribbed something from Sony’s playbook.

    Perhaps it’s the difference between an indie/niche product and something mainstream like the iPhone. Perhaps it’s the added pressure of the carriers wanting super-locked down devices on their networks. (I doubt that though. Just grab a Symbian device and do with it as you please.) Perhaps it’s Apple realizing that it’s big enough that it can do as it pleases.

    Then again, maybe they’re biding their time while they polish the official non-web-2.0 SDK. We can all dream, can’t we?

    Pull up a chair and bring it close to the fire. Let me tell you about the golden age of the iPhone…

  • Google Maps GeoXml crash course

    Over the weekend I added KML/GeoRSS data loading via GGeoXml to some mapping software for work. I ran in to a couple of gotchas and a couple of things that I thought were really interesting, so I thought I’d share.

    Getting started

    GGeoXml and particularly clickable polylines are relatively new features, so we need to specify that we want to use beta features when we grab our google maps code:

    <script src="http://maps.google.com/maps?file=api&v=2.x&key=your_key_here" type="text/javascript"></script>

    The key here is v=2.x which specifies that we want some 2.x or somewhat bleeding edge features. Now that we’ve got that loaded up, we’ll want to define a couple of variables:

    var map;
    var geoXml;

    This set up two global variables that we’ll be using. While I’m not a big fan of polluting global namespaces, this will allow me to play with these variables via Firebug once the page has loaded. For non-sample production code you’ll want to properly namespace all of your work. Next we’ll grab some data using GGeoXml:

    geoXml = new GGeoXml("http://example.com/path/to/data.kml");

    This will grab data from the XML file. In my case it’s a list of things to do in and around Kansas City. Now that we have data in hand, let’s create a map and add this data as an overlay:

    if (GBrowserIsCompatible()) {
      map = new GMap2(document.getElementById("map_canvas")); 
      map.setCenter(new GLatLng(38.960543, -95.254383), 9);
      map.addControl(new GLargeMapControl());
      map.addControl(new GLargeMapControl());
      map.addOverlay(geoXml);
    } 

    This should be pretty familiar if you’ve ever worked with the Google Maps API. We’re creating a new map using the div map_canvas in the document. Then we set the center of the map and add a few controls. Once we’re done with that, we’re going to add the geoXml that we loaded via KML to the map. Here’s the complete basic example:

    KC Basics

    Let Google do the hard stuff

    You’ll notice that the basic map is centered manually and doesn’t really fill the whole viewport. GGeoXml has finished running, we can query it for useful information. For example, I can ask what its default center is from Firebug:

    >>> geoXml.getDefaultCenter();
    (39.076937, -94.601867) Uk=39.076937 La=-94.601867 x=-94.601867 y=39.076937

    Knowing that I could then set the center of the map as follows:

    map.setCenter(geoXml.getDefaultCenter());

    While this handles setting the center correctly, it doesn’t help me figure out what zoom level to set. Luckily there is another method on GGeoXml objects: gotoDefaultViewport(map). I can then call the following and have Google do all the hard work of figuring out what center and zoom to use to make sure all of the KML/GeoRSS content fits within the viewport:

    geoXml.gotoDefaultViewport(map);

    This allows us to let Google create bounding boxes, find centers and zoom levels, which while interesting exercises aren’t fun to do on a daily basis. There’s one gotcha here though: you can’t get information about a GGeoXml instance until it’s done loading.

    Are we there yet?

    When we call GGeoXml, we can optionally provide a callback function that will be called as soon as GGeoXml is done doing its thing and we can access it. First let’s create a function that centers and zooms so that the data is contained nicely within the viewport:

    var geoCallback = function()
    {
      geoXml.gotoDefaultViewport(map);
    }

    Next we have to modify our call to GGeoXml to include the callback:

    geoXml = new GGeoXml("http://example.com/path/to/data.kml", geoCallback);

    Here’s the final code that includes the callback:

    KC Final

    I hope that illustrates how much can be done with very little code. Definitely take advantage of the rich map annotating capabilities that Google’s My Maps offers and don’t be shy about including them in maps on your own site.

  • Accidental APIs: NFL edition

    NFL flash app powered by JSON

    These days whenever I find an interesting interactive/updating flash app I tend to fire up Firebug and see where the data is coming from. Quite often there’s an XML data feed somewhere that the flash app is being fed with. For example, you can get an XML feed of parking space availability or a list of airlines with gate information at Kansas City International Airport. As with many XML feeds designed for consumption with Flash, these feeds aren’t always well-formed but the data is there for the taking.

    I went on a similar quest after checking in on my Redskins at NFL.com. I was pleasantly suprised to find JSON driving the live game update instead of XML. There are three JSON feeds exposed on the live game update page.

    The first is the game-specific updates. This feed includes a score breakdown by quarter, who has possesion, time left, and the last few recent plays, along with a few other things that weren’t obvious at first glance.

    The second drives the league-wide scoreboard at the top of the page. This includes game date/time, the teams involved, what quarter they’re in, who has the ball, and what the score is. From time to time this feed will also include extra information such as a recent score change.

    The third feed includes information about weekly leaders in the NFL. This includes the top five passing, rushing, receiving, and scoring players this week. That sounds like great information to have programmatic access to if you’re in to fantasy football.

    It makes me happy to see big companies use XML and JSON feeds for their flash apps rather than a proprietary alternative. It’s also fun to see things like Prototype and Sciptaculous on a site like NFL.com. These feeds are rarely documented, but for the large part are self-documenting. Some of the subtitles in teh NFL feeds can most likely be determined by watching the feed and the flash display over time.

  • Google Maps adds clickability to GPolyline and GPolygon

    Google Maps: clickable poly!

    I’ve been waiting for this announcement Ever since Google introduced GGeoXml to its mapping API:

    In our latest release (2.88) of the API, we’ve added “click” events to GPolyline and GPolygon, much to the enthusiasm of developers in the forum.

    I knew it was just a matter of time since their internal apps have been supporting clickable GPolylines and GPolygons for some time now. Read the whole post for some fascinating information on how click detection works.

    What this boils down to (for me anyway) is that you can display information generated with Google’s MyMaps interface on your own site with the same fidelity as the original via KML and GGeoXml. Up until now you could load KML from MyMaps via GGeoXml but the GPolylines and GPololygons only displayed and were not clickable. This removes a huge roadblock and should allow for even more interesting mapping applications.

  • Crosswalk usability

    Crosswalk

    Today the City of Lawrence announced the operational status of a new crosswalk on 11th between New York and New Jersey. I’m a big fan of pedestrian safety, especially when it benefits kids on the way to school, but I was a little confused about the description of the new crosswalk and related signaling:

    The unique design consists of three lights (two reds and one yellow) configured like an inverted triangle. The signal remains dark until activated by a pedestrian pushing a button. The signal then flashes yellow for approximately six seconds followed by a steady yellow for approximately four seconds and followed by a double, steady red during the time pedestrians are receiving a “walk” signal. Once the pedestrian display changes to “Don’t Walk,” the motorist’s signal changes to alternating flashing red. During the flashing red, motorists may proceed through the crosswalk after stopping if the pedestrian has completed crossing.

    The operation of this crosswalk appears straightforward from the pedestrian point of view. Press button; wait for walk signal; walk across. Things are a bit more vague for motorists. Here are several questions I can think of with answers inferred from the press release and tri-fold pamphlet, along with some common sense:

    What do I do if someone is crossing in the crosswalk?
    Stop and wait for the person to finish crossing.
    What do I do if the bottom yellow light is flashing?
    This means that a pedestrian has just activated the signal. It’s probably best to slow to a stop and allow the person to cross.
    What do I do if the bottom yellow light is solid?
    A pedestrian activated the signal a few seconds ago and is waiting to cross. It’s probably best to slow to a stop and allow the person to cross.
    What do I do if the top two lights are red?
    The two red lights are equivalent to a stop sign or red light and you are required to stop at or before the line to let the pedestrian cross
    What do I do if the two red lights are alternating flashing red?

    If there is a pedestrian in the crosswalk you must either stop or continue to stop. If the pedestrian has cleared the crosswalk you may proceed.

    While I think that a crosswalk with lights to indicate it is in use is a great thing, some simplification could be done here. With all of the various light states above, the following always applies:

    What do I do if someone is crossing in the crosswalk?
    Stop and wait for the person to finish crossing.

    Perhaps it would be best to reduce the crosswalk to a binary state: either someone has pushed the button and the crosswalk is lit, or it is not in use and therefore not lit. This would reduce the four light states in to one single state and greatly simplifies what a driver needs to keep track of. If you would like to give the driver warning, use a solid red preceded by a solid yellow for a few seconds. This would closer emulate the traffic signal that drivers are used to obeying. I have seen other crosswalks that flash yellow and transition to solid yellow. Either of these solutions seem simpler and more effective than the High Intensity Activated crossWalK described above.

  • Those annoying AT&T “free reminder” SMSes

    ATT SMSI’ve recieved an AT&T “free reminder” SMS twice now in two days. I know I’m not paying for it, but these messages amount to SMS spam to me. It may not be a big deal to most people, but for me most of the time I recieve an SMS it means a server is down and needs my attention. There’s a certain stress level associated with my incoming SMS sound, so it really irks me when I check the message and it’s spam from my carrier.

    The first one I ignored, but I called up customer support as soon as the second one came in. I let them know that these messages, while I know that I’m not paying for them, amount to spam in my inbox and that I never received any such messages while I was a Cingular customer and that these messages made me very unhappy. I was as polite about it as I could be, because the person on the other end of the phone deals with a lot of angry customers during the day.

    She asked me if there was a long code as the sender of the message, and after checking my phone I confirmed that yes indeed it was (in this case it was 1 111 301 000). After looking that up in her knowledge base she let me know that the easiest way to unsubscribe from these messages is to reply to the message with the word “stop” or “unsubscribe”. There were a few others, but these are the two that I remember.

    My phone UI (S60 2nd edition) didn’t allow me to directly reply to this message, but I composed a new text message to “1 111 301 000” with the word “stop” as the message body. We’ll see if this works. If it does I’ll be happy. If it doesn’t, I’ll be quite unhappy.

  • There is an Erlang community, it’s just smaller than you’re used to

    I thought I’d pick a nit with something that Ted Leung mentioned in his response to Sam Ruby’s response to Russ’ original post about Java needing an overhaul.

    Particularly this comment about the Erlang community:

    This is actually 2 problems. There’s the issue with the libraries, and there’s the issue with the community that did/didn’t produce the libraries. We don’t just need a technology, we need a community. Hmm, Erlang lab, anyone?

    I’d like to assert that there is a vibrant Erlang community, it’s just smaller than you’re used to, and might be a little harder to find than most.

    I’ve been lurking, participating, and sharing what I’ve learned in #erlang on irc.freenode.net since the Erlang movie blew my mind. I started tinkering with Erlang and the PDF for Programming Erlang came out a few days later. I still consider myself an Erlang noob. I still ask questions with obvious answers, spend hours trying to do something that should have taken 5 minutes, and sometimes don’t do things in the most Erlangish manner.

    But the Erlang community has been great to me. Whenever I ask a question in #erlang, I almost always get the answer I was looking for, whether it’s a pointer to a specific part of the Erlang docs, a snippet of code, an opinion on the best way to do something, or a link to a blog post that has the answer. I’ve been around long enough that I can offer the same to people who are just picking up Programming Erlang and are running in to the same things I was a month or two back.

    If you don’t think there’s an Erlang community, please come by #erlang and spend some time. They’ve been one of the most helpful communities I’ve ever been a part of. Activity is currently skewed more towards the European timezones, but as the community grows and more people across the world pick up Erlang that’s changing.

    There’s also a pretty huge community outside of IRC. I’ve been subscribed to erlang-questions, the most active Erlang mailing list for a month or two too. The solution to one of my problems with bit syntax was asked and answered before I even knew that’s what I wanted. I’ve also learned a lot of things about Erlang that I wouldn’t have otherwise from the mailing list.

    The community doesn’t stop there. Head over to trapexit.org and check out the Wiki and the forums. When you’re done there, check out the packages available at CEAN (the smaller Erlang counterpart of CPAN). There are lots of libraries included here if that’s what you’re looking for. Anything in CEAN can be installed from within the Erlang shell.

    If you’re looking for libraries, don’t forget to check out Erlang’s module documentation. It’s far from Python’s batteries included, but there’s more there than it gets credit for. Aside from a distributed database there are TCP and UDP socket libraries, an http client and server, an XML library and support for SNMP and SSH. You’ll find many more protocol implementations at CEAN while the building blocks reside in Erlang’s standard library. Other places to look for sample code or libraries is Jungerl, a loosely knit collection of useful (but sometimes aging) libraries and applications, or Google Code.

    While many third party Erlang libraries feel like they’re at the 0.1 stage (and many are simply because their authors are new to Erlang), don’t forget about the polished apps and libraries. I’m specifically thinking of ejabberd, RabbitMQ, YAWS, and Wings3D to name a few. Also worth a specific mention is ErlyWeb and the several libraries that it is built on top of.

    So yes: the Erlang community is quite small. Think Python 10-12 years ago or Ruby before the Rails. But don’t pretend that it doesn’t exist, because while tiny, it’s vibrant and extremely helpful.

  • On the internet, everyone can hear you scream

    When I first read this story on techcrunch about Grand Central snubbing customers and changing their numbers with very little notice, it seemed like the kind of thing that was affecting thousands of users. Perhaps it was a problem on the same scale as the recent Skype outage. That’s a big deal right?

    Wrong.

    The problem affected exactly 434 users.

    As explained by founder Craig Walker in the comments of the techcrunch post, the problem occurred when one of their partners stopped providing service in a particular part of the country. They were able to port the majority of customers to a new provider but were unable to do so for 434 people.

    Unfortunately two of those 434 people had a blog. Then it got picked up by Techcrunch and all of a sudden it’s not a problem that affected 434 people, it’s a problem that affected the entire internet.

    It’s unfortunate (for Grand Central and Google) that some of those 434 people were in Northern Virginia. The blog per capita there is off the charts. If those 434 people had been in rural Iowa, the internet would have never known.

    That brings me to the other takeaway from this incident: When designing a product or service (especially for alpha geeks) you have one and only one chance to get it right. You’re never more than one power outage, one service outage, one information breach, bad decision, misstep, misquote, or mess up away from loosing your customers or potential customers forever.

    Are people going to remember that this issue affected 434 people a few months down the road? Nope. The conversation will go something like this: “Grand Central? I dunno about them. I remember hearing that they changed phone numbers on a ton of people after promising them ‘one number for life.’”

  • The state of the US 3G market

    Last week there was an interesting discussion about 3G penetration in the US on the mobiledesign yahoo group. I put a bit of thought in to my response and defense that the 3G market here is further along than we’re given credit for. I thought I’d cross-post it here because I think it’s interesting.

    I don’t have any numbers to back this up, but my gut tells me that 3G has more penetration in the US than this, but not in the smartphone market.

    In the US the featurephone rules, and I wouldn’t expect any different in terms of 3G sales and availability. Right now AT&T has about 8 different models (some with color/configuration variations) that are 3G capable. I’m guessing that’s a mix of UMTS and HSDPA but I haven’t checked too closely.

    In-store they seem to be pushing the RAZR (4 colors with 3G), Sync (4 colors with 3G), and other featurephones such as the Samsung A717, A727, and the LG Trax. Also in the lineup are a few smartphones: the N75, HTC 8528, and Samsung Blackjack. All of these devices support 3G data.

    The bottom of the line is still dominated by EDGE devices, but there are several 3G options at the free to $100 price range on contract. All of the in-store RAZRs are now 3G, and I have a feeling that they’re still selling quite briskly.

    I’m personally holding out for the US N95 and my wife just picked up an N75 at the store with a contract renewal, but from what I’ve observed most US customers are concerned with which color RAZR they want or what their favorite phone in the free to $100 range on contract is.

    I haven’t spent a significant amount of time in Verizon or Sprint stores lately, but I believe that you would find a similar selection of EVDO-capable devices in those stores. Their branding gets in the way a bit, but for Sprint I believe that you are looking for “PowerVision” and for Verizon you’re looking for “BroadbandAccess.” Again, I’m guessing that you’ll see a handful of featurephones and a few smartphones.

    As Gautam mentioned, T-Mobile are still rolling out their 3G network but the top 3 carriers all have 3G networks in many (most?) areas and at least in AT&T’s case a solid selection of devices that take advantage of them.

    –Matt

  • The all-S60 family

    Newest member of the phone family

    Today we became a completely S60 family.

    I’ve been an S60 (previously “Series 60”) guy ever since I grabbed myself a 3650 on T-Mobile a few years back. Actually, S60 had me the first time I heard Russ talk about his 7650

    After that 3650, I picked up a taco for $60 at GameStop and I’m currently using a 6682, though it’s getting a bit long in the tooth. We had set aside money for me to pick up an N95 a month or two back, but we’ve temporarily funneled that money in to the “we’re buying a house” fund. I think I’ll end up on the winning end of that, though, as now I’m saving for a US-HSDPA N95.

    This isn’t a story about me and my somewhat unhealthy obsession with mobile technology. This is a story about how today we became an S60 family.

    A few months back my wife’s tried an true Motorola v551 went for a brief swim in her cup of water. After a few days of trying to dry it out, we declared the phone dead and went on a hunt for a replacement. Of course we were some 18 months in to our Cingular contract which meant that even the cheapest of phones were running upwards of $100-200. After a couple of missteps, we found a refurbished Nokia 6030 gophone online. A few days later we popped her SIM in the 6030 and she was on her way.

    This is where we get to the point about S60 being a bit of a hard sell for normal people. My wife appreciates a phone that can, not surprisingly, make a call. She also appreciates phones that look and behave like phones. Needless to say neither the circular keypad of my 3650 or the “you do what?” talking configuration of the N-Gage were very appealing to her. She did borrow my 6682 when I was playing with the N95 and seemed to get along with it pretty well. Over the weekend she realized that we were now 20+ months in to our contract and it was time to look closely for a replacement for her really-low-end 6030.

    After looking on line for a bit, her decision came down to either a Nokia N75 or a Samsung Sync. The Sync seemed to have darned good specs but the N75 was a S60 flip phone with a solid camera, a combination that’s been too long in the making. Both phones were free after rebate on a new contract at letstalk.com. Armed with that knowledge we hopped in to the car to check out the phones in person at our local AT&T dealer.

    We were expecting to take a look at the Sync but were surprised to see the N75 on the shelf too. The N75 beat the pants off the Sync when we looked at them side by side. We scooted home expecting to order a pair online.

    This is the part where I get really annoyed at AT&T in particular and wireless carriers in general about how poorly they treat customers that hurl a hundred or more dollars at them every month. The same N75 that was free after rebate on a new contract was $199 on a contract extension through letstalk.com. My wife and I grumbled for a bit while I recalled the number of $300-400 Sprint phones I had purchased over the years. Then we decided to double check the in-store contract extension price on the N75 that she had already fallen in love with.

    It turns out that the N75 was $150 after rebates at the AT&T store. That was just cheap enough that I was able to talk her in to it as a birthday present. We made another round trip to the AT&T store, this time coming back with an N75.

    I have to say that it’s a sleek little phone. The size is not-too-big-not-too-small, the screen is huge, and there’s a decent sized external screen that acts as an itty bitty S60 UI via the external softkeys. I was pretty blown away after we figured out that you can use the external screen as a viewfinder for the camera. It’s another evolution of the phone being a particular type of device depending on how you use it. When you plug headphones in and use the music player softkeys, it’s a music player. When you open it up, it’s a phone. When you hit the camera button and use the external screen as a viewfinder, it’s a camera. I’m really glad that Nokia have figured this out. Some of the first attempts (such as the 3250) were a good concept implemented poorly. These days Nokia has pegged it.

    One thing that I’m constantly reminded of is that S60 and Symbian fall down completely during the configuration and setup process. Finding which sub-sub-menu a particular option is on is a complete nightmare. I can’t remember how many times we said something along the lines of “I know I saw that option somewhere” or “I was just there!” Ease of seatup and configurability is definitely something that Symbian/S60 can improve on.

    After getting the basics set up, we spent the afternoon entering contacts and playing with the phone. It seems quite capable with excellent fit and finish.

    I’m quite happy to finally be able to buy an S60 flip-phone for my wife, and I hope that she’s not too embarrassed at how excited I am to be an all-S60 family.

  • Erlang bit syntax and network programming

    I’ve been playing with Erlang over nights and weekends off and on for a few months now. I’m loving it for several reasons. First off, it’s completely different than any other programming language I’ve worked with. It makes me think rather than take things for granted. I’m intrigued by concurrency abilities and its immutable no-shared-state mentality. I do go through periods of amazing productivity followed by hours if not days of figuring out a simple task. Luckily the folks in #erlang on irc.freenode.net have been extremely patient with myself and the hundreds of other newcomers and have been extremely helpful. I’m also finding that those long pain periods are happening less frequently the longer I stick with it.

    One of the things that truly blew me away about Erlang (after the original Erlang Now! moment) is its bit syntax. The bit syntax as documented at erlang.org and covered in Programming Erlang is extremely powerful. Some of the examples in Joe’s book such as parsing an MP3 file or an IPv4 datagram hint at the power and conciseness of binary matching and Erlang’s bit syntax. I wanted to highlight a few more that have impressed me while I was working on some network socket programming in Erlang.

    There are several mind-boggling examples in Applications, Implementation and Performance Evaluation of Bit Stream Programming in Erlang (PDF) by Per Gustafsson and Konstantinos Sagonas. Here are two functions for uuencoding and uudecoding a binary:

    uuencode(BitStr) ->
    << (X+32):8 || <<X:6>> <= BitStr >>.
    uudecode(Text) ->
    << (X-32):6 || <<X:8>> <= Text >>.
    

    UUencoding and UUdecoding isn’t particularly hard, but I’ve never seen an implementation so concise. I’ve also found that Erlang’s bit syntax makes socket programming extremely easy. The gen_tcp library makes connection to TCP sockets easy, and Erlang’s bit syntax makes creating requests and processing responses dead simple too.

    Here’s an example from qrbgerl, a quick project of mine that receives random numbers from the Quantum Random Bit Generator service. The only documentation I needed to use the protocol was the Python client and the C++ client. Having access to an existing Python client helped me bridge the “how might I do this in Python?” and “how might I do this in Erlang?” gaps, but I ended up referring to the canonical C++ implementation quite a bit too.

    I start out by opening a socket and sending a request. Here’s the binary representation of the request I’m sending:

    list_to_binary([<<0:8,ContentLength:16,UsernameLength:8>>, Username, 
    <<PasswordLength:8>>, Password, <<?REQUEST_SIZE:32>>]),

    This creates a binary packet that complies exactly with what the QRBG service expects. The first thing that it expects is a 0 represented in 8 bits. Then it wants the length of the username plus the length of the password plus 6 (ContentLength above) represented in 16 bits. Then we have the username represented as 8 bit characters/integers, followed by the length of the password represented in 8 bits, followed by the password (again as 8 bit characters/integers). Finally we represent the size of the request in 32 bits. In this case the macro ?REQUEST_SIZE is 4096.

    While that’s a little tricky, once we’ve sent the request, we can use Erlang’s pattern matching and bit syntax to process the response:

    <<Response:8, Reason:8, Length:32, Data:Length/binary, 
    _Rest/binary>> = Bin,

    We’re matching several things here. The response code is the first 8 bits of the response. In a successful response we’ll get a 0. The next 8 bits represent the reason code, again 0 in this case. The next 32 bits will represent the length of the data we’re being sent back. It should be 4096 bytes of data, but we can’t be sure. Next we’re using the length of the data that we just determined to match that length of data as a binary. Finally we match anything else after the data and discard it. This is crucial because binaries are often padded at the beginning or end of the stream. In this case there’s some padding at the end that we need to match but can safely discard.

    Now that we have 4096 bytes of random bits, let’s do something with them! I’ve mirrored the C++ and Python APIs as well as I could, but because of Erlang’s no shared state it’s going to look a little different. Let’s match a 32 bit integer from the random data that we’ve obtained:

    <<Int:32/integer-signed, Rest/binary>> = Bin,

    We’re matching the first 32 bits of our binary stream to a signed integer. We’re also matching the rest of the data in binary form so that we can reuse it later. Here’s that data extraction in action:

    5> {Int, RestData} = qrbg:extract_int(Data).
    {-427507221,
     <<0,254,163,8,239,180,51,164,169,160,170,248,94,132,220,79,234,4,117,
       248,174,59,167,49,165,170,154,...>>}
    6> Int.
    -427507221

    I’ve been quite happy with my experimentation with Erlang, but I’m definitely still learning some basic syntax and have only begun to play with concurrency. If the above examples confuse you, it might help to view them in context or take a look at the project on google code. I have also released an ISBN-10 and ISBN-13 validation and conversion library for Erlang which was a project I used to teach myself some Erlang basics. I definitely have some polishing to do with the QRBG client, but isbn.erl has full documentation and some 44 tests.

  • Google Analytics for project hosting

    Google analytics for project hosting

    This must be a relatively new feature because I remember thinking to myself “if only Google project hosting supported Google Analytics.” I kept meaning to send someone an email about it, mostly because I was curious how many people had been taking a look at my two little Erlang projects. I’m guessing that the answer is “not many,” but still.

    Thanks, Google, for knocking out a feature before I could even ask for it. As a happy Google project hosting user, I’d highly suggest using them for open source project hosting big and small. The administration UI is minimal but intuitive, it includes a subversion repository, issue tracker, download manager, and it’s easy to link out for other resources that your project might have.

  • Is LG making the RAZR mistake?

    Last night I saw an ad on television for “The All New LG Chocolate.” At first glance at the spinning 360 degree shot all I can see i that perhaps it’s just a little thinner. Other than that there doesn’t seem to be any major changes to either the hardware or software from what I can tell. It looks like they’ve simplified the buttons on the front of the phone (good for them) and are going for the iPod wheel look. It’s laden with all of the newest Verizon mobile TV technology and also features a “it’s definitely not an iPod” music UI. Verizon’s music identification service sounds novel but seems to be one of the few new features on this version of the Chocolate. From a hardware standpoint, it can handle up to 4 gigs of MicroSD memory instead of 2 gigs, but the internal memory (128 megs) remains the same.

    Many companies have made the RAZR mistake in the past. A few years back, Sony Ericsson rode the T610 form factor for much longer than they should have. For a year or two, 610’s and similar were all I saw in the US. Sony Ericsson hasn’t put together a phone with US mass market appeal since, though they have made some excellent phones. Now, for the time being at least, everything’s coming up RAZR.

    Rewind 10 years and everyone was clamoring for the Motorola StarTAC and the Nokia 8200 series. Give it another year, and we’ll be dumping our RAZRs for the next new thing (whatever that is) that hits critical mass.

    Please excuse my US-centric analogies above. While I’m a total mobile geek and keep track of mobile trends throughout the world, my real world experience with “normal” non-geeks is limited to what I can observe around me.

    Perhaps it’s time to start treating mobile phones like the fashion accessories they are. Phones are subject to the same trends, fads and knockoffs that the fashion industry is.

    “Have you seen the fall Nokia lineup?”

    “I can’t believe she’s wearing those boots and using last years’ phone!”

    Fashion or not, trend or not, there’s no excuse for riding your success and market share in to the ground instead of innovating. Even if you don’t get it right, don’t have “The Next Big Thing,” you at least have to try.

  • Getting the most from your N95

    Nokia N95 image gallery

    The folks at WOM World have let me borrow a Nokia N95 for a few weeks. I’ve been very impressed with it so far, but I wanted to share some of the things that I’ve learned over the past few days:

    Read every bit of Steve Litchfield’s top Nokia N95 tips. Do not pass go, do not collect $200. This contains everything from obvious tips for new users to subtle nuances that even an experienced S60 user might overlook.

    Also worth mentioning are Steve’s S60 freeware listing and S60 essentials. There are some tried and true apps that have been around since the 1st and 2nd edition days as well as some newcomers.

    Fire up the download app from the main menu. This makes downloading several apps that I’m excited about extremely easy: Nokia Podcasting, Nokia Sports Tracker, Gizmo for S60, and Widsets, which didn’t work on my locked 6682.

    If you spend as much time as I do in IRC, grab mIRIGGI. I truly miss WirelessIRC which I’ve used more than any other app on my 1st and 2nd edition devices, but mIRIGGI seems to be improving steadily with each release.

    Start memorizing those Nokia Web Browser shortcuts, they’re a lifesaver.

    Don’t forget to customize! In particular setting up the menu items that are displayed when you hit the Multimedia button (Multimedia button -> Options -> Menu items) can provide you quick access to the apps you use a lot. Another crucial customization is the standby mode apps (Application button -> Tools -> Settings -> General -> Personalization -> Standby mode -> Active standby apps and Shortcuts. This is crucial for those apps that you use on a daily basis. You get to choose a total of 8 between the 5 up top and the two softkey apps on the bottom.

    Don’t forget those apps tucked away in the corners. You can set up your N95 to use VoIP calls in additon to GSM calls by following these instructions (or by using Gizmo for S60). You can look up your location using the GPS data app in Tools -> GPS data. This is handy if all you want to know is your lat/lon. Don’t overlook the Video centre app in the Multimedia menu either (don’t forget to add YouTube videos by selecting Add new services).

    The Nokia Podcasting app also has some great audio and video content. I’m a big fan of the Marketplace podcasts as well as some of the video podcasts availble in the Directories menu of the podcast app.

    You have a 5 megapixel camera with an amazing f/2.8 Zeiss lens, so make use of it! See Steve’s notes about sharpness on the different scene modes. So far the N95 has been taking great pictures in mixed-light conditions indoors and the flash is great for closer indoor photos too. The lens is pretty wide-angle so don’t be shy: fill the frame with your subject! The only gotcha that I’ve noticed so far is that if you’re taking landscapes don’t forget to the Landscape scene mode which seems to set the auto-focus to infinity as well as tweak other settings. For just about every other type of photo the Automatic mode has been working perfectly for me.

    I can’t wait to dig deeper in to the N95 but I’m having a blast so far. Stay tuned as I take a look at the N95 from a couple of different angles.

  • 2007: The year of “The Real Internet”

    I know that 2006 and every year that came before it was supposed to be “the year of the mobile web”. Maybe it’s time to change that a little. 2007 will be the year of “The Real Internet.”

    As with most things mobile, “The Real Internet” has been available on Nokia devices since 2006 in the form of the Nokia Mobile Browser, based on the same open-source technology as the iPhone‘s Safari.

    Later this month, Apple will unleash “The Real Internet” on its iPhone to much fanfare.

    Today Opera released a beta version of its new mobile browser that aims to bring “The Real Internet” to all devices that can run J2ME. This means that “The Real Internet” can come to a wide range of devices, be they computing monsters or low-end free-on-contract phones. The new version of Opera Mini allows users to zoom in and out much like Safari on the iPhone (albeit in a much less sexy way). There is a video demo and an online emulator if you’d like to check it out.

    So there it is, 2007 (or 2006 in Finland) seems to be shaping up to be the year of “The Real Internet.”

  • Accessing iPhone built in services from Safari

    During the iPhone demo at yesterday’s WWDC keynote, we saw several examples of accessing the iPhone‘s built in apps and services. I thought I’d go through the demoed features and break ’em down a little:

    Tap on a phone number to call

    This technology dates back to the wtai:// pragma from the WAP/WML dark ages and has since been codified with the tel: uri scheme as outlined in RFC 3966. The tel: scheme is used with XHTML MP and existing mobile browsers (here’s an example from one of Brain Fling’s presentations). I would hope for consistency sake that Apple makes use of tel: but there’s a chance they might go for the unstandardized-but-used-a-lot callto: instead. The callto: scheme is used by Microsoft Netmeeting and Skype on most desktop systems.

    Tap on an email address to invoke the native mail client

    It’s mailto: folks, let’s move along.

    Tap on an address to launch the Google Maps app

    I’m assuming that this is being handled via a proprietary URI scheme which the Google Maps app is registered to. I can’t tell you if it’s going to be gmaps:// or something else, but it’s going to be as simple as creating a link to gmaps://q=20+Infinite+Loop+Cupertino,+CA (or something very similar). This functionality is the most intriguing to me as a geowanker, but my gut tells me that it just boils down to a URL scheme.

    During the demo, leaving the Google Maps app returned to the home screen instead of going back to Safari, so an extra click was required to get back to the Safari webapp. No big deal, just an interesting tidbit.

    So what’s the takeaway for a developer looking to target the iPhone? The long and short of it is that nothing’s really changed since before WWDC. Write yourself a webapp and target the iPhone. What about access to all those built in services and apps? The good news is that it’s nothing special, it’s stuff you’re used to dealing with, and (with the exception of a new uri scheme for Google Maps) there’s really nothing new here. The bad news? It’s nothing special, it’s stuff you’re used to dealing with, and (with the exception of a new uri scheme for Google Maps) there’s really nothing new here.

    Update: Apple has released developer notes for the iPhone. The winners are tel:, mailto:, and (interestingly) they’re just hijacking calls to maps.google.com and sending them over to the google maps app.

  • All DECT out

    A few weeks ago my wife and I decided to replace our 5.8GHz two-handset cordless phone system. We got them for a great price but didn’t realize until after we had trashed the packaging that only one handset could be used at a time. That was a pretty big showstopper as it means one of us is tied to the corded phone in the kitchen.

    While ambiently looking at phones at our local Best Buy, I came to a wonderful realization: DECT has finally made it to the US mainstream. I have friends in Europe, so I’ve known about (and been envious of) DECT for years. DECT has more in common with a GSM phone than it does a microwave. There are specs that deal with audio codecs, and there’s a Generic Access Profile which allows for at least a chance of interop between different manufacturers’ devices.

    We eventually settled on the Panasonic KX-TG1034S with a total of 4 handsets, and we absolutely love them. I’ve used higher end Panasonic multi-phone systems over the years and I’ve always been happy.

    Some of the things I’m particularly pleased with in our unit is the ability to edit the phonebook on one phone and synchronize it to all other phones linked to the base station. I can’t tell you how much time that will save us in the long run. I also like that I can check voicemail from any handset rather than trip over my junk in the den in order to hit the play button. I can also clear the caller ID of a missed call on one phone and that will propogate out to the other devices. These are (I believe) proprietary features that probably won’t work on a non-Panasonic system, but they’re quite nice indeed.

    Like every wireless device in the US, DECT phones here run on a different frequency than everywhere else in the world (are you suprised?) They run at 1880-1900MHz in Europe and 1920-1930MHz in the US. It looks like DECT was approved at that frequency range back in 2005 but I’ve only noticed devices on the shelves for a few months now. DECT devices in the US are labeled “DECT 6.0” which seems utterly silly given that 6.0 has nothing to do with frequency (like 2.4 and 5.8 do), it’s just simply a marketing tactic (6.0 is clearly better than 5.8).

    I’m glad that we’re slowly catching up on yet another wireless standard over here and I have nothing but good things to say about our new phones.