buffer

Flush kernel's TCP buffer for `MSG_MORE`-flagged packets

send()'s man page reveals the MSG_MORE flag which is asserted to act like TCP_CORK. I have a wrapper function around send(): int SocketConnection_Write(SocketConnection *this, void *buf, int len) { errno = 0; int sent = send(this->fd, buf, len, MSG_NOSIGNAL); if (errno == EPIPE || errno == ENOTCONN) { throw(exc, &S...

Native JDK code to copy files

Is there a native JDK code to copy files(buffers, streams, or whatever)? ...

Charater string buffer too small

I have select: select v.accs, v.currency,v.amount,v.drcr_ind, count(*) qua,wm_concat(ids) npx_IDS, wm_concat(px_dtct) npx_DTCT from table v group by accs, currency, amount, drcr_ind but i get error ORA-06502: PL/SQL: : character string buffer too small if i'll remove one string, because sometimes (when v.accs= 3570) count(*) = 215 bu...

How can you store JSP buffered output from an include/import to a variable?

I don't want to use any Java code, I just want to use <jsp:include> or <c:import> or something to that effect. So that I can use <c:set var="myPage" value="bufferedPageOutput" /> to output the generated HTML later. How can I do this with JSP/JSTL/Struts? ...

mysql insert and buffers, is this possible

how is this possible first i do insert into table2 select * from table1 where table1.id=1 ( 50k records should be moved 6 indexes has to be updated ) second delete from table1 where id=1 ( 50k records are removed ) How is it possible that only 45k of records are moved? Im scratching my head over this and cant find a right answer Is...

PHP FTP Upload thousands of files

Hi, I've written a small FTP class which I used to move files from a local server to a remote server. It does this by checking an array of local files with an array of files on the remote server. If the file exists on the remote server, it won't bother uploading it. The script works fine for small amounts of files, but I've noticed tha...

Analyzing the wave data of the currently played music track

Hi! I can't seem to find the proper audio source for recording/analyzing/receiving the currently played music track (or just any playing media). I'm not talking about the Mic. The spectrum live wallpaper does this on the Nexus One AFAIK. How can I keep receiving wave buffers of the currently playing media? (I would like to support eve...

How to write to the OpenGL Depth Buffer

I'm trying to implement an old-school technique where a rendered background image AND preset depth information is used to occlude other objects in the scene. So for instance if you have a picture of a room with some wires hanging from the ceiling in the foreground, these are given a shallow depth value in the depthmap, and when rendered...

AVAudioPlayer slow buffering over HTTP

Hi! When Im using AvAudioPlayer (Iphone) for streaming music from http it takes about 7 seconds until it starts playing. If Im using AudioQueue (about 8 buffers) instead the number of seconds is about 3 for the same song. Is this because AvAudioPlayer is using a larger buffer internally? Is there any way of speeding up AvAudioPlayer? ...

Getting IOException Push back buffer is full while trying to unzip a String value using ZipInputStream

I am trying to unzip a String value. But I am getting a java.io.IOException: Push back buffer is full public byte[] unzipArray(String stringToUnzip) { byte[] inputByteArray = Base64.decode(stringToUnzip); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( inputByteArray)...

InputStreamReader buffering issue

Hi all, I am reading data from a file that has, unfortunately, two types of character encoding. There is a header and a body. The header is always in ASCII and defines the character set that the body is encoded in. The header is not fixed length and must be run through a parser to determine its content/length. The file may also be q...

IndexOutOfRangeException when a stream is a multiple of the buffer size

I don't have a lot of experience with streams and buffers, but I'm having to do it for a project, and I'm stuck on an exception being thrown when the stream I'm reading is a multiple of the buffer size I've chosen. Let me show you: My code starts by reading bufferSize (100, let's say) bytes from the stream: numberOfBytesRead = DataRea...

What is faster: multiple `send`s or using buffering?

I'm playing around with sockets in C/Python and I wonder what is the most efficient way to send headers from a Python dictionary to the client socket. My ideas: use a send call for every header. Pros: No memory allocation needed. Cons: many send calls -- probably error prone; error management should be rather complicated use a buffer....

Zsh: how to see all buffers?

You can push things to buffer with ^Q and pop them with ESC-g. Alt+x vi-set-buffer changes buffer somehow. How can I see all the buffers? They are probably some files to look at. ...

ZSH: how can I run Vim-style substitute command in command line?

I forgot the array syntax while on Zsh-commandline: $ hello=[1,2,3,4] %ERR: I want to fix the problem by substitution. In Vim, I would do :.s@,@ @g. So how can I edit the current line, or let call it a current buffer, by running a command on it? ...

Java HTTP Requests Buffer size

Hello, I have an HTTP Request Dispatcher class that works most of the time, but I had noticed that it "stalls" when receiving larger requests. After looking into the problem, I thought that perhaps I wasn't allocating enough bytes to the buffer. Before, I was doing: byte[] buffer = new byte[10000]; After changing it to 20000, it seem...

problem with pasting image over lines in wx DC

hello .. i have the same code as wx Doodle pad in the wx demos i added a tool to paste images from the clipboard to the pad. using wx.DrawBitmap() function , but whenever i refresh the buffer .and call funtions ( drawSavedLines and drawSavedBitmap) it keeps putting bitmap above line no matter what i did even if i called draw bitmap ...

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

who free's setvbuf buffer?

So I've been digging into how the stdio portion of libc is implemented and I've come across another question. Looking at man setvbuf I see the following: When the first I/O operation occurs on a file, malloc(3) is called, and a buffer is obtained. This makes sense, your program should have a malloc in it for I/O unless you actu...

Storing Shell Output

Hello everybody, I am trying to read the output of a shell command into a string buffer, the reading and adding the values is ok except for the fact that the added values are every second line in the shell output. for example, I have 10 rows od shell output and this code only stores the 1, 3, 5, 7, 9, row . Can anyone point out why i am...