khalodark / addi

Automatically exported from code.google.com/p/addi
0 stars 0 forks source link

MissingResourceException while trying to speed up plots #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since cell phones still don't have that much CPU-Power I was trying to find a 
quick way to improve plotting abilities of Addi; from within Addi.
First of all, I was kind of dissappointed I didn't find any function similar to 
unique, but I found what I was looking for on
http://globec.whoi.edu/software/saga/unique.m
Using this I was trying to reshape plotting data, since with Addi and Addi Plot 
the data always exists twice. Data efficiency is even more important, I 
overclocked my phone anyway, but memory...
We all know the problem.
Setting the Data to the integer-values of pixels on the screen they will be 
displayed on should somewhat help.
My function 'uniqueplot.m' looks like this:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function uniqueplot(Xpl,Ypl)
fprintf('x range is %f to %f,linear',min(Xpl),max(Xpl));
fprintf('y range is %f to %f,linear',min(Ypl),max(Ypl));
%
%reshaping data points
Xpl=uint16(Xpl.*840/max(Xpl)-min(Xpl));
Ypl=uint16(Ypl.*840/max(Ypl)-min(Ypl));
[PLDATA,~,~]=unique([Xpl;Ypl]');
Xpl=PLDATA(:,1);
Ypl=PLDATA(:,2);
plot(Xpl,Ypl);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Together with 'unique.m' this should produce fairly good results, at least for 
plots with too much data in them, like:
x=x:0.0001:10
y=x.^2
y2=x
x=[x,x]
y=[y,y2]
uniqueplot(x,y);
%
Yes, what's the point, I could reduce the x-step, but I somehow couldn't let go 
of that idea.
Having the files on my /sdcard and trying to run the last few commands from a 
file called 'upt.m' gives:

class java.util.MissingResourceException : Can't find resource for bundle 
'jmathlib.resourcebundles.ErrorBundle_en_US',key "

which I assume means he doesn't know how to formulate his error in plain 
English. If that assumption is correct it would be great if the 
error-help-files could be included with the help-files in the upcoming 
versions. Also it would be great if someone could figure out where my actual 
mistake is. 'sort' somewhat sorts a whole lot differently (?!?!?) than Matlabs 
equivalent, but that shouldn't produce any error.
Sadly my beloved 'File Magic' won't open any of these files, maybe the encoding 
is part of the problem already, but sadly I currently don't have time to look 
further into this topic.
In case we get this running the plotting algorithm might be slightly altered; 
or at least unique should get included, since it's a great function. At least 
that's what I'm thinking.

Bye and thanks to Corbin for producing such a great tool and to anyone who 
spots my mistake!
Dennis

Original issue reported on code.google.com by DennisHe...@gmail.com on 5 Apr 2011 at 1:16

GoogleCodeExporter commented 9 years ago
There is a new version up and running today (Apr 07,2011).
At first I hat a little trouble installing, getting market error - 18.
This problem had occured to more people with different kind of software too:
http://www.google.de/support/forum/p/Android+Market/thread?tid=7d004179e5574276&
hl=en
No matter if I tell Cyanogenmod 7CM4 to install it on the SD or the phone, it 
didn't work although untill this version Addi was happy on the SD.
I quick-fixed this with unmounting the SD and updating then. Not sure it's a 
software or a pure market problem, just wanted to mention this, in case anyone 
else got the same problem.
I love the editor and the help files!
Addi can now finally start growing into something great, looking forward to 
that!
Interresting thing about the mentioned script:
I finally got my error message!
The problem was within 'upt.m', the very first line.
"x is unknown string or token..."
Running a script 'test.m' with the single line
%%%%%%%%%%%%
x=1:100
%%%%%%%%%%%%
before execution of 'upt.m' solved the problem. I'm not quite sure why Addi 
wanted to have x declared with integer values(?) at first but that worked.
The interresting part is that I could reproduce this scenario 3 times.
Now I wanted to write down the exact error-message and it works just fine (up 
to a later point in the script at least).
I assume Android seems to remember what kind of variables are getting saved.
Since this problem is hard to reproduce (maybe via uninstall&re-install) I'm 
not quite sure how the chances are on a fix.
fprintf doesn't exist (yet?) so I replaced that with disp which is fine too.
The software runs fine as long as I don't get a phonecall every few minutes. 
The software just has to be force-closed in that situation. Sad, but we are 
talking about a cellphone after all, so you might consider running your bad-ass 
simulations during the night with airplane-mode enabled :) Just remember, your 
overclocked phone will become a radiator! Still my first smartphone got a 
lot(!!!) hotter without overclocking.

Apart from phone-interruptions everything works fine untill the software 
reaches 'unique(.m)'.
At that point I get the error:

ERROR: Can't find resource for bundle 'jmathlib.resourcebundles. 
ErrorBundle_en_US', key" 

Notice the missing 'class java...' part. And the " at the end, which is neat, 
but not exactly a big bug.
Presumably I'm trying to run a function that doesn't exist, but I still don't 
have time to look into that kind of thing.
Running 'unique.m' without parameters gives:
"class java...ErrorBundle_en_US..."
which is reasonable since it defaults into 'help unique' that just doesn't 
exist.
A replacement-string for this kind of situation still would be nice and 
presumably rather easy. Just say something like "That function is not 
implemented in Addi and hence doesn't have a help file yet. It's a cellphone, 
what did you expect?"
Also 'ed file_without_dot_m' could check for the existence of said file and 
open&edit it, only expect a '.m' if you want to create a new file.
Another thing about Androids ability to remember (sorry for jumping topics 
today) is that Android wanted to force-close Addi a couple of times, since 
those calculations, indeed, take a lot of time. Telling him that's fine 2-3 
times apparently fixed that.
I'm not quite sure, but by my experience apps with the somewhat neat spinning 
"I'm still thinking" circle didn't have that problem. Sadyl I'm not quite sure 
how easily Android can be tricked on that subject.

Bye and thanks for the new features, I'm sure that's gonna cost me a lot of 
battery as soon as I find the time! :)
Dennis

Original comment by DennisHe...@gmail.com on 7 Apr 2011 at 4:22

GoogleCodeExporter commented 9 years ago
the reason you needed to define x first was because you first line was this
x=x:0.0001:10
So, x is in the right hand side, but you hadn't declared it.

I am going to close this issue, can you enumerate any remaining issues you are 
having or feature requests you would like as separate items.  

Original comment by corbi...@gmail.com on 26 May 2011 at 11:56