Questions tagged [binary-data]

0

votes
0

answer
3

Views

How to process binary data from API Gateway in Lambda and vice-versa?

I'm currently have the following setup: 1. S3 Bucket 2. API Gateway with GET/POST resource 3. Two Lambda Functions (one for getting data from s3, one for storing data to s3) For example the GET Resource, i pass a key parameter, which is used in the lambda function to get the object from s3 bucket. t...
Moritz Büttner
1

votes
0

answer
93

Views

Jmeter not POSTing binary data correctly

I am trying to post protobuf data with JMeter. I have a Sampler HTTP Request setup with the body as: b'' This should simply be an empty protobuf object, but JMeter is actually sending some wrapped version of this: b'b''' I have used Content-Type to be both application/protobuf and application/octe...
Tyrick
1

votes
1

answer
329

Views

JPEG decompression in python3

I am currently creating a TIFF file reader. For that, I need to implement JPEG decompression, so I can display the JPEG-Compressed image. I have been looking for libraries for python3 to do this, but I couldn't seem to find anything. This is my code: zipped_image_data = read(image_tags[279][0]) #com...
Ian Rehwinkel
1

votes
2

answer
36

Views

binary data image conversion does not equal jpg of the same image

I am trying to compare an embedded image located in a MP3 file with the exact same image saved as a JPG. If the images are identical then I would like to perform some further processing, however, when I compare the 2 images (RGB comparison) I keep getting false. I am sure that the images are identi...
oznomal
1

votes
0

answer
83

Views

Is there an emacs mode (or other editor) for editing binary records?

I'm looking for a way to view and edit files of fixed-length binary records with fields consisting of various raw data types like integer, string, etc. There is no way to directly infer the format, but one could have a simple printf-like format descriptor like: '%12d: (%d, %f)\n' to parse and print...
Christopher Crawford
1

votes
0

answer
60

Views

Load Binary C structs from File into Swift structs

I have been given a binary file that has been generated by a system designed to support embedded hardware. The file was generated using C. I have a spreadsheet that outlines the format of said file. I would probably be able to load this file using C, although it's been quite some time since I've h...
Brandon M
1

votes
1

answer
35

Views

Custom Newline in Binary Stream using Hex Array in WPF

I have a binary file I am reading and printing into a textbox while wrapping at a set point, but it is wrapping at places it shouldn't be. I want to ignore all line feed characters except those I have defined. There isn't a single Newline byte, rather it seems to be a series of them. I think I foun...
Alan
1

votes
0

answer
38

Views

Regex on binary data in python 3.6 shows weird behaviour

I'm trying to write a small script that reads binary data from a file before processing it further, with e.g. regex for simplifying some steps. During the regex I'm seeing some weird behavior I just can't figure out of. Code basically goes like this (heavily stripped down to just include the relevan...
ritualmagick
1

votes
0

answer
16

Views

Azure PolyBase external table from binary blob data?

I have several million image blobs stored in a Azure storage container. The blobs have a predictable name ([unique key].jpg.) Examples: 1234.jpg, 230.jpg & so on. If possible, how can I create an external table using this data which can be retrieved using a Sql statement? Select PK, IMAGE_CONTENT...
jujiro
1

votes
0

answer
95

Views

Binary Data from PHP to Angular 6 via http

