1,602 questions
3
votes
3
answers
214
views
Mutating detection data into binary
Currently I have a dataframe of bear detections that I want to convert into a binary detection history (14 columns of day1, day2, day3, etc. where:
actual_date_out = the date the camera was deployed, ...
0
votes
1
answer
86
views
DB2 LUW What's up with BINARY vs. CHAR FOR BIT DATA column data types?
We have DB2 LUW v11.5 and it supports both BINARY and CHAR FOR BIT DATA column data types. I've read the documentation, and I've Googled it, but I don't really see an effective difference between ...
2
votes
1
answer
104
views
How to convert cmd pipe to powershell in context of binary data (ffmpeg and streamlink)
I'd like to convert a pipe of video stream between streamlink and ffmpeg from cmd to Powershell. But from what I searched powershell only supports piping objects.
Is there any way to reproduce this in ...
2
votes
0
answers
82
views
Insert image from in-memory binary to ODT file LibreOffice
I want to replace a string in my ODT file with an image, but this image is from binary data, not a file. I don't want to write to temp file and load it, I want to purely do so in memory.
I have this ...
0
votes
1
answer
89
views
Hexadecimal concatenation in recursive CTE is truncated to 64 characters
I'm working on Nested Set Hierarchies. I'm using a recursive CTE to build the nested equivalent of adjacency list table. MySQL 8.4 is my platform.
-- adjacency list table
CREATE TABLE dct_node_adjc
(
...
0
votes
0
answers
12
views
Is it possible to calculate abilities per participant per stimulus in BradleyTerry2 R package?
I have a task in which participants engage in a pairwise comparison task of 12 stimuli. All participants see all comparisons and the order is fully randomised. For subsequent analyses, I need to ...
1
vote
1
answer
527
views
Is it possible to dump a Java byte array to a file from the IntelliJ debugger?
I am debugging some code that involves transferring files over a network. I have received the binary data and want to confirm that the file is correct by downloading it an opening it in a viewer ...
1
vote
0
answers
49
views
Using cURL in PHP to post multi-part data held in variable rather than on disk [duplicate]
I am finding it surprisingly difficult to post an image that I have manipulated using GD image to an API without first saving it to disk. It seems like there must be some way to post the GD image ...
1
vote
0
answers
31
views
Ideal method to do image similarity comparison between two binary images - Tactile Maps
I have a task for image similarity comparisons between two binary images of tactile maps (maps for the visually impaired to map out an area). The goal is to have an output score of how similar the two ...
0
votes
0
answers
25
views
Converting binary data to unsigned ints
I'm getting an error pulling out binary data from a database using GORM. Here's my situation:
Database field (Aurora MySQL, if it's relevant):
tag_to_change binary(4) null,
Structure:
type ...
0
votes
0
answers
44
views
4 byte binary integer resets above 128 (or its multiples)
I read binary data from an instrument but the output is quite weird. I have a python program that relies on pyvisa that I describe below. The weird thing is that everytime 128, or a multiple of 128, ...
0
votes
0
answers
169
views
Reading binary data from serial port instrument
Intro
I would like to retrieve binary data from an instrument (SR620) using RS-232. The data is an histogram made of 250 bins. The python program I did works well when no data is acquired (I get 250 ...
0
votes
0
answers
125
views
How to Get image bytes directly out of clipboard
I am writing a script to automatically calculate totals for each category from a report that is exported to an excel spreadsheet. The system that generates the report uses images (for some reason) in ...
1
vote
2
answers
45
views
How to replace ^B in log or text files with sed?
I have a log/text file which is full of highlighted ^B lines when opened with less. Usually I see ^A and I have the following sed command to replace ^A with |. I found it a while ago and do not know ...
0
votes
0
answers
98
views
Django max_length validation for BinaryField causes KeyError in translation __init__.py
I have a simple model, something like
class Notenbild(models.Model):
bild_data = models.BinaryField(max_length=500000, editable=True)
In admin.py
class BinaryFieldWithUpload(forms.FileField):
...
0
votes
1
answer
245
views
What binary format is the binary mesh export and how can it be converted to ASCII with Python?
I have generated some large meshes using Gmsh via the Python API. The ASCII files can be Gigabytes. Since binary files are smaller and faster to read, I set Gmsh to save the mesh files in binary ...
3
votes
2
answers
138
views
In C, extract mantissa of a double as a long long in portable way
Function frexp(3) returns the normalized mantissa xm of a double x, with a value in [0.5,1.0), unless x=0. So I can convert it to a long long as follows:
int ie; // will be set in next line
...
0
votes
1
answer
245
views
Log viewer for binary logs
I have a clustered real time system that produces a very large amount of binary logs.
I get a bunch of binary logs from each node in the system and I want to view the logs in a convinent way. Mostly, ...
0
votes
0
answers
230
views
Detecting symbols in arbitrary binary files
Given a program such as Ghidra, Binary Ninja, etc., is there a way to auto-identify a set of data and assign values a symbol based on the pattern of the data? For example, from this screenshot in ...
0
votes
1
answer
56
views
HDF5 simple dataset only writing half of the elements
I have a larger data conversion utility this is a small piece of. It converts from an old format to memory, then writes memory to an HDF5 based output format. Below is a function, WriteFloatDataset, ...
0
votes
1
answer
264
views
How to handle binary response in Azure logic apps correctly?
My workflow requires 2 steps
Call an external HTTP API which returns a binary file / pdf.
Convert that to a base64 string and send it to another API.
Unfortunately I'm not able interpret the binary ...
1
vote
1
answer
378
views
is there a way to output and consume binary files on stdout/stdin of powershell?
I am expierencing an issue with a powershell script which doesn't work whereas dotnet application with the same commands works. I believe the problem is related to encoding, I think in powershell the ...
0
votes
1
answer
333
views
How to convert a binary file with extension .GRD to .TXT in R?
I have 20 binary files with .grd extension for rainfall (0.25 X 0.25 degree) that I downloaded from Indian Meteorological Department website from 2000 to 2020.
The data are arranged in 135x129 grid ...
3
votes
1
answer
151
views
How to determine which compression method is being used on a block of data?
I have a program that reads files from an older system. One section of data in each file (not the whole file) is compressed using an unknown compression scheme, which I need to know how to decompress....
0
votes
1
answer
31
views
Getting bad char in struct format when reading byte data
I have binary data with following specification
1 Byte SF-Major
1 Byte SF-Minor
1 Byte SF-Patch
1 Byte SF-Build
2 Byte build (little endian)
I wrote following code to read this data
format_string = (
...
1
vote
0
answers
88
views
How to find timestamp in binary file?
I am searching for the specific timestamp of 7:12:53am Monday April 22, 2024 within a binary file (Sunday, April 21, 2024 9:12:53 in UTC). I am using a hex editor and have been searching for the epoch ...
0
votes
1
answer
120
views
Linear Regression Function in R with a Constrained (ie Bounded) variable and Binary Variables
I am running a linear regression with 3 independent variables of which 2 are continuous and one is binary representing a holiday. In 7th grade language it would look like
log(Unit_Sales) ~ Intercept + ...
0
votes
1
answer
81
views
Read binary data file [duplicate]
I have a file that looks live a .XML (it even has a <?xml version="1.0" encoding="utf-8"?> header). But before the header, when I open the file in Notepad++, there is random ...
1
vote
1
answer
105
views
Trouble writing/reading struct array in a binary file in C
I am trying to make a program that stores the name, employee number and salary of employees in a database, where I have to then store the amount of employees along with all the information of each ...
1
vote
1
answer
188
views
Decode suspected timestamps
I'm writing a tool to decode data I retrieve via mini-USB cable from the Beurer BF-105 scale.
The part I'm really struggling with are the 4 bytes that I think should encode the timestamp of the ...
0
votes
1
answer
120
views
NodeJS Buffer Size Logic: why 8KB as a default and not just the data size?
If you read a file smaller than 8KB in size NodeJS allocates 8 KB for it.
This isn't intuitive or expected, we are getting "more" bytes than we put. But it isn't a bug either at least in the ...
0
votes
1
answer
102
views
Sorting a binary file with structs
I'm working on a C++ program that deals with Pokémon data stored in a binary file. The program reads Pokémon records from a binary file, sorts them based on their power, and then writes the sorted ...
-1
votes
1
answer
89
views
How to decode a binary file containing an array of floats?
encoded_floats_hex = [ "35F1AC3D", "610BB63D", "8C25BF3D", "B73FC83D", "E259D13D", "0E74DA3D", "B5AB5C00", "...
1
vote
3
answers
101
views
Binary database into a frequency table
I am using R to write a report for a class, and I have a pretty big binary database (1 and NA) to indicate presence or absence.
`# A tibble: 149 × 31
Vide Copé. Ca…¹ Copé.…² Copé.…³ Copé.…⁴ Polyc…⁵...
2
votes
1
answer
69
views
The byte-order in UTF8
I've read a question elsewhere about "Why there isn't a need for the Byte Order Mark in UTF-8", especially regarding systems with different Endianness.
To me the TLDR; is that UTF-8 enforces ...
1
vote
1
answer
320
views
How to treat a field as binary/blob with Oracle Golen Gate
I've a ancient database with EBCDIC characterset.
I setupping a CDC (Oracle Golden Gate with Kafka Connect Handler) to expose to other services.
In some table was used varchar field as binary field (...
0
votes
1
answer
81
views
How to Display File Stored in ORACLE "LONG RAW" Field in Flutter App
I have an Oracle Database that stores binary files like PDF, XLS, JPG etc in a field named FILE_FILE_DATA which is of type LONG RAW
I am required to fetch this data from Oracle and display in my ...
0
votes
0
answers
38
views
Correctly read binary data encoded in variable-lengths
I'm trying to read a binary data file containing time-series data in Matlab.
Sample data: [23,-10,47,19,-417,-434,-1,29,11,22,23,6,18,13,-383]
Command: fopen(filename,'r','ieee-le');
When I read the ...
0
votes
1
answer
370
views
How to Parse and Transform a Binary Data Structure in Apache NiFi?
I am working with Apache NiFi and I need to parse and transform incoming binary data that follows a specific structure defined by the format string '<BBHBBHHHHHHh'(20bytes) per message (similar to ...
2
votes
2
answers
632
views
How do I print the half-precision / bfloat16 values from in a (binary) file?
This is a variant of:
How to print float value from binary file in shell?
in that question, we wanted to print IEEE 754 single-precision (i.e. 32-bit) floating-point values from a binary file.
Now ...
1
vote
3
answers
198
views
C Reading binary data into struct
I have a struct
typedef struct {
uint8_t type; // 1B -> 1B
uint16_t hash; // 2B -> 3B
uint16_t id; // 2B -> 5B
uint32_t ip; // 4B -> 9B
uint16_t port; // 2B -> ...
1
vote
1
answer
187
views
why does binary pair encoding (BPE) not work on binary data but only on natural languages?
I know that BPE is used on sentences that can generate some sort of tokenization and pairings, with spare bytes being used to create such mappings. Why doesn't it work on BPE?
What would be the best ...
1
vote
1
answer
184
views
Binary data to date/time stamp, unable to find the proper conversion using Python
First post, long time lurker, couldn't get the format the way I wanted it to be. -sorry
I'm trying to convert part of a binary file to a date/time (in Python). But whatever I try I'm unable to find ...
-1
votes
1
answer
148
views
What is the first argument to Apple's getsectiondata function?
I need to access binary resources wrapped by ld -sectcreate. Some newer materials (such as comments in this answer) told that I should use getsectiondata instead of getsectbyname to correctly work ...
1
vote
2
answers
71
views
Logistic Regression gradually tends to predict all 0s while training on mini batches
I am using mini-batches to train my model which is as follows
SimpleModel(
(embed): Embedding(vocab_size, embedding_size, max_norm=2)
(model): Sequential(
(0): Flatten(start_dim=1, end_dim=-1)
...
1
vote
2
answers
145
views
C bit counting causes unexpected behaviour
I was writing a Hamming weight function in C. I wanted to know if I did it correctly, so my plan was to test on the number 5. I didn't want to google the binary for 5 and wrote some code to do it ...
3
votes
1
answer
443
views
How to reverse UTF-8 encoding in a byte array?
I have the following problem:
A certain producer sends Protobuf messages as binary data (byte array).
These binary data enter a misconfigured Kafka cluster which deserializes the byte array as ...
0
votes
0
answers
96
views
How do I send binary data as raw POST?
I am using this code to POST binary data to a REST interface:
var file = $("#file-to-upload")[0].files[0];
var filename = file.name;
var url = "/upload";
const reader = new ...
1
vote
0
answers
201
views
How to read ODQDATA blob field from HANA database?
How to decompile blob fields in a SAP ERP using gzip basXml as format with python? In my case I want to read the field "xdata" from the ODQDATA tables.
I tried to unpack the object with gzip ...
0
votes
1
answer
160
views
Access binary files that are stored in zipped form
I have R code files that are made using readbin to make the map of drainage bin. But they are in the binary form and zipped. When I extracted manually there are numerous files. How can I access the R ...