buffer

How to properly error trap read in c to get byte number from a file descriptor

若如初见. 提交于 2019-12-12 03:57:17
问题 I am currently writing a small dummy program to try and get the hang of properly using the read in c. I made a small function called readdata to read from the file descriptor and store in a buffer then return the number of bytes read. My problem is I am trying to correctly error handle and trap things so that there is no buffer overflow but I keep doing something from. Here is the tester: #include <stdio.h> #include <string.h> #include <unistd.h> #define BUFSIZE 10 int readdata(int fd, char

Why do I get, “The size necessary to buffer the XML content exceeded the buffer quota”?

雨燕双飞 提交于 2019-12-12 03:44:07
问题 Based on what I see here, it seems as if "The size necessary to buffer the XML content exceeded the buffer quota" is usually due to a problem in the .rdl file, rather than really being an excess of data or so. But when there's a problem with the contents of the .rdl, usually the Preview tab won't display at all, instead informing me that errors in the report first need to be fixed. I'm getting no errors, though; it allows me to enter the report parameters, and runs for a time generating the

how to add a button next to a message in java builder

房东的猫 提交于 2019-12-12 03:17:06
问题 Kinda new to Java programming, And I am trying to create a native app for android. my problem is, that when I select some stuff from my SQLite DB - I want to add a button with an eventlistener next to the output. if(view==btnViewAll) { Cursor c=db.rawQuery("SELECT * FROM catalogue", null); if(c.getCount()==0) { showMessage("Error", "No records found"); return; } StringBuffer buffer=new StringBuffer(); while(c.moveToNext()) { buffer.append("Product name: "+c.getString(1)+"\n"); buffer.append(

fscanf help: how to check for formatting

眉间皱痕 提交于 2019-12-12 03:03:24
问题 So the current function is supposed to see anything stored between two pound signs (#abc# should give back abc), but if I want to error check to see if there's a pound sign missing, or there's nothing between the pound signs, or that the length of the string in between the two pound signs is greater than a certain number of characters, do I use the fscanf function to do that? Here's what the fscanf code looks like: if (fscanf(fp, " %c%[^#]%c", &start, buffer, &end) == 3) { return strdup

Does Python bytearray use signed integers in the C representation?

十年热恋 提交于 2019-12-12 02:56:45
问题 I have written a small Cython tool for in-place sorting of structures exposing the buffer protocol in Python. It's a work in progress; please forgive any mistakes. This is just for me to learn. In my set of unit tests, I am working on testing the in-place sort across many different kinds of buffer-exposing data structures, each with many types of underlying data contained in them. I can verify it is working as expected for most cases, but the case of bytearray is very peculiar. If you take it

Copying float arrays and float values to a bytebuffer - Java

十年热恋 提交于 2019-12-12 02:56:08
问题 I am trying copy the data from two arrays and two variables to a bytebuffer. The bytebuffer will hold this data for a uniform block structure in a fragment shader. I can copy the first one in fine but the second always generates an index out of range error. I've tried using .asFloatBuffer, tried initializing the buffer to twice the size I needed and tried using a FloatBuffer (I need a ByteBuffer but I thought I'd just try to fix this error then work my way back) The structure from fragment

opengl es 2.0 populating the Vertex and index Buffer

情到浓时终转凉″ 提交于 2019-12-12 02:43:32
问题 This may seem like a silly question but i feel i need to ask it so i can understand how openGl buffers work. I have two buffers , vertex buffer and index buffer. To fill these buffers i am parsing an obj file. After parsing the data i fill the buffers with what i think is the correct data and order of data. However when i debug the code i see some strange things in the buffers. Firstly the vertex buffer. The first 3 values that i put in the Vbuffer are 0.99,-0.99,-0.7741 However when i check

Callback Confusion and Collecting Data in Node

杀马特。学长 韩版系。学妹 提交于 2019-12-12 02:28:14
问题 I'm new to node and having trouble following what's going on here. my comment is below, but basically i'm really struggling to follow why the callback in utils.collectData is there (second parameter) and how it arbitrarily adds to the messages array. how would I know to naturally do this in the future? I know that the collectData function is defined as taking a callback as its second argument, so let's start from there... var utils = require('./utils'); "POST": function(request, response) { /

D3D10 Constant buffer not working

半腔热情 提交于 2019-12-12 01:45:36
问题 I am using a constant buffer to transfer data to my pixel shader The problem is that the buffer contains 0s in the shader during runtime for x, y, z, and w of the float4 member, regardless of what data is updated to the buffer Structure definitions are as follows: // (C++) struct Buffer { XMMATRIX mvp_; XMFLOAT4 rgba_; int usemvp_; }; // HLSL cbuffer Buffer : register( b0 ) { matrix mvp_; float4 rgba_; int usemvp_; }; Any help is much appreciated 回答1: You need to pad your struct to make it 16

Vulkan Buffer WorkGroupID not returning actual value when large number of elements

老子叫甜甜 提交于 2019-12-12 00:59:39
问题 Creating a buffer with pow(2, 24) and a local_size_x = 64 for the layout input qualifier will return WorkGroupID = 262143 which is all fine due to pow(2,24) / 64 - 1 , it is zero indexed. However if we increase the global dimension / no elements / size of the problem to pow(2, 25) lets say WorkGroupID will return values without a reason, they do not match the math. Here are some limits that the device got that I think matter: maxStorageBufferRange: uint32_t = 4294967295