reading

Better data stream reading in Haskell

I am trying to parse an input stream where the first line tells me how many lines of data there are. I'm ending up with the following code, and it works, but I think there is a better way. Is there? main = do numCases <- getLine proc $ read numCases proc :: Integer -> IO () proc numCases | numCases == 0 = return () ...

How can the Kindle be used as a source code reading tool?

I'm a programmer. I want to be a better programmer. I want to read more source code written by other people (especially open source projects). Also, I'd like to be able to have a on-hand searchable reference to all of that source code so that I can pull up reference to structures and snippets. Does anyone know of a way to use the Kin...

Programming books from cover to cover in one-shot?

Is it a good idea to just read the entire programming-related book, assuming within your grasp of 250-400 pp.? Or take it slow and go through it taking your time trying to understand absolutely everything. UPDATE 1: I am reading Beginning ASP.NET 4: in C# and VB and Programming in Objective-C 2.0 and I found that I learn a lot more if I...

reading excel data.

How to read Excel data having Number format ;;; ie hidden value in C# using spreadsheet gear. ...

SRP & "axis of change"?

I'm reading Bob Martin's principles of OOD, specifically the SRP text, and I understand the spirit of what it's saying pretty well, but I don't quite understand a particular phrasing, from page 2 of the link (page 150 of the book): I paraphrase: It is important to separate these two responsibilities into separate classes because each r...

An alternative to reading input from Java's System.in

I’m working on the UVa Online Judge problem set archive as a way to practice Java, and as a way to practice data structures and algorithms in general. They give an example input file to submit to the online judge to use as a starting point (it’s the solution to problem 100). Input from the standard input stream (java.lang.System.in) ...

Fastest file reading in C.

Right now I am using fread() to read a file, but in other language fread() is inefficient i'v been told. Is this the same in C? If so, how would faster file reading be done? ...

Is it safe to read global data from multiple threads?

The scenario is as follows: Create an instance of a class (std::map) and sore it as global variable. Spawn threads. Threads read and use the same global instance of the class (call methods, access members etc) All spawned threads quit Global class instance is destroyed No mutex used, no spawn thread modifies the global class instance...

Reading Text from Pdf

Hi, This is Srinvas, How to read the content of a uploaded pdf file in asp.net. I tried but i am unable getting the content of a Uploaded File. I stuck with this Problem. If you have any Source code, Please provide me or Please help me.. Thanks & Regards Srinivas K. ...

reading partially from sockets

I'm having a little test program that sends a lot of udp packets between client->server->client (ping/pong test). The packets are fixed size on each run(last run is max allowable size of udp packet) I'm filling the packets with random data except for the beginning of each packet that contains the packet number. So I'm only interested to ...

How can I read CPU temperature on an Embedded XP install from a C++/CLI app?

I've read of some WMI solutions which are able to read the temperature of the CPU. I've tried this and it doesn't appear to work for Windows XP Embedded running on an Intel Atom based board. Is there a library or some other solution out there which would work? ...

Grails HTML Code -- Further Reading?

So I've done some reading on grails, mainly on object and the relationships, etc, so I get how to create domain classes and controllers and how they work and everything, but the connection I haven't made yet is how you can take that and design a working HTML interface and useable website with that. Can anyone suggest some further reading...

Reading a text document character by character

I am reading a text file character by character using ifstream infile.get() in an infinite while loop. This sits inside an infinite while loop, and should break out of it once the end of file condition is reached. (EOF). The while loop itself sits within a function of type void. Here is the pseudo-code: void function (...) { while...

Code reading sources

I have heard a lot of people saying that to be a good programmer one needs to read a lot of good code. Can you help me find some good code in Java? Thanks. ...

C++, console Application, reading files from directory

I have a directory and I want to read all the text files in it using C++ and having windows OS also using console application I don't know the files' names or their number thanks in advance ...

Export/Import NSImage as ICO

Hi everyone, I would like to save and read an ICO file. It doesnt matter if its NSImage or NSBitmapImageRep or anything. It just needs to be done. How could this be accomplished? ...

Most versatile font for printing and screen?

I have to choose a font for a web application that produces a printable view of some text (long text, no colors, white background). Example here. Users will read this printable view in these possible ways: From pc\Ereader (after saving it in html) From pc\Ereader (after "printing" it in Pdf, mac users will natively do it) From pape...

UI design so users will actually *read* disclaimer screen/text?

Client insists that users see disclaimer/legal/iAccept screen/text on their way into the web application. Same Client already perceives users as not reading that sort of text when presented with it. How do you design/decorate/etc this sort of screen/text in a web application so that users will actually read the content? I'm hoping som...

Transfer all new e-mails to a database

I am using postfix for my linux mail server. The goal is to have any incoming mail dumped into a database with the headers and message information, then the e-mail being deleted from the mail server. Is there any way to make postfix post a message to a php file everytime a new e-mail comes in then delete the e-mail message? The only othe...

reading from stdin, while consuming no more memory than needed

Hi. I am trying to create a line-by-line filter in python. However, stdin.readlines() reads all lines in before starting to process, and python runs out of memory (MemoryError). How can I have just one line in memory at a time? The kind of code I have: for line in sys.stdin.readlines(): if( filter.apply( line ) ): print(...