Posts

Unable to receive Apple push notification on iphone through php service -

I'm sorry if this is a duplicate question, but I did not find the solution I was looking for. Here is the service code to send information to my PHP's iPhone: & lt ;? Php $ data = array (); // Place your device token here (without spaces): $ deviceToken = 'eb9ea0d12eb9a0bae159c7e54fa59baee22329df'; // Place the passphrase of your private key here: $ passphrase = 'dell'; $ Message = 'push notification service'; //////////////////////////////////////////////// ////////////////////////// $ ctx = stream_context_create (); Stream_context_set_option ($ ctx, 'ssl', 'local_cert', 'app / controller / ck.pem'); Stream_context_set_option ($ ctx, 'ssl', 'passphrase', $ passphrase); // Open the connection to the APNS server $ fp = stream_socket_client ('SSL: //gateway.sandbox.push.apple.com: 2195', $$ err, $ errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ ctx); If (! $ Fp) // exit ("Faile...

java - Writing to Files : Printwriter Converting Forward Slash to Backslash -

Why are doing this Printwriter? file file = new file ("/ files / kattextext"); Author = new printritter (file); Writer.write ("hello"); I get an error in the code above which says: java.io.FileNotFoundException: \ files \ KA.txt (the network path was Not found) This was not my specified path? Then how do I specify a file to write - usually create a new file and write it on? It also throws errors if KA.txt does not exist - I want to make it a new file and author. Thanks I ideally create a new file and author You can create just one file, PrintWriter author = new Print Writer ("name.txt", "UTF-8") ; Author.println ("text"); Where UTF-8 is file encoding. And write the file, remember that the file exists with the same name, then this override

c++ - Whose destructor is this one? -

नीचे दिए गए कोड में: #include & lt; स्ट्रिंग & gt; # शामिल करें & lt; iostream & gt; Struct एस {std :: string a; Int b; एस (const एस & amp;) = डिफ़ॉल्ट; एस (एस एंड amp;) = डिफ़ॉल्ट; & Amp; ऑपरेटर = (सेट एस & amp;) = डिफ़ॉल्ट; & Amp; ऑपरेटर = (एस एंड amp;) = डिफ़ॉल्ट; // यहां जरूरी नहीं है लेकिन इसे पूर्णता के लिए जोड़ा जाना चाहिए ~ एस () {std :: cout & lt; & lt; एक & lt; & lt; "" & Lt; & lt; बी एंड एलटी; & lt; std :: endl; }}; एस एफ (एस आर्ज) {एस s0 {}; एस एस 1 (एस 0); // s1 {s0}; पुस्तक में s1 = arg; वापसी s1; } Int main () {एस एस 3 {"उपकरण", 42}; च (S3); } मुझे निम्न आउटपुट मिलता है (मैंने अपनी युक्तियों के साथ आउटपुट टिप्पणी की थी): 42 // ??? 0 / s0 उपकरण को नष्ट कर दिया गया है 42 / / एआरजी उपकरण नष्ट कर दिया है 42 / / पर वापस लौटने के मूल्य एफ उपकरण नष्ट हो गया है 42 / s3 नष्ट हो जाता है जिसके विनाशक एक है जो outputs 42 ?? मैं इसे समझ नहीं सकता स्वचालित वैरिएबल घोषणा के रिवर्स ऑर्डर...

c# - Amazon Feed API - The file's header row is missing or invalid -

I am trying to submit a flat file filled with products (tab delimited) if I upload media Uploading this file with & amp; Inventory page upload is correct though, if I try to use the API I get an error: The file's header row is missing or invalid header row only uses Amazon And should not be modified or removed. To fix this error, then download the template again with vendor support and use that new copy, or insert the correct header row directly above the column headings in your existing file. This sample code, feeds API stream client library - C #. Submit Request Request = New Deposit (); request. Merchant = merchantId; request. Market placeIdlist = new irredist (); Request.MarketplaceIdList.Id = New list & lt; String & gt; (New string [] {marketplaceId}); Request.FeedContent = File.Open (@ "C: \ Amazon_Upload_20141104_10.txt", FileMode.Open, FileAccess.Read); Request.ContentMD5 = MarketplaceWebServiceClient.CalculateContentMD5 (request.FeedConte...

