Posts

iphone - NSXMLParser initWithContentsOfURL timeout -

How can I set a timeout when I am parsing a feed using initWithContentsOfURL? Sometimes our feeds return an empty response and then it will only try to parse the feed forever. I want to integrate 30 seconds, so look at UAL-ul-view and then try to feed and re-insert. NSURL * feedURL = [[NSURL alloc] initWithString: URL]; NSXMLPers * Parser = [[NSX Parser Allok] Init with content of URL: feed URL]; [Parser set deliaget: self]; [Parser's sethold process namespace: no]; [Parser setshall reportnamePassprint: no]; [Parsets setSoldRSOLVXACATTTS: No]; [Parser pars]; The first method: A delayed selector Perhaps the easiest way to do this is to use the method of NSBox. You can define some method parsingDidTimeout as such: - (zero) parsingditetimeout {if (self.parsingDidComplete == NO) {[self.parser abortParsing]; // Create your error and display it here // Try to reload and parse it again ...}} For this, you should assign a parser to an instance variable ( Self.parser )...

grails - groovy XmlSlurper not parse my xml file -

I have an XML, and I can not parse the file with xmlslurper Here is a copy of my XML file : & lt; Entrezgene-Set & gt; & Lt; Entrezgene & gt; & Lt; Entrezgene_summary & gt; This gene is the plasma glycoprotein of the unknown function of the encoded protein. Some immunoglobulin supergene family member shows the sequence similarity to the variable areas of protein. [Provided by RefSeq] & lt; / Entrezgene_summary & gt; & Lt; / Entrezgene & gt; & Lt; / Entrezgene set & gt; Just call me & lt; Entrezgene_summary & gt; to /eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi? " Def qs = [] qs & lt; & Lt; "DB = Gene" QS & LT; & Lt; "Id = 1" qs & lt; & Lt; "Retmode = xml" def url = new URL (base + qs.join ( "& amp;") def connection = url.openConnection () Diif result = [] if (connection.responseCode == 200) {def xml = Connection.content.t...

PHP MySQL fails whenever WHERE statement is present -

I am trying to do a simple query in a small SECL table, but when I insert the clause I suddenly added an invalid query error (a while (mysql_fetch_array) {} without work). The MYSQL console returns a 1064 (syntax) error, however, I checked the MySQL documentation and I'm using the appropriate syntax as much as possible. & lt ;? Php $ ind = rand (1,3); $ Bid = null; $ = Null sign; $ Afil = Null; $ Con = mysql_connect (localhost, root, ********); // Database mysql_select_db ("phone_site", $ con); // Select the table $ query = "SELECT * FROM quotes WHERE index = $ IND"; // Get a line for that index $ data = mysql_query ($ query); // Print Out Print ("& lt; p id = \" quote \ "& gt;". $ Data ['quote']. "& Lt; / p & gt;"); Print ("& lt; p id = \" ename \ "& gt;" $ data ['sign']. "& Lt; / p & gt;"); Print ("& lt; p id = \" afill \ ...

javascript - Should setting `checkbox.checked = false` not clear the HTML attribute too? -

यह मेरा HTML है: & lt; input id = "test" type = "चेकबॉक्स "चेक =" "& gt; यहां एक फायरबग अंश है: & gt; & gt; & gt; परीक्षण & lt; इनपुट आईडी = "परीक्षण" प्रकार = "चेकबॉक्स" चेक = "" & gt; & Gt; & gt; & gt; Test.checked = false झूठी & gt; & gt; & gt; परीक्षण & lt; इनपुट आईडी = "परीक्षण" प्रकार = "चेकबॉक्स" चेक = "" & gt; उम ... क्या मुझे कुछ याद आ रहा है, या क्या आखिरी पंक्ति निम्नलिखित नहीं पढ़ी चाहिए? & lt; इनपुट आईडी = "परीक्षण" प्रकार = "चेकबॉक्स" & gt; UI-wise, चेकबॉक्स वास्तव में अनचेक होता है जब मैं checked = false लाइन निष्पादित करता हूं। फिर भी, अगर कुछ वैध स्पष्टीकरण है यदि यह चेक = गलत मूल्य विशेषता का इनपुट प्रकार = "टेक्स्ट" और चेक किया गया या चयनित इनपुट प्रकार = "चेकबॉक्स" , रेडियो और विकल्प के गुणों के गुण फ़ील्ड के प्रारंभिक मान के...

c# - Get ID of the newly inserted record, using SqlDataAdapter -

बीजीआरएक्स.बीजीआरएक्सडीटाटेबल _बीआरएक्सडेटा = नया बीजीआरईएक्स.बीजीआरएक्सडीटाटेबल (); बीजीआरएक्स.बीजीआरएक्सआरओ बीजीआरएक्सआरओ = _बीआरएक्सडीटाटेबलन्यूबीजीआरएक्सआरओ (); BgRexRow.BGRes_TITLE = "abc"; BgRexRow.BGRes_VERSION = 123; _bRexDataTable.AddBGREXRow (bgRexRow); Int rewEffected = एडाप्टर। अद्यतन (_bRexDataTable); डेटाबेस में रिकॉर्ड सम्मिलित करने के लिए ऊपर का उपयोग करते हुए बीड करें, पूर्ण काम करता है। अब मुझे नये डाले गए रिकार्ड के आईडी (प्राथमिक कुंजी) की आवश्यकता है जो ऑटो उत्पन्न होता है, जो कि एडाप्टर। अपडेट (_bRexDataTable) से लौटाए जाने वाले प्रभावित पंक्तियों के बजाय; ऐसा लगता है कि मुझे SCOPE_IDENTITY () फ़ंक्शन की आवश्यकता है, लेकिन मुझे यकीन नहीं है कि इसे डिजाइनर में कहां शामिल करना है क्योंकि डिज़ाइनर वास्तविक प्रविष्टि क्वेरी में जोड़ा गया सिंटैक्स के साथ खुश नहीं है। यह sqlserver प्रबंधन कंसोल में ठीक है, हालांकि DECLARE @ROWI_D int सम्मिलित करें ..... ..... VALUES ("val1", "val2", .......................) SET ROW_ID = SCO...

Checking an array of data for similar elements in C -

मैंने एक "पता" संरचना बनाई है। प्रत्येक पते (xx.yy.zz.mm) में एक एक्सएक्स, य्, ज़्ज़ और मिमी तत्व होता है, जो सभी इन्सटी हैं। प्रत्येक पते में इसके साथ "नाम" तत्व भी होता है। मेरे पास "नेटवर्क" नामक 100 पते तक की एक सरणी है यहां नेटवर्क में कुछ तत्वों का एक उदाहरण है: 186.88.1.21 टायलर 186.88.9.11 बॉब 101.21.0.13 टॉम 111.11.3.89 चक 101.21.5.99 ल्यूक मुझे प्रत्येक पते की जांच करने की आवश्यकता है और देखें कि क्या समान स्थान से अन्य पते हैं। दो पते उसी स्थान से हैं यदि तत्व xx और yy समान हैं। यदि एक ही स्थान से 1 या अधिक पते हैं, तो मुझे इस जानकारी को आउटपुट करने की आवश्यकता है। नीचे ऐसा कुछ कोड है जिसे मैंने करने की कोशिश की है: char temp [1 1]; Int nameCount; के लिए (i = 0; i & lt; गिनती; i ++) {चार नाम [100] [10] = {}; Strcpy (temp, नेटवर्क [i] .name); अस्थायी [11] = '\ 0'; NameCount = 0; के लिए (जे = आई + 1; जम्मू & lt; count; j ++) {यदि (नेटवर्क [i] .xx == नेटवर्क [जे] .xx और amp; नेटवर्क [i] .yy == नेटवर्क [जे] .आई ) {S...

portability - MySql portable version -

Anyone know the portable version of mysql? I know xampp but it comes with PHP and Apache Does anybody know how to separate mysql? You can download MySQL Essentials to use the relative path instead of the version and full path my.ini file. You can then run the server directly without installing or using a Windows service. Download a MySQL .zip file ( .msi , though you receive .msi And extract 7 from the files using zip or orca). Extract files. At least you have bin and share directory (in fact, in bin , you can actually enter only mysqld.exe to run the server as the full min) Edit my.ini to change basedir and Datadir to some relative For example the path: basedir = ".." datadir = "/ MySQLdb" If you have existing Do not have a database, then create one: mysqld --bootstrap To run the server (you have Switch to switch-grant-tables to leave it until you set up your MySQL user): mysqld current low To a...