Posts

Showing posts from July, 2014

Testing the new Amazon Zocalo cloud file storage service

I am still looking for Dropbox alternatives. I wrote five days ago about trying Office 365 and OneDrive and today I will briefly go over my first impressions of Zocalo: The setup was confusing: I used a "-" in the site name and the initialization process failed silently, never sending me a confirmation email. I removed the "-" (as a wild guess!) from the site name and everything worked. Zocalo is a beta service, so this is understandable. A more serious problem for my particular use case is that there seems to be no support for "selective sync." On Dropbox, I save space on the small SSD drive of my MacBook Air by un-syncing folders that I probably won't need for a while. I like this feature. The strong points of Zocalo are managing files in a work team or a family group. This is the great use case for Zocalo. It really is not fair to compare Zocalo and Office 365/OneStore with Dropbox because third parties have had time to use the Dropbox APIs

Trying Office 365 on Mac, iPad, and Android

I am evaluating alternative cloud services and the 1 terabyte of OneDrive storage certainly attracted my attention. I have been using Dropbox for many years and have usually been happy with it. While I was very disappointed that Dropbox added Condoleezza Rice to their board of directors (I don't like her strong support of our invasion of Iraq and her views on privacy vs. unencumbered government surveillance) that alone is not enough to make me stop using Dropbox. Still it is good to have options and I very much like the direction that Microsoft's new CEO Satya Nadella is taking the company. Don't get me wrong, I don't view Microsoft, Apple, and Google as being perfect either in regards to user privacy. A simple fact of life is that the US government can apply very strong soft pressure against tech companies in the US, to the detriment of our economy. Anyway, enough politics, here are my initial thoughts on Office 365: I signed up for the free 30 day trial of Office 36

Some Haskell hacks: SPARQL queries to DBPedia and using OpenCalais web service

For various personal (and a few consulting) projects I need to access DBPedia and other SPARQL endpoints. I use the hsparql Haskell library written by Jeff Wheeler and maintained by Rob Stewart. The following code snippet: {-# LANGUAGE ScopedTypeVariables,OverloadedStrings #-} module Sparql2 where import Database.HSparql.Connection import Database.HSparql.QueryGenerator import Data.RDF hiding ( triple ) import Data.RDF.TriplesGraph simpleDescribe :: Query DescribeQuery simpleDescribe = do resource <- prefix "dbpedia" (iriRef "http://dbpedia.org/resource/" ) uri <- describeIRI (resource .:. "Sedona_Arizona" ) return DescribeQuery { queryDescribe = uri } doit = do (rdfGraph :: TriplesGraph ) <- describeQuery "http://dbpedia.org/sparql" simpleDescribe --mapM_ print (triplesOf rdfGraph) --print "\n\n\n" --print rdfGraph mapM ( \ ( Triple s p o) ->

Setting up your own SPARQL endpoint for Freebase (with a Java client)

Image
Originally published July 5, 2014 SINDICETECH has done a great job configuring the RDF data dumps from Freebase and making them available as preconfigured images for both Google Cloud and AWS. You can read their documentation here. I used SINDICETECH's AMI for Amazon Web Services and getting an EC2 instance set up was very simple (about 15 minutes, including the starup time for Virtuoso.). Good job SINDICETECH, and the people at Google and OPENLINK (helped tune Virtuoso) for making this happen! The directions called for using a small EC2 instance but since I will likely only be running my instance occasionally (as needed) I chose a medium instance, hopefully to make my queries run faster. If you are used to using Freebase data, the conversion to the rdf.freebase.com/ns/ namespace is easy enough to understand. The easiest way to start exploring the data is to use the SPARQL web interface (see a screen shot at the end of this post). You can also use SPARQL libraries for your fav

My experience converting my NLP library and demo web app from Clojure to Haskell

Originally published June 20, 2014 Several years ago I took ten years of part time natural language processing (NLP) hacks in Common Lisp, Scheme, and Java and converted a useful subset to Clojure. The resulting code base was much easier to work with both because Clojure is such a clean and practical language, and also because any large scale code cleanup removes technical debt and makes for easier development. In the last month in my spare time I took my Clojure code and converted it to Haskell. Here is the demo web app . I have about 80% of the functionality of the NLP library converted (automatic summarization, entity detection, and categorization). The Haskell web app is very simple compared to the Clojure demo web app, and I might improve the demo web app sometime but for now I am more interested in improving the functionality and accuracy of the NLP library. Even though I am still learning Haskell I am already finding it easier to work on the NLP library using Haskell. I find

Do your family and friends a favor and watch the movie "Fed Up" with them

Originally published June 18, 2014 Learn how the food industry in the USA is destroying the health of many people. The movie Fed Up will educate you on how to protect your family's health. I wish that everyone would watch it. Here is the Knowledge Graph description: For the past 30 years, everything we thought we knew about food and exercise is dead wrong. FED UP is the film the food industry doesn't want you to see. From Katie Couric, Laurie David, and director Stephanie Soechtig, FED UP will change the way you eat forever. It has been a long time since I have seen a documentary as useful and interesting as Fed Up.

Experimenting with Apple's new language Swift

Originally published June 3, 2014 To be honest, I have always considered developing for Apple's platforms to be less than a joyful experience. When the Mac first came out in 1984 I developed the AI application ExperOPS5, which did well financially but at a cost of a steep learning curve (there were many "telephone book like" Inside Mac manuals to be read, and the tooling was not great.) I also developed a commercial Go playing program for the Apple II which was a lot of fun but painful because the UCSD Pascal development environment was so slow. Anyway, enough of my complaining about the distant past! I was pleased to see Apple's announcement yesterday of a new programming language Swift that seems to have copied nice features from Rust and functional languages like Haskell. I did a quick skim of the free Swift book and downloaded the XCode 6 beta IDE that supports Swift. Swift seems like a practical language. I like that there are no pointers except for the inout

Haskell experiments - NLP and Yesod web apps

Originally published May 30, 2014 I am still struggling a bit learning Haskell - so far this has been a multi-year process :-) I converted some NLP code for tagging/categorization from Clojure to Haskell. I was surprised that this code ended up being only 62 lines, including white space. That said, there is still more code to port but I think the final library will be something like 100 lines of code. I like concise programming languages! I also wrote a very simple Yesod based web app that uses the Haskell tagging/categorization module (41 lines of code). You can try it here if you want . I still find coding in Haskell to be slow and painful, but I do have periods when I feel very productive so I hope to sometime in the future get as efficient as I am in Clojure or Ruby. Wish me luck :-)

