stream

How to stream image object in Sinatra

I had uploaded images to mongoDB using GridFS. I want to retrieve an image from the db and display it in the browser. How to do this with the help of Sinatra and HAML. ...

Java invalid stream header Problem

Hi all, im writen a client-server app, and now i´m facing a problem that I dont know how to solve: This is the client: try { Socket socket = new Socket(ip, port); ObjectOutputStream ooos = new ObjectOutputStream(socket .getOutputStream()); SendMessage message = new Send...

Create a Stream without having a physical file to create from.

I'm needing to create a zip file containing documents that exist on the server. I am using the .Net Package class to do so, and to create a new Package (which is the zip file) I have to have either a path to a physical file or a stream. I am trying to not create an actual file that would be the zip file, instead just create a stream that...

Writing String to Stream and reading it back does not work

I want to write a String to a Stream (a MemoryStream in this case) and read the bytes one by one. stringAsStream = new MemoryStream(); UnicodeEncoding uniEncoding = new UnicodeEncoding(); String message = "Message"; stringAsStream.Write(uniEncoding.GetBytes(message), 0, message.Length); Console.WriteLine("This:\t\t" + (char)uniEncodi...

Redirect C++ std::clog to syslog on Unix

I work on Unix on a C++ program that send messages to syslog. The current code uses the syslog system call that works like printf. Now I would prefer to use a stream for that purpose instead, typically the built-in std::clog. But clog merely redirect output to stderr, not to syslog and that is useless for me as I also use stderr and st...

tweepy stream.filter() method doesn't work properly

Hi there i've got some problems with the tweepy api. I'm just tryin to write a little app that gets me a stream of statuses of one user (ore more), but one would be fine to start with ;-) now: my code is like that: def main(): config = ConfigParser.ConfigParser() config.read('twitter.cfg') username = config....

Convert XmlPullParser instance to XMLStreamReader instance

Short of it is I am using a 3rd party library to parse some xmpp messages. It is giving me an instance of XmlPullParser to parse an atom syndicate feed entity myself. I'd like to use the apache Abdera project for this but the XmlPullParser un-encodes encoded characters (<, >, etc) this causes problems when I give the buffer to Abdera as ...

Reading from an embedded resource stream

I've been trying to access an image resource named "IndexPointer.jpg" in an embedded RESX file called "Images.resx". GetManifestResourceNames() returns a single value - SCtor.Images.resources". Assembly::GetExecutingAssembly()->GetManifestResourceStream("SCtor.Images.resources.IndexPointer.jpg") only returns a nullptr. Obviously, I've...

Getting SHOUTcast metadata on the Mac

I'm creating an application in Objective-C and I need to get the metadata from a SHOUTcast stream. I tried this: NSURL *URL = [NSURL URLWithString:@"http://202.4.100.2:8000/"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; [request addValue:@"1" forHTTPHeaderField:@"icy-metadata"]; [request addValu...

How to get stream to "in-memory" database created via H2DB?

I have to create such a mechanism: Create in-memory (H2DB) database; Create tables and fill them using some data; Get stream to that database; Send that stream via WebDAV or something else; I know everything except that "How to get stream to "in-memory" database created via H2DB"? And some explanations: I can't create file becau...

Is there any way to close a StreamWriter without closing it's BaseStream?

My root problem is that when using calls Dispose on a StreamWriter, it also disposes the BaseStream (same problem with Close). I have a workaround for this, but as you can see it involves copying the stream. Is there any way to do this without copying the stream? The purpose of this is to get the contents of a string (originally read f...

Default input and output buffering for fopen'd files?

So a FILE stream can have both input and output buffers. You can adjust the output stream using setvbuf (I am unaware of any method to play with the input buffer size and behavior). Also, by default the buffer is BUFSIZ (not sure if this is a POSIX or C thing). It is very clear what this means for stdin/stdout/stderr, but what are the d...

How to serve MP3's using RED5 flash server

I have installed RED5 flash server and 12 hours after installing it, I still cannot serve a simple MP3 file. So far, If I have understood correctly, you need to create and compile a Java application to simply serve a file!?.... Which seems a little over-complicated to be honest. Never touched Java. I have used the oflademo however can...

I'm implement http live streaming video from my webserver to iPhone. Will I get rejected for bandwidth?

Apache webserver setup added: AddType application/x-mpegURL .m3u8 AddType video/MP2T .ts to "httpd.conf" file. Movie file preparation I have 3 movie files (9mb - 25mb each). Used QuickTime to convert movies into iPhone format. Used mediafilesegmenter to convert .m4v into 10-second segments of .ts files, with an accompanying .m3u8 ...

Facebook Stream.Get -- How to access data in array?

On stream.get, I try to echo $feeds["posts"][$i]["attachment"]["href"]; It return the URL, but, in the same array scope where "type" is located (which returns string: video, etc), trying $feeds["posts"][$i]["attachment"]["type"] returns nothing at all! Here's an array through PHP's var_dump: http://pastie.org/930475 So, from testing...

Formula for Live Video Streaming Bitrate

I am simply looking for the formula that should be used here. All the results I've found base "finding the bitrate" off of already existing video. I'm talking about LIVE streaming. (indeterminate length) So, I know some basic parts of it, but I just need to know if I'm right or missing anything. For Kbps: Resolution * Framerate / ...

How to download file into string with progress callback?

I would like to use the WebClient (or there is another better option?) but there is a problem. I understand that opening up the stream takes some time and this can not be avoided. However, reading it takes a strangely much more amount of time compared to read it entirely immediately. Is there a best way to do this? I mean two ways, to s...

Implementing Dispose on a class derived from Stream

I'm building a class that derives from Stream to wrap a COM IStream. However I've come across an issue where I need to release the COM IStream deteministically. Ok so that's easy just use Marshal.ReleaseComObject in the Dispose method. However I'm not sure its that simple. The Stream base class already has an protected virtual metho...

FQL Stream Facebook Application publish_stream

I want to create/show an activity stream of everything that has been published/commented on behalf of my application. My question is, do I need to "farm" any "post" id's or am I able to call upon everything posted into the stream via my application from it's id in a FQL statement? Thanks in advance! ...

ByteBuffer from OutputStream

In Java I need to put content of OutputStream (I fill data to that stream myself) into a ByteBuffer. How to do it in a simple way ? ...