Questions tagged [stream]

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.

Filter by
Sorted by
Tagged with
3 votes
1 answer
301 views

Implementation of java.util.stream.Stream (and friends) that reads lines from the internet without requiring you to manage the resources

This streams lines of information over the internet using BufferedReader::lines. However, what makes this special (and thus, extraordinarily complicated imo) is ...
davidalayachew's user avatar
4 votes
1 answer
99 views

Video transcoding using ffmpeg

I am transcoding video to different quality using ffmpeg using subprocess in Python. I want to make my transcoding faster. I tried multi-threading but it didn't help. Hardware acceleration is not ...
Rai Shahnawaz's user avatar
2 votes
2 answers
99 views

Find all line numbers of prefix duplicates with streams

All line indices of lines from a text that begin with the same line prefix should be found. The prefixes and the corresponding line numbers should be returned. Streams and lambdas should be used as ...
Tobias Grothe's user avatar
5 votes
2 answers
143 views

Print the three most occurring chars in Java using streams

The three characters that occurs most in a given string should be printed by using streams/lambdas (functional programming). The order of characters that occur equally often should be preserved. My ...
Tobias Grothe's user avatar
1 vote
0 answers
84 views

Import large Excel files directly from XML streams into an SQLite database

I've got some pretty large Excel files with nearly 1M rows that are almost impossible to open and work with in Excel anymore that I'm migrating into a database. Desipte this these files will stick ...
t3chb0t's user avatar
  • 44.3k
1 vote
0 answers
1k views

Streaming Parquet file in chunks for write operation

I am taking beginner steps into DE and was tinkering with writing an ingestion script which does the following tasks: Reads data from a source (in this case a remote parquet file) Writes it to local ...
av abhishiek's user avatar
7 votes
2 answers
477 views

Copy file with text replacement

I am currently learning C++. I coded a tiny program for school and I wonder if there could be issues (like bugs or security issues) with it. Any ways to make it have weird behaviours would be very ...
BobDeTunis's user avatar
2 votes
1 answer
106 views

Logger that can be redirected to switch off output

I am evaluating two implementations of a C++ logging mechanism. The first implementation, below, unconditionally streams (calls the insertion operator) to the ...
StoneThrow's user avatar
5 votes
1 answer
846 views

Merge multiple map with java stream api

I am trying to merge multiple map with Java stream API. The reqiurements like ... this method can receive multiple map, does not care hot many of it support 2 merge method: intersection, union if key ...
Juneyoung Oh's user avatar
1 vote
1 answer
107 views

Stream Implementation In JavaScript

I usually do not create Streams, but it seems that JavaScript doesn't have a built-in one and I figured I would do it for a personal project I am working on. This code seems to work as intended and ...
Matthew's user avatar
  • 281
2 votes
1 answer
60 views

SDL Stream for C++ follow up

Initial review requested here: The big thing I had missed was that read/write either work successfully (and all requested data is read/written) or it fails the flags are set appropriately. For write ...
Martin York's user avatar
  • 95.1k
4 votes
1 answer
114 views

SDL Stream for C++

Looking at the SDL library. Looking to load images from file into an SDL_Surface using the SDL2 Image API to do this I need to implement the SDL_RWops object class in terms of a C++ stream. The reason ...
Martin York's user avatar
  • 95.1k
1 vote
0 answers
132 views

Upload large image files to Azure

I am currently writing a program that takes image files from my data base and uploads them to Azure storage here is what I have written: ...
Adil15's user avatar
  • 155
0 votes
1 answer
45 views

ANSI background color codec

After a discussion of a mysterious color code on the Arch Linux live medium on the Arch Linux forums, I implemented a codec to encode (and decode) arbitrary byte streams to ANSI background colors. The ...
Richard Neumann's user avatar
1 vote
3 answers
490 views

Improving a TCP communication between Python and C# programs

I have been using a TCP communications between Python and C# program. Python side (server) runs on a raspberry pi 4 and C# side (client) runs on my computer. RPi and PC connected over Wi-Fi. I have a ...
crackanddie's user avatar
2 votes
1 answer
129 views

Function to capture all stdout to String

I wanted to have a simple way to capture all sysout for a block of code. Ended up with this: ...
K.H.'s user avatar
  • 2,668
5 votes
1 answer
73 views

Character source with lookahead for lexer

I've been out of the C++ game for a few years and I'm trying to knock the rust off by implementing a programming language. This Source interface is used to read ...
ruds's user avatar
  • 3,311
1 vote
2 answers
595 views

Implemented Sorting of Map by Value and then by Key in java

So I had this requirement to get the frequency of names appearing in a list and then print the one appearing the most number of times. If there is a clash, print the one which comes first in the ...
Janardhan Maithil's user avatar
1 vote
1 answer
86 views

Chunk output into files, based on number of entries and total size

Below is my client code which stream all the customer URLs from a golang grpc server. It takes Request input parameter and streams customer URLs based on matching a ...
AndyP's user avatar
  • 239
0 votes
1 answer
992 views

Basic Client/Server model using Unix signals

I've created a basic client/server model using user defined signals (SIGUSR1 representing bit 1 and SIGUSR2 for bit 0). At a ...
Question's user avatar
0 votes
1 answer
3k views

check if two lists of objects have the same value of an attribute

I have two lists of objects localList and remoteList, both lists have a consent attribute I want to check the value of the consent attribute if the same for both lists. If not, I want to remove all ...
LMA's user avatar
  • 17
4 votes
3 answers
1k views

Find vowels count in each given country names using Java6 and Java8

I am trying to use Java8 for a piece of code which I had written in Java6 and am able to achieve the result using both the version of java but I am thinking there could be more better way to write the ...
ABC's user avatar
  • 143
1 vote
2 answers
250 views

Download and unzip an XML document

I am working on an integration software. I will need to download a list of products and import it into my website. The list of products will be downloaded from ...
Hooman Bahreini's user avatar
1 vote
1 answer
70 views

Stream that computes running median value

I was solving a DSA question, running median in a stream. And I decided to design my own stream class with additional features. ...
Ankush Tripathi's user avatar
1 vote
0 answers
107 views

Getting metadata out of a Shoutcast stream

I have written the following class used to get the metadata out of an internet radio station. It takes a Node Stream and transforms it to grab the metadata out of the mp3 stream and then removes the ...
Isiah L's user avatar
  • 111
2 votes
1 answer
299 views

C++ simple type serialization for streaming primitive- / pod types over a web socket (e.g. asio)

I am experimenting with asio web sockets and tried to write a simple serializer / deserializer. I am also thinking about an approach on how to serialize some type information alongside the actual data....
Symlink's user avatar
  • 143
0 votes
3 answers
246 views

Luhn algorithm using Stream API

Example ...
DozezQuest's user avatar
3 votes
2 answers
360 views

Streaming substrings of a string

Given a (long) string src, generate substrings (up to) len characters long on demand by iterating over ...
Kedar Mhaswade's user avatar
3 votes
0 answers
300 views

How can I filter and sort LinkedList faster and more effective?I have list of orders that should be processed

I have method that fetches all orders from Database and filtering, sorting that data(I know better to do It by specific query to Database but I dont know how). I have Order entity that has following <...
Justtoasktheneededquestions's user avatar
3 votes
1 answer
672 views

Conditional Output Streaming in C++

I stumbled into an idea for creating a simple class that would entirely avoid streaming of any data unless some condition is met. The idea here is that a ...
Tom Manner's user avatar
1 vote
1 answer
4k views

How to append values into existed Vec with iterator

I have a Vec with value default [0], and then I want to append into the vec with an iterator which is read from stdin, now my code is not performant since I use an insert to shift all the values ...
prehistoricpenguin's user avatar
2 votes
0 answers
764 views

Reading stdout and stderr of a sub process using Win32, Overlapped I/O

I'm writing C++ Windows code that will start a process, then read its stdout and stderr, separately, into buffers. If I try to just read the streams one at a time it may hang if the child process is ...
user11693's user avatar
2 votes
0 answers
1k views

Read compressed XML file inside ZIP and parse data as fast as possible

I am trying to read and parse an XML file inside of a ZIP archive as fast as possible. The XML file is roughly 85GB in size, so I know for a fact that I/O also plays a role here, as I need to ...
MortenMoulder's user avatar
1 vote
1 answer
132 views

A Paragraph Merger with Removing Overlapped Duplicated Lines in C#

