Search Results

Search found 10693 results on 428 pages for 'reading'.

Page 19/428 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • C# Multithreading File IO (Reading)

    - by washtik
    We have a situation where our application needs to process a series of files and rather than perform this function synchronously, we would like to employ multi-threading to have the workload split amongst different threads. Each item of work is: 1. Open a file for read only 2. Process the data in the file 3. Write the processed data to a Dictionary We would like to perform each file's work on a new thread? Is this possible and should be we better to use the ThreadPool or spawn new threads keeping in mind that each item of "work" only takes 30ms however its possible that hundreds of files will need to be processed. Any ideas to make this more efficient is appreciated.

    Read the article

  • Reading multiple instances of a tag or element using XSLT

    - by shashank saket
    My RDF xml file is something like this.. <rdf:RDF> <rdf:Description rdf:about="........"> <j.0:property rdf:resource="....."/> <j.0:property rdf:resource=....."/> <j.0:property rdf:resource="........"/> </rdf:Description> </rdf:RDF> Now in my XSLT stylesheet I need to retrieve the values of all the j.0:property tags. I am using something like this: <xsl:apply-templates select="j.0:property"/> <xsl:template match="j.0:property"> <xsl:text><xsl:value-of select="/rdf:RDF/rdf:Description/j.0:propert /@rdf:resource"/></xsl:text> </xsl:template> But then it returns the same value 3 times. The value being the value of the first property encountered. Kindly help as to how I can get the value for each property.

    Read the article

  • Reading DBF with VFPOLEDB driver problem.

    - by John Sheares
    I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value. Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView. public DataSet GetDBFData(FileInfo fi, string tbl) { using (OleDbConnection conn = new OleDbConnection( @"Provider=VFPOLEDB.1;Data Source=" + fi.DirectoryName + ";")) { conn.Open(); string command = "SELECT * FROM " + tbl; OleDbDataAdapter da = new OleDbDataAdapter(command, conn); DataSet ds = new DataSet(); da.Fill(ds); return ds; } }

    Read the article

  • Reading XML outer tables

    - by Sathish
    I have an Xml file as shown below in which if i convert this to Dataset, the dataset will contain 3 tables with talble names Table Name1, Table Name2 and Table Name3 but i want to get this information without converting this to dataset Basically i want to get all the outer table names out of my excel. Please help me with the piece of code <Main Table> <Table Name1> <Something> <Something> <Something> <Something> </Table Name1> <Table Name2> <Something> <Something> <Something> <Something> </Table Name2> <Table Name3> <Something> <Something> <Something> </Table Name3> </Main Table>

    Read the article

  • Reading from compressed lucene index

    - by Akhil
    I created a lucene index and compressed the index directory with bz2 or zip. I donot want to uncompress it. Is there any API call that can read the index from this zipped directory and thus allow searching and other functionalities. That is, can lucence IndexReader read the index from a compressed file. I saw that Lucnene IndexReader does not support "Reader" to open the index, otherwise I would have created a Reader class that uncompresses the file and streams the uncompressed version. Any alternatives to this are welcome. Thanks, Akhil

    Read the article

  • Reading a certificate signing request with c#

    - by Jorge
    Hello, I want to read the contents of a csr in c#, however I haven't found any way to do it in c#. What I've found was the namespace System.Security.Cryptography.X509Certificates, but it only handles existing certificates, not certificate requests:/ Can anyone give me an hint about it? Thanks in advance. Jorge

    Read the article

  • When is calculating or variable-reading faster?

    - by Andreas Hornig
    hi, to be honest, I don't really know what the "small green men" in my cpu and compiler do, so I sometimes would like to know :). Currently I would like to know what's faster, so that I can design my code in a more efficient way. So for example I want to calclate something at different points in my sourcecode, when will it be faster to calculate it once and store it in a variable that's read and used for the next points it's needed and when is it faster to calculate it everytime? I think it's depending on how "complex" and "long" the calculation is and how fast then cache is, where variables are stored, but I don't have any clue what's faster :). Thanks for any reply to my tiny but important question! Andreas PS: perhaps it's important to know that I code in JAVA, but it's more a genral question.

    Read the article

  • Reading Local Group Policy / Active Directory Settings

    - by Shinobi
    I'm writing a C# program that will enforce password complexity in accordance with the Windows Group Policy setting "Password must meet complexity requirements". Specifically, if that policy is set to Enabled either on the local machine (if it's not part of a domain) or by the Domain Security Policy (for domain members), then my software needs to enforce a complex password for its own internal security. The issue is that I can't figure out how to read that GPO setting. Google searches have indicated that I can read GPO settings with one of these two APIs: the System.DirectoryServices library in .NET Framework, and Windows Management Instrumentation (WMI), but I haven't had any success so far. Any insights would be helpful.

    Read the article

  • Problems reading RSS feed with jQuery.get()

    - by bbeckford
    Hi there, I've been pulling my hair out trying to use jQuery.get() to pull in my dynamically generated RSS feed and I'm having nothing but issues, is my RSS feed the wrong format? If so can I convert it to the correct format using javascript? Here's my feed: http://dev.chriscurddesign.co.uk/burns/p/rc_rss.php?rcf_id=0 Here's my code: function get_rss_feed() { $(".content").empty(); $.get("http://dev.chriscurddesign.co.uk/burns/p/rc_rss.php?rcf_id=0", function(d) { var i = 0; $(d).find('item').each(function() { var $item = $(this); var title = $item.find('title').text(); var link = $item.find('link').text(); var location = $item.find('location').text(); var pubDate = $item.find('pubDate').text(); var html = '<div class="entry"><a href="' + link + '" target="_blank">' + title + '</a></div>'; $('.content').append(html); i++; }); }); }; Any input would be greatly appreciated!! Thanks

    Read the article

  • reading a BYTE as a DWORD in Masm

    - by Help I'm in college
    Hi, once again I'm doing MASM programming. I'm trying to write a procedure using the Irvine32 library where the user enters a string which is put into an array of BYTEs with ReadString. Then it loops over that arrray and determines if each character is a number. However, when I try cmp [buffer + ecx], 30h MASM complains about comparing two things that are not the same size. Is there anyway I could read the ASCII code in each BYTE in the array as a DWORD (or otherwise extract the ASCII value in each BYTE)?

    Read the article

  • Reading from serial port with Boost Asio?

    - by trikri
    Hi! I'm going to check for incoming messages (data packages) on the serial port, using Boost Asio. Each message will start with a header that is one byte long, and will specify which type of the message has been sent. Each different type of message has an own length. The function I'm about to write should check for new incoming messages continually, and when it finds one it should read it, and then some other function should parse it. I thought that the code might look something like this: void check_for_incoming_messages() { boost::asio::streambuf response; boost::system::error_code error; std::string s1, s2; if (boost::asio::read(port, response, boost::asio::transfer_at_least(0), error)) { s1 = streambuf_to_string(response); int msg_code = s1[0]; if (msg_code < 0 || msg_code >= NUM_MESSAGES) { // Handle error, invalid message header } if (boost::asio::read(port, response, boost::asio::transfer_at_least(message_lengths[msg_code]-s1.length()), error)) { s2 = streambuf_to_string(response); // Handle the content of s1 and s2 } else if (error != boost::asio::error::eof) { throw boost::system::system_error(error); } } else if (error != boost::asio::error::eof) { throw boost::system::system_error(error); } } Is boost::asio::streambuf is the right thing to use? And how do I extract the data from it so I can parse the message? I also want to know if I need to have a separate thread which only calls this function, so that it get called more often? Isn't there a risk for loosing data in between two calls to the function otherwise, because so much data comes in that it can't be stored in the serial ports memory? I'm using Qt as a widget toolkit and I don't really know how long time it needs to process all it's events.

    Read the article

  • Cross domain cookie reading/setting cross browsers

    - by Rac123
    I know there are already a few threads available here on this subject but I want others' opinion on this. There are two ways to set/read the cross domain cookies: Creating IFrame on A.com pointing to a page on B.com which creates the cookie and pass that information by creating another IFrame on B.com side pointing to A.com, either using window.name or in location.href.hash A.com page makes a XHR/JSONP call to B.com web service/page that has the following headers and it also sets up the cookie and returns the value. AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"") As we don't have postMessage available across all the browsers, I believe we have to go with one of the cases mentioned above. My question is which is a better way (cleaner) and why to implement for cross browser. Using any other JS framework is out of scope of this discussion. If there's another better way, please mention here! Thank you for your intelligent input in advance! :)

    Read the article

  • Reading a document's content from the gdata API?

    - by user246114
    Hi, I'm using the java library to access the gdata api. I just want to be able to print the contents of a document. I setup my project to list all the docs in my feed, now that I have a document listing, I want to print its contents: for (DocumentListEntry entry : feed.getEntries()) { // Ok, how do we print the doc's contents now? entry.getContents(); } It looks like we're supposed to get the URL from the entry, then read the contents at the URL ourselves. I found a post stating that this is how we get that URL: MediaContent content = (MediaContent)entry.getContent(); String url = content.getUri(); but when I try to read from it, I get an html response saying 'this content has moved'. I read that this is because we have to authenticate our http-read method, but I'm not sure how to do that. Is there really no built-in way to do this? Thanks

    Read the article

  • Inherited varibles are not reading correctly when using bitwise comparisons

    - by Shawn B
    Hey, I have a few classes set up for a game, with XMapObject as the base, and XEntity, XEnviron, and XItem inheriting it. MapObjects have a number of flags, one of them being MAPOBJECT_SOLID. My problem is, that XEntity is the only class that correctly detects MAPOBJECT_SOLID. Both Items are Environs are always considered solid by the game, regardless of the flag's state. What is important, is that Environs and Item should almost never be solid. Here are the relevent code samples: XMapObject: class XMapObject : public XObject { public: Uint8 MapObjectType,Location[2],MapObjectFlags; XMapObject *NextMapObject,*PrevMapObject; XMapObject(); void CreateMapObject(Uint8 MapObjectType); void SpawnMapObject(Uint8 MapObjectLocation[2]); void RemoveMapObject(); void DeleteMapObject(); void MapObjectSetLocation(Uint8 Y,Uint8 X); void MapObjectMapLink(); void MapObjectMapUnlink(); }; XEntity: class XEntity : public XMapObject { public: Uint8 Health,EntityFlags; float Speed,Time; XEntity *NextEntity,*PrevEntity; XItem *IventoryList; XEntity(); void CreateEntity(Uint8 EntityType,Uint8 EntityLocation[2]); void DeleteEntity(); void EntityLink(); void EntityUnlink(); Uint8 MoveEntity(Uint8 YOffset,Uint8 XOffset); }; XEnviron: class XEnviron : public XMapObject { public: Uint8 Effect,TimeOut; void CreateEnviron(Uint8 Type,Uint8 Y,Uint8 X,Uint8 TimeOut); }; XItem: class XItem : public XMapObject { public: void CreateItem(Uint8 Type,Uint8 Y,Uint8 X); }; And lastly, the entity move code. Only entities are capable of moving themselves. Uint8 XEntity::MoveEntity(Uint8 YOffset,Uint8 XOffset) { Uint8 NewY = Location[0] + YOffset, NewX = Location[1] + XOffset; if((NewY >= 0 && NewY < MAPY) && (NewX >= 0 && NewX < MAPX)) { XTile *Tile = GetTile(NewY,NewX); if(Tile->MapList != NULL) { XMapObject *MapObject = Tile->MapList; while(MapObject != NULL) { if(MapObject->MapObjectFlags & MAPOBJECT_SOLID) { printf("solid\n"); return 0; } MapObject = MapObject->NextMapObject; } } if(Tile->Flags & TILE_SOLID && EntityFlags & ENTITY_CLIPPING) { return 0; } this->MapObjectSetLocation(NewY,NewX); return 1; } return 0; } What is wierd, is that the bitwise operator always returns true when the MapObject is an Environ or an Item, but it works correctly for Entities. For debug I am using the printf "Solid", and also a printf containing the value of the flag for both Environs and Items. Any help is greatly appreciated, as this is a major bug for the small game I am working on.

    Read the article

  • Problem reading hexadecimal buffer from C socket

    - by Olaseni
    I'm using the SDL_net sockets API to create a server and client. I can easily read a string buffer, but when I try to send hexadecimal data, recv gets the length, but I cannot seem to be a able to read the buffer contents. IPaddress ip; TCPsocket server,client; int bufSize = 1024; char message[bufSize]; int len; server = SDLNet_TCP_Open(&ip); client = SDLNet_TCP_Accept(server); len = SDLNet_TCP_Recv(client,message,bufSize); Here's a snippet. the buffer length "len" is set (i.e. message length) but I can't get to the data contents in the message buffer. Some sample bind_transmitter PDU data was sent by a random client to the server at that port. I can't read the PDU (SMPP).

    Read the article

  • GZipStream not reading the whole file

    - by Ed
    I have some code that downloads gzipped files, and decompresses them. The problem is, I can't get it to decompress the whole file, it only reads the first 4096 bytes and then about 500 more. Byte[] buffer = new Byte[4096]; int count = 0; FileStream fileInput = new FileStream("input.gzip", FileMode.Open, FileAccess.Read, FileShare.Read); FileStream fileOutput = new FileStream("output.dat", FileMode.Create, FileAccess.Write, FileShare.None); GZipStream gzipStream = new GZipStream(fileInput, CompressionMode.Decompress, true); // Read from gzip steam while ((count = gzipStream.Read(buffer, 0, buffer.Length)) > 0) { // Write to output file fileOutput.Write(buffer, 0, count); } // Close the streams ... I've checked the downloaded file; it's 13MB when compressed, and contains one XML file. I've manually decompressed the XML file, and the content is all there. But when I do it with this code, it only outputs the very beginning of the XML file. Anyone have any ideas why this might be happening?

    Read the article

  • FileNotFoundException when reading .xml file to parse

    - by thechiman
    I'm writing a program in Java where I read in data from an XML file and parse it. The file is imported into a folder named "Resources" in the src directory of my project. I'm using Eclipse. When I run the program, I get the following error: java.io.FileNotFoundException: /Users/thechiman/Dropbox/introcs/PSU SOC Crawler/resources/majors_xml_db.xml (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at java.io.FileInputStream.<init>(FileInputStream.java:66) ... The relevant code is here: private void parseXML() { //Get a factory DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { //Use factory to get a new DocumentBuilder DocumentBuilder db = dbf.newDocumentBuilder(); //Parse the XML file, get DOM representation dom = db.parse("resources/majors_xml_db.xml"); } catch(ParserConfigurationException pce) { pce.printStackTrace(); } catch(SAXException se) { se.printStackTrace(); } catch(IOException ioe) { ioe.printStackTrace(); } } I do not understand why I'm getting the FileNotFoundException when the file is there. Thanks for the help.

    Read the article

  • Reading Foxpro database date field using PHP

    - by Bill Yang
    I've wrote a PHP script to export a Foxpro database to other formats by using ADODB (http://phplens.com/lens/adodb) library to access Foxpro OLE DB provider. Everything worked fine except the date fields are mangled and become like these: 11/17-/2-00 3/4/-20-08 By comparing to actual data I can guess that it is probably in the format of MM/DD/YYYY or m/d/YYYY. How can I properly export the date field?

    Read the article

  • Problem while reading the File in a eclipse Plugin application

    - by Abhishek Choudhary
    I 've developed an eclipse plugin and in that I have a java file trying to read directories and then populate result accordingly. When I try to run the file from eclipse itself through RunJava application , it gives me proper result but as soon as I try to run the same through Eclipse Application, it is throwing NullPointerException because unable to find the directory. I tried the following ways- Suppose , I have a package as - Package - com.test.abhishek.file.java.TestWork.java Directories - com.test.abhishek.file.java.Dir1 com.test.abhishek.file.java.Dir2 Now in TestWork.java- InputStream is = LGHelpContentView.class.getResourceAsStream("/"+dirName);** The above line is getting failed. How should I keep my directory and where so that it will run as an eclipse plug-in as well.

    Read the article

  • Delphi: Alternative to using Assign/ReadLn for text file reading

    - by Ian Boyd
    i want to process a text file line by line. In the olden days i loaded the file into a StringList: slFile := TStringList.Create(); slFile.LoadFromFile(filename); for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; Problem with that is once the file gets to be a few hundred megabytes, i have to allocate a huge chunk of memory; when really i only need enough memory to hold one line at a time. (Plus, you can't really indicate progress when you the system is locked up loading the file in step 1). The i tried using the native, and recommended, file I/O routines provided by Delphi: var f: TextFile; begin Assign(filename, f); while ReadLn(f, oneLine) do begin //process the line end; Problem withAssign is that there is no option to read the file without locking (i.e. fmShareDenyNone). The former stringlist example doesn't support no-lock either, unless you change it to LoadFromStream: slFile := TStringList.Create; stream := TFileStream.Create(filename, fmOpenRead or fmShareDenyNone); slFile.LoadFromStream(stream); stream.Free; for i := 0 to slFile.Count-1 do begin oneLine := slFile.Strings[i]; //process the line end; So now even though i've gained no locks being held, i'm back to loading the entire file into memory. Is there some alternative to Assign/ReadLn, where i can read a file line-by-line, without taking a sharing lock? i'd rather not get directly into Win32 CreateFile/ReadFile, and having to deal with allocating buffers and detecting CR, LF, CRLF's. i thought about memory mapped files, but there's the difficulty if the entire file doesn't fit (map) into virtual memory, and having to maps views (pieces) of the file at a time. Starts to get ugly. i just want Assign with fmShareDenyNone!

    Read the article

  • Reading value at an address

    - by user146780
    I'm trying to make a program that reads the value at a certain address. I have this: int _tmain(int argc, _TCHAR* argv[]) { int *address; address = (int*)0x00000021; cout << *address; return 0; } But this gives a read violation error. What am I doing wrong? Thanks

    Read the article

  • Reading xml within xml as String in flex/AS3

    - by duder
    I'm getting XML input that looks like this <?xml version="1.0" encoding="utf-8"?> <data1>this is data 1</data1> <data2>this is data 2</data2> <data3> <3a>this is data 3a</3a> <3b>this is data 3b</3b> <3c> <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"> <p direction="ltr" > <span>some text</span> <span>some additional text</span> </p> <p direction="ltr"> <span>some text</span> <span>some additional text</span> </p> </TextFlow> </3c> </data3> I can read <data1> with event.result.data1 which outputs a string this is data1 But when I do the same thing to event.result.data3.3c, it prints object [object] so I guess it's trying to dig deeper into the tree. But I need the actual string text (not xml tree) starting from and including <TextFlow></TextFlow> to be stored and printed as a string. Any idea what's the syntax for this? The string I'm looking for would look like this: <TextFlow xmlns="http://ns.adobe.com/textLayout/2008"> <p direction="ltr" > <span>some text</span> <span>some additional text</span> </p> <p direction="ltr"> <span>some text</span> <span>some additional text</span> </p> </TextFlow>

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >