Blah, Blah, Blah

  • Vacation Pictures from Italy

    Well we’re back from Italy, and if you want to see where S and I took her parents, head on over to this Facebook album, or to this other one to complete the in-law travel extravaganza, depending upon which branch of the family you want to see.

    Being B&L’s first trip to Italy, we focused on the sites perhaps considered boring by seasoned travelers, but expected by anyone claiming to have visited Italy: Rome, Venice, and Florence. We braved the throngs of tourists we’ve always tried to avoid, but as a result a lot of it was new, even to S.

    We started with 3 days in Rome, staying near Piazza Navona at Hotel Raphael. The location is a great launch pad for walking trips, and there’s a lovely rooftop bar to return to. In April, the rooms didn’t suffer from the usual Italian urban din. We loved the breakfasts, served with a myriad of buffet-style options including lox, omelettes cooked to order, mechanically fresh-squeezed juice (blood orange one day), breads, standard English fair…..

    The crowds were incredible, but we lucked out in getting guided tours of the Colosseum, Forum, and Palatine Hill one day and the Vatican Museum, Saint Peter’s Basilica, and the Sistine Chapel, both from City Wonders. Jack-ass tip? Though there are still crowds in April, the tours don’t fill up. Your tour guide will give you a discount code to book future tours. Book one ahead of time, and wait until the evening after to book subsequent tours. Really, the tours weren’t that expensive and the benefit of skipping the line and providing interpretation are invaluable. Sites usually have text interpretation, but the plaques are usually obscured by several dozen oblivious tourists listening to their own guide.

    Away from the tours, we saw the Trevi Fountain, the Spanish Steps, and the Pantheon. The crowds were horrendous, even in April, so have a back-up plan to drop by during the evening or early morning. One nice surprise taking a detour to avoid a crowd was Fontanella Borghese Market where we bought prints of Roman sites. Make sure to avoid your hotel restaurant and ask for restaurant suggestions, avoid the shills, and kill your jet lag at the bar (with espresso! :)….

    The Forum.

    The sight that surprised me the most was Galleria Borghese. I love baroque music, but never paid much mind to sculpture. Who knew naked marble bodies could be so beautiful. In my backwoods opinion, there are several Borghese items that put Michelangelo to shame… I guess that’s what a couple hundred years of study will do. The cherry on top has to be the ceiling frescos above the sculptures. Jack-ass tip?: You have to book your visit for a 2-hour block ahead of time. There’ll will be a big crowd rushing to go in. Avoid the crowd, spend 45 minutes upstairs to look at the paintings, and then return downstairs to the now relatively empty sculpture galleries.

    A fiercer David than Florence’s.

    We took the train next to Venice. The rap on Italian trains is not well-deserved. Our train was fast, modern, smoke-free, and more-or-less on-time. It did help to have S have her attack-dog Italian schpiel ready to assert our seat reservations, though.

    Canal-side in Murano.

    I had only been to Venice for a day trip and it was like another world to be able to explore away from the cruise-ship crowds, get lost at night, and take longer trips on the vaporetto to other clusters like Murano, San Michele, and Guidecca, where there are burnt-out glass furnaces, Igor Stravinsky’s grave, and wonderful pizza, respectively. Honestly, there’s amazing pizza all over Italy, even in the Venice train station, but Guidecca after dark was deserted and the pizzeria staff were delighted to share their knowledge of American pop music….

    We stayed at the Locanda Ca San Marcuola, which was simple, centrally-located close to San Marco and the train station, and spitting distance from a vaporetto stop. Detracting from the beauty was the ceaseless canal noise.

    My favorite sights were the Museo della Musica, where there were Calace mandolins; seeing Lame de Barba perform in the campo; and the Rick-Steves-endorsed bar tour with Alessandro. Swallow your ego with your wine and enjoy the personal stand-up routine/roast; you’ll learn what sfuso is.

    We had to back track to get to Florence, where we stayed around the corner from the Duomo at Rodo Fashion Hotel, which is great if you really cannot walk far to the Duomo or want to spend your time watching the crowd ooze by from their terrace, but the constant noise and uncomfortable beds drove me weary.

    Speaking of crowds, we never made it into the Duomo or to the Accademia to see the real David…. so take my opinion lightly on the younger David above. Jack-ass tip?: Book your trip to the Uffizzi on-line and early in the day. The line will be 20-minutes instead of hours. S told me that she cried when she first saw the Birth of Venice, and from the crowd around it, I believe her — that painting commands respect. It’s the only high-profile work of art I’ve seen where tourists almost-universally keep a several-pace distance from it. I say “almost” because a group of high-school students crouched underneath it for a jubilant photo op. It might be the most beautiful painting in all of Italy, and it’s still underrated.

    Beyond the periphery of the crowd, I enjoyed most our trip through Santa Croce just before closing, and the Opera del Duomo where you get to get up close to designs of the Duomo, art that just didn’t fit into it, and copies of sculpture too high to otherwise observe closely. Cathedrals aren’t my motivating reason for travel, but perusing the monuments and grave markers in Santa Croche was a pleasant stroll through renaissance history. The Opera del Duomo provided a relatively intimate look at the tourist-inflicted church around the corner.

    Big men at the Opera del Duomo in Florence.

    Following our guided-tour theme, we took walking night tour (not highly recommended) and a day trip to a winery near Castellina in Chianti, San Gimignano, and Siena. The Siena Duomo interior was certainly the highlight for me. Again, I’m not a cathedral person, but the paintings, high striped columns, and tiled floors could give me days of ogling.

    We staged our departure from the Hilton Rome Airport, relatively reasonably priced and it spared us from the long morning commute from Rome to Fiumicino. Jack-ass tip?: print a copy of your air-travel itinerary, otherwise the airport ushers won’t let you get to the ticket counter….

  • Chromebooks for Developers?

    Earlier this year, my mother-in-law-J’s hand-me-down MacBook kicked the bucket. To reduce complexity and “support” phone time, my wife convinced me to buy her a Chromebook. I still worry about not being able to help out (and I’m a sucker for gadgets), so I blew the net savings from the Chromebook gift in comparison to the potential MacBook purchase on a second Chromebook.

    There are two stories here, one short and one developing…. The short story is that since for most people a Chromebook only runs a browser, there’s really no support beyond figuring out web services. We’ve yet to receive a cry for help from J. To increase n to 2, we gave mother-in-law-L a Chromebook for Christmas 5ish years ago…. and I wouldn’t know she used it ever, except that she says that she does and I occasionally see it on the kitchen island.

    The longer story is what I should do with the extra Chromebook….

    The Hardware

    I dragged my feet on buying Chromebooks until BestBuy had a sale. Google had a sales rep at BestBuy, and from his enthusiasm, I think I might have been his only customer ever. I don’t think he believed that I was going to buy a pair, even, as he took my photo and walked me to the cashier. In the end, I bought two Samsung Chromebook Pros.

    The display is beautiful, generating guilt never to use the touch screen; there’s a built in stylus that I’ve only used to demo Adobe Sketch; the keyboard has all the programming bracket keys, but oddly spaced; the case is a nice compromise between cheap, sturdy, and thin; the battery life lets me forget about the machine for a few days.

    Messing Around

    Google says that you can run Android apps on Chrome OS, but that might be stretching the truth a little. Chrome OS emulates Android for each app. Apps appear on a phone-sized rectangle, with a buggy option to resize to the entire screen. The file access seems to be limited to files under the app’s install directory, so text-editor output might not be useful and there’s no access to the SD-card from Android, presenting a hurdle for playing music stored locally.

    I tried without success to get several Android music players to work. To make matters more confusing, VLC has two versions that appear identical in the application tray — one for Android and one for Chrome OS. The former is buggy and freezes. The latter is a Chrome app…. which Google won’t support outside Chrome OS, so I worry VLC’s future. Google Play Music no longer lets you play music from an SD card. In the end, I found that Remo works reliably, but exposes a track ordering and song selection identical to the filesystem.

    I’m not so in love with my favorite Android apps, kWS and Jota, that I’ve unlocked Chrome OS beyond installing local Chrome Extensions.

    Accessing a Server

    The easiest way to get my code fix via Chrome OS is just to install an ssh Chrome extension and connect to my server. There are several similar extensions. I just chose the one recommended from the crosh shell. Programming via an ssh connection reminds me of VT-100 and modem wails in college, but out of the box I got the same syntax highlighting from vim, YouCompleteMe, and npx. mdv piped into less -R pretty prints markdown well enough.

    Untethered Development

    For proof of concept that one could write something using only a ChromeBook, I used Text to write a simple hello-world Chrome Extension from Google’s tutorial. Presumably one could work in the emulated Android environment with Termux, suggested on Medium….

  • Spark (for Java)

    I almost missed this goodie on Technology Radar — not only is it shadowed by the popular Apache Spark name, it’s reference was hidden in a Spring Boot summary… not my favorite family of XML-bloated tools. Spark is a lightweight web framework for Java 8. It has modest run-time dependencies — Jetty and slf4j and four-line hello-world example — including imports, but not close curly braces.

    Let’s go through a somewhat more complex conversation with Spark than “Hello, World” and set up a simple key-value store.

    Project Setup

    Create a Maven project. Spark has instructions for Intellij and Eclipse. You don’t need an archetype; just make sure to select Java SDK 1.8.

    Salutations, Terrene

    We’ll implement a simple REST dictionary so that we can show off our vocabulary, or our thesaurus skills, and because we’re snooty, we’ll “protect” our dictionary with a password.

    package org.bredin;
    
    import spark.*
    import java.io.UnsupportedEncodingException;
    import java.net.URLDecoder;
    import java.util.*
    
    public class Main {
        private static Map<String,String> keyStore = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
    
        public static void main(String[] args) {
            Spark.before((request, response) -> {
                        if (!"blam".equalsIgnoreCase(request.queryParams("secret"))) {
                            Spark.halt(401, "invalid secret");
                        }
                    });
            Spark.get("/get/:key", (request, response) -> readEntry(request, response));
            Spark.get("/put/:key/:value", (request, response) -> writeEntry(request, response));
        }
    
        public static Object readEntry(Request request, Response response) {
            String key = request.params(":key");
            String value = keyStore.get(key);
            if (value == null) {
                response.status(404);
                return "unknown key " + key;
            } else {
                return value;
            }
        }
    
        public static Object writeEntry(Request request, Response response) throws UnsupportedEncodingException {
            String key = request.params(":key");
            String value = URLDecoder.decode(request.params(":value"), "UTF-8");
            String oldValue = keyStore.put(key, value);
            if (oldValue == null) return "";
            else return oldValue;
        }
    }
    
    
    
    
    

    OK, it’s not as terse as Ruby or Node.js, but it’s readable (similar to Express), statically-typed, and integrates with the rest of your JVM. The real beauty of Spark is in the route definitions and filters — try approaching that level of conciseness with Spring… or even Jetty and annotations.

    Spark provides before() and after() filters, presumably for authentication, logging, forwarding…. executed in the order applied in your code. Above, there’s only an unsophisticated password check. I’ve not dug in to discover whether or not Spark exposes enough bells and whistles for Kerberos.

    The Spark.get() methods provide conduits for REST into your application. Spark checks to see that the request parameters are present, returning 404 otherwise, and dispatches your registered handlers.

    You can run and test drive the example

    $ curl 'localhost:4567/put/foo/What%20precedes%20bar?secret=BLAM'
    
    $ curl localhost:4567/get/foo?secret=BLAM
    What precedes bar
    

    Neat! I’ve always been uneasy that Jetty’s annotations aren’t thoroughly checked by the compiler. DropWizard has loads of dependencies with versioning issues that have tripped me up.