xmppframework: iPhoneXMPP: RootController not updated with friend's presence - xmppframework

I tried the iPhoneXMPP demo but it seems that the GUI is not updated when my friend is online or offline. I modified the nsfetchresultcontroller to show online friend only:
...
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:#"sectionNum == 0"]];
...
In xcode's console, it showed that it did receive the presences from my friends. But I saw that controllerDidChangeContent: is not get called at all. (Actually, I saw it's called sometimes, but randomly and rarely).
When I debugged more deeply, I saw that XMPPRosterCoreDataStorage handlePresence:xmppStream is called, then managedObjectContextDidSave:notification is called also. So everything seems right. But the resultfetchcontroller did not see the changes.
So what is the problem? Is there anything I did wrong?
Thanks.

I just tested your Predicate: It works just fine.
Did you initialize your NSFetchedResultsController correctly? You need to pass the NSManagedObjectContext of your XMPPRosterCoreDataStorage.

Related

viewer.impl.disableRollover(true); not working

Seems like something changed in Forge's library as suddenly viewer.impl.disableRollover(true); has stopped working.
Would anyone kindly confirm or deny this?
Try that:
viewer.disableHighlight(true)
Keep in mind that every method under viewer.impl. is NOT part of the public API and is subject to change from one version to another.

IMobileServiceSyncTable PullAsync doesn't return

