Spring Semester Remarks

It’s hard to believe the semester is almost over.  It still feels like it’s just beginning.  If you want the quick version of my semester, “overwhelmed”.  For the long version, read on.

Before we left for last semester, we made a schedule for a release in early February.  So over winter break, I spent a great deal of time working on the UI for the Wine Agent.  While we tried our best to stay on schedule, unexpected complications pushed the project back.

As the semester started, I was quickly drawn away from UI to other aspects of the project, specifically the distributed reasoner.  I began investigating wireless Bluetooth communications.  While I had some initial early success, I ran into many obstacles.  One of the issues was with the phone’s firmware having deprecated Bluetooth functionality.  There is still a bug that I have yet to determine that’s preventing sending communication (I can establish a connected socket but it’s always closed when I try sending or receiving from it).

I believe it was somewhere during this period the article A Semantic Sommelier was eaten by the internet robots (and I’m just adding to it by linking to it now).  The article gives a general overview of the Wine Agent, but it was picked up, linked to, and reposted on several news sites, and hundreds of sites linked to those.  Actually, just today I classified 100 articles.

I was pulled away from Bluetooth to work on translating some of the server communication code.  This began my career in Objective C translation.  It started innocently enough with the CommDelegate classes.  But those classes required the OWL Classes, which was an incredible undertaking.  Translating the OWL Classes was like fighting the Hydra, every class I translated referenced two (or more) classes that needed to be translated.  I’m still working on this, but I hope I’m nearing the end.

Unfortunately for me, Objective C has a steep learning curve.  The syntax of Objective C did not seem intuitive to me.  The really challenging part was translating someone else’s (largely uncommented) code in an unfamiliar language to Java.  There obviously doesn’t exist a 1-1 mapping between Objective C and Java.  This hurdle was overcome with lots and lots of practice and guidance from Evan.

Somewhere in the middle of this translation madness, I got a chance to RDF encode restaurant menus.  This was one of the most interesting parts of this semester.  Every once and a while, Evan would send out an email  for odd jobs like this that needed to be done.

So why did I describe this semester as overwhelming?  Well that’s because there is just so much that needed to be done to catch up the Android Wine Agent to the iOS Wine Agent.  Philip and Yu were both dedicated to just the iOS version and Evan (understandably) has limited time to work on the Wine Agent, so has had to prioritize to work on the iOS version (not that he has ignored the Android version).  Even so, if this was the only thing I had to do this semester, it might not have been so bad but unfortunately this was coupled with what could possibly be described as my most demanding semester.

Overall, it has been a great semester.  I’d like to thank everyone at TWC for being so supportive and providing such a great research experience.


Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

April 2011

Almost all of my April has been devoted to translating Wine Agent classes from Objective C to Java.  There was a pretty steep learning curve but after translating thousands of lines of code, I’m really starting to understand how Objective C works.  The more I do translate, the easier it gets, so it’s a good thing there’s still plenty more to translate.

I also spent some time RDF encoding the menu for a restaurant in Oregon.  For more information, please see my earlier blog post which goes into more detail.

Oh and my blog reached a milestone this month, it got it’s first spam in the comments.  If anyone needs “$40 to spend on gourmet foods” or $15 for $30 Worth of Fine-Dining Fare at Pananas Restaurant in Agawam”, please let me know.

Leave a comment

Filed under Tetherless World Constellation, Wine Agent

What’s on the Menu?

Interestingly enough last night after spending a few hours RDF encoding dinner menus,  I came across a similar public effort.

The New York Public Library launched a new website dedicated to transcribing historical restaurant menus.  It’s quick, intuitive, and simple to use, which makes it a very effective crowd-sourcing tool.

It would be interesting if we could put together a similar tool for Wine Agent.

Leave a comment

Filed under Tetherless World Constellation, Wine Agent

Menu Encoding

I spent the last couple days encoding the menu  for Paley’s Place in Portland, Oregon.  While not totally briefed on the situations, I’m assuming the Wine Agent will be making an appearance in Portland soon, which is very exciting.

The general process was to identify the item, describe it using the ontology, try to find a picture, repeat.  Most entries looked a little something like this:

<food:Dessert rdf:ID=”FromageBlancCheesecake”>
<rdfs:label xml:lang=”en”>Fromage Blanc Cheesecake</rdfs:label>
<food:contains rdf:resource=”&food;Cake”/>
<food:contains rdf:resource=”&food;Cheese”/>
<food:contains rdf:resource=”&food;Fruit”/>
<rdfs:comment>graham cookie, fruit salade, sunflower honey</rdfs:comment>
<foaf:depiction rdf:resource=”cheese-cake.jpg”/>


While encoding the menu into RDF wasn’t particularly difficult or exciting, the opportunity was an excellent chance to brush up on the Food and Wine ontologies.

But what I found most interesting was how little I know about fine dining.  I had to Google almost everything on the menu  (I’m pretty sure there are no bunnies in rabbit ravioli).  I also didn’t recognize any of their 16 different cheeses from three different animals (I had no idea they made cheese (or anything) from sheep milk).  Fine dining is so far beyond my world of college cuisine, so I find this fancy food fascinating (yet mostly unappetizing).

Oh, and here’s an image to coax John into reading my blog post:

Fromage Blanc Cheesecake


Filed under Tetherless World Constellation, Wine Agent

Status Update

So this past month, I’ve been continuing work on the Android Wine Agent.  Specifically, I’ve been working on Bluetooth communication between Android devices as part of the reasoner and translating the CommDelegate classes from the IOS version.

From the Android standpoint, Bluetooth is separated into two main parts, device detection and connection management.  The Android application must handle device discovery/detection because the Android Bluetooth API is closely linked to the application activity.  However, connection management is not so restrictive, so I’m working on incorporating this into the reasoning library we’re building.

I was able to create a quick test application that was capable finding devices, connecting to a device, and sending the bytes of  “Hello!” from one device to another.  This was a great start for a proof of concept but did not fit into the framework for building the reasoner library, because connection management was not separated enough from the application activity.  So I’ve been working on abstracting the Bluetooth connection management to fit into the framework of the reasoner.  In the process of adapting it to fit into this framework, I seem to have broken something.  Currently, device discovery, pairing devices, and creation of an RFCOMM channel are working, but when I go to read or write from the communication channel, the socket is always closed.

All the Wine Agent projects have started utilizing trac, which I feel is a huge step forward.  Our goal is to do ~1 trac item per week,  which is a manageable goal that ensures that progress continues to be made in all aspects of the Wine Agent.

Recently, I’ve been asked to translate the IOS classes that deal with server communication.  I have a previous blog post about my first experience with Objective C, but to reiterate, Objective C syntax was needlessly complicated and confusing (especially for method invocation), but after a couple of days and countless Google searches, I was able to translate almost all of the completely uncommented Comm Delegate classes.

As for next (this?) month, I plan to keep working on the trac items to continue moving the Android Wine Agent closer to a release.  I’m also going to work on making the Bluetooth communications work within the reasoner.

Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent

Objective C Translation

So I’ve spent the last week or so translating the server interaction code from Objective C to Java.  Since Objective C is just a superset of C, I didn’t think it would be too difficult.  Of course I should have realized this was not the case since I was translating classes (aka the reason for Objective C).  The syntax for Objective C had a far greater learning curve than I had expected, although it gets easier the more you work with it.

Here are a few things I discovered along the way:

  • Almost all Objective C data types exist in Java if you remove the preceding NS.  For example: NSString -> String, NSUrlConnection -> UrlConnection, etc.
  • When Objective C says id, it means Object.
  • Ternary operator syntax is the same (yay!).
  • + represents class methods.  represents instance methods.  (Obvious right?)
  • Calling a method looks like this: [ object method:arg1 argument2:arg2 ]
  • @ appears in front of Objective C reserved words (an easy way to avoid conflicts between C and Objective C during compilation).  It also appears in front of string literals, for example @”Hello”.
  • Objective C BOOL uses YES and NO
  • Memory management exists in Objective C.


Filed under Tetherless World Constellation, Wine Agent

Bluetooth Update

So recently I discovered an issue with Android Bluetooth.  Android runs on many different phones from many different manufacturers and it’s up to the manufacturer to maintain the firmware for their hardware.  Not all phones have Bluetooth, which is fine since it is easy to detect if the phone is capable of Bluetooth communication.  The issue arises when the phone has a Bluetooth chip but the Bluetooth drivers are incomplete and do not implement all Bluetooth 2.0 features like in the HTC Desire.  For these phones, the unfinished Bluetooth implementations is satisfactory for communicating with a Bluetooth headset but not communicating over an RFCOMM channel with other devices.

Evan was able to direct me today to the custom firmware project CyanogenMod.  The firmware was very easy to install thanks to the program unrevoked.  CyanogenMod fixed the communication issue because the Bluetooth drivers are much better.

Now that the Nexus One and the HTC Desire can communicate via Bluetooth, I can begin testing and rewriting the Bluetooth communications for the remote reasoner.

Leave a comment

Filed under Android, Tetherless World Constellation, Wine Agent