A semantic puzzle

There was a workshop/summer school before the Materials Informatics conference and I gave a set of exercises which included converting chemistry from legacy to XML. [You DON’T need to understand chemistry or java to tackle this puzzle.] Here’s my Powerpoint slide of what I asked the delegates to do:

It worked for 90% of the delegates but 2 had problems. There was an error:

This contains a clear indication of the problem (you DON’T need to understand Java). I failed to diagnose what was wrong.

So

  • What did I do to diagnose the error?
  • What was the culprit?
  • What action should you and I take in future? (MUCH more general than Java)

I have given you all the clues…

I’ll post the answer when I have had some useful replies. A really smart web-savvy person will know how I solved it and report that.

============== UPDATE and SPOILER ===============

@Villu has answered this!! See discussion. I’ll post my answer below (scroll if you need it)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I posted my question to StackOverflow – a community resource which has answered over 4 MILLION programming questions. Here’s what I asked. http://stackoverflow.com/questions/14638911/cannot-load-jar-with-dependencies-on-mac Note that I got the diagnosis COMPLETELY WRONG!!

Cannot load jar-with-dependencies on Mac

 

I have an application created in Maven as a complete jar which runs on most platforms (Windows, Unix, some Mac) but not on Mac lion/10.6, failing with the error

java –jar jumbo-converters-crystal-cif-0.3-SNAPSHOT-jar-with-dependencies.jar 0151.cif 0151.cml

Exception in thread "main" java.lang.NoClassDefFoundError: ?jar

Caused by: java.lang.ClassNotFoundException: ?jar

        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

        at java.security.AccessController.doPrivileged(Native Method)

        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

 

And I got the answer (from @Charlie):

(I have deliberately used an image!)

The point is that I wrote this correctly but WHEN I PASTED IT INTO POWERPOINT , Powerpoint automatically and “helpfully” converted one of the MINUS signs into an EN_DASH. Visually this is almost impossible to spot.

 

 

 

This entry was posted in Uncategorized. Bookmark the permalink.

10 Responses to A semantic puzzle

  1. Ruud Steltenpool says:

    The only guess I have is: it has something to do with the differences of how filenames are interpreted on different operating systems. I’d try replacing the “0.3” with “0_3” first. If that doesn’t help I’d also try replacing every “-” with “_”. Next try would be using lowercase only.
    If the solution is in there I would Google for “filename differences operating systems” to find a tool to help me prevent the incompatibilities in the future.

  2. Villu says:

    The “-jar” command-line arguments starts with the “en dash” character (U+2013), not with the “hyphen” character (U+002D). This is morphed to the question mark “?jar”, because most terminals don’t know how to present non-ASCII characters.

    • Villu says:

      1) In order to diagnose the problem, you pasted the text to a text editor and changed text encoding from “UTF-8” (or some other variant of unicode) to “US-ASCII”. Depending on the text editor, non-US ASCII characters clearly stand out as question marks or black boxes.
      2) The culprit is MS PowerPoint and its “smart” text auto-correction algorithm
      3) You should disable the latter

    • pm286 says:

      Brilliant!

  3. Chris Maloney says:

    Another problem like like this that I often encounter is the conversion of straight quotes (“…”) into smart quotes (“…”) when people type their code samples into Word.
    A general way to address this, that ought to be used by every author every time, is to go through all the samples, and to start from a completely blank environment, and follow the instructions from the slides, before giving the presentation.

    • Chris Maloney says:

      Hah, I notice that this blog software helpfully converted my straight quotes into smart quotes when it posted my comment. Nice!

    • pm286 says:

      Completely agree.
      And the test should be carried out by someone else on a clean machine.
      And the instructions should NEVER by in Word or PPT.
      But … I was asked to use PPT – should have refused. And we were under time pressure…

Leave a Reply

Your email address will not be published. Required fields are marked *