I currently use Azure Mobile Services with Offline Sync and I it has been working fine. However I now have come to a problem I can't seem to debug. On the PullAsync it never returns, never goes to the Web API, it never errors, it just seems to be stuck somewhere and I don't know where.
IMobileServiceSyncTable<ResponseType> responseTypeTable = MobileService.GetSyncTable<ResponseType>();
await responseTypeTable.PullAsync(responseTypeTable.Where(c => c.CompanyId == companyId));
I use identical code elsewhere with a different type and it works well.
The only thing that happens is the Windows Phone emulator UI locks up, I can press buttons on the keyboard but the input or buttons are all frozen.
I get this on the Debug Output
The thread 0xb80 has exited with code 259 (0x103).
After a 5 seconds and that's about it. Breakpoints everywhere, nothing happening.
The method was in a Command (I'm using MVVMLight). When I call the function on the class initialization and just hold the value it works fine. There is obviously some bug that occurs when calling PullAsync on an event, in an async RelayCommand but getting the call out of there solves the issue.
I'll leave it at that unless anyone comes back with why it is actually happening. This is just a workaround at the moment.

why does console.log not output in chrome?

Recently I read a query about "What does console.log do" and I read an answer, tried using it and found that despite the answer stating that it outputs to the console in googles browser, I just tried it and I get no output.
I did try this code:
function put(p){
if ( window.console && window.console.log ) {
console.log(p); // console is available
}else{
alert(p);
}
}
BUT... I get neither console output or alert and furthermore .log is a Math property, what gives with that?
Make sure that in the Developer Tools the Filter in the console section is set to All or Logs...
I had a similar experience where I couldn't see any of my console.log output and it was because the console was set to filter on Errors only... All the log entries were there - they just weren't visible.
Bonus marks: you can also Ctrl + Click to select multiple filters (Errors + Logs for example).
Press F12 and look at in Developer Tools: Console. I tried your code just now, works fine for me -- Chrome version 30.0.
Since you're after console logging, not mathematical logarithms, perhaps you could stop going on about there being similarly-named function in the Math object. It's not relevant here whatsoever.
You're also coming across just a little shouty. console.log() works fine, and your question didn't indicate that you knew where to look. This is totally your problem, but I'm trying to help you. I can obviously only go on the information you provide, and I can't say your initial question was written very clearly.
It appears, since the snippet of code you posted works here absolutely fine, that your calling code & containing (which you haven't posted) would be the cause of the problem. You should debug these, to find out what's going wrong.
Do you know how to use the Chrome debugger? Are there any error messages showing in Chrome or on the console?
Test it on a simple page if necessary, to rule out other errors in the page/ or surrounding context breaking it. One common mistakes is declare functions in a jQuery ready handler or similar, and then try & access them globally. Make sure your logging function is actually global (outside any other function(){} or object {} blocks).
Lastly, it's good to have a logging function for portability (I have one myself) but put() is not a good name for it. Naming it consoleLog() or log() would be better.
Had the same issue .
Make sure your using de right path when you try import thing's .
Example whit my issue :
Wrong path ----> ** import normalizedData from 'normalizr'; **
Right path ---> ** import normalizedData from '../schemas/index.js'; **
I had also faced the same problem. Make sure you apply no filter in the console. It worked for me.

Event that fires when a url is confirmed as valid

Alright dudes... I have a problem that is looking for an answer more specific than the seemingly obvious solution.
I have a block of code that I want to execute directly after a url is known to be valid. What I mean by 'valid' is that the program has checked to see if that filepath actually exists. This could be accomplished by a COMPLETE listener, because after all, a loader couldn't finish loading its content if the referenced file didn't exist, but I want it to happen before any of the bytes begin to get sucked in. I have also tried the HTTPS_STATUS event, with a conditional saying "if the status is this [some non-error status number], then run this block of code." This would have worked great, except that different environments produce different network codes, and some even can't distinguish between errors and non-errors, just returning 0's no matter what. Because of this, I can't write a conditional that works no matter what browser....
So, anyone got any ideas?!?!?!?!
If this doesn't work post your code.
myUrlLoader.addEventListener(Event.OPEN, openHandler);
//Dispatched when the download operation commences following a call to the URLLoader.load() method.

Bizarre problem with Google's Rich Snippets Testing Tool

I'm currently experiencing the weirdest problem with Google's Rich Snippets Testing Tool. It kept throwing up warnings for my website which didn't make sense, so I pulled all of the structured markup out of my page to do some testing:
The following (based on Google's examples) works perfectly: the 'Google search preview' section displays the result with a snippet. See example here.
So I took the working example, and replaced the dummy details with my own. I was amazed to find that it didn't work! I'm told by the app that it has "Insufficient data to generate the preview". See example here.
So (after lots more testing and banging my head against the wall) I try using the original (working) snippet in example 1, and replace one field at a time. I only got as far as the first 'name' field, and it broke! What's wrong with my name Google? See example here.
I'm really confused by this, what's up? I noticed that if I change my name to "Row Manni" (the same character length as "Bob Smith" in the example), then it does work.
Has anybody experienced anything similar? If so, how did you solve it, and if not, what do I do next?
Thank you
Edit 2011-01-19:
After changing to use vcard (on comment suggestion) I ran a few more tests and I get exactly the same result. These tests are available here (not working - uses my full name) and here (working - using truncated names).
I can't for the life of me work out what's wrong here! If their testing tool isn't working correctly, does their search detect rich snippets in the same way, and is this broken too? I'm leaving the microformats in my page now, but I'd still really like to pursue this for my own interest (and sanity!).
I've cross-posted on the Google webmaster forums (as mentioned in the comments) to see if they pick it up. You can view the thread here.
It's a "bug":
If name itemprop="name"' (with or without spaces, case-insensitive) matches a substring of the domain, then this error is generated:
Insufficient data to generate the preview.
your domain "dev.rowanmanning.co.uk" contains "Rowan Manning" [minus the space]
try changing your name to: "Rowan Something Manning" and see if it works.
TEST CASES:
fails:
domain: rutledge.com
name: ru t l e d g e . co
test link
fails:
domain: jpwco.org
name: jpw co
test link
succeeds:
domain: jpwco.org
name: not_jpwco
test link
Names also expected to fail: "co" "uk" "ning" "dev.r owan".
ps. "name" match to the path part of the URL (after the domain) will not yield the error. IE: http://jpwco.com/stack/dev.rowanmanning.co.uk/test3.html succeeds, with the name "Rowan Manning".
Bizarre indeed.