read

How to read continous HTTP streaming data in Python?

Hi How to read binary streams from a HTTP streamer server in python. I did a search and someone said urllib2 can do the job but had blocking issues. Someone suggested Twisted framework. My questions are: If it's just a streaming client reads data on background, can I ignore the blocking issues caused by urllib2? What will happen if u...

Recommend codebase to read and hone Python skills

Possible Duplicates: A good open source Python project to read code? How to learn Python: Good Example Code? I've been reading through Coders at Work and there is a repeated theme: hackers tend to read a lot of other's code and learn from it. I program in Python, there are plenty of open source code in it. Which codebase you...

C# - Save ListView contents as XML (With multicolumns) and read on Form_Load

My application has a ListView control that has data added to it across several columns and rows. When the form is closed (calling the Form_Closing event), the contents are saved to an XML file. Then, at the following run time, the XML document is read and its contents are displayed in the ListView control. For some reason, it only loa...

How can I get the last changed directory in Perl?

Apache version 2.2.11 (Unix) Architecture x86_64 Operating system Linux Kernel version 2.6.18-164.el5 Ok, here is what I have working. However, I may not be using File::Util for anything else in the rest of the script. My directory names are 8 digits starting at 10000000 . I was comparing the highest found number with stat last create...

Why does this FileStream only return zeroes?

I've got a file (test.txt) which contains "1234567". However when I try to read it on C# using FileStream.Read, I get only 0s (seven zeroes in this case). Could anyone tell me why? I'm really lost here. Edit: Problem solved, wrong comparision operator. However now it's returning "49505152535455" Edit 2: Done. For the record, I had to o...

Large file handling - Read algorithm breaks - C#

So I've got an algorithm that reads from a (very large, ~155+ MB) binary file, parses it according to a spec and writes out the necessary info (to a CSV, flat text). It works flawlessly for the first 15.5 million lines of output, which produces a CSV file of ~0.99-1.03 GB. This gets through hardly over 20% of the binary file. After this ...

default root folder for an eclipse project

I am attempting to read a file as follows: File imgLoc = new File("Player.gif"); BufferedImage image = null; try{ image = ImageIO.read(imgLoc); } catch(Exception ex) { System.out.println("Image read error"); System.exit(1); } return image; I have a file named "Player.gif" as shown in imgLoc, but I do not know where to pu...

Processing huge text files

Problem: I've a huge raw text file (assume of 3gig), I need to go through each word in the file and find out that a word appears how many times in the file. My Proposed Solution: Split the huge file into multiple files and each splitted file will have words in a sorted manner. For example, all the words starting with "a" will be stored ...

Explanation of stack overflow when using read on a small file and a questionable workaround

I hope the question explained my problem. I would also be grateful if the workaround that "works" is explained. The traditional way of reading a file (that i know of) int fd; char buffer[MAX]; while(read(fd,buffer,MAX)>0) { buffer[MAX]='\0'; write(sockfd,buffer,MAX); memset(buffer,NULL,MAX); } was causing ...

Reading Excel file (.xls) in Java

I want to read text from excel file in J2SE using NetBeans. I found an article here about using Apache POI and JExcelApi, but I'd prefer not depending on external packages. if possible, using only Java built-in packages. This almost worked, but it gives me an exception error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data ...

InputMissMatchException

I want to read data about MMORPG characters from a .txt file and then filter on experience (minimum experience). But I'm getting this exception, which I know the meaning of but I really don't understand what I'm doing wrong. this my code: I'm not good at java, I'm a beginner actually. Can someone please explain this to me. Probably I'm ...

Checking a file for a certain string in Java.

I'm trying to have my application read through a text file and look for a string. If the string does not exist, it makes it using println. The only problem I'm having is that it doesn't seem to read the text file. What I have so far is: PrintWriter itemwriter = new PrintWriter(new FileOutputStream(items)); FileInputStream fstream = new ...

Read in external links in PHP

I know how to do this in Ruby, but I want to do this in PHP. Grab a page and be able to parse stuff out of it. ...

Java libraries for reading meta data from .img, .osc and .mccd files

I need to read meta data from .img, .osc and .mccd files. Can you anyone recommend any libraries or provide any pointers as to how I would go about doing this. Eventually I need to put that meta-data into an XML file so it can be harvested by a repository. ...

java read file from network device

can someone help me to find a tutorial or sample java code for reading file from a any machine which is same network ...

Java quick sort, reading from a user input file into any array (to be sorted)

What's up y'all, I am trying to write some code in Java that will read in the numbers from a file (one # on each line of .txt file) put them into an array, and then run quick sort on the array. Eclipse is showing some red that I am having trouble with. My errors are marked with comments, and what the error is, if anyone can help me get ...

What is the difference between read and pread in unix?

What is the difference between the functions read() and pread() in unix? When choosing between them, what points should I take into consideration? I googled for the difference between them but without results. ...

script to read input from textbox and output response if input is found or not

I need a script that can read input from a textbox on a webpage and output yes or no (or other words) if the input was found in a .txt file For example, if I have the file of colors located on my website, each separated by ", " and the user puts in "red" and clicks submit, I'd like the next page to say "Yes red is a color". If they in...

How to read/write nodes and child nodes from xml file in c# maybe using xpath?

Hello, Maybe somebody could help me. I need a two methods. The first should open a xml file and get all nodes with the given parameter ie.: XML file (file.xml): <Menu id="1" Name="myMenu"> <MenuItem Header="Header 1" Name="header1" /> <MenuItem Header="Header 2" Name="header2"> <MenuItem Header="subHeader 2.1" Name="header2_...

IOWriteBytesPersec is actually total bytes?

The documentation for the Windows WMI counter Win32_PerfRawData_PerfProc_Process.IOWriteBytesPersec says it's number of bytes per second, but it behaves like a total. For example, the same data is viewable in task manager as "I/O Write Bytes" but the value only ever seems to go up, never down. The same goes for read byte...