Search Results

Search found 58802 results on 2353 pages for 'system xml'.

Page 104/2353 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • Doubts in System call mechanism in linux

    - by bala1486
    We transit from ring3 to ring0 using 'int' or the new 'syscall/sysenter' instruction. Does that mean that the page tables and other stuffs that needs to be modified for the kernel is automatically done by the 'int' instruction or the interrupt handler for the 'int 0x80' will do the required stuff and jump to the respective system call. Also when returning from a system call, we again need to go to user space. For this we need to know the instruction address in the user space to continue the user application. Where is that address stored. Does the 'ret' instruction automatically changes the ring from ring3 to ring0 or where/how this ring changing mechanism takes place? Then, i read that changing from ring3 to ring0 is not as costly as changing from ring0 to ring3. Why is this so?? Thanks, Bala

    Read the article

  • Measuring execution time of a system call in C++

    - by jm1234567890
    I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does not seem to work for system calls. I imagine this is because the execution jumps out of the current process. clock_t begin=clock(); system(something); clock_t end=clock(); cout<<"Execution time: "<<diffclock(end,begin)<<" s."<<endl; Then double diffclock(clock_t clock1,clock_t clock2) { double diffticks=clock1-clock2; double diffms=(diffticks)/(CLOCKS_PER_SEC); return diffms; } However this always returns 0 seconds... Is there another method that will work? Also, this is in Linux. Thanks!

    Read the article

  • Call iconv from Ruby through system()

    - by Sebastian
    I have a problem with iconv tool. I try to call it from rake file in that way: Dir.glob("*.txt") do |file| system("iconv -f UTF-8 -t 'ASCII//TRANSLIT' #{ file } >> ascii_#{ file }") end But one file is converted partly (size of partialy converted: 10059092 bytes, before convertion: 10081854). Comparing this two files prove that not all content was writen to ASCII. When I call this command explicit from shell it works perfectly. Other smaller files are converted without problems. Is there any limitations on iconv or Ruby's system()?

    Read the article

  • What is the performance penalty of XML data type in SQL Server when compared to NVARCHAR(MAX)?

    - by Piotr Owsiak
    I have a DB that is going to keep log entries. One of the columns in the log table contains serialized (to XML) objects and a guy on my team proposed to go with XML data type rather than NVARCHAR(MAX). This table will have logs kept "forever" (archiving some very old entries may be considered in the future). I'm a little worried about the CPU overhead, but I'm even more worried that DB can grow faster (FoxyBOA from the referenced question got 70% bigger DB when using XML). I have read this question http://stackoverflow.com/questions/514827/microsoft-sql-server-2005-2008-xml-vs-text-varchar-data-type and it gave me some ideas but I am particulairly interrested in clarification on whether the DB size increases or decreases. Can you please share your insight/experiences in that matter. BTW. I don't currently have any need to depend on XML features within SQL Server (there's nearly zero advantage to me in the specific case). Ocasionally log entries will be extracted, but I prefer to handle the XML using .NET (either by writing a small client or using a function defined in a .NET assembly).

    Read the article

  • How to parse large xml files on google app engine?

    - by Alon Carmel
    Hey, I have fairly large xml file 1mb in size that i host on s3. I need to parse that xml file into my app engine datastore entirely. I have written a simple DOM parser that works fine locally but online it reaches the 30sec error and stops. I tried lowering the xml parsing by downloading the xml file into a BLOB at first before the parser then parse the xml file from blob. problem is that blobs are limited to 1mb. so it fails. I have multiple inserts to the datastore which cause it to fail on 30 sec. i saw somewhere that they recommend using the Mapper class and save some exception where the process stopped but as i am a python n00b i cant figure out how to implement it on a DOM parser or an SAX one (please provide an example?) on how to use it. i'm pretty much doing a bad thing right now and i parse the xml using php outside the app engine and push the data via HTTP post to the app engine using a proprietary API which works fine but is stupid and makes me maintain two codes. can you please help me out?

    Read the article

  • PHP exec() and system() functions always return false in IIS

    - by Loftx
    Hi there, I'm trying to use the PHP exec() or system() (or any other similar function) to run a batch file, but I can't seem to get these to return anything. The simplest example I've seen is this, which outputs nothing: <?php echo system('dir'); ?> The script is running on a windows XP machine on IIS with PHP installed and I've also tried it on my shared hosting account running windows 2003 server/IIS. Can anyone suggest what I need to do to get this working, or provide any commands I can use for troubleshooting? Cheers, Tom

    Read the article

  • XSLT question, how to transform xml when I have xslt file stored, but object in mem?

    - by JL
    I have a function that takes 2 parameters : 1 = XML file, 2 = XSLT file, then performs a transformation and returns the resulting HTML. Here is the function: /// <summary> /// Will apply an XSLT style to any XML file and return the rendered HTML. /// </summary> /// <param name="xmlFileName"> /// The file name of the XML document. /// </param> /// <param name="xslFileName"> /// The file name of the XSL document. /// </param> /// <returns> /// The rendered HTML. /// </returns> public string TransformXml(string xmlFileName, string xslFileName) { var xtr = new XmlTextReader(xmlFileName) { WhitespaceHandling = WhitespaceHandling.None }; var xd = new XmlDocument(); xd.Load(xtr); var xslt = new System.Xml.Xsl.XslCompiledTransform(); xslt.Load(xslFileName); var stm = new MemoryStream(); xslt.Transform(xd, null, stm); stm.Position = 1; var sr = new StreamReader(stm); xtr.Close(); return sr.ReadToEnd(); } I want to change the function not to accept a file name, but rather a strongly typed object de-serialized (now in the form of a variable). Is this possible? So keep the xslt coming from a file, but the xml input should be a the serialized xml of the object I pass, and I want to do this without file system IO.

    Read the article

  • Add namespace to XmlTextWriter using C#

    - by xml
    Hi, I have an serializeable class that his root is serizlized to XmlRootAttribute with namespace. I want to add additional namespace to this root elemt, how can i do it? adding XmlAttribute failed to compile. The code: [System.Xml.Serialization.XmlRootAttribute("Root", Namespace = "http://www.w3.org/2003/05/soap-envelope", IsNullable = false)] public class MyClass { [System.Xml.Serialization.XmlElement("...")] public ClassA A; [System.Xml.Serialization.XmlElement("..")] public ClassB b; } After the serialization i'm getting something like that: <Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2003/05/soap-envelope"> <ClassA/> <ClassB/> </Envelope> I want to add to the rood additioanl namespace, e.g. i want the xml to be: <Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" **xmlns:tns="anotherXml"** xmlns="http://www.w3.org/2003/05/soap-envelope"> <ClassA/> <ClassB/> </Envelope> Any idea?

    Read the article

  • How to detect pending system shutdown on Linux?

    - by Rajorshi
    Hi, I am working on an app where I need to detect system shutdown. However, I have not found any reliable way get a notification on this event. I know that on shutdown, my app will receive a SIGTERM signal followed by a SIGKILL. What I want to know is if there is someway to query if a SIGTERM is part of a shutdown sequence? Does any one know if there is a way to query that programmatically (C API)? As far as I know, the system does not provide any other method to query for an impending shutdowm. If it does, that would solve my problem as well. I have been trying out runlevels as well, but change in runlevels seem to be instantaneous and without any prior warnings.

    Read the article

  • Is there an application that can help someone create an XML document based on the Relax NG schema?

    - by meowsqueak
    I've spent a bit of time creating a Relax NG schema for use within our team to validate XML documents we use for exchanging information. The schema is not complicated, but it is reasonably large. I am wondering if there exists a tool that can read in such a Relax NG schema and assist a user in creating a corresponding instance document, using the schema as a template. Perhaps an application with a GUI that creates fields and drop-down selections for each part of the document? For example, the tool might create an outline XML document and prompt the user to select multiples of certain elements, fill in each field, perhaps with permitted values read directly from the schema. It might also show the user via visual feedback when their document is 'complete', or highlight validation problems as they come up. I could anticipate writing a custom GUI tool to create such an XML document, but I'd really like changes to the schema to be automatically reflected by the GUI - and I really wonder if this hasn't already been done. I know some editors can automatically validate an XML document against a schema as it's being written, but I would really like to get my users one step away from the XML so they don't have to worry about the details of the XML syntax.

    Read the article

  • Issuing native system commands in Scala

    - by Tony
    I want to issue a native system command from a Scala program, and perhaps trap the output. ("ls" comes to mind. There may be other ways to get directory information without issuing the command, but that's beside the point of my question.) It would correspond to os.system(...) in Python. I've looked in "Programming in Scala". I've looked in O'Reilly's "Programming Scala". I've Googled several combinations of terms. No luck yet. Can someone out there give me an example, or point me at a resource where I can find an example?

    Read the article

  • HOW TO understand the programmming of operation system..!!!

    - by piemesons
    Hello, I want to learn the operating system. How it works. I dont want to make my own operating system. I just want to learn how it works. As i can find out source code of any open source OS. But how to start. Like stating from the first elementary kernal(what ever it is). Some body suggested me try to implement linux from scratch.etc etc.Please guide me in a proper way. i want to know about the proper path to follow. I am ready to invest three four years just to understand the basics. I am having good fundamentals of c c++,php, Oops, compiler design

    Read the article

  • Killing a script launched in a Process via os.system()

    - by L.J.
    I have a python script which launches several processes. Each process basically just calls a shell script: from multiprocessing import Process import os import logging def thread_method(n = 4): global logger command = "~/Scripts/run.sh " + str(n) + " >> /var/log/mylog.log" if (debug): logger.debug(command) os.system(command) I launch several of these threads, which are meant to run in the background. I want to have a timeout on these threads, such that if it exceeds the timeout, they are killed: t = [] for x in range(10): try: t.append(Process(target=thread_method, args=(x,) ) ) t[-1].start() except Exception as e: logger.error("Error: unable to start thread") logger.error("Error message: " + str(e)) logger.info("Waiting up to 60 seconds to allow threads to finish") t[0].join(60) for n in range(len(t)): if t[n].is_alive(): logger.info(str(n) + " is still alive after 60 seconds, forcibly terminating") t[n].terminate() The problem is that calling terminate() on the process threads isn't killing the launched run.sh script - it continues running in the background until I either force kill it from the command line, or it finishes internally. Is there a way to have terminate also kill the subshell created by os.system()?

    Read the article

  • Why is IE8 on XP not properly reading from XML using JQuery?

    - by dking
    Given this XML in data.xml <?xml version="1.0" encoding="utf-8"?> <data> <bar>100</bar> </data> I want to display the content from the "bar" element using the following code in test.html <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> </head> <body> <script type="text/javascript"> $.get('data.xml', function(xml) { var foo = $(xml).find('bar').text(); document.write("<span>foo: [" + foo + "]</span>"); }); </script> </body> </html> The output in webkit based browsers: foo: [100] The output in IE8 on XP: foo: [] Why do webkit browsers read the element's content correctly while IE8 interprets it as an empty string?

    Read the article

  • What's so bad about building XML with string concatenation?

    - by wsanville
    In the thread What’s your favorite “programmer ignorance” pet peeve?, the following answer appears, with a large amount of upvotes: Programmers who build XML using string concatenation. My question is, why is building XML via string concatenation (such as a StringBuilder in C#) bad? I've done this several times in the past, as it's sometimes the quickest way for me to get from point A to point B when to comes to the data structures/objects I'm working with. So far, I have come up with a few reasons why this isn't the greatest approach, but is there something I'm overlooking? Why should this be avoided? Probably the biggest reason I can think of is you need to escape your strings manually, and most programmers will forget this. It will work great for them when they test it, but then "randomly" their apps will fail when someone throws an & symbol in their input somewhere. Ok, I'll buy this, but it's really easy to prevent the problem (SecurityElement.Escape to name one). When I do this, I usually omit the XML declaration (i.e. <?xml version="1.0"?>). Is this harmful? Performance penalties? If you stick with proper string concatenation (i.e. StringBuilder), is this anything to be concerned about? Presumably, a class like XmlWriter will also need to do a bit of string manipulation... There are more elegant ways of generating XML, such as using XmlSerializer to automatically serialize/deserialize your classes. Ok sure, I agree. C# has a ton of useful classes for this, but sometimes I don't want to make a class for something really quick, like writing out a log file or something. Is this just me being lazy? If I am doing something "real" this is my preferred approach for dealing w/ XML.

    Read the article

  • System.Net.WebClient Class in .Net CompactFramework 3.5 ?

    - by Leen15
    Hi at all! I need to comunicate with a Server that give me async answers (streamer connection). I find this: http://msdn.microsoft.com/en-en/library/ms144211%28v=VS.80%29.aspx that generate this event: http://msdn.microsoft.com/en-en/library/system.net.webclient.openreadcompleted%28v=VS.80%29.aspx I think this is what i need, but i don't have the WebClient class in my System.Net of CompactFramework 3.5. How can i do? Thanks. EDIT: I've done a more clear question: httpRequest, httpResponse, send GET through Stream and Receive the Result in C#

    Read the article

  • Ruby - Nokogiri - Parsing XML from memory and putting all same name node values into an array.

    - by r3nrut
    I have an XML I'm trying to parse from memory and get the status of each of my heart beat tests using Nokogiri. Here is the solution I have... xml = <a:HBeat> <a:ElapsedTime>3 ms</a:ElapsedTime> <a:Name>Service 1</a:Name> <a:Status>true</a:Status> </a:HBeat> <a:HBeat> <a:ElapsedTime>4 ms</a:ElapsedTime> <a:Name>Service 2</a:Name> <a:Status>true</a:Status> </a:HBeat> <a:HBeat> I have tried using both css and xpath to pull back the value for each Status and put it into an array. Code is below: doc = Nokogiri::XML.parse(xml) #service_state = doc.css("a:HBeat, a:Status", 'a' => 'http://schemas.datacontract.org/2004/07/OpenAPI.Entity').map {|node| node.children.text} service_state = doc.xpath("//*[@a:Status]", 'a' => 'http://schemas.datacontract.org/2004/07/OpenAPI.Entity').map(&:text) Both will return service_state = []. Any thoughts or recommendations? Also, consider that I have almost identical xml for another test and I used the following snippet of code which does exactly what I wanted but for some reason isn't working with the xml that contains namespaces. service_state = doc.css("HBeat Status").map(&:text) Thanks!

    Read the article

  • Scala XML API: Why allow NodeSeq as attribute values?

    - by Synesso
    It seems attribute values are of type Seq[Node]. scala> <a b="1"/>.attribute("b") res11: Option[Seq[scala.xml.Node]] = Some(1) This means you can assign XML as an attribute value. scala> <a b={<z><x/></z>}/>.attribute("b") res16: Option[Seq[scala.xml.Node]] = Some(<z><x></x></z>) scala> <a b={<z><x/></z>}/>.attribute("b").map(_ \ "x") res17: Option[scala.xml.NodeSeq] = Some(<x></x>) scala> new xml.PrettyPrinter(120, 2).format(<a b={<z><x/></z>}/>) res19: String = <a b="<z><x></x></z>"></a> This seems funky to me. I've never seen XML as attribute values in the real world. Why is it allowed? Why is an attribute value simply not of type String?

    Read the article

  • Change XML node element value in PHP and save file.

    - by Hannes
    <testimonials> <testimonial id="4c050652f0c3e"> <nimi>John</nimi> <email>[email protected]</email> <text>Some text</text> <active>1</active> </testimonial> <testimonial id="4c05085e1cd4f"> <name>ats</name> <email>[email protected]</email> <text>Great site!</text> <active>0</akctive> </testimonial> </testimonials> I have this XML strcuture and i need to find a testimonial with specific id and change its value and save file. I have a PHP script deleting specific testimonial according its ID: <?php $xmlFile = file_get_contents('test.xml'); $xml = new SimpleXMLElement($xmlFile); $kust_id = $_GET["id"]; foreach($xml->testimonial as $story) { if($story['id'] == $kust_id) { $dom=dom_import_simplexml($story); $dom->parentNode->removeChild($dom); $xml->asXML('test.xml'); header("Location: newfile.php"); } } ?>

    Read the article

  • pthreads recursively calling system command and segfault appears

    - by jess
    I have a code base where i am creating 8 threads and each thread just calls system command to display date in a continuous cycle, as shown below: void * system_thread(void *arg) { int cpu = (int)arg; printf("thread : start %d\n", cpu); for (;;) { // date ã³ãã³ãã®å®è¡ if (mode == 0) { system("date"); } else { f_hfp_nlc_Fsystem("date"); } } sleep(timerval); return NULL; } This application segfaults after running for 2-3 seconds, due to following 2 reasons: 1. read access, where the address is out of VM area 2. write acces, where it does not of write permission and its trying to modify some structure.

    Read the article

  • DotNet Get User Operating System (HTTP_USER_AGENT)

    - by rockinthesixstring
    I'm looking at building an exhaustive function that returns a friendly name for the Users Operating System. I think I have most of the Windows stuff down, but I'm not sure about Linux, OSX, and others. Does anyone know where I can find an exhaustive list of HTTP_USER_AGENT's 'Gets the users operating system Public Shared Function GetUserOS() As String Dim strAgent As String = HttpContext.Current.Request.ServerVariables("HTTP_USER_AGENT") 'Windows OS's If InStr(strAgent, "Windows NT 6.1") Then : Return "Windows 7" ElseIf InStr(strAgent, "Windows NT 6.0") Then : Return "Windows Vista" ElseIf InStr(strAgent, "Windows NT 5.2") Then : Return "Windows Server 2003" ElseIf InStr(strAgent, "Windows NT 5.1") Then : Return "Windows XP" ElseIf InStr(strAgent, "Windows NT 5.0") Then : Return "Windows 2000" ElseIf InStr(strAgent, "Windows 98") Then : Return "Windows 98" ElseIf InStr(strAgent, "Windows 95") Then : Return "Windows 95" 'Mac OS's ElseIf InStr(strAgent, "Mac OS X") Then : Return "Mac OS X" 'Linux OS's ElseIf InStr(strAgent, "Linux") Then : Return "Linux" Else : Return "Unknown" End If End Function 'GetUserOS

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >