Posts

javascript - How to Parse Facebook Graph API "hours" response -

I am working with the Facebook Graph API to get some data from the Facebook page but I do not know how the results "Hour" is something like this: {"wed_1_open": "17:00", "wed_1_close": "02:00", "thu_1_open": "17:00", "" 02: 00 "," 2_1 "," 1/2 "," 1/2 "", "1/2", "Free_1_close": "02:00", "Sat_1_pennon": "12:00", "sat_1_close": "02:00", "So I wonder how to parse this result to get some human-readable text like one from the info bar: / P> Wedding - Venus: 17:00 - 2:00 Saturday: 12:00 - 2:00 Sun: 12:00 - 20:00 ago Thanks! One way to do this is:. Note: Something I have just written in a few minutes. If you are working with large amounts of data, then you have to customize accordingly. var rawFbData = {"wed_1_open": "17:00 "," Wed_1_close ":" 0...

string - Extract the file name and its extension in C -

तो हमारे पास पथ स्ट्रिंग /home/user/music/thomas.mp3 है। फ़ाइल स्ट्रिंग निकालने का आसान तरीका कहां से है (एक्सटेंशन के बिना, "थॉमस") और इसका एक्सटेंशन ("एमपी 3") इस स्ट्रिंग से है? फ़ाइल नाम के लिए एक फ़ंक्शन, और विस्तार के लिए। और हमारे हाथों में केवल जीएनयू लिबसी। #include & lt; stdio.h & gt; # शामिल करें & lt; stdlib.h & gt; #include & lt; string.h & gt; #define MAX_FILENAME_SIZE 256 char * filename (char * str) {char * परिणाम; चार * अंतिम; अगर ((अंतिम = strrchr (str, '।'))! = नल) {if ((* last == '।') & Amp; amp; amp; & amp; (अंतिम == str)) वापसी str; Else {परिणाम = (चार *) मॉलोक (MAX_FILENAME_SIZE); Snprintf (परिणाम, आकार के परिणाम, "%। * S", (int) (अंतिम - str), str); वापसी परिणाम; }} और {वापसी str; }} Char * extname (char * str) {char * परिणाम; चार * अंतिम; अगर ((अंतिम = स्ट्र्रर्चर (str, '।'))! = नल) {if ((* last == '।') & Amp; amp; amp; (अंतिम == str)) "" वापस...

ios - How to implement a UINavigationController for modal presentation, not for popover, with an adaptive segue -

Using a universal storyboard and adaptive segues, how can a current popover apply segue, which will have a navigation bar A title and a close button) only when presented as a model on the iPhone, and when presented as a popover, will there be no navigation controller on the iPad? I believe the proper setup does not include a NAV controller in the storyboard, control-over the new view controller and select the current Popostar Segue. After this, one will need to create a navigation controller in the prepareForSegue and embed the destination controller in it, then add the title and button, but only if this framework is presented if this approach is correct, then the code How can I do this? Rdelmar is correct, you can type such a Destination View Controller in ' prepareForSegue Has already been set in. In iOS 7 and earlier you need to add that navigation controller to the storyboard and then you can navigate the navigation controller and its root view in separate seg...

javascript - Finding Specified Object Index in Array -

मेरे पास यह कोड है: var आइटम = [{मूल्य: 1, पाठ: "एक"}, {मूल्य: 2, पाठ: "दो"}, {मूल्य: 3, पाठ: "तीन"}]; Console.log (items.indexOf ({मान: 2, पाठ: "दो"})); और मुझे यह परिणाम कंसोल में मिलता है: -1 लेकिन मुझे ऑब्जेक्ट इंडेक्स प्राप्त करने की उम्मीद है , मुझे क्या करना चाहिए? जावास्क्रिप्ट का अर्रे.इंडएक्सऑफ़ इसकी तुलना नहीं करता है वस्तुओं के गुण यह बिल्कुल । और === ऑपरेटर उस ऑब्जेक्ट पर विचार नहीं करेगा जो आप दूसरी पंक्ति में बना रहे हैं, जिसकी आपको आइटम सरणी में मिलती है, बस क्योंकि वे दो हैं विभिन्न वस्तुओं शायद यह आपकी मदद करेगा: यदि ({"a": 1} === {"a": 1}) अलर्ट ("बराबर"); अन्य अलर्ट ("बराबर नहीं"); दो ऑब्जेक्ट बराबर नहीं हैं इसलिए केवल एकमात्र समाधान सरणी के सभी मदों पर पुनरावृत्त होना और प्रत्येक एक के गुणों को अपने नए ऑब्जेक्ट की तुलना करना होगा (टिमजेवी के उत्तर में प्रदान किया गया है)। फ़ायरफ़ॉक्स में केवल एक अंतर्निहित है जो यह बनाता है कार्य आसान है।

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects -

text after "itemprop =" text "> I have problems with the session I described as ASPState and I can configure my webconfig but show that error Are unable to sort session state. "Stetsrhwar 'and Skyuelsrhwar' mode, Aspianiti session will Serial state objects, and as a result do not allow non-Sirijlaij usable objects or Marshlbiyrfeed object. The same restriction applies if the custom series is made by the state store similarly serialized in 'custom' mode. [SerializationException: Type 'System.ServiceModel.ClientBase1 [[Tourism.Plugin.BiletBank.BiletBankSRV.I_Shopping, Tourism.Plugin.BiletBank, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null]] assembly' 'System.ServiceModel , version = 4.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089 'is not marked as serializable.] the exception is that class give System.ServiceModel.ClientBase`1 [[ Tourism.Plugin .BiletBank.BiletBankSRV.I_Shopping but I serializabl...

Why does print line is invalid syntax? [python] -

इस सवाल का पहले से ही एक उत्तर है: 10 उत्तर #! / Usr / bin / python def create_table (): mailingTable = open ("mailingTable.txt", "r") लाइनों = lineTable.readline () पंक्तियों में पंक्ति के लिए: प्रिंट लाइन mailingTable.close () यह कहते हैं कि प्रिंट लाइन अमान्य सिंटैक्स है। क्यूं कर? मैं पायथन 3.3.5 का उपयोग कर रहा हूँ पायथन 3.x में, आपको इस प्रकार लिखना होगा, क्योंकि अब यह एक फ़ंक्शन है: प्रिंट (पंक्ति) पायथन 2.x में यह को छोड़ना संभव था () , लेकिन यह अब मामला नहीं है।

javascript - How can I use an extended jQuery function? -

मैं एक jQuery प्लगइन का उपयोग करते हैं। मैं जो स्रोत शामिल करता हूं। तो, मेरा कोड सिर्फ $ ("# some_id") है। ColorPicker (some_options) , जैसा कि डॉक्टर में बताया गया है और यह ठीक काम करता है। लेकिन अब, मैं चाहता हूं स्रोत से केवल एक फ़ंक्शन का उपयोग करने के लिए, फ़ंक्शन हेक्सतोहएसबी () , लेकिन मुझे नहीं पता कि इसका उपयोग कैसे करना है क्योंकि मैं पूरी तरह से jQuery प्लग इन आयात नहीं समझता। मैंने कोशिश की $। ColorPicker.HexToHSB () लेकिन यह कुछ भी नहीं था। आप ऐसा नहीं करेंगे ऐसा करने में सक्षम हो क्योंकि इन फ़ंक्शन मॉड्यूल ColorPicker के लिए निजी हैं और आपके पास उन तक पहुंच नहीं है। इस तरह से आप काम करने के लिए प्लगइन को समझ सकते हैं: // ColorPicker सार्वजनिक विधियों के साथ एक ऑब्जेक्ट है, लेकिन इसमें निजी वैरिएबल और फ़ंक्शन के लिए कोई एक्सेस नहीं है। // फ़ंक्शन को रनटाइम पर लागू किया जा रहा है, ऑब्जेक्ट var को बदलना ColorPicker = function () {var निजी व्हीरीबल्स; Var निजीफंक्शन = समारोह () {...}; ... वापसी {publicFunction1 = function () {...}, publicFun...