read

socket behavior on read

the client writes 5 bytes to the socket after every 1 second. the server continuously reads from the socket. the buffer at the server end is 10 bytes long. so the function looks like this read(fd, buf, 10); the server reads 5 bytes everytime. now the client writes 5 bytes continuously. the server is the same. the server reads 10 byt...

Reading and writing to console in Java

What is the most efficient class to use to read from and write to console in Java? ...

API's to extract 7z files in .net

Is there any API available, that can be used in .net that can read/extract 7z files ? ...

How do I create and read an xml file with jquery

I know there is alot of information to do this in the internet, but I got very confused. I want to create an xml file and send it with Ajax to the server. I will need to reseve and xml file back. This is an example of the XML file I will need to create. <?xml version="1.0" encoding="UTF-8"?> <data> <item>dkfjgn</item> <item>sd...

Importing a file using the Java FileChooser

Hi I'm having trouble using the Java JFileChooser and was wondering if anyone could help me out. It's probably something really simple but I just cant spot whats wrong. The JFileChooser window opens fine when I click my import button and I can navigate to any field but I just cant read them into my JTextFields. Heres my JFileChooser m...

Go - How to read/write to file?

I've been trying to learn Go / Golang on my own, but I've been stumped on trying read and write to ordinary files. I can get as far as: inFile,_ := os.Open(INFILE,0,0); but actually getting the content of the file doesn't make sense, since the read function takes a []byte as a parameter?? func (file *File) Read(b []byte) (n int, err E...

File read by interrupt in java

Hi, I am using a text file to store the serial port output. And now I want to put the contents of the file to an textArea in java. I have created a dedicated thread for file read operation. I need the thread to sleep when there is no data to read and thread should wake up automatically once data available for read in the file. In the th...

Flash : How to read data from shape/graphics object.

Hallo, I am wondering if it is possible to get the data that is stored in a shape/graphics object in flash using actionscript 3? In my project I would like to be able to draw a shape and then read all the points in that shape into my script. The reason for that is that I need go generate lines from those points that I later can use to ...

How to read a file line-by-line in C?

Okay, I'm a beginner when it comes to C, so bear with me. Here's the problem: I have a text file with up to 100 IP addresses, 1 per line. I need to read each address, as a string, into an array called "list". First, I'm assuming that "list" will need to be a two-dimensional char array. Each IP address is 11 characters in length, 12 if y...

Read skype message archive

I would like to read my skype message archive outside of the Skype app. And be able to export it in some sort (other than copy-paste it from my messages) as far i can figure skype only provides 30days or archives. Any one out there using an app for archiving / exporting Skype messages ? Best regards, Mike S. ...

Python: Selecting to read the first line only

After reading in a file how would tell python to read the first line only? ...

How do i put stars into `read`?

Hello, what do i need to do for code in Bash, if i want to put stars, or even just that you cant see anything, when the user types something in using read. What do i need to do to edit read, so it can have like stars or so. ...

Empty or "flush" a file descriptor without read()?

(Note: This is not a question of how to flush a write(). This is the other end of it, so to speak.) Is it possible to empty a file descriptor that has data to be read in it without having to read() it? You might not be interested in the data, and reading it all would therefore waste space and cycles you might have better uses for. If ...

Django return large file

I am trying to find the best way (most efficient way) to return large files from Django back to an http client. receive http get request read large file from disk return the content of that file I don't want to read the file then post the response using HttpResponse as the file content is first stored in RAM if I am correct. How can ...

Prolog Read Skips Lines ?

Hello, Im trying to read a file in gprolog, but I have a small problem, it seems to read a line, then skip one, then read the next one, etc... Heres my code : readFichierEnt([],Fichier_Ent) :- read(end_of_file). readFichierEnt(ExampleList,Fichier_Ent) :- read(X), write(X), readFichierEnt(ExampleList,Fichier_Ent). If I provided train...

Is a file available to be opened?

Short version: I think I'm asking for a file too soon, but it's pretending like it's ready. Am I missing something? Slightly longer version: I am writing files to disk. Before I do so, I have the user add some meta data, including the new file name. Once the user is done, the screen goes away and the program writes the file to disk. The...

To read pdf in asp.net

I want to read pdf file and i want to store it's detail in my database. But i could not read pdf file & store it in sql database in asp.net using c#. So, please give me a solution if anyone knows... Very very thanx in advance ...

C# and IStream.Read

Hi All, I'm trying to use System.Runtime.InteropServices.ComTypes.IStream from C#, but I'm having some trouble. According to MSDN, the C# definition looks like this: void Read( byte[] pv, int cb, IntPtr pcbRead ) Basically, I can read data from the stream, but the above "pcbRead" value is always "0" (even though the byte...

php read start from zero number case

Hi All, May you can help me... many years ago my friend gave me php script code presented below, now i want to change it can read numbering start from zero existing just possible read 1:1, 10:200 etc.. but i want to make also possible read from 01:01, 0000002:0120 etc... function is_valid_number($sesuatu) { if(preg_match("/^([0-9]+)$...

Read numbers from a text file in C#

This is something that should be very simple. I just want to read numbers and words from a text file that consists of tokens separated by white space. How do you do this in C#? For example, in C++, the following code would work to read an integer, float, and word. I don't want to have to use a regex or write any special parsing code. if...