{"id":6384,"date":"2014-04-17T01:14:07","date_gmt":"2014-04-17T01:14:07","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/xmlnode-jsnode-asyncrelated-issues-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:49:29","modified_gmt":"2022-08-30T15:49:29","slug":"xmlnode-jsnode-asyncrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/17\/xmlnode-jsnode-asyncrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"xml,node.js,node-asyncRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/599366b4f9ea182dd32e92325cc40ec2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMercfh<br \/>\nprogramming-practices xml<br \/>\nI understand the purpose of XML, but I always hear people complain about how BAD it is? I don&#8217;t really understand whats so bad about it? I usually hear the terms &#8220;bloated&#8221; and &#8220;slow&#8221; tossed around.But I guess as programmers, what do you mainly use it for? And do you really consider it &#8220;bad&#8221;&#8230;.because if it is, an awful lot of people use it for transporting of data&#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5bdb495c960b3384649e2a7e49c39cb9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPolyGeo<br \/>\narcgis-desktop xml file-geodatabase<br \/>\ni tried purging a file geodatabase and copying values from an xml file via the load xml document The file has over 400,000 records but only 98000 records copy.I keep getting loading xml recordset document failed. Fatal error parsing xml.Line 2369184, char= 0. Invalid byte &#8216;A&#8217; at position 1 of a 1 byte sequence.I tried looking at the mxd table and reviewing the last row added and checking the xml file to remove the row information directly after to see if it would skip this one. It doesn&#8217;t. It r<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/Ct2i5.png?s=32&amp;g=1\" \/><br \/>\nQueenvictoria<br \/>\nfeeds xml xpath namespaces<br \/>\nI am using Feeds and Feeds XPath Parser.I have an XML source like this.&lt;xml&gt;&lt;records&gt;&lt;record&gt;&lt;EAC-CPF xmlns:eac=&#8221;http:\/\/jefferson.village.virginia.edu\/eac&#8221; xmlns:edit=&#8221;http:\/\/nla.gov.au\/nla.party&#8221; xml:id=&#8221;_cb2bf3c2-b54c-42c3-a890-048c06549e45#10&#8243; xsi:schemaLocation=&#8221;urn:isbn:1-931666-33-4 http:\/\/eac.staatsbibliothek-berlin.de\/schema\/cpf.xsd&#8221;&gt;&lt;cpfDescription&gt;&lt;identity&gt;&#8230;&lt;\/identity&gt;&lt;\/cpfDescription&gt;&lt;\/EAC-CPF&gt;&lt;\/record&gt;&lt;\/records&gt; &lt;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/BueoL.jpg?s=32&amp;g=1\" \/><br \/>\nMuhammed Refaat<br \/>\njava xml parsing xml-parsing fatal-error<br \/>\nI&#8217;m have XML data in the shape of String and i want to convert it to XML document in order to make some process in it, and i&#8217;m using the following method to make that:private Document convert(String xml) throws ParserConfigurationException,SAXException, IOException {\/\/ convert String into InputStreamInputStream is = new ByteArrayInputStream(xml.getBytes());\/\/ convert InputStream to DocumentdomFactory = DocumentBuilderFactory.newInstance();domFactory.setNamespaceAware(true);builder = domFactory.n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/05f075124ea05c61b9bae20e87b7ceb1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrkhff<br \/>\nphp xml curl rss<br \/>\nI&#8217;m trying to include an RSS feed on my website. The following code works locally but causes a fatal error on the live site:&lt;?php \/\/ Initialise the cURL resource handle: $ch = curl_init(&#8220;http:\/\/www.blogs.stopjunkmail.org.uk\/diary\/index.php?\/feeds\/index.rss2&#8221;); \/\/ Set connection options: curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); \/\/ Execute connection, wait for response, and close: $data = curl_exec($ch); curl_close($ch); \/\/ Parse the data: $doc = new<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a2d818d801ce38a33807f68fdd92043a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBoltClock<br \/>\nphp xml<br \/>\nI don&#8217;t know why I&#8217;m getting this error. I have libxml ver 2.6.22. I&#8217;ve done more searching than anyone cares for. Please help.Fatal error: Call to undefined method XMLReader::readInnerXML()<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f05406f30ec268c2a23f940e5c96d5b2?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser555<br \/>\nphp xml ubuntu<br \/>\nI&#8217;ve searched on the Internet about this error. Somebody told me that my computer is missing lib xml for php. But I don&#8217;t know how to install it on Ubuntu 12.04 TLS.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/ChzYU.jpg?s=32&amp;g=1\" \/><br \/>\ncassie_vjc<br \/>\nandroid xml logcat<br \/>\nMy Bluetooth application&#8217;s can already auto request to enable bluetooth but when I did some functionality on my option menu the application will crash right after the bluetooth was turned on.These were the messages found in the LogCat:12-21 15:20:08.531: D\/BluetoothCommandService(1203): start 12-21 15:20:08.531: D\/BluetoothCommandService(1203): setState() 0 -&gt; 1 12-21 15:20:08.581: W\/dalvikvm(1203): threadid=1: thread exiting with uncaught exception (group=0x40028870) 12-21 15:20:08.851: E\/An<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/954e2482079fcfe67dfbdddc30d43d93?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njasonh<br \/>\njava xml jaxp<br \/>\nI&#8217;ve built a document using JAXP like this:DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.newDocument(); Element rootElement = document.createElement(&#8220;Root&#8221;);for (MyObject o : myCollection) {Element entry = document.createElement(&#8220;Entry&#8221;);Element entryItem = document.createElement(&#8220;EntryItem&#8221;);entryItem.appendChild(document.createTextNode(o.getProperty()));entry.appendChild(entryItem);root<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f7964a2f116b5355c1a10775929a77e0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nguillaume<br \/>\njava android xml<br \/>\nI want to use a AsynTask to parse XML data. So in the Activity i&#8217;ve : static List&lt;String&gt; citations = null;static void setCitations(List&lt;String&gt; data) {citations = data;}\/** Called when the activity is first created. *\/@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);new data().execute();And in the data class i&#8217;ve : class data extends AsyncTask&lt;Void, Void, List&lt;String&gt;&gt; {private XMLReader saxReader;private SimpleContentHandler s<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/18e42b0ddc143340cfb072987f45ca50?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPeter Mortensen<br \/>\narchitecture ruby-on-rails node.js rewrite<br \/>\nPlease tell me if:Node.js will make our site faster! Node.js will consume fewer server resources, we can save money! Node.js will make us more productive! Node.js means we can share client and server side JavaScript code.To clarify, we&#8217;re rewriting a frontend server, which will talk to our existing Ruby on Rails application as an API. Meanwhile, we&#8217;ll refactor our Ruby on Rails application into services.More details on the existing architecture:Memcached for HTML partials caching Redis for sessi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/afbff7ebac0401613e9eecb65d5dcf6b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDavid<br \/>\nmapnik windows node.js<br \/>\nI have been spending the last few days trying to get node-mapnik running but with no success.Initially inspired by Wilhelm Berg&#8217;s demo (https:\/\/www.youtube.com\/watch?v=GlTaRpg3CbQ) which renders pure vector maps using node-mapnik I was interested in getting this running on a Windows Server.I have worked through all of the StackExchange issues on these topics including Wilhelm&#8217;s checklist for getting this working on Windows 7 x64 but I am at a dead end and my knowledge is really limited in being<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/46679faeb6780ecb1ea57527fdc66eb3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBrandon Wamboldt<br \/>\njavascript node.js<br \/>\nI&#8217;m looking for some general feedback about the layout and structure of my code. Basically just any feedback, as I&#8217;m not super happy about this code, but I&#8217;m not sure how to improve it further.&#8217;use strict&#8217;;\/* jshint node: true *\/var fs = require(&#8216;fs&#8217;); var os = require(&#8216;os&#8217;); var nodemailer = require(&#8216;nodemailer&#8217;); var rimraf = require(&#8216;rimraf&#8217;); var config = require(&#8216;..\/config&#8217;); var dropbox = require(&#8216;..\/lib\/dropbox-sync&#8217;); var mysql = require(&#8216;..\/lib\/mysql-back<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/U1wme.jpg?s=32&amp;g=1\" \/><br \/>\nshaunthomas999<br \/>\njava node.js ubuntu meteor npm<br \/>\nI am using &#8216;node-excel-api&#8217; npm package inside my Meteor application. It has dependency on &#8216;java&#8217; npm package. I am getting the following error on startup of Meteor server. A fatal error has been detected by the Java Runtime Environment:Internal Error (threadLocalStorage.cpp:56), pid=3880, tid=3074959104 guarantee(get_thread() == thread) failed: must be the same thread, quicklyJRE version: (7.0_45-b18) (build ) Java VM: Java HotSpot(TM) Server VM (24.45-b08 mixed mode, sharing linux-x86 ) Faile<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/932d3fbb93a7cc8bc8ee1bd74de8929a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSean<br \/>\njavascript node.js gruntjs livereload<br \/>\nPC Specs: Windows 7 Enterprise x64I&#8217;m running grunt.js on a project and recently started receiving an error when attempting to run &#8216;grunt watch&#8217;.Grunt worked fine yesterday but today I started seeing:Running &#8220;watch&#8221; task Waiting&#8230;Fatal error: listen EACCESI read another question here: Cloud 9 and Grunt.jsthat lead me to remove &#8216;options: {livereload: true}&#8217; from Gruntfile.jsrunning watch again works as intended. Is there a way to reconfigure grunt or livereload to get livereload working with G<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0f7a8038e608d4db2a0557507f0a5e85?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nkisna<br \/>\nnode.js gruntjs<br \/>\nHi for responsive images i downloaded project from https:\/\/github.com\/andismith\/grunt-responsive-imagesi installed all those things what they have mentioned&#8230;whenever i say grunt it saying fallowing error:Running &#8220;jshint:all&#8221; (jshint) task&gt;&gt; 3 files lint free.Running &#8220;clean:tests&#8221; (clean) taskCleaning &#8220;tmp&#8221;&#8230;OKRunning &#8220;responsive_images:default_options&#8221; (responsive_images) taskFatal error: spawn ENOENTwhy i am getting this error pla tellme&#8230;Thnk you.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/kXGIv.png?s=32&amp;g=1\" \/><br \/>\numerk44<br \/>\nnode.js git<br \/>\nI got this error.stderr: fatal: Not a git repository: &#8216;C:\/Users\/DELL\/SparkleShare\/test4&#8217;When i run app.js file from command line using node command.Here is config.js file where repository is added.exports.sessionSecret = &#8216;JustSomeRandomString&#8217;;exports.folders = [{ type: &#8216;git&#8217;, name: &#8216;Public GIT folder&#8217;, path: &#8216;C:\/Users\/DELL\/SparkleShare\/test4&#8217;, pub: true } ];exports.listen = {port: 3000,host: null };exports.https = {enabled: false,key: &#8216;\/path\/to\/private.key&#8217;,cert: &#8216;\/path\/to\/cert.crt&#8217; };exports.b<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6f8f57b6ef0f6b2c2760483855f57b2b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nsobering<br \/>\nnode.js ubuntu knockout.js gruntjs npm<br \/>\nRunning a totally fresh instance of Ubuntu 13.10 x64 on DigitalOcean. Every time I try and build Knockout.js using npm\/grunt I get the following error:Running &#8220;clean&#8221; taskRunning &#8220;checktrailingspaces:main&#8221; (checktrailingspaces) taskRunning &#8220;build:debug&#8221; (build) taskRunning &#8220;build:min&#8221; (build) task Compiling&#8230;Fatal error: spawn ENOENTThe strange part is, the Fatal error is seemingly random. It is always one of these three:Fatal error: spawn ENOENT Fatal error: spawn EPIPE Fatal error: spawn ECON<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/106e7cc9c254b1ca112c80190a535d15?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ncathulhu<br \/>\nnode.js cmd npm brackets adobe-brackets<br \/>\nI want to create window installer but facing some problem from last 4 days on exectuion of common.js facing this error.What i analyzed: child = child_process.spawn(cmd, args, opts); children.push(child); ..is not executing properly. Can someone help me?Regards<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a3479b51d25dbd419e1b75390ac355bc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\norustammanapov<br \/>\nnode.js gruntjs grunt-contrib-watch<br \/>\ni should probably point out that i&#8217;m inexperienced user first, and my issue is that the &#8216;hostname&#8217; property can&#8217;t have any values assigned except for an empty string(&#8221;), &#8216;0.0.0.0&#8217; and &#8216;localhost&#8217;. I getting: Fatal error: getaddrinfo ENOTFOUND. What am i doing wrong?If get it right, i can change the adress that i&#8217;m usually typing in the address bar, so instead &#8216;localhost&#8217; i could have typed &#8216;example.com&#8217; or something like that. As i mentioned above i&#8217;ve assigned it different values but only thre<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f9072ae53c549431cf41eefbd436575d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlemulot<br \/>\nnode.js error-handling express waterfall node-async<br \/>\nI don&#8217;t see why expressjs don&#8217;t handle error when it&#8217;s throw in async.waterfallvar express = require(&#8216;express&#8217;) , app = express.createServer() , async = require(&#8216;async&#8217;);app.use(express.errorHandler({dumpExceptions: true,showStack: true }));app.get(&#8216;\/error&#8217;, function(req, res){throw Error(&#8216;Aie&#8217;); });app.get(&#8216;\/asyncerror&#8217;, function(req, res){var that = this;async.waterfall([function(next){console.log(&#8216;1&#8217;);next(&#8220;42&#8221;, &#8220;2&#8221;);},function(arg, next) {console.log(arg);res.json(&#8216;ok&#8217;);}], function(err){con<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ef481672aea2e99def679b781127062c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTolga E<br \/>\njavascript json node.js node-async<br \/>\nI basically need to make about 3 calls to get the data for a json object.. It basically JSON array of JSON object which have some attributes, one of which is an array of other values selected using a second query, then that one also has an array inside which is selected with another db call.I tried using asyn.concatSeries so that I can dig down into the bottom call and put together all the information I collected for one root json object but that&#8217;s creating a lot of unexpected behaviour..Exampl<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b0f914780b79358ef988a7ba6208746b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhippietrail<br \/>\njavascript node.js async.js node-async<br \/>\nHere I&#8217;m trying to make an array of functions with arguments to Async.js.The array consists of instances of RunRequest that are supposed to be set inside the loop in MakeRequest, right before I try pass the function array to Async.So the request in request[i] is fine when I pass it to RunRequest, but inside RunRequest function its undefined?\/\/ Process Requests function RunRequest(db, collection, request, requestHandler, callback) {console.log(&#8216;this happening?&#8217;)\/\/ Connect to the databasedb.open(f<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/98a2a8a3bdc203ab221d3f5534d0b03f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMunim<br \/>\nxml node.js node-async<br \/>\nI have to process a large XML file (around 25 mb in size), and organize the data into documents to import into MongoDB. The issue is, there are around 5-6 types of elements in the xml document, each with around 10k rows. After fetching one xml node of type a, I have to fetch it&#8217;s corresponding elements of types b,c,d, etc.What I am trying to do in node:Fetch all the rows of type a. For each row, using xpath, find its corresponding related rows, and create the document. Insert document in mongo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b0f914780b79358ef988a7ba6208746b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhippietrail<br \/>\njavascript node.js loops async.js node-async<br \/>\nThe popular node.js module async includes functions for collections and control flow which, with versions of some which can be operate in parallel or in series.But among them I cannot find a way to construct a loop which operates in series.I&#8217;m trying to do the same as this pseudocode:forever {l = getline();if (l === undefined) {break;} else {doStuff(l);} }If I wanted all the calls to getLine() to be called in parallel I could use async.whilst. If I wanted to iterate over an array rather than mak<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b0f914780b79358ef988a7ba6208746b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nhippietrail<br \/>\nnode.js async.js node-async<br \/>\nI&#8217;m working with the parallel function in Async.js and for some reason the final call back is not getting executed and I do not see an error happening anywhere. I&#8217;m dynamically creating an array of functions that are passed to the parallel call as such: \/\/ &#8216;theFiles&#8217; is an array of files I&#8217;m working with in a code-generator style type of scenario var callItems = []; theFiles.forEach(function(currentFile) {var genFileFunc = generateFileFunc(destDir + &#8220;\/&#8221; + currentFile, packageName, appName);callI<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mercfh programming-practices xml I understand the purpose of XML, but I always hear people complain about how BAD it is? I don&#8217;t really understand whats so bad about it? I usually hear the terms &#8220;bloated&#8221; and &#8220;slow&#8221; tossed around.But I guess as programmers, what do you mainly use it for? And do you really consider [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,1],"tags":[],"class_list":["post-6384","post","type-post","status-publish","format-standard","hentry","category-php-memcached","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6384","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6384"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6384\/revisions"}],"predecessor-version":[{"id":9005,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6384\/revisions\/9005"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}