the goal is to make a http request (empty) from Angular 7 to PHP to receive binary data in Angular for the use with protobuf3. More specifically, the binary data (encoded like described here: https://developers.google.com/protocol-buffers/docs/encoding) in PHP (source) is encapsulated in a string, w...
JFFIGK
1

votes
0

answer
14

Views

Checking whether an array is a suffix array for any binary string

I'm currently trying to figure out whether a given array, which is a permutation of the numbers 1 to n, is a suffix array of any binary string. For example for n = 3, A = {2, 1, 3} is valid, since there exists the binary string [101] with [01] < [1] < [101] (using lexicographical ordering). However...
ntldr
1

votes
1

answer
31

Views

Python stops binary reading of file after getting byte 0xa or 0xd

I want to read some binary file. It is a big file so i use maximalOffset variable to stop reading after getting to it. But reading is always ends at one offset - 8199. The last byte i get is 0xa. In xxd it is the part of byte 0a0d. I am using Ubuntu 18 and Python 3. I found some info about 0x1A in W...
DenisNovac
1

votes
0

answer
20

Views

Unpack binary data got require string argument error

I'm trying to unpack binary data from .txt and the code is following import struct with open('example.txt','rb') as file : fileContent = file.read() var = struct.unpack('dd',fileContent) print var then I got an error says struct.error: unpack requires a string argument of length 16 My code of wri...
whtitefall
1

votes
1

answer
1.4k

Views

Set binary data using setblob in mysql connector/c++ causes crash

I tried to use setBlob() as follows: class DataBuf : public streambuf { public: DataBuf(char * d, size_t s) { setg(d, d, d + s); } }; char b[20]; DataBuf buffer((char*)b, 20); istream stream(&buffer); PreparedStatement* s = con->PrepareStatement('insert into mytable (mybin) values (?)'); s->setBlob(...
1

votes
3

answer
1.5k

Views

Reading/writing binary structures: how to simplify this code?

I'm writing a network app, which sends and receives a lot of different kinds of binary packets, and I'm trying to make adding new kinds of packets to my app as easy as possible. For now, I created a Packet class, and I create subclasses of it for each different kind of packet. However, it isn't as c...
mik01aj
1

votes
2

answer
1.6k

Views

Passing Binary Data to a Stored Procedure in SQL Server 2008

I'm trying to figure out a way to store files in a database. I know it's recommended to store files on the file system rather than the database, but the job I'm working on would highly prefer using the database to store these images (files). There are also some constraints. I'm not an admin user, an...
Joe Majewski
1

votes
1

answer
2.5k

Views

use vbscript to get 32 bit floating point into binary byte or word representation

I don't know how to do two somewhat related task within vbscript (not vb) -I need to break a 32 bit floating point into it's 4 byte binary representation. -I need to break a 32 bit floating point into it's 2 word(aka16bit) binary representation. For example, 65535.0 in format binary is 100011101111...
jmc
1

votes
1

answer
189

Views

Oracle and programming

I just wanted to know how I can store a picture in oracle data base ;
Aidin
1

votes
1

answer
2.6k

Views

JPA - Update binary data

I am new to JPA and hibernate. I am using HSQLDB 2.0 and hibernate-JPA to insert image into BINARY column. I have annotated as follows @Lob private byte[] profileImage; I can insert the image into the database. I am retrieving the entity from database along with the binary column and converting the...
Niranjan
1

votes
1

answer
741

Views

Storing IPv4 & IPv6 in an RDBMS (MySQL)

I've seen a number of questions floating around here (and have read them) regarding storing both IPv4 and IPv6 addresses in an RDBMS (typically MySQL, not unlike my case) Anyways, if (and I've read differently too, so advise if this is incorrect or officially deprecated) IPv4 address are zero-padded...
Dan Lugg
1

votes
4

answer
1.8k

Views

write a binary string as binary to file

I want to write a string consisting of only zeroes and ones to a output file where the output file literally only contains the zeroes and ones in the order given by the string. At the moment I am trying to write the char to a size 1 bit #include #include #include #include int main(int argc, char...
user986152
1

votes
1

answer
1k

Views

Wrapping a binary data file to self-convert to CSV?

I'm writing custom firmware for a SparkFun Logomatic V2 that records binary data to a file on a 2GB micro-SD card. The data file size will range from 100 MB to 1 GB. The format of the binary data is in flux as the board's firmware evolves (it will actually be dynamically reconfigurable at run-time)...
BobC
14

votes
3

answer
809

Views

How should I replace vector<uint8_t>::const_iterator in an API?

I've been given the task of polishing the interface of a codec library. We're using C++17, and I can only use the standard library (i.e. no Boost). Currently, there's a Decoder class that looks roughly like this: class Decoder : public Codec { public: struct Result { vector::const_iterator new_buffe...
splicer
1

votes
1

answer
316

Views

how to optimize data load from binary file

I have a binary file encoded with little endian and containing ~250.000 values of var1 then another same number of values of var2. I should make a method that reads the file and returns a DataSet with those values in the columns var1 and var2. I am using the library: miscutil mentioned here in SO mu...
Davide Piras
1

votes
1

answer
1.4k

Views

How do I serve a binary data from Tornado?

I have a numpy array, that I want to serve using Tornado, but when I try to write it using self.write(my_np_array) I just get an AssertionErrror. What am I doing wrong? File 'server.py', line 28, in get self.write(values) File '/usr/lib/python2.7/site-packages/tornado/web.py', line 468, in write chu...
AME
1

votes
1

answer
1.5k

Views

How to read binary protocol from InputStream?

I try to read a binary protocol from my serial port in Java. I use the RXTX library to read from the serial port. The protocol is the SiRF binary protocol for GPS receivers. The structure is: first two bytes are 0xA0 and 0xA2, which define the beginning of a data frame next two bytes are the payloa...
htz
1

votes
1

answer
174

Views

assigning new observation to a cluster

Suppose I have a user/item feature matrix in Mahout and I have derived the users' loglikelihood similarity and have identified three user clusters. Now I have a new user with a set of items (same format and same set of items), how can I assign the new user one of these three clusters without recalcu...
user1848018
1

votes
1

answer
728

Views

STAX API reading Binary data

I am using STAX event API to read the binary data that is received from a SOAP call and would like to stream the same to a consumer. The XML payload from the SOAP call is something like this: ......... PHNvYXAtZW52OkVudmVsb3BlIHhtbG5zOnNvYXAtZW52PSJodHRwOi8vc 2NoZW1hcy54bWxzb2FwLhm9yZy9zb2FwL2VudmVs...
mithrandir
1

votes
2

answer
3k

Views

Free tool to send binary data to IP address and port?

I'm using windows 7. There is application that is listening to an ip address and port. It waits for binary data to come and process it. Currently, I'm testing the application now. Is there a free tool that I can use to send binary data to an ip address and port? I had tried using telnet to connect t...
null
1

votes
1

answer
247

Views

Convert a byte to something human-readable

I've got a file consisting of a bunch of 'rows' of data (not actually on separate lines). As far as I can tell from the description (PDF), each 'row' has forty bytes precisely, as follows: 4 bytes I can ignore. 2 bytes that are the byte representations of the (decimal) integer 240 or 241 — that is...
msh210
1

votes
2

answer
2.9k

Views

How do I convert NSData back to NSArray

So first I have this code to convert the NSArray into NSData: NSArray *myArray = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:3], nil]; NSData* encodedArray = [NSData dataWithBytes:myArray length:1]; Now I want to convert it back to an NSArray but I don't know how to do it. This is how I...
Arbitur
1

