buffering

C: Addressing the case of partial headers when using select in the context of HTTP...

This is in reference to a previous question of mine which was already answered: http://stackoverflow.com/questions/2159628/c-using-a-select-call-when-i-am-reading-how-do-i-keep-track-of-the-data My protocol actually sends how much data it is about send initially before it sends any other data. But yesterday, when testing out this code ...

C: Is there something better than a FIFO Queue implementation for this requirement?

In one of my programs, there are multiple clients and each client has its own buffer. In an infinite loop, I check if any of the client has any data to be written to disk. If it does, then I do the same and continue. Now, because the client writes data that is not really in my control (result of some computations), I need a dynamic buf...

gstreamer -playing audio from a website.. buffering issue

hi, I am trying to play a sound file using : gst-launch playbin uri="some URL" where, URL is the whole url of that file. It plays this file, but there is buffering problem and I can't listen to most of the audio. Is there a simple command line argument that will solve this buffering issue. Example: use of appsrc to store a tem...

asp.net double buffering ?

Hi, How can I use double buffering in asp.net C#? I want smthng like that : I dont want full page refresh when I click a button in a web page.. I think it can be solved with double buffering. When a button clicked for redirect a content page (button-in master page), current page will not go until the redirected page completely load in ...

c++ std::ofstream flush() but not close()

I'm on MacOSX. In the logger part of my application, I'm dumping data to a file. suppose I have a globally declared std::ofstream outFile("log"); and in my logging code I have: outFile << "......." ; outFile.flush(); Now, suppose my code crashes after the flush() happens; Is the stuff written to outFile before the flush() guarantee...

Buffered reading from stdin using fread in C

I am trying to efficiently read from the stdin by using setvbuf in `_IOFBF~ mode. I am new to buffering. I am looking for working examples. The input begins with two integers (n,k). The next n lines of input contain 1 integer. The aim is to print how many integers are divisible by k. #define BUFSIZE 32 int main(){ int n, k, tmp, ans=...

SQL Server "Dry Run" mode? Load data buffers, without holding locks or changing data

i'm going to running some queries against an SQL Server database, followed by a delete. Ideally all this happens inside a transaction (i.e. atomic). But practically, because the data has long since been purged from the buffers, SQL Server will have to perform a lot of physical IO in order to complete the transacted T-SQL. This can be a ...

calculate total time in flex audio player?

How to calculate the song total time in flex audio player. i want to assign the total time to progress slider.. please any one help me.. Thanks Aswath ...

Flash computeSpectrum() unsynchronized with audio

I am using Flash's (CS4, AS3) SoundMixer.computeSpectrum to visualize a DFT of what supposed to be, according to the docs, whatever is currently being played. However, there is a considerable delay between the audio and the visualization (audio comes later). It seems that computeSpectrum captures whatever is on it's way to the buffer, an...

How can two threads access a common array of buffers with minimal blocking ? (c#)

Hello, I'm working on an image processing application where I have two threads on top of my main thread: 1 - CameraThread that captures images from the webcam and writes them into a buffer 2 - ImageProcessingThread that takes the latest image from that buffer for filtering. The reason why this is multithreaded is because speed is cri...

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...

Problems with sys.stdout.write() with time.sleep() in a function

What I wanted is printing out 5 dots that a dot printed per a second using time.sleep(), but the result was 5 dots were printed at once after 5 seconds delay. Tried both print and sys.stdout.write, same result. Thanks for any advices. import time import sys def wait_for(n): """Wait for {n} seconds. {n} should be an integer great...

Having trouble with time.sleep

When I run, for example: print("[",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ") time.sleep(1) print("=",end=" ...

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...

HTML5 video currentTime and buffering

Hello, I have a buffering issue. On my page (which I access remotely), I have a video that I position using the currentTime attribute. However, it seems like, despite the fact that I do not autbuffer, the video is still buffered until this position. Is that correct ? Is there a way I can seek to this position without reading the video ...

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...

Android - Buffering in MediaPlayer

I am using MediaPlayer to play a video in my app. The video takes a while to buffer and the videoview is blank for that time. Is there a way to start the buffering when the user is in the previous screen, so that when he comes to the video playing screen, the video is ready to play? Thanks Chris ...

Generation of formatted files with Ruby in the way how it can be done with PHP

Hi, I use PHP to generate files of some special format, and I have decided to try the same thing with Ruby. To make a file with PHP, I use the following code: <? include 'functions_and_settings.php'; ob_start() ?> some parts of another format <? // php functions generating file content, // including other formatted files ?> some ...

Whats the point of using ob_start without any parameters in PHP

OK, I can see the use of ob_start with the output_callback parameter set but I can't see the use of ob_start when calling it without any parameters set at all. Whats the point of disabling output to later throw all the output at once? Don't this use more memory (server side) and slow downloads (client side) since the download starts onl...

Is triple buffering really a free performance boost?

So I've been reading a lot about openGL and gpus and graphics in general, and triple buffering is semi-frequently mentioned as giving a free performance boost. I know why it helps; in effect, you can do v-sync without being limited to a framerate choice of 60 or 30 or 20 or 15 or etc, so you can actually achieve, say, 55fps. But is there...