Run time error in Xcode for having too many lines of code - iphone

I have written a large code (a calculator program) about 220,000 line of code and more in my base implementation file. The program build and run well, but whenever it comes to execute the codes from specific line number and further, the program stops, and gives a run time error. There is no problem with the code, I have tried it in smaller scale, (I mean deleting some lines) when it become smaller it runs ok.
My question here is this, does the Xcode have limitation in capacity of each file when running?
And if the answer is NO, so what should I do?

Related

Matlab figures lagging

Last week, Matlab crashed on my computer and gave a message regarding the figure driver or engine being changed (unfortunately, I do not remember exactly what it said). Ever since then, all of my figures have been extremely laggy and have appeared to have a lower resolution.
Has anyone run into this or have any troubleshooting advice?
I was able to solve this by creating a startup.m file in my MATLAB directory (located in Documents in my case). This file is called every time MATLAB is initialized. In this file I typed: opengl('save','hardware'). After staring MATLAB once with this startup.m file, I was able to delete this line of code from that file (this command changes opengl permanently, unless it is manually changed back).
Alternatively, I could have typed opengl hardware into the startup.m file. In this case this line of code would need to be left in the startup file.

MATLAB doesn't find files I downloaded while the script is running

My problem is as described. My script downloads files through an external call to cmd (using the system function and then .NET to make keypresses). The issue is that when it tries to fopen these files I downloaded (filenames from a text file I write as I download), it doesn't find them, causing an error. When I run the script again after seeing it fail, it works but only up to the point where it's trying to download/call new files again, where it runs into the same problem.
Are new files downloaded during when a script is running somehow not visible to the search path? Because the folder is most definitely in my search path (seeing as it works outside of during-script downloads). It's not that it isn't getting the files fast enough either, cause they appear in my folder almost instantly, and I've tried a delay to allow for it to recognize it, but that didn't work either.
I'm not sure if it's important to note that the script calls an external function which tries to read the files from the .txt list I create in the main script.
Any ideas?
The script to download the files looks like so:
NET.addAssembly('System.Windows.Forms');
sendkey = #(strkey) System.Windows.Forms.SendKeys.SendWait(strkey);
system('start cygwinbatch.bat')
pause(.1)
sendkey(callStr1)
sendkey('{ENTER}')
pause(.1)
sendkey(callStr2)
sendkey('{ENTER}')
pause(.1)
sendkey('exit')
pause(2)
sendkey('{ENTER}')
But that is not the main reason I am asking: I am confident that the downloads are occurring when the script calls them, because I see them appearing in my folder as it called. I am more confused as to why MATLAB doesn't seem to know they are there while the script is running, and I have to stop it and run it again for it to recognize the ones I've downloaded already.
Thank you,
Aaron
The answer here is probably to run the 'rehash' function. Matlab does not look for new files while executing an operation, and in some environments misses new files even during interactive activity.
Running the rehash function forces Matlab to search through its full path and determine if there are any new files.
I've never tried to run rehash in the middle of an operation though. ...
My guess is that the MATLAB interpreter is trying to look ahead and is throwing errors based on a snapshot of what the filesystem looked like before the files were downloaded. Do you get different behavior if you run it one line at a time using F9? If that's the case then you may be able to prevent the interpreter from looking ahead by using eval().

MatLab - Undefined function or variable 'script'

I have a script, called TESTSCRIPT. It was running fine since I created it several hours ago, but now whenever I try to run it, either by pressing F5 or using the command prompt, I get the error message
Undefined function or variable 'TESTSCRIPT'
TESTSCRIPT is in fact a solution to another script file that had suffered the same consequence. I have read through many people's MatLab Forum posts, and I have tried many, if not all, the solutions given:
Checked, double checked, and triple checked the Matlab paths using path, which TESTSCRIPT, and pwd. All return the correct paths.
Changed file and function names so that they wouldn't match any function or file I don't know about within the MatLab paths.
Creating a new file, and copying the code. This provided a temporary solution, until now.
Commented out all but the declaration of two variables. Still get the same error message.
Changed computers. This didn't change anything.
The only thing that stood out when I did all these was when I typed which TESTSCRIPT and got <path>\MATLAB\TESTSCRIPT\TESTSCRIPT.m % Has no license available. I definitely do have a license, because I've been using it for the last 8-9 months without a problem.
I cannot put breakpoints within the code. When I try, a window pops up and says:
License Checkout failed.
License Manager Error -39
along with other stuff.
Scripts older than a week run fine when I hit F5. If I select a piece of code, within TESTSCRIPT, and run just that selection (by pressing F9), that runs without a problem.
My first thought was the file is corrupt, but then a new file would have worked, and this being the third time I've had to creat a new set of files, I'm confident it is not the case.
What is going on, and how do I solve this?
UPDATE
This seems to have resolved itself when I closed and opened MatLab. It does not explain why it has done this, but the problem seems to be solved.
Both dec2rad and pi are builtin functions, rename both variables to avoid the error.

Why doesn't "coverage.py run -a" always increase my code coverage percent?

I have a GUI application that I am trying to determine what is being used and what isn't. I have a number of test suites that have to be run manually to test the user interface portions. Sometimes I run the same file a couple of times with "coverage.py run file_name -a" and do different actions each time to check different interface tools. I would expect that each time I ran with the -a argument, I could only increase the code covered line count by coverage.py (at least unless new files are pulled in). However, sometimes it gives lower code coverage after an additional run - what could be causing this?
I am not editing source between runs and no new files are being pulled in as far as I can tell. I am using coverage.py version 3.5.1.
That sounds odd indeed. If you can provide source code and a list of steps to reproduce the problem, I'd like to take a look at it: you can create a ticket for it here: https://bitbucket.org/ned/coveragepy/issues

MATLAB slowing down on long debugging sessions

I have noticed that MATLAB (R2011b on Windows 7, 64 bit) tends to slow down if I am in debugging mode for a long period of time (e.g. 3 hours). I don't recall this happening on previous versions of MATLAB.
The slow down is small, but significant enough to have an impact on my productivity (sometimes MATLAB needs to wait for up to 1 sec before I can type on the command line or on the editor).
I usually spend hours on debugging mode (e.g. after stopping at a keyboard statement) coding full projects in this mode. I find working on debugging mode convenient to organically grow my code while inspecting my code anytime in execution time.
The odd thing is my machine has 16 GB of RAM and the total size of all workspaces while in debugging mode is usually less than 4 GB. I don't have any other large process running in the background, and my system reports ~8GB of free RAM.
Also, unfortunately MATLAB does not let me call pack from debugging mode; it complains with :
Warning: PACK can only be used from the MATLAB command line.
I have reproduced this behavior after restarting MATLAB, rebooting my system, and on different days. With this, my question/s are:
Has anybody else noticed this? Is there anything I could do to prevent this slowdown without exiting debugging mode?
Are there any technical notes or statements from Mathworks addressing this issue?
In case it matters, my code is on a network drive, so I added the following on my startup.m file, which should alleviate any impact on performance resulting from it:
system_dependent('RemoteCWDPolicy', 'None');
system_dependent('RemotePathPolicy', 'None');
system_dependent('DirChangeHandleWarn','Never');
I have experienced some similar issues. The problem ended up being that Mathworks changed how Matlab caches files. For some users, it is now storing data in the TMP folder as defined by the environment variables. This folder was being scanned by anti virus and causing a lot of performance problem. Of course, IT wouldn't let us exclude the TMP folder from scans. So we added a line to our start up script that changes the environment variable of TMP to some other location within an excluded folder.
You don't have to worry about changing the variable back or messing up other programs. When applications launch, they copy the environment variables into their own local instance of them. Any changes made to them only change the local copy of those variables, not the system copy.
Here is the function you will need.
setenv('TEMP', 'C:\TEMP');
I'm not sure if it was TMP or TEMP. Check your environment variables to be sure.
I am using MATLAB R2011 on linux 10, windows 7 (32 bit).
I experienced MATLAB slowing down while printing simple variables in command window.
It turned that there was one .m file loaded in my Editor.
It was a big file with 10000 lines. These lines were simple data that should have been saved as mat file. When i closed this file, the editor was back to its normal speed.