Questions tagged [io]

In computing, input/output, or I/O, refers to the communication between an information processing system (such as a computer) and the outside world (possibly a display, an information storage system, or another information processing system).

Filter by
Sorted by
Tagged with
4
votes
1answer
72 views

Nisse Server: Part 3 Stream Layer

Getting close to a release of generic server. Nisse Server: Part 1 Helper Functions Nisse Server: Part 2 Socket Layer Here is the stream layer code. This basically provides a ...
9
votes
4answers
704 views

FileWriter supporting writing to multiple files

I got bored with opening and closing files whenever I need to write to one, so I wrote a FileWriter class that's used like this: ...
15
votes
2answers
1k views

File reader/writer (text)

Following-up on this post, I wanted to be able to use my FileWriter with a syntax reminiscent of .net's using blocks, which ...
12
votes
1answer
288 views

Easy Bit IO. Very simple interface works up to N == 64

After reading this question Easy bitset I/O. I wanted to see if there was a simpler way of doing it. This is how I would define a way of outputting ...
5
votes
2answers
2k views

Easy bitset I/O

I'm writing a program that makes heavy use of std::bitset's and occasionally needs to read/write these to file. std::bitset does ...
38
votes
5answers
4k views

Easier user input in C++

A more proper version of this utility can be found at the following link here: Giveth me thy easier user input in C++ - follow up. I've always been a little bothered by the fact, that in order to get ...
14
votes
1answer
100k views

Reading data from Excel sheet with ExcelDataReader

Objective: I want to import an Excel file, and read the rows of certain columns. For this, I use ExcelDataReader. I've implemented a low-level class called ...
11
votes
7answers
21k views

Reading Large Files in Java getting really slow

I am trying to read a large file ~200 MB (~300 million lines of text). I am using a relatively standard way of reading like: ...
22
votes
3answers
3k views

Parsing log files of HearthStone: The log reading API

I'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show ...
10
votes
5answers
360 views

Summing user input

A small project I recently started. The program must sum all the numbers the user input. You must first specify how many numbers there will be. Sumaster.c ...
5
votes
2answers
811 views

Abstraction for an IO device

I have a C++ class which acts as an abstraction for an IO device which is controlled through file descriptors. As I am very new to C++, I would be glad if you can give me devastating feedback on ...
10
votes
3answers
4k views

Writing .ppm images to a file

I am struggling with commenting and variable naming. My teacher says my comments need to be more explanatory and explicit. He says my variable names are also sometimes confusing. I was just wondering ...
8
votes
6answers
591 views

K&R 1-23 Remove all C comments

From K&R exercise 1-23, Write a program to remove all comments from a C program. Don't forget to handle quoted strings and character constants properly. C comments don't nest. My solution, ...
7
votes
2answers
1k views

TCP Tunnel in C

I'm completely aware that I'm not using NIO, but this is my first polished C project. All criticism is welcome, if I'm doing something wrong, I want to nip it in the bud before I'm used to it. ...
6
votes
2answers
321 views

A way to handle integer input

I'm working on simple code that is to read input where: The first line is a number of cases to consider. The next lines are integers separated by a space that will be tested lately. Possible input: ...
4
votes
1answer
76 views

A trivial command line utility for trimming whitespace from lines in C

I was practicing some C and decided to write this simple command line utility for stripping leading and trailing white-space characters. Note: see the next iteration at A trivial command line utility ...
4
votes
1answer
414 views

Giveth me thy easier user input in C++ - follow up

I've decided to take some of the many suggestions for improvement on my previous question, Easier user input in C++, and actually get it to work as expected. This time around, a few things are ...
3
votes
0answers
65 views

One interface for multiple CRUD resources

I asked about an abstraction layer for accessing files (link) a couple of days ago (I decided to not call it a follow-up anymore as there are too many changes). I tried to incorporate many of the ...
3
votes
2answers
3k views

Getting a hash string for a very large file

After reading about large files and memory problems, I'm suspecting that my code below may be inefficient because it reads the entire files into memory before applying the hash algorithm. Is there a ...
20
votes
3answers
1k views

“Welcome to Buzzway Subs!”

There were a few recent questions which had a challenge like this: The subway shop provides catering for meetings and other events. All sandwich platters are $40 each. Cookie platters are $20 ...
15
votes
2answers
874 views

K&R 1-21 write an “entab” program

From K&R exercise 1-21, Write a program entab that replaces strings of blanks by the minimum number of tabs and blanks to achieve the same spacing. Use the same tab stops as for detab. When ...
12
votes
1answer
1k views

