buffer

How to save a Java FloatBuffer (or any Buffer) to a file

I have a FloatBuffer of known size and just want to dump the data to a file (in binary) for inspection outside my app. What's the easiest way to do this? ...

C++ socket 256 byte buffer

Hello. I am trying to use some socket network programming in C++. I am trying to send the text "Hello World!" to a server using the C++ send() function. At first, I set the buffer to the size of 13 since "Hello World!" altogether is 12 characters (you have to make it one more than the character count). The send function only sends the ch...

Optimal buffer size for response stream of HttpWebResponse

What's the optimal buffer size to use with a stream from HttpWebResponse.GetResponseStream()? Online examples vary from 256b to as much as 5Kb. What gives? I guess buffer sizes might be situational. If so what are the situations to use what type of buffer size? Thanks. ...

Prevent new line when outputting to console

I've set the buffer size to the window size to get rid of the scroll bar. Now, I'm trying to fill the console with a value, but there is always a new blank line added to the end, which causes the first line to be cleared from the buffer. I know why it's happening, but is there any way that I can prevent it? I've tried moving the buffer...

How to flush a TFileStream?

TFileStream provides buffered output, which is great in most cases, but in some cases (especially during debugging) it's nice to flush the buffer immediately. Thing is, I don't know of any way to do that except calling Free, which is kind of counterproductive. Is there a better way to do it? ...

Recieving chunked data from a Socket to a single buffer

I'm trying to write a simple SNPP (Simple Network Paging Protocol) client using sockets. Everything seems to be working well, except for a small inconsistency between servers. When I send a command, I need to read the reply, which is usually a single chunk of data. However, Sprint's SNPP server sends replies in two parts. The first chun...

How can I operate on more emacs buffers at the same time?

I am looking for an equivalent of the ":bufdo" Vim command in Emacs. ":bufdo" takes an argument - another command - and executes the command on all open buffers. I have not yet found a similar feature in Emacs - any suggestions? Thanks. ...

Socket Server Disconnect and Reconnect Buffer Error?

I'm using the following TCP Sockets Server/Client example: http://www.codeguru.com/Csharp/Csharp/cs_network/sockets/article.php/c8781/ I'm also using the following CryptoStream example: http://www.obviex.com/samples/Encryption.aspx Problem: Both Server and Clients communicate perfectly until I Stop the Server socket, wait a minute or s...

vim — How can I search buffers?

I am looking for some command like: :b1!g/something_here/ where I supposedly search for a word "something_here" in the buffer "b1". How can I do it? ...

How can I filter compilation output only for a specific mode or buffer in Emacs?

I have a HTML page, with html-mode enabled. I call function sgml-validate to check for any markup errors. It's based on compilation-mode. I want to remove some warnings from the compilation output, so I wrote a function and hooked it to compilation-filter-hook (this variable is not documented, but compilation-filter invokes it). Everythi...

Most memory efficient way to save binary file from the web with Python 2.6?

I'm trying to download (and save) a binary file from the web using Python 2.6 and urllib. As I understand it, read(), readline() and readlines() are the 3 ways to read a file-like object. Since the binary files aren't really broken into newlines, read() and readlines() read teh whole file into memory. Is choosing a random read() buffer...

What is the default buffer size of CreateFile in Windows?

When CreateFile Function is called without the flag FILE_FLAG_NO_BUFFERING, what is the size of the inner buffer of operating system? If my buffer size is larger than the inner buffer of Windows, can I fully use up the throughput of disk? ...

Limit on cout stream?

A puzzle that hit me. In some simple test harness code, if I stream too many characters to stdout, the program fails. Strange but very reproducable. This may be a Windows only issue, but it's easy to see: #include <iostream> #include <deque> using namespace std; int main() { deque<char> d; char c; while (cin.get(c)) d.push_b...

flex buffered data

Hello, we are implementing an AIR application in Flex. We populate dynamically a canvas and present it. The problem is that the data are build not before the the change of canvas. Is there a way to buffer the output and present it after the data has been populated? thanks in advance ...

Python Mod_WSGI Output Buffer

This is a bit of a tricky question; I'm working with mod_wsgi in python and want to make an output buffer that yields HTML on an ongoing basis (until the page is done loading). Right now I have my script set up so that the Application() function creates a separate 'Page' thread for the page code, then immediately after, it runs a con...

How to know the line number corresponding to a buffer position?

When Emacs reports error it always show code with a buffer position, with which it is quite unconvenient to find out where the exact words locate. It there any way to know the exact line number of the buffer position? ...

Detect empty buffer on a windows handle without using readfile()

I was wondering if there was any function along the lines of IsBufferEmpty() to use on a synchronous handle rather than using ReadFile() and waiting for it to return false. I need something to eliminate the delay that ReadFile() takes to try to read data. ...

How can I get the compilation buffer on the bottom rather than on the right in Emacs 23?

I've installed Emacs 23 and have found that the compilation buffer (when using M-x compile) appears in a different position than it did in Emacs 22. The currently open buffer appears on the left and the compilation buffer on the right. How to I revert to the Emacs 22 behavior of having the current buffer open on the top and the compilati...

is there a limit for the number of sk_buffs in the kernel

Hi, I need to steal some SKBs in my NetFilter hook, and retain them for some time. Is there a limit in the kernel about how many SKBs can I use at a time? What are the consequences of having some 100,000 or even more SKBs held in my kernel module? I could avoid copying my packets two time if I can have many-many SKBs. Regards, Denes ...

C# or .NET Flushing Keyboard Buffer

How do I flush the keyboard buffer in C# using Windows Forms? I have a barcode scanner which acts like a keyboard. If a really long barcode is scanned and the cancel button is hit on the form, I need the keyboard buffer to be cleared. So I need to flush and ignore all pending input. I need the buffer cleared because if the barcode conta...