Technical diversity

Originally published May 1, 2014 A few times in my technical career/life I have tried to concentrate on one language, one stack (when doing web apps). This usually does not work out for me both because I have diverse interests and customers want me to use a variety of tech. I have several deployed web apps using Clojure (and Clojurescript for one), one using Meteor.js, and a few Ruby/Sinatra apps for customers. I am playing with Haskell/Yesod and I really like the type checking right down to web assets but due to my relative inexperience with this stack it does not yet seem agile to me. I have experimented with Pharo Smalltalk and Seaside quite a bit over the years, and to some extent Seaside and Meteor.js fill the same ecological niche for me (rich client web apps). For general programming I also can't settle on one language. I think that I am going to give up trying to settle on using just one or two languages and live with the overhead of staying spun up on different techn

I am still trying to learn Haskell

Originally published April 14, 2014 I started studying Haskell again a few months ago and since I finished my new book last weekend, studying Haskell using the excellent learning resources at FPComplete has been my primary non-working geek activity. In the last four or five years I have bought four Haskell books, made some effort to learn Haskell, had fun, and indirectly improved my Clojure and Scala chops - but, Haskell has never before really 'clicked' for me. FPComplete has several good tutorials on Haskell that are live web pages: you do the example exercises in the text by using the 'Open in IDE' links. Reading and then immediately trying to solve problems with what you just read is a great way to learn. You can use large parts of FPComplete for free, but I signed up for their Personal Plan so I could use their online IDE for my own private projects. The people at FPComplete wrote their web apps for their IDE and for the interactive lessons using Haskell (of

My new book "Build Intelligent Systems with JavaScript"

Originally published April 12, 2014 I have been working on this book since last summer. You can get more information here . In some sense I wrote this book for my own requirements. I the last 20+ years I have written information processing systems in Common Lisp, Java, Clojure, and Ruby. Last year I became interested in JavaScript largely because of web frameworks like Express.js and Meteor.js. I then started hacking on some of the same types of problems that I used to use Lisp languages for, and enjoyed using JavaScript. I started writing small snippets of code in JavaScript for accessing data stores, doing simple NLP, and general information processing. While I was motivated by my own projects I also thought that other people might find the material useful.

Java 8 and Clojure

Originally published April 5, 2014 I have to admit that I have often been lazy about converting Java code to Clojure. Several of my side projects have :java-source-paths set in my project.clj file and I just copy in the bits of old Java code that I am too lazy to convert. In some way I justify this because it is so easy to mix and match Clojure and Java code and the lein build process works well and I have never had any problems. One thing that does not work, as far as I know, is mixing Java 8 lambdas with Clojure. That may happen sometime, but not a big deal for me. Mixing in my favorite Java 8 addition (streams) with Clojure is also not so important to me since it would not bring much to the table for Clojure developers. I am far from being a "Clojure purist" (or any other single language) but one thing that really strikes me after using Clojure for about one third of my development over the last 4 or 5 years is that it is such a practical language for getting stuff do

Trying out the Google Cloud Platform

Originally published April 2, 2014 I watched the Google Cloud Platform webcast last week and a few days later I received a $500 credit that I need to use in the next three months. The side project I am working on right now is in Clojure. A few years ago I wrote a few small test web apps in Clojure for AppEngine but the loading request time (i.e., the time to serve a request for a cold instance) was several seconds - not so good. With the free credit, I am experimenting now with a Compute Engine instance to run the prototype Clojure web app, just running with "lein trampoline ..." In the past several years I have experimented a lot with AppEngine. With Java (and using Objectify as a datastore API) loading request time was very quick (about a second) and I wrote a GWT application, hosted my knowledgebooks.com site, and wrote several Google Wave robots hosted on AppEngine. I don't much use Python but I did do one Python AppEngine app for a customer several years ago and t

Great joy in the world - Java 8 released

Originally published March 18, 2014 I have been using pre-release versions of Java 8 for a long time but it is great to have an official release. You can get it here. I have found that lambdas and streams have been very useful features. Many people, myself included, worried about the future of Java when Oracle bought the bones of Sun Microsystems. I must say now that I think Oracle has been doing a good job supporting Java. I would like to convert most of my open source Java projects to Java 8, taking advantage of new features as appropriate. The problem is that I hate to break backwards compatibility for people who aren't going to update soon. I probably should not update the code examples for my Java books either.

I finally tried Google Glasses

Image
Originally published February 15, 2014 I never had the chance to try Google Glasses while I consulted at Google last year but my friend Judy just got a pair and I tried them this morning. Judy took the following picture of me wearing her glasses: I was pleasantly surprised at how nice they were (after a couple of minutes getting them adjusted). I think that when Google finalizes the product and starts shipping them at a reduced price that the glasses will be popular for a variety of applications like: Workers who need to keep their hands free People with disabilities Walking tours, supplying information about what a person is looking at Hands free web search Hands free photography and videography (but, the Google Glasses need an indicator light warning people when the camera is on!) etc., etc. I already "talk to my phone" to do web searches, get directions, etc., so talking to the glasses seems natural enough. I think that for general consumers that price point will make

What a difference 3 years makes - Cassandra 2.x, CQL, Java, Clojure, and Node APIs

Originally published February 2, 2014 It has been a few years since I had a need for Cassandra (I now have a pilot project for which I would like a scalable data store). I grabbed the latest Cassandra source from github and I have been looking at some of the code, and running it locally also with the CQL shell. I know that CQL has been around for a while, but this is my first experience with it. Huge improvement. I really like it. I am still trying to decide if I want to use Java (version 8), Clojure or Javascript but the newest Java driver for Cassandra, the Clojure wrapper alia for this driver, and the node-cassandra-cql all look very good. I give up some tunable degree of consistency (the "C" in "ACID") with Cassandra but I can easily live with that in my project. For now "developer friendliness" is really important to me since I am just experimenting with some ideas but if I need to I would like to be able to scale without changing my code.

My Mom Elaine Watson died yesterday

Image
Originally published January 29, 2014 My Mom was a fun person to be with. My very fondest memories of time with her are many hundreds of days spent boating together and also our family dinners. My Mom was a gourmet cook and when I was growing up she would make incredible dinners for my Dad Ken, my older brother Ron, and me. Love you Mom! Here is a picture of my Mom and Dad taken in 1955 when I was four years old:

Java and Clojure examples for reading the new WARC Common Crawl files

Originally published January 26, 2014 I just added a Clojure example to my Common Crawl repo . This Clojure example assumes that you have locally copied a crawl segment file to your laptop. In the next week I will add another Clojure example that pulls segment files from S3. There are two Java examples in the repo for reading local segment files and from S3.

Less Java and Clojure, more JavaScript

Originally published January 21, 2014 ... and, almost no Ruby. I have always been a polyglot (programmer who uses many programming languages). Since 1974, I have easily been paid to design and write software in over a dozen languages. I still really like (love!!) Clojure as a language, Java is very practical for many applications because of the JVM's efficiency and the wonderful Java library and framework ecosystem. I don't use Ruby very much anymore except for small utilities. Why JavaScript? The primary reason is that I am writing a JavaScript book ("Build Intelligent Systems with JavaScript") and the secondary reason is most of my development efforts are centering around Meteor right now. The more I use Meteor, the more impressed I am. I am not yet a highly skilled JavaScript programmer (I just use a small bit of the language, and rely in IntelliJ with jslint always running to keep me mostly out of trouble) but JavaScript is a good-enough language and I fin

I am very pleased to be helping the Common Crawl Organization

Originally published January 13, 2014 I am setting aside some of my time to volunteer helping out with the CommonCrawl.org Much of the information in the world is now digitized and on the web. Search engines allow people to have a tiny view of the web, sort of like shining a low powered flashlight around in the forest at night. The Common Crawl provides the data from billions of web sites as compressed web archive files in Amazon S3 storage and thus allows individuals and organizations to inexpensively access much of the web for whatever information they need - like turning the lights on :-) The crawl is now in a different file format. My first project is working on programming examples and how-to material for using this new format.

Happy New Year

Originally published January 3, 2014 I wanted to wish everyone a happy new year! Carol and I are now (fairly) permanently back living in our home in Sedona Arizona except for three planned trips to visit family. Working at Google in Mountain View last fall for four months was a fun and very interesting experience but it is good to be back home. Even nice hotels get tiring after a while. I usually make new years resolutions, but this year there is not much to change. I would like to get back to a (mostly) vegetarian diet. We have also been drastically reducing the amount of gluten (and wheat in general) from our diets. I also intend to get back to hiking 10 to 15 hours a week like I used to. When it comes to work and continual learning, I don't really have any specific new years resolutions. I am getting back into Clojure and ClojureScript (and looking at the Reactive libraries). I am also still interested in how the Java 8 rollout will go. Except for working on code exampl

Practical Internet Privacy and Security

Originally published December 23, 2013 I find some conflict between my desire to take advantage of services from Google, Twitter, Facebook, and some other web properties and my desire for maintaining some reasonable amount of privacy. To be sure these services are not free because these companies make money from information about us. This blog post contains my own practical approach to using these services. The multiple web browser approach I use three web browsers on a regular basis: Chrome - I run Chrome with default privacy settings and only use Chrome for accessing Google, Twitter and Facebook services. These companies are very capable of tracking activities on the web. I consciously allow them to track me while using their services. Firefox - I use Firefox for my web browsing. I run Firefox in a very secure privacy mode using the Ghostery plugin to block tracking. Under the Firefox preferences, I set the maximum security settings. Opera - I only use Opera for my onlin