c++ - casting between two derived classes -

Is it appropriate to put between the points of the general ancestor? Does the compiler notice such a hierarchy and is it safe (call 1)? Or should the user be manually protected from the hierarchy manually (call 2)? Say that we have class A {}; Class B: A {}; Class C: A {Public: int SomeFunc () {return 3;}}; Int _tmain (int argc, _TCHAR * argv []) {b * b = (b *) ((a *) new c ()); // It is done manually, I believe it is safe ((C *) b) - & gt; Some finger (); // it's safe? This question has been refunded ((C *) ((A *) B)) - & gt; Some finger (); Edit: This code is consistent and scalable edit2: more comments added b * b = (b *) ((a *) new c ()); // It is done manually, I believe it is safe this no is safe. By changing the form of (t) xp , either static_cast or reinterpret_cast , speaking roughly. [Expr.cast] / 4: Conversions made by a const_cast (5.2.11), (5.2.9), a static_cast followed by const_cast , one const_cast , one rei...

Search Contact name from ABAddressBook using NSPredicate for iOS -

I am creating a custom phone book. In the search bar functionality, I need to find specific contacts using the text I entered. So what specific thing should I write that will filter the array using the addressbook array type ABrecord? There should be something like the name starts with "text" You can do something like this: NSArray * All People = CFBridgingRelease (ABAddressBookCopyArrayOfAllPeople (Address Book)); NSPredicate * predicate = [NSPredicate predicateWithBlock: ^ BOOL (ID person, NSDictionary * binding) {NSString * firstName = CFBridgingRelease (ABRecordCopyValue ((__ bridge ABRecordRef person, KABPersonFirstNameProperty)); If (first name & amp; amp; firstName rangeOfString: searchTerm option: NSCaseInsensitiveSearch] .post == 0) return TRUE; NSString * Last Name = CFBridgingRelease (ABRecordCopyValue ((__ bridge ABRecordRef person, KABPersonLastNameProperty)); If (Last Name & amp; amp; [Last Name Rangeoffstring: SearchEarth Options: NSCCINSiti...

regex - how do i extract the string 'myUIBean' from the string 'com.test.pkg1.myUIBean.getName' -

मैं स्ट्रिंग से ' myUIBean ' स्ट्रिंग कैसे निकालूं? ' com.test .pkg1.myUIBean.getName '। मेरे पास समान स्ट्रिंग्स का एक सेट है जिसमें com.test.pkg1.myUIBean1.getName com.test.pkg1.myUIBean2.getName com.test.pkg1.myUIBean3.getName मुझे आउटपुट होना चाहिए: myUIBean1 myUIBean2 myUIBean3 मैं पैटर्न का उपयोग कर रहा हूं और निकाले गए समूहों को प्रदर्शित कर रहा हूं, लेकिन यह अंतिम वाक्य में 'myUIBean' से पहले सभी पाठ का चयन कर रहा है। मैं उपयोग कर रहा हूँ पैटर्न है: (। *) "+" UIBean "+" (। *) धन्यवाद अग्रिम में। कोशिश करें: । * \। (MyUIBean। *) \ .. * मान लें कि आप जावा का उपयोग कर रहे हैं, ताकि आप निम्न का उपयोग कर सकें: पैटर्न पैटर्न = Pattern.compile ("। * \\। (MyUIBean। *) \\ .. * "); Matcher matcher = pattern.matcher ("com.test.pkg1.myUIBean1.getName"); If (matcher.find ()) {System.out.println (matcher.group (1)); }