fgets() Alternative

size_t readline_tostring(char * restrict dest, size_t size, FILE * restrict stream) fgets() is OK yet it has some short-...
10
votes
4answers
6k views

Trimming fgets(): strlen() or strtok()

After a successful fgets(buffer, ...), it is often desirable to trim a potential End-of-Line '\n'. Of the following 2 methods, ...
8
votes
4answers
1k views

getline substitute that will enforce 'n' as limit of characters read

Following from a discussion with others on StackOverflow concerning the issue with getline not limiting input and happily reallocating until enough space for a ...
8
votes
1answer
1k views

AT&T Assembly - Basic loop & write

The code loops to display "Hello, World!" ten times. I would like someone to criticize it. I know that's far from being good assembly but I only started learning it a few days ago and I would like to ...
6
votes
2answers
1k views

Very basic shell on microcontroller in C

Objective: A lightweight shell that runs on a microcontroller (MSP430) and parses incoming data into a command and additional parameters. Requirements: Support of quoting in ...
6
votes
2answers
186 views

Extensible Abstract Log Reader

My goal with the following code is to provide an extensible class that can be extended in order to read log files and transforms them into meaningful output. I'd like to have comments about the code ...
5
votes
3answers
3k views

Generating character permutations

I want to generate a 'dictionary' containing all 8 character permutations of upper-case letters such that the output file looks like: ...
5
votes
2answers
537 views

K&R 1-20 Converting tabs to spaces using idiomatic C

I'm learning C with K&R 2nd Ed. I just completed exercise 1-20 (which is the detab program). I was hoping to get some feedback on my work. I want to make ...
5
votes
1answer
145 views

K&R Exercise 1-21. Write a program `entab` that replaces strings of blanks with tabs

Intro I'm going through the K&R book (2nd edition, ANSI C ver.) and want to get the most from it: learn (outdated) C and practice problem-solving at the same time. I believe that the author's ...
5
votes
1answer
106 views

Enforcing correct input/output of integers

The problem: Some types, like cstdint aliases or, at least purely theoretically, even std::size_t, may be (but don’t have to be)...
5
votes
1answer
532 views

FizzBuzz from a file

This was found on CodeEval. Challenge: Write a program that prints out the final series of numbers where those divisible by X, Y and both are replaced by “F” for fizz, “B” for buzz and “FB” for fizz ...
5
votes
1answer
282 views

Reading the contents of an XPI file

I wrote this code to list contents of an XPI file and then read the contents in it. I was thinking of these areas of improvement: I put the zr.open in the ...
4
votes
1answer
715 views

Method to read the number of lines in a web page

Needing a way to read the number of lines on a web page for the purpose of a progress bar the following method is created: ...
4
votes
1answer
5k views

Read text file filled with numbers and tranfer to an array

This is my ProcessDataFileParallel.Java file. I'm taking numbers from a .txt file and putting it into an array in Java. While it works, I would like to improve the code and possibly change some ...
3
votes
2answers
110 views

K&R Exercise 1-13. Printing histogram of word lengths (horizontal variant)

I'm going through the K&R book (2nd edition, ANSI C ver.) and want to get the most from it. How does the following solution look to you? Note that, for the sake of exercise, I don't want to use ...
3
votes
1answer
85 views

A Java class for reading MaCH dosage files

A dosage file (used in computational genetics) is formatted like this: ...
3
votes
1answer
3k views

Simple XOR file encryption

In https://stackoverflow.com/a/39299060, I wrote the following program. ...
2
votes
1answer
759 views

Very basic shell on microcontroller in C - follow-up

This is a follow-up of: Very basic shell on microcontroller in C A few days back I've asked for a review on a simple shell parser in c. Based on the answers, I've restructured my code to use a table-...
2
votes
1answer
454 views

Non-blocking line-oriented input from several file descriptors

This is a follow-up to Extracting lines from a bytearray ; I got a pretty good answer to the narrow question I asked there, but was invited to show more of the code in case there was a simpler way to ...
2
votes
1answer
46 views

A Java class for reading MaCH dosage files v2.0

Version 2 of A Java class for reading MaCH dosage files ...
1
vote
1answer
46 views

Extracting lines from a bytearray

This class is part of a utility that reads lines from a set of nonblocking file descriptors, blocking only when there are no complete lines to emit. ...
0
votes
1answer
953 views

Reading from text files in C/C++ [closed]

I'm writing a program that has to check which are the two largest three digit numbers that are missing from a text file. I'm writing this in C++ and I'm trying to solve the mystery in a ...