buffer

How do stop output buffering in a WPF TextBox?

I don't want text to be buffered from my application to a WPF TextBox. I can't see an obvious property for it. Currently, I'm just using the AppendText method. In C we used something like setbuf(stdout, (char *)NULL) - is it something like that in C# or something simpler? ...

How can you buffer two online videos alternately while playing one of them?

On my website, I want my user to be able to launch video 2 at any point in the middle of video 1 without waiting or refreshing the window. How can I buffer the two videos such that I buffer video 1 enough to let it start playing, and then buffer just enough of video 2 that if the user launches it at any point, he does not have to wait to...

recv returns old data

This loop is supposed to take data from a socket line by line and put it in a buffer. For some reason, when there is no new data to return, recv returns the last couple lines it got. I was able to stop the bug by commenting out the first recv, but then I cant tell how long the next line will be. I know it's not a while(this->connected)...

Using read() directly into a C++ std:vector

I'm wrapping up user space linux socket functionality in some C++ for an embedded system (yes, this is probably reinventing the wheel again). I want to offer a read and write implementation using a vector. Doing the write is pretty easy, I can just pass &myvec[0] and avoid unnecessary copying. I'd like to do the same and read directly ...

iPhone OpenGL ES - occasional initialisation problem

I am using OpenGL for a 2D graphing application. I have recently started having strange problems with the UIView that displays the GL render buffer. Sometimes (40% of the time?) when it initialises, the view is in a frozen state, occasionally displaying artefacts of the last successful running of the program. The rest of the program is...

Can only read one element at once of a circular buffer

I have implemented the standard single consumer, single producer queue as a circular buffer in C consisting of an array and two indexes: one for read, one for write. My circular buffer is of the type that returns an error if you attempt to insert an item into a full queue and uses one empty slot to distinguish between an empty ring buff...

Problems with reading into buffer using boost::asio::async_read

Good day. I have a Types.hpp file in my project. And within it i have: .... namespace RC { ..... ..... struct ViewSettings { .... }; ..... } In the Server.cpp file I'm including this Types.hpp file, and i have there: class Session { ..... RC::ViewSettings tmp; boost::asio::async_read(socket_, boost::asio::buffer(&...

How to get a fully transparent backbuffer in directx 9 without vista Desktop Window Manager

I currently have an activex control that initiates a media (video/audio) framework another development group in my company developed and I am providing a window handle to that code. That handle is being used by their rendering plugin in the pipeline that uses Direct3d for rendering the video using that handle. I have seperate LPDIRECT3D...

Reading HttpURLConnection InputStream - manual buffer or BufferedInputStream?

When reading the InputStream of an HttpURLConnection, is there any reason to use one of the following over the other? I've seen both used in examples. Manual Buffer: while ((length = inputStream.read(buffer)) > 0) { os.write(buf, 0, ret); } BufferedInputStream is = http.getInputStream(); bis = new BufferedInputStream(is); ByteAr...

what size of buffer is the best for uploading file to internet

I'm using HTTP API provided by MS to upload video to YouTube, I noticed the total elapsed time is different with different buffer size, what size of buffer is the best for uploading file to internet? Thanks in advance. ...

How can I eliminate latency in quicktime streamed video

I'm prototyping a client that displays streaming video from a HaiVision Barracuda through a quicktime client. I've been unable to reduce the buffer size below 3.0 seconds... for this application, we need as low a latency as the network allows, and prefer video dropouts to delay. I'm doing the following: - (void)applicationDidFinishLau...

Will SerialPort DataReceived Event trigger repeatedly?

Suppose I read data from SerialPort whenever there is 100 bytes available or else nothing is done. That means, the remaining data will still be available in the SerialPort Buffer. This reading is done inside the event handler of DataReceived. Now suppose a situation arises, when there there is, say 50 bytes in the SerilaPort Buffer and ...

What is buffer? What are buffered reads and writes?

I heard the word buffer after a long time today and wondering if somebody can give a good overview of buffer and some examples of how it matters in today's world. ...

File viewer with sliding buffer

Hello, I'd like to make a simple text file viewer and I'd like it to be able to handle large files (possibly larger than the computer's memory). I know that I need to implement something like a sliding buffer, that will contain the currently visible portion of the file. The main problem is to determine the relation between lines and fil...

How to effectively draw on desktop in C#?

I want to draw directly on the desktop in C#. From searching a bit, I ended up using a Graphics object from the Desktop HDC (null). Then, I painted normally using this Graphics object. The problem is that my shapes get lost when any part of the screen is redrawn. I tried a While loop, but it actually ends up drawing as fast as the appli...

how to init binary buffer in python

so, I read from DB binary field i.e. 'field1' to var Buf1, and then do something like: unpack_from('I', Buf1, 0) so, all is ok. but question is how can I ini Buf1 without going to DB? I can get value from DB manually and init my var statically, but how? in DB field 'field1' I see something like '0x7B0500000100000064000000B80100006'. ...

Simple Emacs keybindings

I have two operations that I do all the time in Emacs: Create a new buffer and paste the clipboard. [C-S-n] Close the current buffer. [C-S-w] Switch to the last viewed buffer [C-TAB] I feel like a keyboard acrobat when doing the first two operations. I think it would be worth trying some custom keybindings and macros. A few questio...

Buffer size: N*sizeof(type) or sizeof(var)? C++

I am just starting with cpp and I've been following different examples to learn from them, and I see that buffer size is set in different ways, for example: char buffer[255]; StringCchPrintf(buffer, sizeof(buffer), TEXT("%s"), X); VS char buffer[255]; StringCchPrintf(buffer, 255*sizeof(char), TEXT("%s"), X); Which one is the correc...

Can the arguments BUFFER and DIRECT be used with expdp

I have a strange case where in what this guy says is not happening with me. I am not able to set the above two parameters neither through command line directly, nor using a par file. expdp -help doesn't show any such arguments, so are there analogous arguments to BUFFER and DIRECT (from exp) in the data-pump version. ...

Android - Buffering Lag with VideoView

I am using VideoView to display a video in my app. The problem is that, once the layout gets created there is lag of almost 10-30 seconds before which the video starts to play. I can see in LogCat that the video is buffering during the lag. Is there a way I can minimize this lag, or tell MediaPlayer to play the video sooner? Thanks Ch...