stream

Does isEmpty method in Stream evaluate the whole Stream?

In Scala, does calling isEmtpy method on an instance of Stream class cause the stream to be evaluated completely? My code is like this: import Stream.cons private val odds: Stream[Int] = cons(3, odds.map(_ + 2)) private val primes: Stream[Int] = cons(2, odds filter isPrime) private def isPrime(n: Int): Boolean = n match { case 1 => ...

In Scala, is there a way to get the currently evaluated items in a Stream?

In Scala, is there a way to get the currently evaluated items in a Stream? For example in the Stream val s: Stream[Int] = Stream.cons(1, Stream.cons(2, Stream.cons(3, s.map(_+1)))) the method should return only List(1,2,3). ...

Java. Read file from FTP but DON'T download it whole

I need to read CSV file header from FTP. As these files can be very huge, I don't need to download them. Is there a way to read first line of CSV file from FTP and abort connection? ...

Play mp3 stream from http URL on Windows Mobile 6.0

After a short period of time learning about how to play a mp3 http url on windows mobile 6.0, I found that very less dll support that (until now, I just found out Bass.dll work nice). So I intend to change to another way to approach the goal. Here's my idea: Get a stream from http url. Decode the mp3 stream. Play the result from step 2...

How to cast a pointer of memory block to std stream

I have programed an application on windows XP and in Visual Studio with c++ language. In that app I used LoadResource() API to load a resource for giving a file in the resource memory. It returned a pointer of memory block and I wanna cast the pointer to the std stream to use for compatibility. Could anyone help me? ...

How to create a wave STREAM out of raw audio samples in C#?

The title is actually the question! Thank you. ...

Read and write directly from and to compressed files in C

Hi, in Java I think it is possible to cruise through jar files like they were not compressed. Is there some similar (and portable) thing in C/C++ ? I would like to import binary data into memory from a large (zipped or similar) file without decompressing to disk first and afterwards writing to disk in a compressed way. Maybe some tr...

Creating a shim Stream

A decompression API that I am using has the following API: Decode(Stream inStream,Stream outStream) I'd like to create a wrapper around this API, such that I can create my own Stream class which offers up the decoded data. Stream decodedStream=new BlaDecodeStream(inStream); So that I can than use this stream as a parameter to the X...

How to open a WPF Content Stream?

Here's the code snippet String str= ??????? // I want to assign c:/my/test.html to this string Uri uri= new Uri (str); Stream src = Application.GetContentStream(uri).Stream; What's the correct way to do this? I'm getting "URI not relative" Exception thrown ...

PHP: Grab an image from a stream (in an img tag) but if it's not there, i don't want the img tag written. How?

I currently have code like this in a web based file called 'view_file.php' to grab an image from an internal network. <img src="put_file.php?type=<?=$TN_TYPE;?>&path=<?=$TN_PATH;?>&filename=<?=$TN_FILENAME;?>" /> The 'put_file.php' script allows access to an internal server that we don't want to expose to the internet. This script che...

How does the Firefox website make its download stats page work?

On the Mozilla website, there’s a page showing (apparently) live download statistics for Firefox: http://www.mozilla.com/en-US/firefox/stats/ How are they performing their request to get the live stats data? I can not see a constant connection in Firebug. How is this working? ...

ArgumentOutOfRangeException when reading bytes from stream

I'm trying to read the response stream from an HttpWebResponse object. I know the length of the stream (_response.ContentLength) however I keep getting the following exception: Specified argument was out of the range of valid values. Parameter name: size While debugging, I noticed that at the time of the error, the values were as suc...

Fake output stream type

By default certain programs format their output according to the type of the stream they write to. For example, the output of ls and ls > file looks differently. I'd like to know how this is achieved by a program. Additionally, is there a way by which we can trick such programs as if the output stream is a terminal where it actually is a...

Strip the last line from a text file

Hello, I need to strip the last line from a text file. I know how to open and save text files in C#, but how would I strip the last line of the text file? The text file will always be different sizes (some have 80 lines, some have 20). Can someone please show me how to do this? Thanks. ...

Play Shoutcast Radio stream in Python?

I know this is a second post on the same topic, but I am doing this in hopes of some help. I am trying to create a player for my Shoutcast internet radio station, but I can't seem to get anything to work. It is a live MP3 broadcast. When you click the link to tune in, it gives a .PLS file with the server url in it. Anyone have any ideas ...

Convert shoutcast stream to playable samples in Python?

I have a shoutcat radio station and now want to build a player for it. I know how to "get" thet stream from the server, thanks a lot to bobince , but I am not sure how to convert that stream into playable samples. How is it done? ...

What is Sony BIVL framework?

What is Sony BIVL framework? How to develop a application in that? How to i put my video's on BIVL? ...

Virtual camera/direct show filter for network stream

Hi guys, i'm working with Flash Live Encoder. It's using camera for streaming video. Support forum say's that i can create custom direct show filter and stream data that i need. I cann't understand how direct show filter will display in the source list of the live encoder. I've tryed to use some commercial virtual camera and it work's fi...

Streaming audio (YouTube)

Hello all, I'm writing a CLI for a music-media-platform. One of the features is going to be that you can directly play YouTube videos from the CLI. I don't really have an idea to do it but this one sounded the most reasonable: I'm going to use of those sites where you can download music from YouTube, e.g. http://keepvid.com/ - then I d...

Reading HTML table data / html tag

I have some 50 pages of html which have around 100-plus rows of data in each, with all sort of CSS style, I want to read the html file and just get the data, like Name, Age, Class, Teacher. and store it in Database, but I am not able to read the html tags e.g space i kept to display it here <table class="table_100"> <tr> <...