Trying to find a Java equivalent for Clojure + Compojure + Noir

Originally published November 17, 2013 For a few years my most used stack for writing web applications has been Clojure + Compojure+ Noir, usually using Bootstrap, with some experiments using Ember.js and Meteor. After playing a lot with Java 8 (with lambdas, Streams, etc.) I am considering once again using Java as one of my go-to languages for new projects. Even with new language features, Java 8 is not quite the fun developer's experiences as Clojure, JRuby, and Scala but Java has a few advantages: lots of available developers, great tooling, mature tooling, and a wealth of libraries. I looked hard at Scala and Scalatra but there are rough edges to Scala (like sbt!) that I don't particularly like. Clojure is close to the efficiency of Java (about a factor of 2, in both space and time) but not as efficient. I love coding in Ruby, but the runtime performance keeps me from using Ruby except for small scripts for text processing, quick Sinatra web apps, etc. I have exper

I am immersed in graph databases

Originally published November 2, 2013 I am old school: most of my data storage requirements used to be well met with Postgres. Now most of what I work with is graph databases of one form or another: This morning I was in my office at Google working on a Knowledge Graph schema (yeah, I know it is Saturday, so it goes...) and now that I am back "home" (*) this afternoon, I am working on a technical review for the book Neo4j In Action - Neo4j is a very fine open source (and commercial) graph database. Last night I was reviewing third party developer documentation for Facebook's Open Graph, Wolfram Alpha, and the still publicly available Freebase APIs. This is all for my "after Google" project that I have planned for later next year, if my plans don't change. I don't usually put long quotes from other people in my blog, but I saw something early this morning that really resonated with me: Darin Stewart's blog at Gartner discussing Google's K

