A stream is a series of data elements (characters, bytes or complex packets) which can be accessed or made accessible in a serial fashion. Random access is not possible.

learn more… | top users | synonyms (1)

2
votes
2answers
65 views

Xml messages processing networkstream [closed]

I'm currently processing xml messages with C#. It is working But I'm not confident that my code is fast enough. There are 3 possible messages I can receive. When I receive one the message an event is ...
1
vote
1answer
45 views

ISO8583 encoding data fields

I just want to confirm that my ISO8583 format is correct. Example: For the data field 35, the length of the data is 36, so I put 36 before the 4842. Then all the data is inserted in a string (...
4
votes
1answer
50 views

Clojure word count

I'm fairly new to Clojure and looking to improve my use of the proper idioms, and make my code more readable. Here's the problem: Read from standard input and produce the count of each word to ...
5
votes
2answers
155 views

Counting words from standard input in Swift

I know Swift isn't exactly meant to be used to write your classic stdin to stdout scripts, and that Python, Ruby, Perl, bash, awk, and friends are much better in this area, but I'd still like to see ...
2
votes
1answer
84 views

Prepend data to stream in C#

I'm working on an XNA project that loads several resources that are packed into a single file. XNA can take a WAV file stream and turn that into a SoundEffect (seen below in "case ".wav""). Since ...
6
votes
1answer
383 views

C++ console program

I have been learning C++ programming. What you see here is all that I know how to do at this point. I look forward to learning more and I know there are better ways to accomplish a task such as ...
4
votes
1answer
35 views

OutputStream class for use with subprocess.Popen

I've recently been writing an application which does a lot of work with the output of commands. To call the commands I've been using the subprocess module, and originally, was using ...
3
votes
2answers
77 views

ConsumingRouter to consume based on condition

Started as to make a stream splitter to split stream based on condition, but finally found that I did ConsumingRouter, to consume based on condition and while have to provide consumers before using ...
5
votes
1answer
114 views

Java InfiniteStream with Queue

I did InfiniteStream by implementing Stream and Consumer. You can initiate the stream then ...
6
votes
3answers
62 views

begin and end overloads for istream_iterator

I wrote this pretty straight forward begin and end overloads for istream_iterator. Is this standards compliant? Any problems with usage? ...
8
votes
1answer
65 views

Stream manipulating indenter

I've always wanted to be able to steer stream indentation, so that I could write code like this: ...
12
votes
1answer
153 views

Mandelbrot Streams

A recent Mandelbrot question (Hi @EBrown) in C# inspired me to build my own using the Java 8 parallel streams to implement the parallelism that's useful for computing each pixel value. The intention ...
6
votes
1answer
79 views

Reading bits from a stream from least to most significant

For a recent project I was in need of excessive bit manipulation. Specifically, I had to write to or read from a variable number of bits up from the least significant bit towards the most significant ...
5
votes
3answers
238 views

Duplicate words in a text

Here is a simplified implementation to obtain the duplicate words in a text using lambda expressions. ...
4
votes
1answer
165 views

White box input stream for creating test scenarios

I need to test a specialized input stream class that takes input from a TCP/IP network connection. I particularly need to ensure that the blocking and availability behavior is correct. To help me ...
4
votes
1answer
78 views

Passing variable pointer as string to another function

With Delphi 7 I need to create a TStream variable and use/free it in another part of the code. Unfortunately it cannot be passed as "normal" parameter. I created a ...
5
votes
0answers
66 views

Processing files with streams

I'm using iojs. I have to read some files as a stream, process them with a same function and join them back into a stream. So, I decided to create my own solution with ...
0
votes
0answers
116 views

Custom capacity aware stream grouping

This is the code to make a capacity aware stream grouping for Storm topologies. Please review this. The summary method has to be called every ten minutes once. Future task - This method and fields ...
5
votes
1answer
147 views

A Stream wrapper that executes all writes asynchronously

I wanted to make a Stream that can wrap another stream and buffer all writes, to increase performance; comparable to the ...
8
votes
2answers
168 views

Parsing a simple tuple “(float,float,float)” in c++11 iostreams

I spotted this tutorial example at compactcpp: #5 – Parsing strings into “tokens” ...
4
votes
2answers
83 views

EncodingTranslatorStream - A stream object that translates character encoding

This class is a stream designed to perform character encoding translation. So you instantiate it, pass an input stream, and specify the input encoding and desired output encoding, so that when you ...
2
votes
2answers
66 views

MemoryQueueBufferStream

This stream class is designed to hold data only until it is read from the stream. As opposed to the MemoryStream which holds data until the stream is closed. It was written some time ago and was ...
6
votes
1answer
79 views

Merging word streams from files

A follow-on, rags-to-riches implementation of The most efficient way to merge two lists in Java The original requirements are to: Identify the distinct values from two input files, and output the ...
3
votes
3answers
1k views

Parsing multiple line records using Java 8 Streams

There was a suggestion in this StackOverflow question to move this question here. I added some more information and restructured the question a bit. I'm trying to parse the following file which ...
11
votes
2answers
158 views

Streaming int support

This recent question Print Consecutive numbers by comparing two parameters frustrated me because I could not find a convenient way in Java 8 to support the conditions that are required. I answered it ...
6
votes
4answers
121 views

Build a double from a stream of chars

Back in my calculator post, janos suggested I either find a better way to read a double from a StreamReader or else go the whole ...
6
votes
1answer
191 views

Determining winner and winning hand in poker (holdem)

I wrote couple classes that calculate winner, winning hand and winning hands rank (straight, flush, fullhouse etc.). I searched for something similar, but only found posts where five cards are used, ...
1
vote
1answer
137 views

Is there something wrong with my remove-duplicates implementation in Scheme?

For an assignment I handed in this code to remove duplicates from a stream. ...
6
votes
1answer
267 views

Automatic flowchart generator

I wanted to see graphically what my programme was doing so I wrote this automatic flowchart generator: ...
4
votes
1answer
365 views

Using swing and creating JPanel

I watched bunch of videos about swing and GUI in general and created my first component (correct me if it is not one). JPanel class: ...
11
votes
2answers
498 views

Printing removed items using lambdas and streams

I'm struggling to make my lambdas readable. I've seen various approaches. Below are three different examples that all do the same thing. Forgive the example: I suspect there are better actual ...
16
votes
1answer
105 views

Streaming Collatz

Challenge The recent question The 3n + 1 algorithm for a range inspired me to investigate a Java-8 dependent streaming mechanism for solving the programming challenge: For any two numbers ...
2
votes
2answers
116 views

Comparing triangles using Java 8 streams

I'm trying to get more familiar with Java 8 streams as they seem to be very powerful (and shorter), so I rewrote a method to use streams. However I'm not very satisfied with it and would like some ...
3
votes
1answer
69 views

SICP streams in C++

To brush up on my C++ chops, I've implemented a toy version of "SICP Streams", which behave like lists with one twist: the first element of the list is always available, the rest of the list is stored ...
10
votes
1answer
157 views

The answer to life, the universe, and Project Euler

I've never did a real Project Euler in my life, so I figured it was about to do one. And what better Project Euler to start with than Problem 42? Project description from Project Euler: By ...
2
votes
0answers
245 views

Read from DataInputStream (Socket connection)

I am interfacing with a network device and must read a response after I issue a command. Sometimes when I attempt to read, nothing has been returned from the terminal. This means I must wait, but not ...
12
votes
1answer
275 views

Project Euler #54 - Poker Streams

This challenge posted by Durron597 intrigued me, and inspired me to answer his question, and also to determine whether a more functional approach was available for poker hand ranking. The problem ...
12
votes
1answer
149 views

Trabb Pardo – Knuth - Algorithm in streams

Trabb Pardo and Knuth devised this simple procedure as a way to explore the functionality of various languages. The wiki page describes it as: The Trabb Pardo–Knuth algorithm is a program ...
8
votes
3answers
161 views

Sending duplicate to heaven with Java 8

Follow up to Duplicate like a weapon, arrays like heaven. @rolfl suggested in chat that I try to complete this challenge again in a Java 8 friendly way. I took the opportunity to also employ the ...
4
votes
3answers
761 views

Basic complex number class

As part of my C++ training, I wanted to create a basic complex number class for basic complex number calculations. The class should have the following: constructor (non explicit, for implicit ...
10
votes
1answer
394 views

Multiplying corresponding integers using streams

While reviewing Multiplying Lists, I got the impression that the problem was naturally suited to Java 8 streams. Unfortunately, since there is no convenient way to zip two streams, the solution ended ...
3
votes
3answers
2k views

Inserting persons in file into SQLite

I've just started working with SQLite in C# to test various features of an application. In building my first SQLite example I wanted to insert a large .csv into a table (Person) with two columns, A ...
2
votes
1answer
55 views

Correlating multiple related values in streams

Java 8 streams are my new golden hammer that I try to use as often as possible with often enormous gains in brevity and readability. Getting multiple return values, such as a maximum value and its ...
13
votes
2answers
578 views

Pi by Monte-Carlo

I was inspired by this SO post to investigate a good Java8 way to calculate Pi based on simulation. I used a similar task to learn about parallel programming on both CUDA, and Intel Xeon Phi ...
1
vote
2answers
924 views

Streamreader file.Readline properly closing the stream

Is this OK? (.Net 4.5) ...
7
votes
1answer
48 views

Output splitter to handle output

This class is helping to manipulate by output streams stderr, stdout, and file. Are there ...
1
vote
1answer
438 views

Seekable HTTP Range Stream

I read around for a while and surprisingly didn't find a fitting solution. I need a .NET Stream that internally issues HTTP Range requests when it seeks. There are huge files server-side for which I ...
1
vote
1answer
142 views

Save parameters in a “key: value” format

I have been playing with Java for around a year and I started writing this API for storing data in files. I wrote this method which will save the parameters in a "key: value" format in a file. The ...
6
votes
2answers
2k views

StreamIterable - create an iterable from a Java 8 Stream

This seems like an easy thing to mess up, so I'd be grateful if you could think of any edge-cases that I've missed. ...
5
votes
2answers
169 views

ostream wrapper for network logging device

I want to be able to write logging data out to a network device with the same ease as using std::cout. So I implemented an ...