Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9699 > unrolled thread

Encode and Get

Started by"Michael B. Heaney" <mheaney@alum.mit.edu>
First post2012-04-20 11:44 +0000
Last post2012-04-21 04:29 +0000
Articles 3 — 3 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Encode and Get "Michael B. Heaney" <mheaney@alum.mit.edu> - 2012-04-20 11:44 +0000
    Re: Encode and Get David Bailey <dave@removedbailey.co.uk> - 2012-04-21 04:34 +0000
    Re: Encode and Get A Retey <awnl@gmx-topmail.de> - 2012-04-21 04:29 +0000

#9699 — Encode and Get

From"Michael B. Heaney" <mheaney@alum.mit.edu>
Date2012-04-20 11:44 +0000
SubjectEncode and Get
Message-ID<jmri6t$l9m$1@smc.vnet.net>
hi,

i wrote a notebook, and then encoded it using

Encode["plaintext.nb", "codetext.nb", "password"].

i then tried decoding it using

Get["codetext.nb", "password"].

The decoded notebook does not look like the original notebook, and will no
longer run.

what is wrong?

thanks,

Michael

[toc] | [next] | [standalone]


#9725

FromDavid Bailey <dave@removedbailey.co.uk>
Date2012-04-21 04:34 +0000
Message-ID<jmtddd$sj5$1@smc.vnet.net>
In reply to#9699
On 20/04/2012 12:44, Michael B. Heaney wrote:
> hi,
>
> i wrote a notebook, and then encoded it using
>
> Encode["plaintext.nb", "codetext.nb", "password"].
>
> i then tried decoding it using
>
> Get["codetext.nb", "password"].
>
> The decoded notebook does not look like the original notebook, and will no
> longer run.
>
> what is wrong?
>
> thanks,
>
> Michael
>
Encode is meant to run on package files (.m) - not notebooks. An encoded 
..m file can't be decoded as such, but can be read into Mathematica, 
where it can execute.

I hope you have a backup of your original notebook, because I think it 
is lost.

David Bailey
http://www.dbaileyconsultancy.co.uk

[toc] | [prev] | [next] | [standalone]


#9727

FromA Retey <awnl@gmx-topmail.de>
Date2012-04-21 04:29 +0000
Message-ID<jmtd3m$sg9$1@smc.vnet.net>
In reply to#9699
Hi,
>
> i wrote a notebook, and then encoded it using
>
> Encode["plaintext.nb", "codetext.nb", "password"].
>
> i then tried decoding it using
>
> Get["codetext.nb", "password"].
>
> The decoded notebook does not look like the original notebook, and will no
> longer run.
>
> what is wrong?

Encode only is meant to be used with plain text package files (*.m). 
What you Get with what you do is just the raw notebook expression, as it 
is saved to file (a notebook file is a valid Mathematica expression 
after all, which you can check by opening such a file with a text 
editor). You can recover the notebook with:

NotebookPut[Get["codetext.nb", "password"]]

Nevertheless, Encode is really not meant to be used like that. What are 
you trying to achieve?

hth,

albert

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web