Great talk at Google today by Reddit co-founder Alexis Ohanian

Image
Originally published October 17, 2013 Alexis Ohanian's new book Without their Permission was just released yesterday. Copies were on sale and I bought one :-) When Alexis signed the book I bought, I joked about my slight disappointment that Reddit switched away from their Common Lisp initial implementation. Thus his comment. Nice Reddit Alien drawing. Alexis talked about freedom of the Internet, and his charitable work. He also had great advice on entrepreneurship. The fellow at Google who interviewed Alexis (I didn't catch his name) did a fine job. Lots of fun! As long as I am posting pictures, here is a picture of the talk and of my lunch earlier in the day:

Experience Working at Google

Originally published October 8, 2013 I haven't blogged in a while because I have been busy getting used to working as a contractor at Google. My wife Carol and I have also been busy getting settled living in Silicon Valley and exploring the area. I have somewhat reluctantly put my new book project Build Intelligent Systems with JavaScript on hold. You may wonder about my writing a book using Javascript examples when I am so enthusiastic about using Clojure, ClojureScript, and Ruby. I decided that the use of Javascript is so pervasive that it would be useful to write a good reference and source of examples using JavaScript for knowledge representation, AI, semantic web, graph databases (and other NoSQL data stores), relational databases, and general information gathering and reuse. I enjoy writing Javascript code while working in IntelliJ with JSLint turned on to warn errors and style warnings. I think that I will mostly be using Java for development at Google. The training clas

