I have a pretty long program (6 digit number of lines!! - more about this program later), which I can not encode to RAW at http://howto-pages.org/SwissMicros/dm42 ... /index.php#
Get this error:
Status: HTTP response code 500 (Internal Server Error)
Who can I contact to get this sorted out?
DM42 decoder/encoder error
DM42 decoder/encoder error
/Rudi
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
Re: DM42 decoder/encoder error
Unfortunately, not much can be done about this at the moment, the author is not immediately available.
Do you think it's the sheer size of the program? Have you tried to split the monolithic program into 2 files and translating each of them separately?
Although that's very large for a 42S program, it's still small for modern web programs, though I honestly don't know if there is a fixed limit (number of steps and/or bytes) that the encoder is designed to handle.
Another simple thing to try is using another browser (Chrome, Firefox, Safari and Edge, and derivatives should be OK).
Give those suggestions a try and let us know the results.
Thanks.
Do you think it's the sheer size of the program? Have you tried to split the monolithic program into 2 files and translating each of them separately?
Although that's very large for a 42S program, it's still small for modern web programs, though I honestly don't know if there is a fixed limit (number of steps and/or bytes) that the encoder is designed to handle.
Another simple thing to try is using another browser (Chrome, Firefox, Safari and Edge, and derivatives should be OK).
Give those suggestions a try and let us know the results.
Thanks.
--bob p
DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Re: DM42 decoder/encoder error
Thanks Bob.
I could perhaps make pieces and stick the raw files together afterwards on my pc. I can make a small C# program, that can append a raw to another. Omitting the last byte in the first raw perhaps - the .END
I’ll try that and get back.
I could perhaps make pieces and stick the raw files together afterwards on my pc. I can make a small C# program, that can append a raw to another. Omitting the last byte in the first raw perhaps - the .END
I’ll try that and get back.
/Rudi
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
Re: DM42 decoder/encoder error
At that point, wouldn't it be easier to just copy-and-paste the program code into free42 (thanks Thomas for this marvelous functionality!) and to export the raw file from there onto the DM42?
Re: DM42 decoder/encoder error
Thanks for pointing this out! I meant to mention this option, but got side-tracked. If you are a Free42 user, this likely is even easier to use than the encoder site, but may not be if you're not using it.
--bob p
DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Re: DM42 decoder/encoder error
Yes - thanks a lot Florian!!! I never thoght of this approach!
On my Free42 for Windows, I simply pasted the large source code block into an empty program, and that worked fine:
(note the line number )
Then I exported the RAW. But when loading the RAW into DM42, it throws an exception, hangs at "loading..." and clears memory when I press Exit.
See the short video below.
https://www.youtube.com/watch?v=O5zkMhSr4y4
This error message is shown for a fraction of a second:
After pressing Exit at the hanging "Loading...", this message appears
Btw - the program runs fine on Free42 for Windows and instantaneusly finds out, that 99999999977 is a prime number
The raw file is here, please note, the program is not finished yet and this is not a "release" of it:
https://www.dropbox.com/s/a3xkqtucj8zuo ... E.raw?dl=0
On my Free42 for Windows, I simply pasted the large source code block into an empty program, and that worked fine:
(note the line number )
Then I exported the RAW. But when loading the RAW into DM42, it throws an exception, hangs at "loading..." and clears memory when I press Exit.
See the short video below.
https://www.youtube.com/watch?v=O5zkMhSr4y4
This error message is shown for a fraction of a second:
After pressing Exit at the hanging "Loading...", this message appears
Btw - the program runs fine on Free42 for Windows and instantaneusly finds out, that 99999999977 is a prime number
The raw file is here, please note, the program is not finished yet and this is not a "release" of it:
https://www.dropbox.com/s/a3xkqtucj8zuo ... E.raw?dl=0
/Rudi
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
Re: DM42 decoder/encoder error
Your raw file is 10 times bigger than the available memory in the DM42 (Shift CATALOG MEM). But a more explicit error message such as "raw file is too big to fit in memory" would be nicer.
Btw, how did you create a program with 157050 lines?
Btw, how did you create a program with 157050 lines?
DM42: 00425 - DM41X: β00066 - WP43: 00042
Re: DM42 decoder/encoder error
Oups! Dont know why I didn't think about this. I thought the DM42 had mega bytes of memory available
Is it possible to expand the memory? It's not like memory is expensive theese days
And Free42 on Windows can handle it. As mentioned above, the program runs just fine on Free42 on windows.
I will rethink the program and use a smaller, still large, but smaller sieve.
The logic in the program is hand written, the bulk of the gigantic prime sive is generated by a small C# program I wrote yesterday:
Is it possible to expand the memory? It's not like memory is expensive theese days
And Free42 on Windows can handle it. As mentioned above, the program runs just fine on Free42 on windows.
I will rethink the program and use a smaller, still large, but smaller sieve.
The logic in the program is hand written, the bulk of the gigantic prime sive is generated by a small C# program I wrote yesterday:
Code: Select all
// make list of primes to use for testing
List<int> primes = new List<int>();
primes.Add(2); // per definition
primes.Add(3); // per definition
int limit = 1000000; // squareroot of 999 999 999 999
for(int i = 5; i < limit; i += 2)
{
int stop = 1 + Convert.ToInt32(Math.Sqrt(i)); // not very efficient, can be optimized
foreach (int j in primes)
{
if (j >= stop)
{
// no need for more testing, limit reached, this is a prime
primes.Add(i); // add to the list
break;
}
if ((i % j) == 0)
break; // not a prime, continue
}
}
// output as a DM-42 program snipplet
List<string> textLines = new List<string>();
foreach(int prime in primes)
{
textLines.Add(prime.ToString());
textLines.Add("XEQ 00");
}
File.WriteAllLines("code_snippet.txt", textLines);
/Rudi
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
-
- Posts: 1107
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: DM42 decoder/encoder error
Indeed. The program loading logic contains memory allocations that are just assumed to succeed in a few places (just look for the "TODO: handle memory allocation failure" comments). Those should be fixed and the error propagated properly up the call chain, so the user ends up with a polite error message and not a crash.
I suspect the DM42 firmware would also need a bit of work, since it shouldn't consider a memory allocation failure in the Free42 code a fatal error, but an expected condition that should be up to Free42 to handle. So it looks like there is some clean-up to be done in both components.
Re: DM42 decoder/encoder error
Yes, a polite error message is better than telling users “DON’T”, if they do something stupid, that crashes software. Actually, I spent Thursday and Friday at work on exactly such an incident, where a strange keyboard command led to our product simply crash and close in a puff without any messages at all That was due to missing error handling, when trying to write to a file without sufficient access rights.
Are there any particular reason for the memory limitations?
I acknowledge the DM42 is “just” a calculator and if people were to tap programs in manually, 75 kB would be plenty. But with the opportunities for implementing large programs, it would be nice to be able to expand the memory hardware and be able to specify the amount of memory for the Free42 in DM42 setup menu.
Are there any particular reason for the memory limitations?
I acknowledge the DM42 is “just” a calculator and if people were to tap programs in manually, 75 kB would be plenty. But with the opportunities for implementing large programs, it would be nice to be able to expand the memory hardware and be able to specify the amount of memory for the Free42 in DM42 setup menu.
/Rudi
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark