Artificial intelligence loop - prevent the application from not responding

Hello there! I'm trying for fun and for knowledge to build up a simple "bot" which takes informations from the environment (and thus not only from the application itself).
The first attempt to build it was to create a "mainLoop", containing some conditions with sub-loops, going into loop via
- (BOOL) mainLoop {
loop:;
if(/* conditions to exit */) return NO;
// my conditions with subloops
goto loop;
return YES; // will never be cast
The problem is that as soon as I start the program, it will stop responding.
Is my approach wrong? How would you structure it?
Thanks

Thank you, I've tested those codes and learnt something more about threads. Wanting an Objective C solution (just to learn this superset too, without having to port this code on other platforms), I found my error and resolved.
There was still a series of warnings about memory leaking, so surfing on the web I found what an NSAutoreleasePool is and I used it to do threaded stuff and release it at the end.
Now, threading my process, I came to another problem:
* __NSAutoreleaseNoPool(): Object 0x3174e0 of class MemoryAccess autoreleased with no pool in place - just leaking
^-- this and similar errors, like
* __NSAutoreleaseNoPool(): Object 0x30f600 of class NSCFString autoreleased with no pool in place - just leaking
I haven't written the MemoryAccess class, nor is present within my threaded code. I suspect that threading my process may lead to something unwanted within various threads? I'm not sure about that.
The question is: how to find where this class is missing of NSAutoreleasePools?
This is my actual code:
mainLoop evocation:
NSAutoreleasePool *mainLoopPool = [[NSAutoreleasePool alloc] init];
[NSThread detachNewThreadSelector:@selector(mainLoop) toTarget:self withObject:nil];
[mainLoopPool release];
mainLoop method:
- (void) mainLoop {
int nLoop = LOOP_NULL;
NSAutoreleasePool *subLoopPool;
while (/* loop conditions */) {
subLoopPool = [[NSAutoreleasePool alloc] init];
if(nLoop != LOOP_EVENT1 && /* event1 conditions */) {
NSLog(@"LOOP: Entering event1 Loop");
nLoop = LOOP_EVENT1;
[self performSelector:@selector(event1Loop) onThread:[NSThread currentThread] withObject:nil waitUntilDone:YES];
else if(nLoop != LOOP_EVENT2 && /* event2 conditions */) {
NSLog(@"LOOP: Entering event2 Loop");
nLoop = LOOP_EVENT2;
[self performSelector:@selector(event2Loop) onThread:[NSThread currentThread] withObject:nil waitUntilDone:YES];
[subLoopPool release];
[subLoopPool release];
For now event1/2Loop methods are just infinite while cycles with no functions evocated in but the conditional ones.
After a while the program crashes due to
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x93720ed7 objc_msgSend + 23
1 com.apple.CoreFoundation 0x967f50ed _CFAutoreleasePoolPop + 253
There are something like 20 autoreleasepool errors, then the log "LOOP: Entering event1 loop"
Thanks.

Similar Messages

  • I am unable to open adobe bridge on my mac. When I try to open it nothing happens. When I right click it says the application is not responding. I can also not op en through photoshop. Please help

    I am unable to open adobe bridge on my mac. When I try to open it nothing happens. When I right click it says the application is not responding. I can also not op en through photoshop.

    Could you see whether Firefox will start in its Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    Here's how:
    With Firefox closed, hold down the Shift key while starting Firefox.
    A small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).
    Does that work?

  • How do I close multiple documents opened in Finder when the files are loading and the Application is not responding?

    I was moving 90 files from one folder to another and instead accidently double clicked all the files I had selected and they all opened at once and now they are all stuck trying to load and the program is not responding.
    When I put my mouse over the folders, it's just the loading cursor so i can't select anything. I've tried using 'command' - 'option' - 'W' and that doesn't work either.
    I have tried restarting finder and all that does is shut all of the folders and reopens them and they get stuck trying to load all over again.
    I have tried restarting my macbook and every time I log back in, it restarts all the programs and all the finder windows and the whole process repeats.
    (even when I unselect the 'restart opened programs' box.)
    I really hope someone knows how to troubleshoot this problem I am having!

    You're trying to use Spry Accordions for something they were never intended to do.   Why don't you switch to a more appropriate jQuery Mega Menu?
    http://www.designchemical.com/lab/jquery-mega-drop-down-menu-plugin/examples/
    In case you missed the announcement, Spry is dead.  Adobe abandoned it late last year because it has outlived its usefulness.
    http://blogs.adobe.com/dreamweaver/2012/08/update-on-adobe-spry-framework-availability.htm l
    Nancy O.

  • HT203206 When I click the 'backup' and click on the 'Application' itunes not respond

    When I click the 'backup' and click on the 'Application' itunes not respond

    Hello binyaminfromירושלים,
    The article linkded below details a number of troubleshooting steps that can help stabilize iTunes on your computer.
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    https://support.apple.com/en-us/HT203206
    Regards,
    Allen

  • Is there a setting that prevents the slideshow from not playing ?

    Hi All,
    Im experiencing problems in Lr4 with the slideshow module not function properly.  It will open and prepare a preview of images and then default or return to the original screen when finished preparing the previews.
    i.e. it won't play !!!  It just flashes black once and returns to the first image in the slideshow as if its waiting for me to start play.
    Has any one encountered this before ?
    Looking for recommendations and remedies to fix this problem if possible.
    S.

    OS Mavericks 10.9.5
    Lr 4
    no prior trouble shooting out side of the module itself. 

  • When I try to open it, it shows a little box that you can't maximize and if you try to close it it says ''the application is not responding'' help?

    Hello, I really need your help. When I try to open firefox, nothing happens or it will open a really small and empty window in the top corner of my laptop. That window cannot be maximized and if I try to close it either nothing happens or it says that the program stopped working. I dezinstalled it and installed it again 3 times... I don't know what to do anymore. Any help would be appreciated!

    Could you see whether Firefox will start in its Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    Here's how:
    With Firefox closed, hold down the Shift key while starting Firefox.
    A small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).
    Does that work?

  • Windows Server 2012 - Backup failing with Exchange - The application will not be available for recovery from this backup. the consistency check failed

    Hi
    We have a Windows 2012 server with Exchange 2013, all is working fine except now i am getting issues with the backup.
    'Exchange - The application will not be available for recovery from this backup. the consistency check failed for the component Microsoft Exchange Server'
    I have checked the database all is fine, i have created a new db and move all mailbox;s over and then removed the old db, i have enabled circular logging and then disabled it, it seems no matter what i do i cannot get a full backup!
    i did have to restore the server once and the backups still worked for about 4 days after that and then stopped, i have also tried to remove and re add the backup role!
    i am stumped, any advice would be great!

    Hi
    Ok, i created a test db and tried to back it up right away, it failed, i did not add any mailbox's to it either. i got quite a few events in the windows logs, as well as the same event above i got the following:
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:          21/01/2013 10:16:30
    Event ID:      2038
    Task Category: Exchange VSS Writer
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      NERDS-DC01.nerds.local
    Description:
    Microsoft Exchange VSS Writer backup failed. No log files were truncated. Instance 75754d0d-8dfe-4909-8beb-5a4f824254a9. Database 4843b37c-7b3c-42b2-8b57-1393615c2c15.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="MSExchangeRepl" />
        <EventID Qualifiers="32772">2038</EventID>
        <Level>3</Level>
        <Task>2</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-01-21T10:16:30.000000000Z" />
        <EventRecordID>261645</EventRecordID>
        <Channel>Application</Channel>
        <Computer>NERDS-DC01.nerds.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>75754d0d-8dfe-4909-8beb-5a4f824254a9</Data>
        <Data>4843b37c-7b3c-42b2-8b57-1393615c2c15</Data>
      </EventData>
    </Event>
    AND
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:          21/01/2013 10:16:30
    Event ID:      2038
    Task Category: Exchange VSS Writer
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      NERDS-DC01.nerds.local
    Description:
    Microsoft Exchange VSS Writer backup failed. No log files were truncated. Instance 75754d0d-8dfe-4909-8beb-5a4f824254a9. Database db5826f3-1029-4219-ad80-441a0e94537a.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="MSExchangeRepl" />
        <EventID Qualifiers="32772">2038</EventID>
        <Level>3</Level>
        <Task>2</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-01-21T10:16:30.000000000Z" />
        <EventRecordID>261646</EventRecordID>
        <Channel>Application</Channel>
        <Computer>NERDS-DC01.nerds.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>75754d0d-8dfe-4909-8beb-5a4f824254a9</Data>
        <Data>db5826f3-1029-4219-ad80-441a0e94537a</Data>
      </EventData>
    </Event>
    and
    Log Name:      Application
    Source:        MSExchangeRepl
    Date:          21/01/2013 10:16:30
    Event ID:      2034
    Task Category: Exchange VSS Writer
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      NERDS-DC01.nerds.local
    Description:
    The Microsoft Exchange Replication service VSS Writer (Instance 75754d0d-8dfe-4909-8beb-5a4f824254a9) failed with error FFFFFFFC when processing the backup completion event.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="MSExchangeRepl" />
        <EventID Qualifiers="49156">2034</EventID>
        <Level>2</Level>
        <Task>2</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-01-21T10:16:30.000000000Z" />
        <EventRecordID>261649</EventRecordID>
        <Channel>Application</Channel>
        <Computer>NERDS-DC01.nerds.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>75754d0d-8dfe-4909-8beb-5a4f824254a9</Data>
        <Data>FFFFFFFC</Data>
      </EventData>
    </Event>
    and
    Log Name:      Application
    Source:        SPP
    Date:          21/01/2013 10:16:30
    Event ID:      16389
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      NERDS-DC01.nerds.local
    Description:
    Writer Microsoft Exchange Writer experienced retryable error during shadow copy creation. Retrying...  More info: .
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="SPP" />
        <EventID Qualifiers="0">16389</EventID>
        <Level>2</Level>
        <Task>0</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2013-01-21T10:16:30.000000000Z" />
        <EventRecordID>261650</EventRecordID>
        <Channel>Application</Channel>
        <Computer>NERDS-DC01.nerds.local</Computer>
        <Security />
      </System>
      <EventData>
        <Data>Microsoft Exchange Writer</Data>
        <Data>
        </Data>
        <Data>The writer experienced a transient error.  If the backup process is retried, the error may not reoccur. (0x800423F3)</Data>
        <Data>
        </Data>
        <Binary>00000000A5120000981200000000000042BEB7C511CAC619E59C92030000000000000000</Binary>
      </EventData>
    </Event>

  • When i try downloading adobe pro i am getting an error message that is saying: The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author.

    when i try downloading adobe pro i am getting an error message that is saying: The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author.

    Hi Kashmore,
    Seems like the downloaded file was corrupt that could be because of either network restriction or the anti virus might have blocked it. My suggestion would be to try and download the product either by turning off the Antivirus or try a different network.
    Cheers,
    Kartikay Sharma

  • Trying to download the free trial of Adobe Acrobat XL Pro.  I keep getting the message "The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author."  I've repeatedly tried g

    Trying to download the free trial of Adobe Acrobat XL Pro.  I keep getting the message "The application could not be installed because the installer file is damaged. Try obtaining a new installer file from the application author."  I've repeatedly tried getting a new installer file, but get the same message every time.

    K_don52 and Ande8135 please remove your current installation of the Adobe Download Assistant and reinstall.  You can find more details in the known issues section of Troubleshoot Adobe Download Assistant.

  • HT1277 my mail will not open after I click on mail.when I try to shut down my laptop ,it wouldn't  telling that mail is preventing the computer from shutting down,asking to quit Mail and when I do mail dose not quit

    my mail will not open after I click on mail.when I try to shut down my laptop ,it wouldn't  telling that mail is preventing the computer from shutting down,asking to quit Mail and when I do mail dose not quit

    Mail is open but it is frozen, being this the reason why you cannot open the Mail window. Press Alt, Command and Esc keys or go to  > Force Quit, select Mail and force quit it. Finally, you will be able to turn off or restart the MacBook

  • Is there a way for preventing the placeholder from appearing if there is not content for it?

    I am creating a structure with tags and place holders.  However, not all my entries have all the same information. For example, my first entry has a 3 line address (123 West Street, Suit 23, Lincoln NE 68521) but my second entry only has 2 line address (456 North Street, Lincoln NE 68521).  When imported into my structure, the second address reads 456 North Street, <address2>, Lincoln NE 68521. My question for you is, is there a way for preventing the placeholder from appearing if there is not content for it?

    IJWAA,
    A work-around if you don't already use XSLT (to avoid having to) is to not have placeholder text, just use empty tags in your text layout that correspond to your incoming XML structure (any unused by the incoming structure IN ORDER, will be skipped). So long as you don't mind the blank line (rather than left over placeholder copy).
    If you had placeholder copy in your text box (<address2> for example) look at it using the story editor window (edit > edit in story editor, or command-y/control-y) so you can see the surrounding tags... style the surrounding tags by selecting them with the cursor and applying character or paragraph styles (with text in between the tags at the time) and then delete only the placeholder text from the middle of the sandwich, leaving the tags in tact. Trying to do this without being in the story editor will not work.
    Also, when importing the XML, I believe you'll still need to use "merge content" and "don't import empty white space" as you have been in order to replace placeholder text in any areas you had it.
    For situations when you have a mixture of dynamic and static text in the same text block and you are merging data (more so when the placeholder text has been deleted as I've suggested above but the dynamic tags for the possible incoming text are still there), you can use a tag you've created (I call mine "staticText") in your layout to wrap ANY bits of text you don't want to accidentally delete when the surrounding tags get populated or not, using the merge option upon importing your XML. Just be sure never to use "staticText" as an actual tag in your structure or surrounding incoming data. The text contained within staticText tags in your layout will be ignored by incoming data, and won't accidentally get deleted when it's sandwiched between two sets of tags that are dynamically populated when merge content is the import option.
    In my example below I'm using brackets/carats with the tag name instead of the color coded tag icon you see in the story editor, also I've used LB here to indicate a regular line break in Indesign and SP a regular space character in indesign:
    [staticText>Name:<staticText][firstName>Abc<firstName][staticText>SP<staticText][lastName>Xyz<firstName][staticText>LB<staticText]
    [staticText>Address:<staticText][address1><address1][staticText>LB<staticText]
    [address2><address2][staticText>LB<staticText]
    all other tags on following lines...
    This should just leave a blank line for address2 when no data comes in for it. I'm assuming you have line breaks, if not, all the better.

  • I can not resume when I downloaded the application from the Apple Store. If I have to start from the beginning of a solution to this too please.

    I can not resume when I downloaded the application from the Apple Store. If I have to start from the beginning of a solution to this too please. ?

    Are  you away from your home country?
    Settings > General > International > Region Format > set to correct location?
    Settings > Phone > Dial Assist > ON

  • HT201304 iOS parental controls do not prevent the child from changing the device passcode.

    So the parent cannot get into the device at all unless the child provides the passcode. Sure, the device can be taken away until the child provides the passcode, but why don't parental controls just prevent the passcode from being changed?  Either that, or the parental control passcode should allow the parent to get into the device, over-riding the passcode lock.

    We are not Apple iOS programmers.  Just device users like yourself.
    feedback.apple.com is where you should send suggestions.

  • Hi , unfortunately i faced with a problem that i couldent open my audio note so i thought if i delet it and transfer the application from itunse from my pc i can have my files...but all of them deleted from both application and also from wifi address... I

    Hi , unfortunately i faced with a problem that i couldent open my audio note so i thought if i delet it and transfer the application from itunse from my pc i can have my files...but all of them deleted from both application and also from wifi address... Is it any solution for recovery the filew? I missed lots of important files , plz help me
    Tnx alot

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • Office 365 AAD Password Writeback not working; Event Viewer Error: 0x80230619 (A restriction prevents the password from being changed to the current one specified.)

    Hello all,
    I'm currently setting up a Proof Of Concept setup with directory synchronisation and password syncing to Office 365, leveraging AAD Premium for the password reset and password writeback to on premises
    AD functionality. Directory Sync + Password Sync is working flawlessly with the AADSync tool. However, upon requesting a password reset for a user, I'm hitting a password writeback error. The webpage states that the password does not meet the password
    complexity policy, while it does. I can set that particular password for that account at the on premises AD without any problem.
    In the event viewer at the AADSync server, I'm seeing this Error pop up whenever I try to reset the password:
    An unexpected error has occurred during a password set operation.  "BAIL: MMS(4032): ..\server.cpp(11003): 0x80230619 (A restriction prevents the password from being changed
    to the current one specified.) Azure AD Sync 1.0.0475.1202"
    My Setup:
    Windows Server 2012 AD with a single forest
    Seperate domain joined Windows Server 2012 for AADSync tool
    AADSync version 1.0.0475.1202 with options password sync, password writeback enabled
    Service account for AADSync tool with Replicating Directory Changes and Replicating Directory Changes All permissions
    on root AD forest structure with inheritance to all objects. This account also has the permissions to Change Password and Reset Password on all descendant
    User Objects.
    AAD Premium for my office 365 tenant
    AAD Premium licenses for the test users and the office 365 account used to sync to Office 365. This account is also Global Admin.
    Could anyone help me with this? Is there something I’m missing here? My guess is that the AAD is not trusted or the service account for AADSync tool does not have the proper permissions. I’ve tried
    many options, like setting the AADSync Service account to Enterprise Admin or granting the service account Full Control over that particular user.

    Concerning my issue:
    The Default Group Policy setting: Minimum Password Age is set at 1 day. As I was testing this feature with new users, their provisioned passwords were less than 24 hours old and the Minimum Password Age of 1 prevented the change of the password.
    After changing this to 0 days in the Default Group Policy, my password resets started working for newly created users. While this might not have affected existing users in production, it had me looking and searching for permission issues on my AD.
    So for those that might be experiencing ADSync Event ID 6329 and PasswordResetService Event ID 33008 Errors when trying to do a Password Reset using AAD Premium with Password Writeback, it might be helpful to check the applied password policy.
    The issue is solved.

Maybe you are looking for

  • When i go to buy an app on my ipod touch, i click the buy button then the install button and it just keeps repeating itself then dissappears, why is this?

    when i go to buy an app on my ipod touch, i click the buy button then the install button and it just keeps repeating itself then dissappears, why is this?     help me please, i cant download no apps.

  • Error in rebate agreement

    Hi, I would like to request your help on the error i encountered in SAP. I was doing a rebate payment settlement in VBO2 and I encountered the error: Error creating rebate credit memos (see next warning message) then I pressed enter and got this anot

  • Xine broken (solved)

    After a reboot all of the applications that use xine now donot work anymore. For example, the login & logout sound is gone, and when I start Amarok from terminal, I get these: $ amarok KGlobal::locale::Warning your global KLocale is being recreated w

  • Run time binding error

    ok so i have made a non visual component with 3 input in properties 1)_input 2)_check 3)_output it works fine the problem is when i preview it the output is shown in the cells howerver when i try to change the checkpropertiy using a button or anythin

  • LIMIT IN QUERY TO LIMIT RESULTS

    I was reading the article here: http://www.inquiry.com/techtips/oracle_pro/10min/10min1200/10min1200-3.asp I am working from an oracle 8i database with a few thousand records in it. Can you help me out here? I tried the example method, and it appears