votes
2

answer
6.1k

Views

Viewing 8 bit RAW image file in openCV

I have a raw file which contains a header of 5 bytes containing the number of rows and columns in first two bits each . The 5th byte contains the number of bits for each pixel in the image which is 8 bits in all cases. The image data follows after that. Since I am new to openCV, i want to ask how to...
user2035996
1

votes
1

answer
348

Views

Create binary matrix from occurence data in R

I am trying to create a binary occurrence matrix for multiple individuals across a time series of survey occasions. The source data is a dataframe that contains an individual ID field and an occasion number field corresponding to a positive occurrence for that individual. I need to retain the indi...
jlaufenb
1

votes
1

answer
500

Views

How to access sub-chunks's data of .wav file?

How to access sub-chunks's data of .wav file? I've been trying to copy binary data (first 44 bytes) to a struct variable (size of 44 bytes). But there is a problem: I'm convinced that I'd copied binary data from the file input to a struct named hdr. But when I'm trying to display hdr.ChunkID which...
yulian
1

votes
1

answer
364

Views

phantomjs and passing imagedata as json

Can I use phantomjs to create an image of the contents of (The div contains an iframe) how do I make this image (binary data) as part of a json ? , as ({img: binary data}) ?
user644745
1

votes
1

answer
1.2k

Views

JavaFX - Create pdf from binary data

I am writing a JavaFX application that uses WebView to access a website and extract data from its pages. At some point I want to click on a link that opens up a new window which shows a PDF file. With the luck of PDF support in JavaFX I am thinking that one possible solution might be to read the htt...
bluchip.gr
1

votes
1

answer
402

Views

How to pack integers of arbitrary size to byte buffer in Python

The other way is simple int(byte_buffer.encode('hex'), 16 ) But how do I convert that integer back to byte_buffer. The length will be stored by prepending struct.pack('>I', len(byte_buffer)) to the value. In 2.7 there is int.bit_length() that would be a good start, but unfortunately I must be able t...
Kimvais
1

votes
2

answer
4.3k

Views

Storing binary blobs data in Cassandra Column family

I need to store binary byte data in Cassandra column family in all my columns. Below is the code where I will be getting binary byte data. My rowKey is going to be String but all my columns has to store binary blobs data. GenericDatumWriter writer = new GenericDatumWriter(schema); ByteArrayOutputSt...
AKIWEB
1

votes
1

answer
171

Views

Efficient way for manipulating binary data

I have a string containing bitmap data. Basically, it holds cycles of 1 byte of red, green, blue for each pixel in an image. I want to manipulate the 8-bit integer value of each color channel in the bitmap. Currently I do this using unpack('C'.strlen($string)) which gives me an array of integers. Th...
frodeborli
1

votes
1

answer
338

Views

Unhandled exception on generic type<T> in c# because file size not multiple of bytes

I am C# beginner and trying to read a binary file to calculate the frequency of the symbols inside the binary file. (Frequency is the number of time the symbols repeats). As first step I kept the data type of 'symbol' read as 'int' and code worked fine. But now I wanted to make this symbol of generi...
Sss

View additional questions