Bob,
I agree completely! What's in the variable is %23. In retrospect, I should have
expected this. What confused me is that when I save this variable to a server
file, it's saved as # - not %23. This created two problems for me:
1) When I tried to restore this file, Jmol correctly, choked on it.
2) Naively, I admit, I started to search the JS state variable for # in this
context: data.replace(/(models\.aspx.*?\1)(#\2)/g,"$1!HASH!");
I have to make all kinds of adjustments to the state file when I save it to my
Windows server as a text file. It's a script file, and my server gets upset at
a number of characters that can show up in the file. I'm making the adjustments
on the JS variable, and that's what led me to the seeming hash problem.
You have the JS variable correctly set for internal state to model restoration.
Save the JS variable to disk, and %23 (correct) becomes # (incorrect).
Otis
--
Otis Rothenberger
[email protected]
http://chemagic.com
On Dec 13, 2013, at 10:41 AM, Robert Hanson <[email protected]> wrote:
> I don't think so, Otis.
>
> load smiles "C#C"
> show state/sdf
>
> load
> /*file*/"http://cactus.nci.nih.gov/chemical/structure/C%23C/file?format=sdf&get3d=True";
>
>
> It could be that somewhere in your processing. I did that at Chemagic.com.
>
>
> Bob
>
>
>
> On Fri, Dec 13, 2013 at 9:25 AM, Otis Rothenberger <[email protected]>
> wrote:
> This is just an advisory about Jmol state that may save some other users some
> frustration. After the fact, I see that the frustrating situation is actually
> a design feature. I just missed it. If you want to save time on the issue,
> jump to the Bottom Line in my last sentence.
>
> I'm getting state with:
>
> 1) stateData = Jmol.getPropertyAsString(jmolApplet0, "stateInfo");
>
> If a triple bond containing model is loaded with a SMILES, then the state
> file contains something like the following after it's saved to server:
>
> 2) load model ({0}) /*file*/"http://chemagic.com/models.aspx?smi2sdf=CC#C";
>
> That needs to be the following to communicate with Resolver:
>
> 3) load model ({0}) /*file*/"http://chemagic.com/models.aspx?smi2sdf=CC%23C";
>
> This is all well and good. You need to make these # URL conversions when you
> work with Resolver.
>
> Here's the advisory: When you go to make this change using replace on the
> state variable, you need to know that 1 above already has the value "%23" in
> place for triple bond #. This, however, gets written to server as #.
> Consequently, a replace statement on stateData would look something like this:
>
> 4) stateData = stateData.replace(/%23/g, "!HASH!");
>
> Not:
>
> 5) stateData = stateData.replace(/#/g, "!HASH!");
>
> Since the state variable is used directly in Jmol to RESTORE model state, I
> now see why this had to be handled this way. Bottom Line: If you're looking
> for a triple bond # in a state file variable, look for %23, not #.
>
> Otis
>
> --
> Otis Rothenberger
> [email protected]
> http://chemagic.com
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users