I am trying to make a paragraph merger that takes multiple paragraphs and output a concatenated result with removing the duplicated overlapped lines due to redundancy. Each input paragraph is with the ...
JimmyHu's user avatar
  • 4,708
1 vote
1 answer
221 views

A Tiny Text File Read/Write class Implementation in C#

I am trying to implement a tiny text file read / write class FileIO in order to make the operations of reading / writing pure text files easily. The usage is like: <...
JimmyHu's user avatar
  • 4,708
6 votes
3 answers
2k views

Beginner C fgetline() implementation

I am doing C coding practice by reinventing a getline function that works with any streams. Any comments on the overall code quality, including correctness, style ...
UM-Li's user avatar
  • 61
5 votes
1 answer
191 views

Filter out comments in Delphi source code

Today I am working on refactoring and documenting some ancient Delphi code. In that language, which is derived from Pascal, there are three forms of comments: ...
Edward's user avatar
  • 66.4k
3 votes
2 answers
4k views

Multiple filters and maps java stream

I need to find the odd occurring numbers as a list. For example the below list should give 1 and 2 as output. Is there a way that I can do it in a better way? ...
learningUser's user avatar
1 vote
1 answer
44 views

Concise and exception-prone method for running method on component

I have a list of Components. When an actor is connected, I want to run onActorConnected on each component. However, if a ...
Vapid's user avatar
  • 347
3 votes
0 answers
333 views

Javascript / Go plug-and-play server-side WebRTC support for webcam streaming

I normally program in a linux vm and decided to do some machine learning with my webcam when I realized the vm didn't have access to my camera hardware. That kicked-off a mini project to create a plug-...
Coupcoup's user avatar
  • 1,066
3 votes
3 answers
900 views

Produce the sum of all white space separated integers in a given file

How's my code? Works perfectly for what I'm trying to do :) ...
Cluelesshint's user avatar
4 votes
1 answer
580 views

LZW Compression Library

I wrote a library that implements LZW compression and decompression. A goal of this project was to help me acquaint myself with modern C++ development practices (I primarily come from a Java ...
user129137's user avatar
3 votes
2 answers
1k views

Set default value for remaining size of list by use of Java 8 and Stream

I have written a method which will return the size 16 List every time. If the input List has size less than 16, the remaining list object will be filled with default values.  Is there any way to ...
user3789184's user avatar
8 votes
1 answer
3k views

Reading one source Stream by multiple consumers asynchronously

The problem was using single Stream from the HTTP response in multiple consumers simultaneously. For example: while data is loading, I want write it to the some ...
aepot's user avatar
  • 2,009
2 votes
1 answer
2k views

Deserialise Json and Read Stream twice in C#

So this is a modern implementation of a HTTP client, trying to find a way to optimise/simplify this. Specifically the DeserializeAsync method with the GetStream and the compiler statement for if/debug ...
JsonDork's user avatar
  • 414
5 votes
2 answers
727 views

Sorting squares of an integer array

I had this question in an interview recently. Given a sorted array of integers, return a list of those integers squared, with the squares sorted. So given an array of these numbers: ...
Frank's user avatar
  • 309
4 votes
3 answers
2k views

Min heap without recursion

The code reads in integer array from user input and builds a minimum heap via an iterative scheme. Are there any edge cases in which this approach would fail? For the following test case/command ...
Darnoc Eloc's user avatar
3 votes
1 answer
413 views

Finding out the indices of common elements in two array lists having duplicate elements

I have two lists which are also having some duplicate elements , i am converting this list to map as key value pair with element index as the value for the key - element List 1 : [1, 2, 3, 4, 5, 6, ...
Anurag Tiwari's user avatar
2 votes
1 answer
267 views

Reading bytes between two quotes from a stream and decoding it to its appropriate character set [closed]

This is a component for a lexer which operates on a byte input stream that handles reading and decoding the contents of a string contained within double-quotes. The validity of the encoding is handled ...
Zhro's user avatar
  • 249
5 votes
2 answers
84 views

Concisely, robustly, temporarily stashing c++ iostream formats

I got tired of the boilerplate and tedium restoring formatting context, so I made an RAII stasher that relies on the destroy-at-end-of-full-statement temporary semantics. With C++17 I can get it down ...
jthill's user avatar
  • 151

1
2 3 4 5
7