Posts

chat - Get conversation list using Sinch API & iOS SDK -

i have develop messaging app , came across sinch messaging sdk. had downloaded ios sdk , tried sinch instant messaging sample app. able send messages , messages. need know: can conversation list using sinch sdk latest message each conversation show in list? how can differentiate incoming chat messages different users. in sample see 1 chat messages screen populates messages different users. so, have property in sinch sdk differentiates conversations? is there possibility create group name, group image group chat? , how sinch api possibly maintain these group chat , single chat message? no, think of delivery mechanism messages, not mailbox. look @ senderid in messages, differentiate sending. you can implement feature sendmessagewithheaders , sinch im not channel discussion group, more suited multirecipient messages.

Explain C++ pointer initialization -

int value = 3; int *pvalue1 = &value; int *pvalue2(pvalue1); cout << (*pvalue1) << " " << (*pvalue2); in above code if have noticed have written int *pvalue2(pvalue1); instead of int *pvalue2 = new int; pvalue2 = pvalue1; still working , giving proper result. can 1 explain me of default function or constructor getting called in case? int *pvalue2(pvalue1); is equivalent to int* pvalue2 = pvalue1; just assign pvalue2 pvalue1 (assign pvalue2 address of variable value ).

java - how to configure a maven project to read from a config.properties file? -

i have servlet dao class has following constructor: public dao() { env = new hashtable<string, string>(); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://localhost:1389"); env.put(context.security_authentication, "simple"); env.put(context.security_principal, "cn=directory manager"); env.put(context.security_credentials, "secret"); } i've written following config.properties file in source/main/resources : initial_context_factory=com.sun.jndi.ldap.ldapctxfactory provider_url=ldap://localhost:1389 security_authentication=simple security_principal=cn=directory manager security_credentials=secret how configure pom.xml file tell maven use config.properties ? here, resolved adding plugin block: <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>properties-maven-plugin</artifact...

php - Substr 0, -1 return only one character -

i have problem substr() function. $a = ad26tm7i; use this: $b = substr($a, 0, -1); var_dump($b[0]); produce "a". have 5.3.27 php version. know why? on page click ok. help. it because vardump first letter. var_dump($b[0]); gives first letter of string of $b. use var_dump($b);

linux - What permissions are required for scp -

google fails me. permissions need set file make scp -able somewhere? thought read access enough, although can secure-copy file account, collaborators cannot download file test scp username@host.com:/path/to/test test $ ls -aln drwxrwxrwx 3 15016 200 2048 jul 8 13:35 . drwxrwxrwx 3 15016 200 2048 jul 6 18:02 .. -rwxr-xr-x 1 15016 200 0 jul 8 13:35 test

c++ - What does ## (double hash) do in a preprocessor directive? -

#define define_stat(stat) \ struct fthreadsafestaticstat<fstat_##stat> statptr_##stat; the above line take unreal 4, , know ask on over unreal forums, think general c++ question warrants being asked here. i understand first line defines macro, not versed in preprocessor shenanigans in c++ , i'm lost on there. logic tells me backslash means declaration continues onto next line. fthreadsafestaticstat looks bit template, there's #'s going on in there , syntax i've never seen before in c++ could tell me means? understand may not have access unreal 4, it's syntax don't understand. ## preprocessor operator concatenation. so if use define_stat(foo) anywhere in code, gets replaced with struct fthreadsafestaticstat<fstat_foo> statptr_foo; before code compiled. here example a blog post of mine explain further. #include <stdio.h> #define decode(s,t,u,m,p,e,d) m ## s ## u ## t #define begin decode(a,n,i,m,a,t,e) int b...

Sending a message to a contact on another Android device -

while building first android app (a simple game), came across (most newbie) problem: my app needs send message contact (chosen contact list) via own server. same app installed on contact's device, needs retrieve message. the problem facing contact "identification". how can app identify contact such 1 device sends message "id", , device polls messages intended same "id? maybe there kind of id associated contact having android device? thanks (and sorry newbie question :) you can try push notifications service, using google cloud messaging. first device can send http request containing message server manages request , sends message second device, or more 1 device. you can find tutorial here https://developers.google.com/cloud-messaging/