Time-limiting code

[EDIT: 20110523 17:40 CDT - clarify - WDR]
I need to give a program code in a m.file type. but I want that code be expired after a specific time. Can you help me?

댓글 수: 1

Jan
Jan 2011년 5월 23일
Are you sure you need M-files? P-file cannot be modified or read in clear text. But a secure time limitation cannot be achieved by P-coding also.

댓글을 달려면 로그인하십시오.

답변 (2개)

Sean de Wolski
Sean de Wolski 2011년 5월 23일

2 개 추천

댓글 수: 2

Jan
Jan 2011년 5월 23일
This thread concerns P-files. The OP asks for M-files - to my surprise.
Sean de Wolski
Sean de Wolski 2011년 5월 23일
I'd guess the OP had never heard of a p-file.

댓글을 달려면 로그인하십시오.

Jan
Jan 2011년 5월 23일

2 개 추천

M-files are very easy to edit. Therefore it is hard to imagine which level of protection you expect from such an expiration.
I assume the best expiration mechanism for an M-file is removing all comments, using minimalistic names for variables and subfunctions, interchange of variables by ASSIGNIN and EVALIN and using a flock of variables (G1, G2, G3, ...) instead of an array together with EVAL command to access them.
Then let the customer sign a contract, which includes the date of expiration. Without your support, such an ugly M-file is useless and the customer will delete it voluntarily.
There are some very good examples for this method in the FEX. Look for files, which have been rated with 1 star by John D'Errico. [EDITED: Tried to formulate the last sentence more clear.]

댓글 수: 7

Sean de Wolski
Sean de Wolski 2011년 5월 23일
Ha!
Clarification: Files that John rated with 1-star, not files of John's which have a 1-star rating from angry "homework script" authors.
Oleg Komarov
Oleg Komarov 2011년 5월 23일
I would also suggest to modify your M-file to a one-liner and keep of course the normal version for yourself.
Jan
Jan 2011년 5월 23일
@John and all other hard-working FEX comment creators: Your comments improve the usability and quality of the complete FEX. Thanks!
Walter Roberson
Walter Roberson 2011년 5월 23일
I'm fond of variable names that include varying numbers of underscores, or which contain mixes of lower-case L and the digital 1 (which are virtually identical in some fonts.)
Jan
Jan 2011년 5월 23일
And I love using a Mex function to use fieldnames which contain spaces, line breaks, tabs and non-ASCII characters. Then even an inserted SAVE command does not create a usable dump of the variables.
Walter Roberson
Walter Roberson 2011년 5월 23일
Jan, when you create a field name that way, is it the single-byte characters or the double-byte characters? And if you have something like a struct(), does it use double-byte characters like the rest of MATLAB or does it "save space" by using single-byte characters?
Jan
Jan 2011년 5월 24일
The fieldnames are 8 bit UCHARs: CHAR(200) works as fieldname if created inside a Mex and accessed by "S.(char(200))", but CHAR(300) fails.
mxGetFieldNameByNumber replies a pointer to a \0 terminated C-string with a fixed distance of 64 byte - at least in all tests I've performed with Matlab 2009a, but this is not a proof.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Variables에 대해 자세히 알아보기

질문:

2011년 5월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by