My team at Google is hiring for a Semantic Web/Linked Data position

Originally published October 8, 2013 Here is the job posting. Please read this job posting if you have a background in the Semantic Web and Linked Data. We have an interesting project and Google is a fun place to work.

JVM language shootout

Originally published October 8, 2013 I played with Java 8 over the weekend using IntelliJ which has editing support for Lambdas and other Java 8 features. I think that Java 8 will be a very nice update for the language when it becomes widely used. Will the new features be enough to keep from loosing developer mind share to other JVM languages like Scala, JRuby, and Clojure? I really like Scala but the language requires a large learning curve and the compiler is a little slow. Ruby is a great language and the JRuby implementation is very well done, is a pleasure to use, but there is a real performance penalty. Clojure is a lot of fun to use but I don't think it will ever be very widely used even though the development tools and available libraries keep getting better - it is a great language for those of us who love Lisp languages. Other languages like Kotlin are also worth keeping an eye on. Kotlin and Clojure get extra points for also compiling to Javascript. I was joking about

Working at Google as a consultant

Originally published September 4, 2013 I accepted a contracting gig for working at Google a while back and after a vacation with my family I started this week. I don't have too much to say except that the people are nice and Google is a very well run company.

Free Software Foundation (FSF) is even more relevant now than ever before

Originally published August 11, 2013 I have been supporting the FSF since before it was created as an organization in 1985 - I bought tapes with GNU software and the Emacs book from Richard Stallman in the late 1970s. Even though I have written and sold commercial software products for the Xerox Lisp Machine, Macintosh, and Windows in the decade from 1982 to 1991, since the mid-1990s my work and business has been largely centered around using and writing free software or open source software. I just listened to a recent talk by Richard Stallman (he starts at time point 1 hour, 41 minutes into the video). I think that Richard really gets it in many ways. I understand if some people don't agree with his more extreme views of freedom and privacy, but I try to follow his suggestions (and that is what he does, offer suggestions) as much as I can within the limits of earning a living (e.g., many of my consulting customers do not support development using free software or open source

Using OpenCyc RDF/OWL data in StarDog

Originally published August 7, 2013 Over the years I have used the OpenCyc runtime system to explore and experiment with the OpenCyc data that consists of 239K terms and 2 million triples. In order to test the ease of use of the RDF OWL OpenCyc data I tried loading the OpenCyc OWL file into StarDog: $ ./stardog-admin server start $ ./stardog-admin db create -n opencyc ~/Downloads/opencyc-2012-05-10-readable.owl Bulk loading data to new database. Loading data completed...Loaded 3,131,677 triples in 00:00:47 @ 65.8K triples/sec. Successfully created database 'opencyc'. After you load the data you can experiment with the StarDog command line SPARQL interface. You use the interface to enter SPARQL queries one at a time: ./stardog query opencyc "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10" Here are some SPARQL queries to get you started using the command line interface (I am only showing the SPARQL queries): SELECT ?s ?p ?o WHERE { ?s ?p ?o FILTER(REGEX(?o, "C

Python SPARQL client example

Originally published August 5, 2013 I wrote about using linked data sources like DBPedia yesterday but I should have included some example code for you to play with. I will get you started with these directions: Start by installing three packages: sudo easy_install simplejson sudo easy_install RDFLib sudo easy_install SPARQLWrapper If you use the faceted search browser for DBPedia and search for "Berlin" and see a likely URI dbpedia:Berlin_Berlin to start with. The following code finds all triples that have dbpedia:Berlin_Berlin as an object and displays the subjects and predicates. Then, for all of the subjects in these triples, I search again for all triples with these subjects: from SPARQLWrapper import SPARQLWrapper , JSON sparql = SPARQLWrapper ( "http://dbpedia.org/sparql" ) sparql . setQuery ( """ PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dbpedia: <http://dbpedia.org/resource/> SELECT